Special versions of the raylib have extra debugging features built in. This makes the library much slower but can help finding integration problems. Code that links with such a library should define the DEBUG macro to benefit from memory tracing outside the library. Debugging causes the allocation and release functions to store the __FILE__ and __LINE__ cpp macros in a structure describing each allocated memory block. The mi_mem_dump call and error reports can then print the name and line number in the C file that allocated a block of memory.
Debug libraries also places red zones (one unsigned int at both ends) around each allocated block of memory, thus increasing memory consumption. mi_mem_check checks that the red zones have not been written to, and also checks the arena linkage pointers. If memory corruption is detected, detailed reports are printed to stdout. This error report will also benefit from the source file name and line number information stored by standard debugging. Note that memory checking is an expensive process that significantly slows down the program.
Copyright © 1986, 2015 NVIDIA ARC GmbH. All rights reserved.