Skip to content

Instantly share code, notes, and snippets.

@Harold2017
Created July 11, 2020 04:01
Show Gist options
  • Save Harold2017/09b58a08cd1d4314ed77672d6d2404c7 to your computer and use it in GitHub Desktop.
Save Harold2017/09b58a08cd1d4314ed77672d6d2404c7 to your computer and use it in GitHub Desktop.
tcmalloc on window

cmake

compile libtcmalloc_minimal with Release-Patch

link libtcmalloc_minimal.lib in CMakeList

copy libtcmalloc_minimal.dll to execution folder

without cmake

add libtcmalloc_minimal.lib in Additional Dependencies, add __tcmalloc in Forced Symbol References (on Properties/Configuration Properties/Linker/Input page)

notice

set msvc Runtime Library dynamic lib (.dll -> MD), static lib (.lib -> MT)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment