reorganized ungen opcode stuff
fixed mislabeled ungen ops, then added appropriate notes added executable memory functions to API compilation results in an sp_context_t, not a BaseContext now renamed FreeContextVars() to FreeContext() other minor changes --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%4098
This commit is contained in:
@@ -59,7 +59,7 @@ namespace SourcePawn
|
||||
virtual void FreeBaseContext(IPluginContext *ctx) =0;
|
||||
|
||||
/**
|
||||
* Allocates memory.
|
||||
* Allocates large blocks of temporary memory.
|
||||
*
|
||||
* @param size Size of memory to allocate.
|
||||
* @return Pointer to memory, NULL if allocation failed.
|
||||
@@ -72,6 +72,21 @@ namespace SourcePawn
|
||||
* @param mem Memory address to free.
|
||||
*/
|
||||
virtual void BaseFree(void *memory) =0;
|
||||
|
||||
/**
|
||||
* Allocates executable memory.
|
||||
*
|
||||
* @param size Size of memory to allocate.
|
||||
* @return Pointer to memory, NULL if allocation failed.
|
||||
*/
|
||||
virtual void *ExecAlloc(size_t size) =0;
|
||||
|
||||
/**
|
||||
* Frees executable memory.
|
||||
*
|
||||
* @param mem Address to free.
|
||||
*/
|
||||
virtual void ExecFree(void *address) =0;
|
||||
};
|
||||
|
||||
class ICompilation
|
||||
@@ -107,14 +122,14 @@ namespace SourcePawn
|
||||
virtual bool SetCompilationOption(ICompilation *co, const char *key, const char *val) =0;
|
||||
|
||||
/**
|
||||
* Finalizes a compilation into a new IContext.
|
||||
* Finalizes a compilation into a new sp_context_t.
|
||||
* Note: This will free the ICompilation pointer.
|
||||
*
|
||||
* @param co Compilation pointer.
|
||||
* @param err Filled with error code on exit.
|
||||
* @return New plugin context.
|
||||
*/
|
||||
virtual IPluginContext *CompileToContext(ICompilation *co, int *err) =0;
|
||||
virtual sp_context_t *CompileToContext(ICompilation *co, int *err) =0;
|
||||
|
||||
/**
|
||||
* Aborts a compilation and frees the ICompilation pointer.
|
||||
@@ -128,7 +143,7 @@ namespace SourcePawn
|
||||
*
|
||||
* @param ctx Context structure pointer.
|
||||
*/
|
||||
virtual void FreeContextVars(sp_context_t *ctx) =0;
|
||||
virtual void FreeContext(sp_context_t *ctx) =0;
|
||||
|
||||
/**
|
||||
* Calls the "execute" function on a context.
|
||||
|
||||
@@ -201,7 +201,7 @@ typedef int (*SPVM_DEBUGBREAK)(SourcePawn::IPluginContext *, uint32_t, uint32_t)
|
||||
typedef struct sp_context_s
|
||||
{
|
||||
/* general/parent information */
|
||||
void *base; /* base of generated code and memory */
|
||||
void *codebase; /* base of generated code and memory */
|
||||
sp_plugin_t *plugin; /* pointer back to parent information */
|
||||
SourcePawn::IPluginContext *context; /* pointer to IPluginContext */
|
||||
SourcePawn::IVirtualMachine *vmbase; /* pointer to IVirtualMachine */
|
||||
|
||||
Reference in New Issue
Block a user