Matthew Parkinson
Matthew Parkinson
Using the static library will only override the allocations in the exe, but I think you are picking up a DLL as well, which won't have the allocations overridden. There...
Just going to add a comment of the various approaches I have found. * There is [minhooks](https://github.com/TsudaKageyu/minhook) - with an example for using it with an allocator here: https://gist.github.com/Erfan-Ahmadi/93369b8b7fbce77b1adf8e244ea33849 -...
I just looked at the static library by default creates the symbols ``` sn_malloc, sn_free, ... ``` You can override the prefix by passing to CMake: ``` -DSNMALLOC_STATIC_LIBRARY_PREFIX="" ``` This...
@jcelerier I got around to implementing the Windows heap override using Detours. If you are interested in trying it, then take a look at https://github.com/microsoft/snmalloc/pull/775 This PR is, I believe,...
Looks like we need some more `#ifdef` in: https://github.com/microsoft/snmalloc/blob/835ab5186325736ff5aa8ef53728970d1d74c3bc/src/snmalloc/pal/pal_linux.h#L32-L33 How could we detect this configuration? Perhaps, we should be using ``` sys_conf(_SC_PAGE_SIZE) ``` to detect the pagesize properly.
It seems this can be done by macros. https://www.man7.org/linux/man-pages/man3/sysconf.3.html We could change the Posix Pal to: ```C++ #ifdef PAGESIZE static constexpr size_t page_size = PAGESIZE; #else static constexpr size_t page_size...
FYI, I have a bit set of changes in flight, so can fix after those. Or please feel free to raise a PR.
Tried this in #664.
@SchrodingerZhu with the CMake configuration is this fixed? Should we do more to fix this?
That should work. It won't override malloc/free, but will do new/delete. The `snmallocshim-static` target will provide a malloc and free. You also need to set: ``` SNMALLOC_STATIC_LIBRARY_PREFIX="" ``` As it...