gperftools/vsprojects/libtcmalloc_minimal/libtcmalloc_minimal.vcxproj
Aliaksey Kandratsenka d9a99c290a expand emergency malloc integration to !kHaveGoodTLS systems
References github issue #1503.

This significantly reworks both early thread cache access and related
emergency malloc mode checking integration. As a result, we're able to
to rely on emergency malloc even on systems without "good"
TLS (e.g. QNX which does emutls).

One big change here is we're undoing early change to have single
"global" thread cache early during process lifetime. It was nice and
somewhat simpler approach. But because of inherent locking during
early process lifetime, we couldn't be sure of certain lock ordering
aspects w.r.t. backtracing/exception-stack-unwinding. So I choose to
keep it safe. So the new idea is we use SlowTLS facility to find
threads' caches when normal tls isn't ready yet. It avoids holding
locks around potentially recursion-ful things (like
ThreadCache::ModuleInit or growing heap). But we then have to be
careful to "re-attach" those early thread cache instances to regular
TLS. There will nearly always be just one of such thread caches. For
initial thread. But we cannot entirely rule out more general case
where someone creates threads before process initializers ran and
main() is reached. Another notable thing is free-ing memory in this
early mode will always using slow-path deletion directly into central
free list.

SlowTLS facility is "simply" a generalization of previous
CreateBadTLSCache code. I.e. we have a small fixed-size cache that
holds "exceptional" instances of thread-identitity to
thread-cache+emergency-mode-flag mappings.

We also take advantage of tcmalloc::kInvalidTLSKey we introduced
earlier and remove potentially raceful memory ordering between reading
tls_ready_ and tls_key_.

For emergency malloc detection we previously used thread_local
flag. Which we cannot use on !kHaveGoodTLS systems. So we instead
_remove_ thread's cache from it's normal tls storage and place it
"into" SlowTLS instead for the duration of WithStacktraceScope
call (which is how emergency mode is enabled now).
2024-05-23 13:31:42 -04:00

293 lines
16 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-Override|Win32">
<Configuration>Release-Override</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-Override|x64">
<Configuration>Release-Override</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-Patch|Win32">
<Configuration>Release-Patch</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-Patch|x64">
<Configuration>Release-Patch</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<UseNativeEnvironment>true</UseNativeEnvironment>
<ProjectGuid>{55E2B3AE-3CA1-4DB6-97F7-0A044D6F446F}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Patch|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Override|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Patch|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Override|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-Patch|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-Override|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-Patch|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-Override|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>14.0.25431.1</_ProjectFileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<IncludePath>..\..\src\windows;..\..\src;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<IncludePath>..\..\src\windows;..\..\src;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Patch|Win32'">
<IncludePath>..\..\src\windows;..\..\src;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Override|Win32'">
<IncludePath>..\..\src\windows;..\..\src;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Patch|x64'">
<IncludePath>..\..\src\windows;..\..\src;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Override|x64'">
<IncludePath>..\..\src\windows;..\..\src;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level3</WarningLevel>
<EnforceTypeConversionRules>true</EnforceTypeConversionRules>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level3</WarningLevel>
<EnforceTypeConversionRules>true</EnforceTypeConversionRules>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-Patch|Win32'">
<ClCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level3</WarningLevel>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<BufferSecurityCheck>false</BufferSecurityCheck>
<EnforceTypeConversionRules>true</EnforceTypeConversionRules>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-Override|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32_OVERRIDE_ALLOCATORS;PERFTOOLS_DLL_DECL=;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level3</WarningLevel>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<EnforceTypeConversionRules>true</EnforceTypeConversionRules>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-Patch|x64'">
<ClCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level3</WarningLevel>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<BufferSecurityCheck>false</BufferSecurityCheck>
<EnforceTypeConversionRules>true</EnforceTypeConversionRules>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-Override|x64'">
<ClCompile>
<PreprocessorDefinitions>WIN32_OVERRIDE_ALLOCATORS;PERFTOOLS_DLL_DECL=;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level3</WarningLevel>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<EnforceTypeConversionRules>true</EnforceTypeConversionRules>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\src\base\dynamic_annotations.cc" />
<ClCompile Include="..\..\src\base\logging.cc" />
<ClCompile Include="..\..\src\base\spinlock.cc" />
<ClCompile Include="..\..\src\base\spinlock_internal.cc" />
<ClCompile Include="..\..\src\base\generic_writer.cc" />
<ClCompile Include="..\..\src\base\sysinfo.cc" />
<ClCompile Include="..\..\src\base\proc_maps_iterator.cc" />
<ClCompile Include="..\..\src\central_freelist.cc" />
<ClCompile Include="..\..\src\common.cc" />
<ClCompile Include="..\..\src\internal_logging.cc" />
<ClCompile Include="..\..\src\malloc_backtrace.cc" />
<ClCompile Include="..\..\src\malloc_extension.cc" />
<ClCompile Include="..\..\src\malloc_hook.cc" />
<ClCompile Include="..\..\src\page_heap.cc" />
<ClCompile Include="..\..\src\sampler.cc" />
<ClCompile Include="..\..\src\span.cc" />
<ClCompile Include="..\..\src\stacktrace.cc" />
<ClCompile Include="..\..\src\stack_trace_table.cc" />
<ClCompile Include="..\..\src\static_vars.cc" />
<ClCompile Include="..\..\src\symbolize.cc" />
<ClCompile Include="..\..\src\thread_cache.cc" />
<ClCompile Include="..\..\src\thread_cache_ptr.cc" />
<ClCompile Include="..\..\src\windows\ia32_modrm_map.cc" />
<ClCompile Include="..\..\src\windows\ia32_opcode_map.cc" />
<ClCompile Include="..\..\src\windows\mini_disassembler.cc" />
<ClCompile Include="..\..\src\windows\override_functions.cc">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release-Patch|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release-Patch|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\windows\patch_functions.cc">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release-Override|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release-Override|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\windows\port.cc" />
<ClCompile Include="..\..\src\windows\preamble_patcher.cc" />
<ClCompile Include="..\..\src\windows\preamble_patcher_with_stub.cc" />
<ClCompile Include="..\..\src\windows\system-alloc.cc" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\addressmap-inl.h" />
<ClInclude Include="..\..\src\base\basictypes.h" />
<ClInclude Include="..\..\src\base\commandlineflags.h" />
<ClInclude Include="..\..\src\base\googleinit.h" />
<ClInclude Include="..\..\src\base\linked_list.h" />
<ClInclude Include="..\..\src\base\logging.h" />
<ClInclude Include="..\..\src\base\spinlock.h" />
<ClInclude Include="..\..\src\base\spinlock_internal.h" />
<ClInclude Include="..\..\src\base\spinlock_linux-inl.h" />
<ClInclude Include="..\..\src\base\spinlock_posix-inl.h" />
<ClInclude Include="..\..\src\base\spinlock_win32-inl.h" />
<ClInclude Include="..\..\src\base\stl_allocator.h" />
<ClInclude Include="..\..\src\base\sysinfo.h" />
<ClInclude Include="..\..\src\base\thread_annotations.h" />
<ClInclude Include="..\..\src\central_freelist.h" />
<ClInclude Include="..\..\src\common.h" />
<ClInclude Include="..\..\src\gperftools\malloc_backtrace.h" />
<ClInclude Include="..\..\src\gperftools\malloc_extension.h" />
<ClInclude Include="..\..\src\gperftools\malloc_hook.h" />
<ClInclude Include="..\..\src\gperftools\profiler.h" />
<ClInclude Include="..\..\src\gperftools\stacktrace.h" />
<ClInclude Include="..\..\src\internal_logging.h" />
<ClInclude Include="..\..\src\malloc_hook-inl.h" />
<ClInclude Include="..\..\src\packed-cache-inl.h" />
<ClInclude Include="..\..\src\pagemap.h" />
<ClInclude Include="..\..\src\page_heap.h" />
<ClInclude Include="..\..\src\page_heap_allocator.h" />
<ClInclude Include="..\..\src\sampler.h" />
<ClInclude Include="..\..\src\span.h" />
<ClInclude Include="..\..\src\stacktrace_config.h" />
<ClInclude Include="..\..\src\stacktrace_win32-inl.h" />
<ClInclude Include="..\..\src\stack_trace_table.h" />
<ClInclude Include="..\..\src\static_vars.h" />
<ClInclude Include="..\..\src\symbolize.h" />
<ClInclude Include="..\..\src\system-alloc.h" />
<ClInclude Include="..\..\src\tcmalloc_internal.h" />
<ClInclude Include="..\..\src\thread_cache.h" />
<ClInclude Include="..\..\src\thread_cache_ptr.h" />
<ClInclude Include="..\config.h" />
<ClInclude Include="..\..\src\windows\mini_disassembler.h" />
<ClInclude Include="..\..\src\windows\mini_disassembler_types.h" />
<ClInclude Include="..\..\src\windows\port.h" />
<ClInclude Include="..\..\src\windows\preamble_patcher.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
<Import Project="$(MSBuildProjectDirectory)\..\common.vcxproj.props" />
</Project>