Custom Memory Management |
Override new, delete, malloc, free, and realloc
Users wishing to provide custom memory management functions can do so via RakMemoryOverride.cpp. There are 3 global pointers defined in this file, with predefined defaults: void* (*rakMalloc) (size_t size) = RakMalloc; To override, simply set the values of these variables to something else. For example, to override malloc, you may write: #include "RakMemoryOverride.h" void *MyMalloc(size_t size) int main() Then edit the file RakNetDefinesOverrides.h and add #define _USE_RAK_MEMORY_OVERRIDE 1 Alternatively, edit RakNetDefines.h _USE_RAK_MEMORY_OVERRIDE |
See Also |