Revert "make all includes relative"

This reverts commit 1feb6123d9.
This commit is contained in:
Daan Leijen 2021-06-07 16:47:57 -07:00
parent 1feb6123d9
commit 4ba32c3160
21 changed files with 63 additions and 63 deletions

View file

@ -263,7 +263,10 @@ if(MI_BUILD_SHARED)
target_compile_definitions(mimalloc PRIVATE ${mi_defines} MI_SHARED_LIB MI_SHARED_LIB_EXPORT) target_compile_definitions(mimalloc PRIVATE ${mi_defines} MI_SHARED_LIB MI_SHARED_LIB_EXPORT)
target_compile_options(mimalloc PRIVATE ${mi_cflags}) target_compile_options(mimalloc PRIVATE ${mi_cflags})
target_link_libraries(mimalloc PUBLIC ${mi_libraries}) target_link_libraries(mimalloc PUBLIC ${mi_libraries})
target_include_directories(mimalloc PUBLIC $<INSTALL_INTERFACE:${mi_install_incdir}>) target_include_directories(mimalloc PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${mi_install_incdir}>
)
if(WIN32) if(WIN32)
# On windows copy the mimalloc redirection dll too. # On windows copy the mimalloc redirection dll too.
if(CMAKE_SIZEOF_VOID_P EQUAL 4) if(CMAKE_SIZEOF_VOID_P EQUAL 4)
@ -289,7 +292,10 @@ if (MI_BUILD_STATIC)
target_compile_definitions(mimalloc-static PRIVATE ${mi_defines} MI_STATIC_LIB) target_compile_definitions(mimalloc-static PRIVATE ${mi_defines} MI_STATIC_LIB)
target_compile_options(mimalloc-static PRIVATE ${mi_cflags}) target_compile_options(mimalloc-static PRIVATE ${mi_cflags})
target_link_libraries(mimalloc-static PUBLIC ${mi_libraries}) target_link_libraries(mimalloc-static PUBLIC ${mi_libraries})
target_include_directories(mimalloc-static PUBLIC $<INSTALL_INTERFACE:${mi_install_incdir}>) target_include_directories(mimalloc-static PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${mi_install_incdir}>
)
if(WIN32) if(WIN32)
# When building both static and shared libraries on Windows, a static library should use a # When building both static and shared libraries on Windows, a static library should use a
# different output name to avoid the conflict with the import library of a shared one. # different output name to avoid the conflict with the import library of a shared one.
@ -326,7 +332,10 @@ if (MI_BUILD_OBJECT)
set_property(TARGET mimalloc-obj PROPERTY POSITION_INDEPENDENT_CODE ON) set_property(TARGET mimalloc-obj PROPERTY POSITION_INDEPENDENT_CODE ON)
target_compile_definitions(mimalloc-obj PRIVATE ${mi_defines}) target_compile_definitions(mimalloc-obj PRIVATE ${mi_defines})
target_compile_options(mimalloc-obj PRIVATE ${mi_cflags}) target_compile_options(mimalloc-obj PRIVATE ${mi_cflags})
target_include_directories(mimalloc-obj PUBLIC $<INSTALL_INTERFACE:${mi_install_incdir}>) target_include_directories(mimalloc-obj PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${mi_install_incdir}>
)
# the following seems to lead to cmake warnings/errors on some systems, disable for now :-( # the following seems to lead to cmake warnings/errors on some systems, disable for now :-(
# install(TARGETS mimalloc-obj EXPORT mimalloc DESTINATION ${mi_install_libdir}) # install(TARGETS mimalloc-obj EXPORT mimalloc DESTINATION ${mi_install_libdir})

View file

@ -177,8 +177,7 @@
</PostBuildEvent> </PostBuildEvent>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="..\..\test\rtest\src\main.cxx" /> <ClCompile Include="..\..\test\main-override.cpp" />
<ClCompile Include="..\..\test\rtest\src\memory_storage.cxx" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="mimalloc-override.vcxproj"> <ProjectReference Include="mimalloc-override.vcxproj">

View file

@ -94,8 +94,7 @@
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck> <SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories> <AdditionalIncludeDirectories>../../include</AdditionalIncludeDirectories>
</AdditionalIncludeDirectories>
<PreprocessorDefinitions>MI_SHARED_LIB;MI_SHARED_LIB_EXPORT;MI_MALLOC_OVERRIDE;%(PreprocessorDefinitions);</PreprocessorDefinitions> <PreprocessorDefinitions>MI_SHARED_LIB;MI_SHARED_LIB_EXPORT;MI_MALLOC_OVERRIDE;%(PreprocessorDefinitions);</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<SupportJustMyCode>false</SupportJustMyCode> <SupportJustMyCode>false</SupportJustMyCode>
@ -123,8 +122,7 @@
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck> <SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories> <AdditionalIncludeDirectories>../../include</AdditionalIncludeDirectories>
</AdditionalIncludeDirectories>
<PreprocessorDefinitions>MI_DEBUG=3;MI_SHARED_LIB;MI_SHARED_LIB_EXPORT;MI_MALLOC_OVERRIDE;%(PreprocessorDefinitions);</PreprocessorDefinitions> <PreprocessorDefinitions>MI_DEBUG=3;MI_SHARED_LIB;MI_SHARED_LIB_EXPORT;MI_MALLOC_OVERRIDE;%(PreprocessorDefinitions);</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<SupportJustMyCode>false</SupportJustMyCode> <SupportJustMyCode>false</SupportJustMyCode>
@ -153,8 +151,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking> <FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions> <IntrinsicFunctions>true</IntrinsicFunctions>
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories> <AdditionalIncludeDirectories>../../include</AdditionalIncludeDirectories>
</AdditionalIncludeDirectories>
<PreprocessorDefinitions>MI_SHARED_LIB;MI_SHARED_LIB_EXPORT;MI_MALLOC_OVERRIDE;%(PreprocessorDefinitions);NDEBUG</PreprocessorDefinitions> <PreprocessorDefinitions>MI_SHARED_LIB;MI_SHARED_LIB_EXPORT;MI_MALLOC_OVERRIDE;%(PreprocessorDefinitions);NDEBUG</PreprocessorDefinitions>
<AssemblerOutput>AssemblyAndSourceCode</AssemblerOutput> <AssemblerOutput>AssemblyAndSourceCode</AssemblerOutput>
<AssemblerListingLocation>$(IntDir)</AssemblerListingLocation> <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
@ -186,8 +183,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking> <FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions> <IntrinsicFunctions>true</IntrinsicFunctions>
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories> <AdditionalIncludeDirectories>../../include</AdditionalIncludeDirectories>
</AdditionalIncludeDirectories>
<PreprocessorDefinitions>MI_SHARED_LIB;MI_SHARED_LIB_EXPORT;MI_MALLOC_OVERRIDE;%(PreprocessorDefinitions);NDEBUG</PreprocessorDefinitions> <PreprocessorDefinitions>MI_SHARED_LIB;MI_SHARED_LIB_EXPORT;MI_MALLOC_OVERRIDE;%(PreprocessorDefinitions);NDEBUG</PreprocessorDefinitions>
<AssemblerOutput>AssemblyAndSourceCode</AssemblerOutput> <AssemblerOutput>AssemblyAndSourceCode</AssemblerOutput>
<AssemblerListingLocation>$(IntDir)</AssemblerListingLocation> <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>

View file

@ -96,8 +96,7 @@
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck> <SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories> <AdditionalIncludeDirectories>../../include</AdditionalIncludeDirectories>
</AdditionalIncludeDirectories>
<PreprocessorDefinitions>MI_DEBUG=3;%(PreprocessorDefinitions);</PreprocessorDefinitions> <PreprocessorDefinitions>MI_DEBUG=3;%(PreprocessorDefinitions);</PreprocessorDefinitions>
<CompileAs>CompileAsCpp</CompileAs> <CompileAs>CompileAsCpp</CompileAs>
<SupportJustMyCode>false</SupportJustMyCode> <SupportJustMyCode>false</SupportJustMyCode>
@ -116,8 +115,7 @@
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck> <SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories> <AdditionalIncludeDirectories>../../include</AdditionalIncludeDirectories>
</AdditionalIncludeDirectories>
<PreprocessorDefinitions>MI_DEBUG=3;%(PreprocessorDefinitions);</PreprocessorDefinitions> <PreprocessorDefinitions>MI_DEBUG=3;%(PreprocessorDefinitions);</PreprocessorDefinitions>
<CompileAs>CompileAsCpp</CompileAs> <CompileAs>CompileAsCpp</CompileAs>
<SupportJustMyCode>false</SupportJustMyCode> <SupportJustMyCode>false</SupportJustMyCode>
@ -144,8 +142,7 @@
<Optimization>MaxSpeed</Optimization> <Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking> <FunctionLevelLinking>true</FunctionLevelLinking>
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories> <AdditionalIncludeDirectories>../../include</AdditionalIncludeDirectories>
</AdditionalIncludeDirectories>
<PreprocessorDefinitions>%(PreprocessorDefinitions);NDEBUG</PreprocessorDefinitions> <PreprocessorDefinitions>%(PreprocessorDefinitions);NDEBUG</PreprocessorDefinitions>
<AssemblerOutput>AssemblyAndSourceCode</AssemblerOutput> <AssemblerOutput>AssemblyAndSourceCode</AssemblerOutput>
<AssemblerListingLocation>$(IntDir)</AssemblerListingLocation> <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
@ -173,8 +170,7 @@
<Optimization>MaxSpeed</Optimization> <Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking> <FunctionLevelLinking>true</FunctionLevelLinking>
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories> <AdditionalIncludeDirectories>../../include</AdditionalIncludeDirectories>
</AdditionalIncludeDirectories>
<PreprocessorDefinitions>%(PreprocessorDefinitions);NDEBUG</PreprocessorDefinitions> <PreprocessorDefinitions>%(PreprocessorDefinitions);NDEBUG</PreprocessorDefinitions>
<AssemblerOutput>AssemblyAndSourceCode</AssemblerOutput> <AssemblerOutput>AssemblyAndSourceCode</AssemblerOutput>
<AssemblerListingLocation>$(IntDir)</AssemblerListingLocation> <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>

View file

@ -10,7 +10,7 @@ terms of the MIT license. A copy of the license can be found in the file
#include <stddef.h> // ptrdiff_t #include <stddef.h> // ptrdiff_t
#include <stdint.h> // uintptr_t, uint16_t, etc #include <stdint.h> // uintptr_t, uint16_t, etc
#include "mimalloc-atomic.h" // _Atomic #include <mimalloc-atomic.h> // _Atomic
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma warning(disable:4214) // bitfield is not int #pragma warning(disable:4214) // bitfield is not int

View file

@ -5,8 +5,8 @@ terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distribution. "LICENSE" at the root of this distribution.
-----------------------------------------------------------------------------*/ -----------------------------------------------------------------------------*/
#include "../include/mimalloc.h" #include "mimalloc.h"
#include "../include/mimalloc-internal.h" #include "mimalloc-internal.h"
#include <string.h> // memset #include <string.h> // memset

View file

@ -5,8 +5,8 @@ terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distribution. "LICENSE" at the root of this distribution.
-----------------------------------------------------------------------------*/ -----------------------------------------------------------------------------*/
#include "../include/mimalloc.h" #include "mimalloc.h"
#include "../include/mimalloc-internal.h" #include "mimalloc-internal.h"
#if defined(MI_MALLOC_OVERRIDE) #if defined(MI_MALLOC_OVERRIDE)

View file

@ -9,8 +9,8 @@ terms of the MIT license. A copy of the license can be found in the file
// mi prefixed publi definitions of various Posix, Unix, and C++ functions // mi prefixed publi definitions of various Posix, Unix, and C++ functions
// for convenience and used when overriding these functions. // for convenience and used when overriding these functions.
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
#include "../include/mimalloc.h" #include "mimalloc.h"
#include "../include/mimalloc-internal.h" #include "mimalloc-internal.h"
// ------------------------------------------------------ // ------------------------------------------------------
// Posix & Unix functions definitions // Posix & Unix functions definitions

View file

@ -4,9 +4,9 @@ This is free software; you can redistribute it and/or modify it under the
terms of the MIT license. A copy of the license can be found in the file terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distribution. "LICENSE" at the root of this distribution.
-----------------------------------------------------------------------------*/ -----------------------------------------------------------------------------*/
#include "../include/mimalloc.h" #include "mimalloc.h"
#include "../include/mimalloc-internal.h" #include "mimalloc-internal.h"
#include "../include/mimalloc-atomic.h" #include "mimalloc-atomic.h"
#include <string.h> // memset, strlen #include <string.h> // memset, strlen
#include <stdlib.h> // malloc, exit #include <stdlib.h> // malloc, exit

View file

@ -25,9 +25,9 @@ blocks of 2GiB (64*32MiB) and no object can cross the boundary. This
can lead to fragmentation but fortunately most objects will be regions can lead to fragmentation but fortunately most objects will be regions
of 256MiB in practice. of 256MiB in practice.
-----------------------------------------------------------------------------*/ -----------------------------------------------------------------------------*/
#include "../include/mimalloc.h" #include "mimalloc.h"
#include "../include/mimalloc-internal.h" #include "mimalloc-internal.h"
#include "../include/mimalloc-atomic.h" #include "mimalloc-atomic.h"
#include <string.h> // memset #include <string.h> // memset
#include <errno.h> // ENOMEM #include <errno.h> // ENOMEM

View file

@ -17,8 +17,8 @@ The `_across` postfixed functions do allow sequences that can cross over
between the fields. (This is used in arena allocation) between the fields. (This is used in arena allocation)
---------------------------------------------------------------------------- */ ---------------------------------------------------------------------------- */
#include "../include/mimalloc.h" #include "mimalloc.h"
#include "../include/mimalloc-internal.h" #include "mimalloc-internal.h"
#include "bitmap.h" #include "bitmap.h"
/* ----------------------------------------------------------- /* -----------------------------------------------------------

View file

@ -5,9 +5,9 @@ terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distribution. "LICENSE" at the root of this distribution.
-----------------------------------------------------------------------------*/ -----------------------------------------------------------------------------*/
#include "../include/mimalloc.h" #include "mimalloc.h"
#include "../include/mimalloc-internal.h" #include "mimalloc-internal.h"
#include "../include/mimalloc-atomic.h" #include "mimalloc-atomic.h"
#include <string.h> // memset, memcpy #include <string.h> // memset, memcpy

View file

@ -4,8 +4,8 @@ This is free software; you can redistribute it and/or modify it under the
terms of the MIT license. A copy of the license can be found in the file terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distribution. "LICENSE" at the root of this distribution.
-----------------------------------------------------------------------------*/ -----------------------------------------------------------------------------*/
#include "../include/mimalloc.h" #include "mimalloc.h"
#include "../include/mimalloc-internal.h" #include "mimalloc-internal.h"
#include <string.h> // memcpy, memset #include <string.h> // memcpy, memset
#include <stdlib.h> // atexit #include <stdlib.h> // atexit

View file

@ -4,9 +4,9 @@ This is free software; you can redistribute it and/or modify it under the
terms of the MIT license. A copy of the license can be found in the file terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distribution. "LICENSE" at the root of this distribution.
-----------------------------------------------------------------------------*/ -----------------------------------------------------------------------------*/
#include "../include/mimalloc.h" #include "mimalloc.h"
#include "../include/mimalloc-internal.h" #include "mimalloc-internal.h"
#include "../include/mimalloc-atomic.h" #include "mimalloc-atomic.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> // strtol #include <stdlib.h> // strtol

View file

@ -16,9 +16,9 @@ terms of the MIT license. A copy of the license can be found in the file
#undef _XOPEN_SOURCE #undef _XOPEN_SOURCE
#undef _POSIX_C_SOURCE #undef _POSIX_C_SOURCE
#endif #endif
#include "../include/mimalloc.h" #include "mimalloc.h"
#include "../include/mimalloc-internal.h" #include "mimalloc-internal.h"
#include "../include/mimalloc-atomic.h" #include "mimalloc-atomic.h"
#include <string.h> // strerror #include <string.h> // strerror

View file

@ -11,9 +11,9 @@ terms of the MIT license. A copy of the license can be found in the file
exported is `mi_malloc_generic`. exported is `mi_malloc_generic`.
----------------------------------------------------------- */ ----------------------------------------------------------- */
#include "../include/mimalloc.h" #include "mimalloc.h"
#include "../include/mimalloc-internal.h" #include "mimalloc-internal.h"
#include "../include/mimalloc-atomic.h" #include "mimalloc-atomic.h"
/* ----------------------------------------------------------- /* -----------------------------------------------------------
Definition of page queues for each block size Definition of page queues for each block size

View file

@ -4,8 +4,8 @@ This is free software; you can redistribute it and/or modify it under the
terms of the MIT license. A copy of the license can be found in the file terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distribution. "LICENSE" at the root of this distribution.
-----------------------------------------------------------------------------*/ -----------------------------------------------------------------------------*/
#include "../include/mimalloc.h" #include "mimalloc.h"
#include "../include/mimalloc-internal.h" #include "mimalloc-internal.h"
#include <string.h> // memset #include <string.h> // memset

View file

@ -31,9 +31,9 @@ Possible issues:
linearly. At what point will direct OS calls be faster? Is there a way to linearly. At what point will direct OS calls be faster? Is there a way to
do this better without adding too much complexity? do this better without adding too much complexity?
-----------------------------------------------------------------------------*/ -----------------------------------------------------------------------------*/
#include "../include/mimalloc.h" #include "mimalloc.h"
#include "../include/mimalloc-internal.h" #include "mimalloc-internal.h"
#include "../include/mimalloc-atomic.h" #include "mimalloc-atomic.h"
#include <string.h> // memset #include <string.h> // memset

View file

@ -4,9 +4,9 @@ This is free software; you can redistribute it and/or modify it under the
terms of the MIT license. A copy of the license can be found in the file terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distribution. "LICENSE" at the root of this distribution.
-----------------------------------------------------------------------------*/ -----------------------------------------------------------------------------*/
#include "../include/mimalloc.h" #include "mimalloc.h"
#include "../include/mimalloc-internal.h" #include "mimalloc-internal.h"
#include "../include/mimalloc-atomic.h" #include "mimalloc-atomic.h"
#include <string.h> // memset #include <string.h> // memset
#include <stdio.h> #include <stdio.h>

View file

@ -13,8 +13,8 @@ terms of the MIT license. A copy of the license can be found in the file
#undef _POSIX_C_SOURCE #undef _POSIX_C_SOURCE
#endif #endif
#include "../include/mimalloc.h" #include "mimalloc.h"
#include "../include/mimalloc-internal.h" #include "mimalloc-internal.h"
// For a static override we create a single object file // For a static override we create a single object file
// containing the whole library. If it is linked first // containing the whole library. If it is linked first

View file

@ -4,9 +4,9 @@ This is free software; you can redistribute it and/or modify it under the
terms of the MIT license. A copy of the license can be found in the file terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distribution. "LICENSE" at the root of this distribution.
-----------------------------------------------------------------------------*/ -----------------------------------------------------------------------------*/
#include "../include/mimalloc.h" #include "mimalloc.h"
#include "../include/mimalloc-internal.h" #include "mimalloc-internal.h"
#include "../include/mimalloc-atomic.h" #include "mimalloc-atomic.h"
#include <stdio.h> // fputs, stderr #include <stdio.h> // fputs, stderr
#include <string.h> // memset #include <string.h> // memset