Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mpk protect #968

Open
wants to merge 675 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
675 commits
Select commit Hold shift + click to select a range
961778f
Merge branch 'dev' into dev-slice
daanx Nov 21, 2022
3ccf849
more refined decommit extend delay
daanx Nov 21, 2022
c007747
back to 64k pages but 32MiB segments and a 1MiB minimal commit size
daanx Nov 21, 2022
83c027c
fix medium page size to 512k
daanx Nov 22, 2022
d01ecc2
Merge branch 'dev' into dev-slice
daanx Nov 22, 2022
85b5fa1
merge segment_init refactoring from dev
daanx Nov 23, 2022
ed82aa9
merge from dev where huge objects are now part of page queues again
daanx Nov 23, 2022
2088080
remove comment
daanx Nov 23, 2022
9e56567
fix decommit for huge objects
daanx Nov 23, 2022
c613c1d
merge from dev
daanx Nov 23, 2022
58d1272
make mi_collect(true) actually free the segment caches
daanx Nov 23, 2022
55dac20
Merge branch 'dev' into dev-slice
daanx Nov 25, 2022
afb5468
Merge branch 'dev' into dev-slice
daanx Nov 26, 2022
6988bbc
fix duplicate definition (issue #652
daanx Nov 27, 2022
447c2f1
Merge branch 'dev' into dev-slice
daanx Nov 27, 2022
90c8f05
Merge branch 'dev' into dev-slice
daanx Nov 28, 2022
911ea81
Merge branch 'dev' into dev-slice
daanx Nov 28, 2022
6304bbe
Merge branch 'dev' into dev-slice
daanx Nov 28, 2022
92ffc25
merge from dev
daanx Dec 20, 2022
35997c0
Merge branch 'dev' into dev-slice
daanx Dec 20, 2022
d862c8a
Merge branch 'dev' into dev-slice
daanx Dec 20, 2022
9b2dd0d
Merge branch 'dev' into dev-slice
daanx Dec 20, 2022
11ddba7
Merge branch 'dev' into dev-slice
daanx Dec 20, 2022
0f796a5
fix bug where eager committed memory would be immediatedy decommitted…
daanx Dec 21, 2022
a873ddc
merge from dev
daanx Dec 21, 2022
d1fff11
reorganize span free code
daanx Dec 21, 2022
e87bada
Merge branch 'dev' into dev-slice
daanx Dec 23, 2022
28cf67e
bump version to 2.0.9
daanx Dec 23, 2022
7bb34e0
fix readme
daanx Dec 23, 2022
1e4b6b7
fix assertion that was too strict (issue #691)
daanx Feb 1, 2023
a6f092a
Merge branch 'dev' into dev-slice
daanx Feb 1, 2023
efb7a15
Merge branch 'dev' into dev-slice
daanx Feb 1, 2023
1a136c7
Merge branch 'dev' into dev-slice
daanx Feb 1, 2023
e7b941a
Merge branch 'dev' into dev-slice
daanx Feb 7, 2023
8be4cee
change max align size to 8
daanx Nov 17, 2022
5fe4a34
revert default max align commit back to 16
daanx Feb 20, 2023
e4b9ea9
merge from dev
daanx Mar 4, 2023
f32b42e
Merge branch 'dev' into dev-slice
daanx Mar 5, 2023
b3176ad
merge from dev, fix commit size in asan tracking
daanx Mar 5, 2023
6f31115
fix segment defined memory for valgrind
daanx Mar 6, 2023
d0eebed
merge from dev
daanx Mar 6, 2023
43533fa
Merge branch 'dev' into dev-slice
daanx Mar 6, 2023
7ec798e
make test-stress match the one in dev
daanx Mar 6, 2023
8184e9d
Merge branch 'dev' into dev-slice
daanx Mar 6, 2023
a90737a
fix valgrind tracking for zero initialized segments
daanx Mar 6, 2023
65bbe40
merge from dev-platform
daanx Mar 15, 2023
3488006
Merge branch 'dev-platform' into dev-slice-platform
daanx Mar 16, 2023
ea40b8f
merge from dev-platform
daanx Mar 16, 2023
c80e2d5
Merge branch 'dev' into dev-slice
daanx Mar 16, 2023
4da64ac
Merge branch 'dev-slice' into dev-slice-platform
daanx Mar 16, 2023
61ae0d1
merge from dev-platform
daanx Mar 16, 2023
1e8769e
Merge branch 'dev-platform' into dev-slice-platform
daanx Mar 17, 2023
33880f9
Merge branch 'dev' into dev-slice
daanx Mar 17, 2023
8a56090
Merge branch 'dev-slice' into dev-slice-platform
daanx Mar 17, 2023
92358f8
Merge branch 'dev-platform' into dev-slice-platform
daanx Mar 17, 2023
eca98ac
Merge branch 'dev-platform' into dev-slice-platform
daanx Mar 17, 2023
8fbe7aa
update process info primitive api
daanx Mar 20, 2023
99c9f55
simplify primitives API
daanx Mar 20, 2023
1a5afd9
Merge branch 'dev-platform' into dev-slice-platform
daanx Mar 20, 2023
3fc30c4
merge from dev, version bump to 2.1.0
daanx Mar 20, 2023
993c0a4
fix includes
daanx Mar 20, 2023
e0763f8
Merge branch 'dev-platform' into dev-slice-platform
daanx Mar 20, 2023
d40a26a
merge from dev
daanx Mar 20, 2023
4a18fa3
Merge branch 'dev-platform' into dev-slice-platform
daanx Mar 20, 2023
dc0dddc
Merge branch 'dev' into dev-slice
daanx Mar 20, 2023
90f866c
fix warnings for issues #709
daanx Mar 20, 2023
4bf6330
fix alignment issue #700
daanx Mar 20, 2023
c935521
fix test and project
daanx Mar 20, 2023
a582d76
refine start offset in a page
daanx Mar 20, 2023
268dcea
Merge branch 'dev' into dev-slice
daanx Mar 20, 2023
0877c94
merge from dev
daanx Mar 20, 2023
b0ba746
merge from dev
daanx Mar 20, 2023
bdf1021
merge from dev
daanx Mar 20, 2023
be04391
Merge branch 'dev' into dev-slice
daanx Mar 22, 2023
65660a8
merge from dev
daanx Mar 22, 2023
0f07900
Merge branch 'dev' into dev-slice
daanx Mar 22, 2023
564222e
Merge branch 'dev' into dev-slice
daanx Mar 22, 2023
b0e4309
Merge branch 'dev' into dev-slice
daanx Mar 23, 2023
1cbc55f
fix initialization of decommit mask for huge pages
daanx Mar 23, 2023
165b847
improve segment_cache assertions
daanx Mar 23, 2023
6a8b158
merge from dev
daanx Mar 28, 2023
4c681cf
merge from dev
daanx Mar 28, 2023
9060018
remove superfluous prototypes
daanx Mar 28, 2023
391f8bb
merge from dev
daanx Mar 28, 2023
6dd3073
avoid caching segments in pinned arenas; happes with huge OS page res…
daanx Mar 28, 2023
ec97e2a
Merge branch 'dev' into dev-slice
daanx Mar 28, 2023
cbd7f94
merge from dev
daanx Mar 29, 2023
42c8015
merge from dev
daanx Mar 29, 2023
5a8f263
Merge branch 'dev' into dev-slice
daanx Mar 29, 2023
72f4e0a
Merge branch 'dev' into dev-slice
daanx Mar 29, 2023
c4220e4
merge from dev
daanx Mar 29, 2023
8f0901b
Merge branch 'dev' into dev-slice
daanx Mar 29, 2023
5021918
Merge branch 'dev' into dev-slice
daanx Mar 29, 2023
ee7814d
Merge branch 'dev' into dev-slice
daanx Mar 29, 2023
9c544ab
bump version for further development
daanx Mar 30, 2023
8c52662
merge from dev-reset
daanx Mar 30, 2023
14fdd9a
Merge branch 'dev' into dev-slice
daanx Mar 31, 2023
b9e28eb
merge from dev
daanx Mar 31, 2023
f8faa8f
Merge branch 'dev-slice' into dev-slice-reset
daanx Mar 31, 2023
92ab16d
Merge branch 'dev-reset' into dev-slice-reset
daanx Mar 31, 2023
f4e006f
merge from dev-reset
daanx Apr 1, 2023
c344bf5
wip: work on purgable arenas
daanx Apr 1, 2023
80d7267
Merge branch 'dev' into dev-slice
daanx Apr 1, 2023
3e31347
merge from dev
daanx Apr 3, 2023
5e4f7d3
bump version for further development
Apr 3, 2023
e96af1d
Merge branch 'dev-slice' into dev-slice-reset
Apr 3, 2023
fcec098
Merge branch 'dev-reset' into dev-slice-reset
Apr 3, 2023
94a8678
wip: purgeable arenas; fix asan warnings
Apr 3, 2023
f5ab38f
wip: use purge throughout for segments and arenas; more agressive delays
Apr 3, 2023
a9f4237
small changes; make minimal commit most fine grained
Apr 3, 2023
d22a13c
wip: purgeable arenas, various fixes
Apr 4, 2023
33d7503
rename to arena_eager_commit
Apr 4, 2023
09297ba
wip: purgeable arenas
Apr 4, 2023
a836d23
merge from dev-reset
Apr 4, 2023
b6603c2
merge from dev-reset
Apr 4, 2023
24034c9
merge from dev-reset
Apr 4, 2023
9f0da5c
merge ide files
Apr 4, 2023
c0c81a1
merge from dev-reset
Apr 5, 2023
1e36f7e
Merge branch 'dev-reset' into dev-slice-reset
Apr 5, 2023
940e890
Merge branch 'dev-reset' into dev-slice-reset
Apr 5, 2023
2715191
merge from dev-reset
Apr 5, 2023
fa621d5
Merge branch 'dev-reset' into dev-slice-reset
Apr 5, 2023
269e0ea
merge from dev-reset
Apr 9, 2023
96b02dd
fix accidental cmake move
Apr 9, 2023
991d04b
merge from dev-reset
Apr 13, 2023
e6681f2
Merge branch 'dev-reset' into dev-slice-reset
Apr 13, 2023
e35e919
remove segment-cache as it is superseded by better arena management
Apr 13, 2023
62708b9
Merge branch 'dev' into dev-slice
daanx Apr 14, 2023
6f531a6
Merge branch 'dev-reset' into dev-slice-reset
Apr 16, 2023
b0104ef
merge from dev
Apr 16, 2023
becf379
merge from dev-reset
Apr 16, 2023
0be48b1
Merge branch 'dev-reset' into dev-slice-reset
Apr 16, 2023
689147e
merge from dev-reset
Apr 16, 2023
5693506
merge from dev-reset
Apr 17, 2023
f890679
Merge branch 'dev' into dev-slice
daanx Apr 17, 2023
66aa7a1
further fix for atomic build error suggested by Davide Di Gennaro (is…
Apr 17, 2023
4dce9c0
merge from dev
Apr 17, 2023
7de3201
Merge branch 'dev-slice' into dev-slice-reset
Apr 17, 2023
866d402
Merge branch 'dev-reset' into dev-slice-reset
Apr 17, 2023
c3200d1
merge from dev
Apr 17, 2023
a295439
Merge branch 'dev' into dev-slice
Apr 17, 2023
6d42f2a
increase pipeline timeout to 10min for tsan
Apr 17, 2023
15e6b6e
Merge branch 'dev' into dev-slice
Apr 17, 2023
a200f01
Merge branch 'dev' into dev-slice
Apr 17, 2023
61fc830
Merge branch 'dev' into dev-slice
Apr 17, 2023
015aac0
keep tsan enabled for dev-slice
Apr 17, 2023
3d7635b
Merge branch 'dev' into dev-slice
Apr 17, 2023
fb07276
merge from dev
Apr 19, 2023
eff7940
merge from dev
Apr 19, 2023
672e3dd
Merge branch 'dev' into dev-slice
Apr 19, 2023
6faff49
merge from dev
Apr 21, 2023
063f25b
merge from dev
Apr 22, 2023
426d2b3
Merge branch 'dev' into dev-slice
Apr 23, 2023
f22801b
Merge branch 'dev' into dev-slice
Apr 23, 2023
6303cd4
Merge branch 'dev' into dev-slice
Apr 23, 2023
2d85abd
merge from dev
Apr 23, 2023
c0695fe
merge from dev
Apr 23, 2023
a6e7bae
merge from dev
Apr 23, 2023
8f768ac
merge from dev
Apr 24, 2023
c0bc8ab
Merge branch 'dev' into dev-slice
Apr 24, 2023
95c2059
fix asan mem tracking
Apr 24, 2023
c93a077
Merge branch 'dev' into dev-slice
Apr 24, 2023
074adc1
Merge branch 'dev' into dev-slice
Apr 24, 2023
56c0a80
merge from dev
Apr 24, 2023
43ce4bd
Merge branch 'dev' into dev-slice
Apr 24, 2023
5e09f1b
Merge branch 'dev' into dev-slice
Apr 25, 2023
2f8fb6a
Merge branch 'dev' into dev-slice
May 19, 2023
c569b77
Merge branch 'dev' into dev-slice
May 20, 2023
24668b9
Merge branch 'dev' into dev-slice
May 20, 2023
578d20f
Merge branch 'dev' into dev-slice
daanx Jun 30, 2023
10efe29
Merge branch 'dev' into dev-slice
daanx Jun 30, 2023
8fb51aa
merge from dev-abandon
daanx Feb 29, 2024
f57c9e1
merge from dev-abandon
daanx Mar 1, 2024
e5d1cb3
merge from dev-abandon
daanx Mar 1, 2024
f6320bd
merge from dev-abandon
daanx Mar 1, 2024
280123b
purge on page free as well
daanx Mar 1, 2024
2845f0c
merge from dev-abandon
daanx Mar 2, 2024
2c433a2
merge from dev-abandon
daanx Mar 2, 2024
4482237
Merge branch 'dev-abandon' into dev-slice-abandon
daanx Mar 2, 2024
7ff4607
merge from dev
daanx Mar 3, 2024
ccd2ac6
merge from dev-slice
daanx Mar 3, 2024
656c81a
Merge branch 'dev-abandon' into dev-slice-abandon
daanx Mar 3, 2024
8e1f8f4
Merge branch 'dev-abandon' into dev-slice-abandon
daanx Mar 3, 2024
5a2ed6d
fix assertion
daanx Mar 3, 2024
0a5cf93
Merge branch 'dev' into dev-slice
daanx Mar 3, 2024
61cc89a
Merge branch 'dev-slice' into dev-slice-abandon
daanx Mar 3, 2024
e5283ed
Merge branch 'dev-abandon' into dev-slice-abandon
daanx Mar 3, 2024
7986e92
merge from dev
daanx Mar 3, 2024
c8f8407
Merge branch 'dev' into dev-slice
daanx Mar 3, 2024
ac5d261
Merge branch 'dev' into dev-slice
daanx Mar 3, 2024
bcb8ce9
merge from dev-abandon
daanx Mar 3, 2024
757f15f
merge from dev-slice
daanx Mar 3, 2024
abb8eab
merge from dev
daanx Mar 4, 2024
2cca58d
Merge branch 'dev' into dev-slice
daanx Mar 4, 2024
6399dbd
merge from dev (new free.c)
daanx Mar 24, 2024
e363f47
Merge branch 'dev' into dev-slice
daanx Mar 24, 2024
3c85983
merge from dev with new page fields (block_size and is_huge)
daanx Mar 25, 2024
af3f2f9
fix assertions and warnings on gcc
daanx Mar 25, 2024
7c17c3d
optimize page struct layout
daanx Mar 25, 2024
cc8d89a
update comments
daanx Mar 25, 2024
c1d7d7f
merge from dev
daanx Mar 25, 2024
630521e
merge from dev
daanx Mar 25, 2024
415127b
Merge branch 'dev' into dev-slice
daanx Mar 25, 2024
c607737
merge from dev
daanx Mar 25, 2024
bcf975c
merge from dev
daanx Mar 26, 2024
f199b88
Merge branch 'dev' into dev-slice
daanx Mar 29, 2024
78418b3
fix overflow of slice count, PR #877
daanx Apr 19, 2024
da1d64f
Merge branch 'dev' into dev-slice
daanx Apr 19, 2024
a7c033c
avoid unused warning
daanx Apr 19, 2024
01ba98b
Merge branch 'dev' into dev-slice
daanx Apr 19, 2024
e688d5c
merge from dev
daanx Apr 19, 2024
833121d
Merge branch 'dev' into dev-slice
daanx Apr 19, 2024
3565868
purge segments on forced collect (issue #878)
daanx Apr 19, 2024
83af243
merge from dev
daanx Apr 19, 2024
25002c0
Merge branch 'dev' into dev-slice
daanx Apr 19, 2024
19626c5
Merge branch 'dev' into dev-slice
daanx Apr 19, 2024
70782c3
merge from dev
daanx Apr 20, 2024
79aa5bb
Merge branch 'dev' into dev-slice
daanx Apr 21, 2024
6ba166f
merge from dev
daanx Apr 22, 2024
1b3cb02
Merge branch 'dev' into dev-slice
daanx Apr 22, 2024
45de947
bump version to 2.1.5 for further development
daanx Apr 22, 2024
bbcfe0f
Merge branch 'dev' into dev-slice
daanx Apr 25, 2024
bc5dca3
Merge branch 'dev' into dev-slice
daanx Apr 27, 2024
3b4c61b
Merge branch 'dev' into dev-slice
daanx May 11, 2024
6c5d6e1
fix max allocation size on 32-bit systems (issue #882)
daanx May 11, 2024
5b3ccc3
Merge branch 'dev' into dev-slice
daanx May 11, 2024
e17b99d
merge from dev
daanx May 11, 2024
e8206e9
merge from dev improved aligned allocation
daanx May 11, 2024
2b42f64
merge from dev
daanx May 11, 2024
ee2167d
Merge branch 'dev' into dev-slice
daanx May 11, 2024
f94f101
Merge branch 'dev' into dev-slice
daanx May 13, 2024
16d6bad
Merge branch 'dev' into dev-slice
daanx May 13, 2024
7b2e9c6
bump version to v2.1.6
daanx May 13, 2024
d824b9d
fix page collection where a freed segment could be accessed
daanx May 13, 2024
6141843
Merge branch 'dev' into dev-slice
daanx May 13, 2024
44b65b1
remove pre_size parameter for slices
daanx May 16, 2024
4a26a45
fix out-of-bounds write on span free in huge segments
daanx May 16, 2024
c27b7c4
Merge branch 'dev' into dev-slice
daanx May 16, 2024
d468745
Merge branch 'dev' into dev-slice
daanx May 16, 2024
69f8173
merge from dev, bump version to v2.1.7
daanx May 17, 2024
21434a2
Merge branch 'dev' into dev-slice
daanx May 17, 2024
1daa4ea
Merge branch 'dev' into dev-slice
daanx May 18, 2024
d4a7c0f
merge from dev
daanx May 18, 2024
b822a44
merge from dev, upstream of python/cpython#113263
daanx May 19, 2024
65a0c82
merge from dev (support for heap tag, upstream of python/cpython#113742
daanx May 19, 2024
1462cc4
Merge branch 'dev' into dev-slice
daanx May 19, 2024
998401b
Merge branch 'dev' into dev-slice
daanx May 21, 2024
b907d76
Merge branch 'dev' into dev-slice
daanx May 21, 2024
8c532c3
Merge branch 'dev' into dev-slice
daanx May 21, 2024
bcdb4dc
mimalloc fix
Dec 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,11 @@ jobs:
CXX: clang++
BuildType: debug-ubsan-clang
cmakeExtraArgs: -DCMAKE_BUILD_TYPE=Debug -DMI_DEBUG_FULL=ON -DMI_DEBUG_UBSAN=ON
# Disable for now as it times out on the azure build machines
# Debug TSAN Clang++:
# CC: clang
# CXX: clang++
# BuildType: debug-tsan-clang-cxx
# cmakeExtraArgs: -DCMAKE_BUILD_TYPE=Debug -DMI_USE_CXX=ON -DMI_DEBUG_TSAN=ON
Debug TSAN Clang++:
CC: clang
CXX: clang++
BuildType: debug-tsan-clang-cxx
cmakeExtraArgs: -DCMAKE_BUILD_TYPE=Debug -DMI_USE_CXX=ON -DMI_DEBUG_TSAN=ON

steps:
- task: CMake@1
Expand Down Expand Up @@ -151,9 +150,16 @@ jobs:
cmakeArgs: .. $(cmakeExtraArgs)
- script: make -j$(sysctl -n hw.ncpu) -C $(BuildType)
displayName: Make
# - script: MIMALLOC_VERBOSE=1 ./mimalloc-test-api
# workingDirectory: $(BuildType)
# displayName: TestAPI
# - script: MIMALLOC_VERBOSE=1 ./mimalloc-test-stress
# workingDirectory: $(BuildType)
# displayName: TestStress
- script: ctest --verbose --timeout 120
workingDirectory: $(BuildType)
displayName: CTest

# - upload: $(Build.SourcesDirectory)/$(BuildType)
# artifact: mimalloc-macos-$(BuildType)

Expand Down
4 changes: 2 additions & 2 deletions cmake/mimalloc-config-version.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
set(mi_version_major 1)
set(mi_version_minor 8)
set(mi_version_major 2)
set(mi_version_minor 1)
set(mi_version_patch 7)
set(mi_version ${mi_version_major}.${mi_version_minor})

Expand Down
10 changes: 5 additions & 5 deletions doc/mimalloc-doc.h
Original file line number Diff line number Diff line change
Expand Up @@ -821,12 +821,12 @@ typedef enum mi_option_e {
mi_option_eager_region_commit, ///< Eagerly commit large (256MiB) memory regions (enabled by default, except on Windows)
mi_option_segment_reset, ///< Experimental
mi_option_reset_delay, ///< Delay in milli-seconds before resetting a page (100ms by default)
mi_option_reset_decommits, ///< Experimental
mi_option_purge_decommits, ///< Experimental

// v2.x specific options
mi_option_allow_decommit, ///< Enable decommitting memory (=on)
mi_option_decommit_delay, ///< Decommit page memory after N milli-seconds delay (25ms).
mi_option_segment_decommit_delay, ///< Decommit large segment memory after N milli-seconds delay (500ms).
mi_option_allow_purge, ///< Enable decommitting memory (=on)
mi_option_purge_delay, ///< Decommit page memory after N milli-seconds delay (25ms).
mi_option_segment_purge_delay, ///< Decommit large segment memory after N milli-seconds delay (500ms).

_mi_option_last
} mi_option_t;
Expand Down Expand Up @@ -1080,7 +1080,7 @@ or via environment variables.
- `MIMALLOC_PAGE_RESET=0`: by default, mimalloc will reset (or purge) OS pages when not in use to signal to the OS
that the underlying physical memory can be reused. This can reduce memory fragmentation in long running (server)
programs. By setting it to `0` no such page resets will be done which can improve performance for programs that are not long
running. As an alternative, the `MIMALLOC_RESET_DELAY=`<msecs> can be set higher (100ms by default) to make the page
running. As an alternative, the `MIMALLOC_DECOMMIT_DELAY=`<msecs> can be set higher (100ms by default) to make the page
reset occur less frequently instead of turning it off completely.
- `MIMALLOC_LARGE_OS_PAGES=1`: use large OS pages (2MiB) when available; for some workloads this can significantly
improve performance. Use `MIMALLOC_VERBOSE` to check if the large OS pages are enabled -- usually one needs
Expand Down
3 changes: 3 additions & 0 deletions ide/vs2017/mimalloc-override.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@
<ClCompile Include="..\..\src\bitmap.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\segment-cache.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\prim\prim.c">
<Filter>Source Files</Filter>
</ClCompile>
Expand Down
3 changes: 3 additions & 0 deletions ide/vs2017/mimalloc.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@
<ClCompile Include="..\..\src\bitmap.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\segment-cache.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\prim\prim.c">
<Filter>Source Files</Filter>
</ClCompile>
Expand Down
7 changes: 5 additions & 2 deletions ide/vs2019/mimalloc-override.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@
<ClCompile Include="..\..\src\bitmap.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\prim\prim.c">
<ClCompile Include="..\..\src\segment-cache.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\prim\prim.c" />
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\segment-map.c">
Expand All @@ -67,7 +70,7 @@
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\bitmap.h">
<Filter>Source Files</Filter>
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\mimalloc\atomic.h">
<Filter>Header Files</Filter>
Expand Down
3 changes: 3 additions & 0 deletions ide/vs2019/mimalloc.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@
<ClCompile Include="..\..\src\bitmap.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\segment-cache.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\prim\prim.c">
<Filter>Source Files</Filter>
</ClCompile>
Expand Down
4 changes: 2 additions & 2 deletions ide/vs2022/mimalloc-test-stress.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@
</ClCompile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="mimalloc.vcxproj">
<Project>{abb5eae7-b3e6-432e-b636-333449892ea6}</Project>
<ProjectReference Include="mimalloc-override.vcxproj">
<Project>{abb5eae7-b3e6-432e-b636-333449892ea7}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
Expand Down
2 changes: 1 addition & 1 deletion ide/vs2022/mimalloc.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
<SDLCheck>true</SDLCheck>
<ConformanceMode>Default</ConformanceMode>
<AdditionalIncludeDirectories>../../include</AdditionalIncludeDirectories>
<PreprocessorDefinitions>MI_DEBUG=4;%(PreprocessorDefinitions);</PreprocessorDefinitions>
<PreprocessorDefinitions>MI_DEBUG=4;MI_SECURE=0;%(PreprocessorDefinitions);</PreprocessorDefinitions>
<CompileAs>CompileAsCpp</CompileAs>
<SupportJustMyCode>false</SupportJustMyCode>
<LanguageStandard>stdcpp20</LanguageStandard>
Expand Down
9 changes: 5 additions & 4 deletions include/mimalloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ terms of the MIT license. A copy of the license can be found in the file
#ifndef MIMALLOC_H
#define MIMALLOC_H

#define MI_MALLOC_VERSION 187 // major + 2 digits minor
#define MI_MALLOC_VERSION 217 // major + 2 digits minor

// ------------------------------------------------------
// Compiler specific attributes
Expand Down Expand Up @@ -97,6 +97,7 @@ terms of the MIT license. A copy of the license can be found in the file

#include <stddef.h> // size_t
#include <stdbool.h> // bool
#include <stdint.h> // INTPTR_MAX

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -516,7 +517,7 @@ template<class T, bool _mi_destroy> struct _mi_heap_stl_allocator_common : publi
protected:
std::shared_ptr<mi_heap_t> heap;
template<class U, bool D> friend struct _mi_heap_stl_allocator_common;

_mi_heap_stl_allocator_common() {
mi_heap_t* hp = mi_heap_new();
this->heap.reset(hp, (_mi_destroy ? &heap_destroy : &heap_delete)); /* calls heap_delete/destroy when the refcount drops to zero */
Expand All @@ -533,7 +534,7 @@ template<class T, bool _mi_destroy> struct _mi_heap_stl_allocator_common : publi
template<class T> struct mi_heap_stl_allocator : public _mi_heap_stl_allocator_common<T, false> {
using typename _mi_heap_stl_allocator_common<T, false>::size_type;
mi_heap_stl_allocator() : _mi_heap_stl_allocator_common<T, false>() { } // creates fresh heap that is deleted when the destructor is called
mi_heap_stl_allocator(mi_heap_t* hp) : _mi_heap_stl_allocator_common<T, false>(hp) { } // no delete nor destroy on the passed in heap
mi_heap_stl_allocator(mi_heap_t* hp) : _mi_heap_stl_allocator_common<T, false>(hp) { } // no delete nor destroy on the passed in heap
template<class U> mi_heap_stl_allocator(const mi_heap_stl_allocator<U>& x) mi_attr_noexcept : _mi_heap_stl_allocator_common<T, false>(x) { }

mi_heap_stl_allocator select_on_container_copy_construction() const { return *this; }
Expand All @@ -550,7 +551,7 @@ template<class T1, class T2> bool operator!=(const mi_heap_stl_allocator<T1>& x,
template<class T> struct mi_heap_destroy_stl_allocator : public _mi_heap_stl_allocator_common<T, true> {
using typename _mi_heap_stl_allocator_common<T, true>::size_type;
mi_heap_destroy_stl_allocator() : _mi_heap_stl_allocator_common<T, true>() { } // creates fresh heap that is destroyed when the destructor is called
mi_heap_destroy_stl_allocator(mi_heap_t* hp) : _mi_heap_stl_allocator_common<T, true>(hp) { } // no delete nor destroy on the passed in heap
mi_heap_destroy_stl_allocator(mi_heap_t* hp) : _mi_heap_stl_allocator_common<T, true>(hp) { } // no delete nor destroy on the passed in heap
template<class U> mi_heap_destroy_stl_allocator(const mi_heap_destroy_stl_allocator<U>& x) mi_attr_noexcept : _mi_heap_stl_allocator_common<T, true>(x) { }

mi_heap_destroy_stl_allocator select_on_container_copy_construction() const { return *this; }
Expand Down
Loading