update docs
diff --git a/README.md b/README.md
index 94f1026..3d3ff01 100644
--- a/README.md
+++ b/README.md
@@ -54,7 +54,7 @@
Then simply use the __rpmalloc__/__rpfree__ and the other malloc style replacement functions. Remember all allocations are 16-byte aligned, so no need to call the explicit rpmemalign/rpaligned_alloc/rpposix_memalign functions unless you need greater alignment, they are simply wrappers to make it easier to replace in existing code.
-If you wish to override the standard library malloc family of functions and have automatic initialization/finalization of process and threads, define __ENABLE_OVERRIDE__ to non-zero which will include the `malloc.c` file in compilation of __rpmalloc.c__. The list of libc entry points replaced may not be complete, use libc replacement only as a convenience for testing the library on an existing code base, not a final solution.
+If you wish to override the standard library malloc family of functions and have automatic initialization/finalization of process and threads, define __ENABLE_OVERRIDE__ to non-zero which will include the `malloc.c` file in compilation of __rpmalloc.c__, and then rebuild the library or your project where you added the rpmalloc source. If you compile rpmalloc as a separate library you must make the linker use the override symbols from the library by referencing at least one symbol. The easiest way is to simply include `rpmalloc.h` in at least one source file and call `rpmalloc_linker_reference` somewhere - it's a dummy empty function. On Windows platforms and C++ overrides you have to `#include <rpnew.h>` in at least one source file and also manually handle the initialize/finalize of the process and all threads. The list of libc entry points replaced may not be complete, use libc/stdc++ replacement only as a convenience for testing the library on an existing code base, not a final solution.
For explicit first class heaps, see the __rpmalloc_heap_*__ API under [first class heaps](#first-class-heaps) section, requiring __RPMALLOC_FIRST_CLASS_HEAPS__ tp be defined to 1.
diff --git a/rpmalloc/malloc.c b/rpmalloc/malloc.c
index c59817f..a39c8aa 100644
--- a/rpmalloc/malloc.c
+++ b/rpmalloc/malloc.c
@@ -37,7 +37,7 @@
#define USE_INTERPOSE 0
#define USE_ALIAS 0
-#if defined(__APPLE__) && ENABLE_PRELOAD
+#if defined(__APPLE__)
#undef USE_INTERPOSE
#define USE_INTERPOSE 1
diff --git a/rpmalloc/rpmalloc.c b/rpmalloc/rpmalloc.c
index cff9ae2..d54a607 100644
--- a/rpmalloc/rpmalloc.c
+++ b/rpmalloc/rpmalloc.c
@@ -2915,6 +2915,8 @@
memset(_memory_heaps, 0, sizeof(_memory_heaps));
atomic_store32_release(&_memory_global_lock, 0);
+ rpmalloc_linker_reference();
+
//Initialize this thread
rpmalloc_thread_initialize();
return 0;
@@ -3527,3 +3529,8 @@
#include "malloc.c"
#endif
+
+void
+rpmalloc_linker_reference(void) {
+ (void)sizeof(_rpmalloc_initialized);
+}
diff --git a/rpmalloc/rpmalloc.h b/rpmalloc/rpmalloc.h
index 00a860d..7632e0c 100644
--- a/rpmalloc/rpmalloc.h
+++ b/rpmalloc/rpmalloc.h
@@ -292,6 +292,10 @@
RPMALLOC_EXPORT size_t
rpmalloc_usable_size(void* ptr);
+//! Dummy empty function for forcing linker symbol inclusion
+RPMALLOC_EXPORT void
+rpmalloc_linker_reference(void);
+
#if RPMALLOC_FIRST_CLASS_HEAPS
//! Heap type