Use AutoPtr in more places in the JIT.
This commit is contained in:
parent
b9b0ec865c
commit
fcec0ee7c7
@ -32,17 +32,11 @@ IsPointerCellAligned(void *p)
|
||||
|
||||
PluginRuntime::PluginRuntime()
|
||||
: m_Debug(&m_plugin),
|
||||
m_pCtx(NULL),
|
||||
m_PubFuncs(NULL),
|
||||
m_CompSerial(0)
|
||||
{
|
||||
memset(&m_plugin, 0, sizeof(m_plugin));
|
||||
|
||||
m_MaxFuncs = 0;
|
||||
m_NumFuncs = 0;
|
||||
float_table_ = NULL;
|
||||
alt_pcode_ = NULL;
|
||||
|
||||
memset(m_CodeHash, 0, sizeof(m_CodeHash));
|
||||
memset(m_DataHash, 0, sizeof(m_DataHash));
|
||||
|
||||
@ -63,14 +57,10 @@ PluginRuntime::~PluginRuntime()
|
||||
for (uint32_t i = 0; i < m_plugin.num_publics; i++)
|
||||
delete m_PubFuncs[i];
|
||||
delete [] m_PubFuncs;
|
||||
delete [] float_table_;
|
||||
delete [] alt_pcode_;
|
||||
|
||||
for (size_t i = 0; i < m_JitFunctions.length(); i++)
|
||||
delete m_JitFunctions[i];
|
||||
|
||||
delete m_pCtx;
|
||||
|
||||
free(m_plugin.base);
|
||||
delete [] m_plugin.memory;
|
||||
delete [] m_plugin.publics;
|
||||
|
@ -107,10 +107,8 @@ class PluginRuntime
|
||||
|
||||
private:
|
||||
sp_plugin_t m_plugin;
|
||||
uint8_t *alt_pcode_;
|
||||
unsigned int m_NumFuncs;
|
||||
unsigned int m_MaxFuncs;
|
||||
floattbl_t *float_table_;
|
||||
ke::AutoArray<uint8_t> alt_pcode_;
|
||||
ke::AutoArray<floattbl_t> float_table_;
|
||||
|
||||
struct FunctionMapPolicy {
|
||||
static inline uint32_t hash(ucell_t value) {
|
||||
@ -127,7 +125,7 @@ class PluginRuntime
|
||||
|
||||
public:
|
||||
DebugInfo m_Debug;
|
||||
PluginContext *m_pCtx;
|
||||
ke::AutoPtr<PluginContext> m_pCtx;
|
||||
ScriptedInvoker **m_PubFuncs;
|
||||
|
||||
public:
|
||||
|
Loading…
Reference in New Issue
Block a user