mirror of
https://github.com/sal063/AC6_recomp
synced 2026-06-25 02:02:10 -04:00
47 lines
899 B
C++
47 lines
899 B
C++
#pragma once
|
|
/**
|
|
* ReXGlue runtime - AC6 Recompilation project
|
|
* Copyright (c) 2026 Tom Clay. All rights reserved.
|
|
*/
|
|
|
|
#include <unordered_map>
|
|
#include <vector>
|
|
|
|
#include <rex/thread/mutex.h>
|
|
|
|
namespace rex::runtime {
|
|
|
|
class Function;
|
|
|
|
typedef struct Entry_t {
|
|
typedef enum {
|
|
STATUS_NEW = 0,
|
|
STATUS_COMPILING,
|
|
STATUS_READY,
|
|
STATUS_FAILED,
|
|
} Status;
|
|
|
|
uint32_t address;
|
|
uint32_t end_address;
|
|
Status status;
|
|
Function* function;
|
|
} Entry;
|
|
|
|
class EntryTable {
|
|
public:
|
|
EntryTable();
|
|
~EntryTable();
|
|
|
|
Entry* Get(uint32_t address);
|
|
Entry::Status GetOrCreate(uint32_t address, Entry** out_entry);
|
|
|
|
std::vector<Function*> FindWithAddress(uint32_t address);
|
|
|
|
private:
|
|
rex::thread::global_critical_region global_critical_region_;
|
|
// TODO(benvanik): replace with a better data structure.
|
|
std::unordered_map<uint32_t, Entry*> map_;
|
|
};
|
|
|
|
} // namespace rex::runtime
|