mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-04 22:49:32 +03:00
macOS: Fix linking statically
`__attribute__((constructor))` does not mark the symbol as used, so the linker ends up dead-stripping the symbol when linked statically. Adding the `used` attribute fixes that.
This commit is contained in:
parent
81a771161e
commit
fefdce3ee4
1 changed files with 1 additions and 0 deletions
|
@ -422,6 +422,7 @@ __attribute__((constructor(0)))
|
||||||
#else
|
#else
|
||||||
__attribute__((constructor)) // seems not supported by g++-11 on the M1
|
__attribute__((constructor)) // seems not supported by g++-11 on the M1
|
||||||
#endif
|
#endif
|
||||||
|
__attribute__((used))
|
||||||
static void _mi_macos_override_malloc(void) {
|
static void _mi_macos_override_malloc(void) {
|
||||||
malloc_zone_t* purgeable_zone = NULL;
|
malloc_zone_t* purgeable_zone = NULL;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue