lwjgl3
lwjgl3 copied to clipboard
[Suggestion]: use canary values to catch memory out of boundary errors when the debug option is enabled
Description
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.