mirror of
https://github.com/simple64/simple64.git
synced 2026-11-15 12:29:21 +01:00
Merge commit '57999ac9b9d32775efc271e0edfed27b784ee1c6' as 'parallel-rsp'
This commit is contained in:
commit
d9155d3878
377 files changed
+137898
No files matched your search
@@ -0,0 +1,33 @@
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include <stdint.h>
|
||||
|
||||
namespace RSP
|
||||
{
|
||||
namespace JIT
|
||||
{
|
||||
class Allocator
|
||||
{
|
||||
public:
|
||||
Allocator() = default;
|
||||
~Allocator();
|
||||
void operator=(const Allocator &) = delete;
|
||||
Allocator(const Allocator &) = delete;
|
||||
|
||||
void *allocate_code(size_t size);
|
||||
static bool commit_code(void *code, size_t size);
|
||||
|
||||
private:
|
||||
struct Block
|
||||
{
|
||||
uint8_t *code = nullptr;
|
||||
size_t size = 0;
|
||||
size_t offset = 0;
|
||||
};
|
||||
std::vector<Block> blocks;
|
||||
|
||||
static Block reserve_block(size_t size);
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user