Describe the bug
I've tried replacing STBDS_REALLOC and STBDS_FREE as instructed in the comments but I think I found a tiny bug. Since STBDS_FREE is used in stb_ds.h outside of the implementation code, it gets replaced by free instead of my custom replacement for the other source files that don't have STB_DS_IMPLEMENTATION defined.
To Reproduce
Steps to reproduce the behavior:
Add stb_ds.h to a project overriding STBDS_FREE and STB_DS_IMPLEMENTATION in a source file
On another source file, #include "stb_ds.h" and try to use arrfree in a context where it makes sense.
Check the intermediary .i file and see that arrfree is gonna be replaced with an expression that contains free instead of your custom implementation.
Expected behavior
Since the point of redefining STBDS_REALLOC and STBDS_FREE is to have your custom allocation code be run always, there should be no exceptions such as this one.
Describe the bug I've tried replacing free instead of my custom replacement for the other source files that don't have
STBDS_REALLOC
andSTBDS_FREE
as instructed in the comments but I think I found a tiny bug. SinceSTBDS_FREE
is used in stb_ds.h outside of the implementation code, it gets replaced bySTB_DS_IMPLEMENTATION
defined.To Reproduce Steps to reproduce the behavior:
STBDS_FREE
andSTB_DS_IMPLEMENTATION
in a source filearrfree
in a context where it makes sense.arrfree
is gonna be replaced with an expression that containsExpected behavior Since the point of redefining
STBDS_REALLOC
andSTBDS_FREE
is to have your custom allocation code be run always, there should be no exceptions such as this one.