Skip to content

Commit 59ea84c

Browse files
authored
Merge pull request #654 from dscho/git-for-windows-assorted-fixes
Assorted fixes from the Git for Windows project
2 parents ddc9841 + 089e85b commit 59ea84c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+828
-782
lines changed

CMakeLists.txt

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ option(MI_ASAN "Compile with address sanitizer support (adds a smal
1515
option(MI_USE_CXX "Use the C++ compiler to compile the library (instead of the C compiler)" OFF)
1616
option(MI_SEE_ASM "Generate assembly files" OFF)
1717
option(MI_OSX_INTERPOSE "Use interpose to override standard malloc on macOS" ON)
18-
option(MI_OSX_ZONE "Use malloc zone to override standard malloc on macOS" ON)
18+
option(MI_OSX_ZONE "Use malloc zone to override standard malloc on macOS" ON)
1919
option(MI_WIN_REDIRECT "Use redirection module ('mimalloc-redirect') on Windows if compiling mimalloc as a DLL" ON)
2020
option(MI_LOCAL_DYNAMIC_TLS "Use slightly slower, dlopen-compatible TLS mechanism (Unix)" OFF)
2121
option(MI_BUILD_SHARED "Build shared library" ON)
@@ -56,7 +56,7 @@ set(mi_sources
5656
# Convenience: set default build type depending on the build directory
5757
# -----------------------------------------------------------------------------
5858

59-
message(STATUS "")
59+
message(STATUS "")
6060
if (NOT CMAKE_BUILD_TYPE)
6161
if ("${CMAKE_BINARY_DIR}" MATCHES ".*(D|d)ebug$" OR MI_DEBUG_FULL)
6262
message(STATUS "No build type selected, default to: Debug")
@@ -88,7 +88,7 @@ if(MI_OVERRIDE)
8888
# use zone's on macOS
8989
message(STATUS " Use malloc zone to override malloc (MI_OSX_ZONE=ON)")
9090
list(APPEND mi_sources src/alloc-override-osx.c)
91-
list(APPEND mi_defines MI_OSX_ZONE=1)
91+
list(APPEND mi_defines MI_OSX_ZONE=1)
9292
if (NOT MI_OSX_INTERPOSE)
9393
message(STATUS " WARNING: zone overriding usually also needs interpose (use -DMI_OSX_INTERPOSE=ON)")
9494
endif()
@@ -201,12 +201,12 @@ if(MI_DEBUG_TSAN)
201201
list(APPEND mi_cflags -fsanitize=thread -g -O1)
202202
list(APPEND CMAKE_EXE_LINKER_FLAGS -fsanitize=thread)
203203
else()
204-
message(WARNING "Can only use thread sanitizer with clang (MI_DEBUG_TSAN=ON but ignored)")
205-
endif()
204+
message(WARNING "Can only use thread sanitizer with clang (MI_DEBUG_TSAN=ON but ignored)")
205+
endif()
206206
endif()
207207

208208
if(MI_DEBUG_UBSAN)
209-
if(CMAKE_BUILD_TYPE MATCHES "Debug")
209+
if(CMAKE_BUILD_TYPE MATCHES "Debug")
210210
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
211211
message(STATUS "Build with undefined-behavior sanitizer (MI_DEBUG_UBSAN=ON)")
212212
list(APPEND mi_cflags -fsanitize=undefined -g -fno-sanitize-recover=undefined)
@@ -216,10 +216,10 @@ if(MI_DEBUG_UBSAN)
216216
set(MI_USE_CXX "ON")
217217
endif()
218218
else()
219-
message(WARNING "Can only use undefined-behavior sanitizer with clang++ (MI_DEBUG_UBSAN=ON but ignored)")
220-
endif()
219+
message(WARNING "Can only use undefined-behavior sanitizer with clang++ (MI_DEBUG_UBSAN=ON but ignored)")
220+
endif()
221221
else()
222-
message(WARNING "Can only use thread sanitizer with a debug build (CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE})")
222+
message(WARNING "Can only use thread sanitizer with a debug build (CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE})")
223223
endif()
224224
endif()
225225

@@ -240,7 +240,7 @@ if(CMAKE_C_COMPILER_ID MATCHES "AppleClang|Clang|GNU")
240240
list(APPEND mi_cflags -Wall -Wextra -Wno-unknown-pragmas -fvisibility=hidden)
241241
if(NOT MI_USE_CXX)
242242
list(APPEND mi_cflags -Wstrict-prototypes)
243-
endif()
243+
endif()
244244
if(CMAKE_C_COMPILER_ID MATCHES "AppleClang|Clang")
245245
list(APPEND mi_cflags -Wpedantic -Wno-static-in-inline)
246246
endif()
@@ -272,7 +272,7 @@ if(WIN32)
272272
else()
273273
set(pc_libraries "")
274274
find_library(MI_LIBPTHREAD pthread)
275-
if (MI_LIBPTHREAD)
275+
if (MI_LIBPTHREAD)
276276
list(APPEND mi_libraries ${MI_LIBPTHREAD})
277277
set(pc_libraries "${pc_libraries} -pthread")
278278
endif()
@@ -282,10 +282,10 @@ else()
282282
set(pc_libraries "${pc_libraries} -lrt")
283283
endif()
284284
find_library(MI_LIBATOMIC atomic)
285-
if (NOT MI_LIBATOMIC AND MI_USE_LIBATOMIC)
285+
if (NOT MI_LIBATOMIC AND MI_USE_LIBATOMIC)
286286
set(MI_LIBATOMIC atomic)
287287
endif()
288-
if (MI_LIBATOMIC)
288+
if (MI_LIBATOMIC)
289289
list(APPEND mi_libraries ${MI_LIBATOMIC})
290290
set(pc_libraries "${pc_libraries} -latomic")
291291
endif()
@@ -302,7 +302,7 @@ set(mi_install_libdir "${CMAKE_INSTALL_LIBDIR}")
302302
# are either installed at top level, or use versioned directories for side-by-side installation (default)
303303
if (MI_INSTALL_TOPLEVEL)
304304
set(mi_install_objdir "${CMAKE_INSTALL_LIBDIR}")
305-
set(mi_install_incdir "${CMAKE_INSTALL_INCLUDEDIR}")
305+
set(mi_install_incdir "${CMAKE_INSTALL_INCLUDEDIR}")
306306
set(mi_install_cmakedir "${CMAKE_INSTALL_LIBDIR}/cmake/mimalloc")
307307
else()
308308
set(mi_install_objdir "${CMAKE_INSTALL_LIBDIR}/mimalloc-${mi_version}") # for static library and object files
@@ -316,7 +316,7 @@ if(MI_SECURE)
316316
endif()
317317
if(MI_VALGRIND)
318318
set(mi_basename "${mi_basename}-valgrind")
319-
endif()
319+
endif()
320320
if(MI_ASAN)
321321
set(mi_basename "${mi_basename}-asan")
322322
endif()
@@ -383,7 +383,7 @@ if(MI_BUILD_SHARED)
383383
install(FILES "$<TARGET_FILE_DIR:mimalloc>/mimalloc-redirect${MIMALLOC_REDIRECT_SUFFIX}.dll" DESTINATION ${mi_install_libdir})
384384
endif()
385385

386-
install(TARGETS mimalloc EXPORT mimalloc DESTINATION ${mi_install_libdir} LIBRARY)
386+
install(TARGETS mimalloc EXPORT mimalloc DESTINATION ${mi_install_libdir} LIBRARY)
387387
install(EXPORT mimalloc DESTINATION ${mi_install_cmakedir})
388388
endif()
389389

azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ trigger:
1313
include:
1414
- v*
1515

16-
jobs:
16+
jobs:
1717
- job:
1818
displayName: Windows
1919
pool:

cmake/mimalloc-config.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ include(${CMAKE_CURRENT_LIST_DIR}/mimalloc.cmake)
22
get_filename_component(MIMALLOC_CMAKE_DIR "${CMAKE_CURRENT_LIST_DIR}" PATH) # one up from the cmake dir, e.g. /usr/local/lib/cmake/mimalloc-2.0
33
get_filename_component(MIMALLOC_VERSION_DIR "${CMAKE_CURRENT_LIST_DIR}" NAME)
44
string(REPLACE "/lib/cmake" "/lib" MIMALLOC_LIBRARY_DIR "${MIMALLOC_CMAKE_DIR}")
5-
if("${MIMALLOC_VERSION_DIR}" EQUAL "mimalloc")
5+
if("${MIMALLOC_VERSION_DIR}" EQUAL "mimalloc")
66
# top level install
77
string(REPLACE "/lib/cmake" "/include" MIMALLOC_INCLUDE_DIR "${MIMALLOC_CMAKE_DIR}")
88
set(MIMALLOC_OBJECT_DIR "${MIMALLOC_LIBRARY_DIR}")
9-
else()
9+
else()
1010
# versioned
1111
string(REPLACE "/lib/cmake/" "/include/" MIMALLOC_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}")
12-
string(REPLACE "/lib/cmake/" "/lib/" MIMALLOC_OBJECT_DIR "${CMAKE_CURRENT_LIST_DIR}")
13-
endif()
12+
string(REPLACE "/lib/cmake/" "/lib/" MIMALLOC_OBJECT_DIR "${CMAKE_CURRENT_LIST_DIR}")
13+
endif()
1414
set(MIMALLOC_TARGET_DIR "${MIMALLOC_LIBRARY_DIR}") # legacy

doc/mimalloc-doc.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Notable aspects of the design include:
4040
per mimalloc page, but for each page we have multiple free lists. In particular, there
4141
is one list for thread-local `free` operations, and another one for concurrent `free`
4242
operations. Free-ing from another thread can now be a single CAS without needing
43-
sophisticated coordination between threads. Since there will be
43+
sophisticated coordination between threads. Since there will be
4444
thousands of separate free lists, contention is naturally distributed over the heap,
4545
and the chance of contending on a single location will be low -- this is quite
4646
similar to randomized algorithms like skip lists where adding
@@ -414,7 +414,7 @@ void mi_register_error(mi_error_fun* errfun, void* arg);
414414
bool mi_is_in_heap_region(const void* p);
415415

416416
/// Reserve OS memory for use by mimalloc. Reserved areas are used
417-
/// before allocating from the OS again. By reserving a large area upfront,
417+
/// before allocating from the OS again. By reserving a large area upfront,
418418
/// allocation can be more efficient, and can be better managed on systems
419419
/// without `mmap`/`VirtualAlloc` (like WASM for example).
420420
/// @param size The size to reserve.
@@ -423,7 +423,7 @@ bool mi_is_in_heap_region(const void* p);
423423
/// @return \a 0 if successful, and an error code otherwise (e.g. `ENOMEM`).
424424
int mi_reserve_os_memory(size_t size, bool commit, bool allow_large);
425425

426-
/// Manage a particular memory area for use by mimalloc.
426+
/// Manage a particular memory area for use by mimalloc.
427427
/// This is just like `mi_reserve_os_memory` except that the area should already be
428428
/// allocated in some manner and available for use my mimalloc.
429429
/// @param start Start of the memory area
@@ -499,7 +499,7 @@ void mi_process_info(size_t* elapsed_msecs, size_t* user_msecs, size_t* system_m
499499
/// \{
500500

501501
/// The maximum supported alignment size (currently 1MiB).
502-
#define MI_ALIGNMENT_MAX (1024*1024UL)
502+
#define MI_ALIGNMENT_MAX (1024*1024UL)
503503

504504
/// Allocate \a size bytes aligned by \a alignment.
505505
/// @param size number of bytes to allocate.
@@ -813,7 +813,7 @@ typedef enum mi_option_e {
813813
mi_option_page_reset, ///< Reset page memory after \a mi_option_reset_delay milliseconds when it becomes free.
814814
mi_option_abandoned_page_reset, //< Reset free page memory when a thread terminates.
815815
mi_option_use_numa_nodes, ///< Pretend there are at most N NUMA nodes; Use 0 to use the actual detected NUMA nodes at runtime.
816-
mi_option_eager_commit_delay, ///< the first N segments per thread are not eagerly committed (=1).
816+
mi_option_eager_commit_delay, ///< the first N segments per thread are not eagerly committed (=1).
817817
mi_option_os_tag, ///< OS tag to assign to mimalloc'd memory
818818
mi_option_limit_os_alloc, ///< If set to 1, do not use OS memory for allocation (but only pre-reserved arenas)
819819

@@ -1097,7 +1097,7 @@ or via environment variables.
10971097
`MIMALLOC_EAGER_COMMIT_DELAY=N` (`N` is 1 by default) to delay the initial `N` segments (of 4MiB)
10981098
of a thread to not allocate in the huge OS pages; this prevents threads that are short lived
10991099
and allocate just a little to take up space in the huge OS page area (which cannot be reset).
1100-
- `MIMALLOC_RESERVE_HUGE_OS_PAGES_AT=N`: where N is the numa node. This reserves the huge pages at a specific numa node.
1100+
- `MIMALLOC_RESERVE_HUGE_OS_PAGES_AT=N`: where N is the numa node. This reserves the huge pages at a specific numa node.
11011101
(`N` is -1 by default to reserve huge pages evenly among the given number of numa nodes (or use the available ones as detected))
11021102
11031103
Use caution when using `fork` in combination with either large or huge OS pages: on a fork, the OS uses copy-on-write

docs/annotated.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
onmouseout="return searchBox.OnSearchSelectHide()"
4444
alt=""/>
4545
<input type="text" id="MSearchField" value="Search" accesskey="S"
46-
onfocus="searchBox.OnSearchFieldFocus(true)"
47-
onblur="searchBox.OnSearchFieldFocus(false)"
46+
onfocus="searchBox.OnSearchFieldFocus(true)"
47+
onblur="searchBox.OnSearchFieldFocus(false)"
4848
onkeyup="searchBox.OnSearchFieldChange(event)"/>
4949
</span><span class="right">
5050
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
@@ -69,7 +69,7 @@
6969
<div id="nav-sync" class="sync"></div>
7070
</div>
7171
</div>
72-
<div id="splitbar" style="-moz-user-select:none;"
72+
<div id="splitbar" style="-moz-user-select:none;"
7373
class="ui-resizable-handle">
7474
</div>
7575
</div>
@@ -88,7 +88,7 @@
8888

8989
<!-- iframe showing the search results (closed by default) -->
9090
<div id="MSearchResultsWindow">
91-
<iframe src="javascript:void(0)" frameborder="0"
91+
<iframe src="javascript:void(0)" frameborder="0"
9292
name="MSearchResults" id="MSearchResults">
9393
</iframe>
9494
</div>

docs/bench.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
onmouseout="return searchBox.OnSearchSelectHide()"
4444
alt=""/>
4545
<input type="text" id="MSearchField" value="Search" accesskey="S"
46-
onfocus="searchBox.OnSearchFieldFocus(true)"
47-
onblur="searchBox.OnSearchFieldFocus(false)"
46+
onfocus="searchBox.OnSearchFieldFocus(true)"
47+
onblur="searchBox.OnSearchFieldFocus(false)"
4848
onkeyup="searchBox.OnSearchFieldChange(event)"/>
4949
</span><span class="right">
5050
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
@@ -69,7 +69,7 @@
6969
<div id="nav-sync" class="sync"></div>
7070
</div>
7171
</div>
72-
<div id="splitbar" style="-moz-user-select:none;"
72+
<div id="splitbar" style="-moz-user-select:none;"
7373
class="ui-resizable-handle">
7474
</div>
7575
</div>
@@ -88,7 +88,7 @@
8888

8989
<!-- iframe showing the search results (closed by default) -->
9090
<div id="MSearchResultsWindow">
91-
<iframe src="javascript:void(0)" frameborder="0"
91+
<iframe src="javascript:void(0)" frameborder="0"
9292
name="MSearchResults" id="MSearchResults">
9393
</iframe>
9494
</div>

docs/build.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
onmouseout="return searchBox.OnSearchSelectHide()"
4444
alt=""/>
4545
<input type="text" id="MSearchField" value="Search" accesskey="S"
46-
onfocus="searchBox.OnSearchFieldFocus(true)"
47-
onblur="searchBox.OnSearchFieldFocus(false)"
46+
onfocus="searchBox.OnSearchFieldFocus(true)"
47+
onblur="searchBox.OnSearchFieldFocus(false)"
4848
onkeyup="searchBox.OnSearchFieldChange(event)"/>
4949
</span><span class="right">
5050
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
@@ -69,7 +69,7 @@
6969
<div id="nav-sync" class="sync"></div>
7070
</div>
7171
</div>
72-
<div id="splitbar" style="-moz-user-select:none;"
72+
<div id="splitbar" style="-moz-user-select:none;"
7373
class="ui-resizable-handle">
7474
</div>
7575
</div>
@@ -88,7 +88,7 @@
8888

8989
<!-- iframe showing the search results (closed by default) -->
9090
<div id="MSearchResultsWindow">
91-
<iframe src="javascript:void(0)" frameborder="0"
91+
<iframe src="javascript:void(0)" frameborder="0"
9292
name="MSearchResults" id="MSearchResults">
9393
</iframe>
9494
</div>

docs/classes.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
onmouseout="return searchBox.OnSearchSelectHide()"
4444
alt=""/>
4545
<input type="text" id="MSearchField" value="Search" accesskey="S"
46-
onfocus="searchBox.OnSearchFieldFocus(true)"
47-
onblur="searchBox.OnSearchFieldFocus(false)"
46+
onfocus="searchBox.OnSearchFieldFocus(true)"
47+
onblur="searchBox.OnSearchFieldFocus(false)"
4848
onkeyup="searchBox.OnSearchFieldChange(event)"/>
4949
</span><span class="right">
5050
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
@@ -69,7 +69,7 @@
6969
<div id="nav-sync" class="sync"></div>
7070
</div>
7171
</div>
72-
<div id="splitbar" style="-moz-user-select:none;"
72+
<div id="splitbar" style="-moz-user-select:none;"
7373
class="ui-resizable-handle">
7474
</div>
7575
</div>
@@ -88,7 +88,7 @@
8888

8989
<!-- iframe showing the search results (closed by default) -->
9090
<div id="MSearchResultsWindow">
91-
<iframe src="javascript:void(0)" frameborder="0"
91+
<iframe src="javascript:void(0)" frameborder="0"
9292
name="MSearchResults" id="MSearchResults">
9393
</iframe>
9494
</div>

0 commit comments

Comments
 (0)