LWJGL is a Java library that enables cross-platform access to popular native APIs useful in the development of graphics (OpenGL, Vulkan, bgfx), audio (OpenAL, Opus), parallel computing (OpenCL, CUDA) and XR (OpenVR, LibOVR, OpenXR) applications.
In debug mode, place canary values before and after the memory blocks allocated by functions like memAlloc or MemoryStack.stackPush.
After native calls, check if these values have been accidentally modified, and throw an exception to warn the developer about the memory boundary issue and provide information such as the line of code where the memory block was allocated.
Description
In debug mode, place canary values before and after the memory blocks allocated by functions like
memAlloc
orMemoryStack.stackPush
. After native calls, check if these values have been accidentally modified, and throw an exception to warn the developer about the memory boundary issue and provide information such as the line of code where the memory block was allocated.