Functions | |
AS_API int | asSetGlobalMemoryFunctions (asALLOCFUNC_t allocFunc, asFREEFUNC_t freeFunc) |
Set the memory management functions that AngelScript should use. | |
AS_API int | asResetGlobalMemoryFunctions () |
Remove previously registered memory management functions. | |
AS_API void * | asAllocMem (size_t size) |
Allocate memory using the memory function registered with AngelScript. | |
AS_API void | asFreeMem (void *mem) |
Deallocates memory using the memory function registered with AngelScript. | |
[in] | size | The size of the buffer to allocate |
Call this method to restore the default memory management functions.
AS_API int asSetGlobalMemoryFunctions | ( | asALLOCFUNC_t | allocFunc, |
asFREEFUNC_t | freeFunc | ||
) |
[in] | allocFunc | The function that will be used to allocate memory. |
[in] | freeFunc | The function that will be used to free the memory. |
Call this method to register the global memory allocation and deallocation functions that AngelScript should use for memory management. This function should be called before asCreateScriptEngine.
If not called, AngelScript will use the malloc and free functions from the standard C library.