Details
-
Technical task
-
Resolution: Fixed
-
Critical
-
4.5.0, 4.5.1
-
None
Description
Context
During investigation of MB-20519 we have found that it is no longer safe to use TCMalloc on Windows 10 anniversary update - it's runtime patching of the CRT memory allocation functions crashes in the presence of C++11 threading.
Currently we rely on TCMalloc to perform bucket memory tracking (via New/Delete hooks) on Windows. Therefore if we want to remove TCMalloc we need an alternative method to track memory allocations on Windows.
Details
By creating a set of our own memory allocation functions - cb_malloc, cb_realloc, cb_calloc and cb_free - and then updating our code to explicitly call these functions instead of the C standard library malloc and friends we can add our own hook functions as desired.