Daan
a4078df9d5
Merge branch 'dev' into dev-slice
2021-10-19 10:17:53 -07:00
Daan
1917fbd847
Merge pull request #467 from tiran/strict_prototypes
...
Fix strict function prototype warnings
2021-10-19 09:35:40 -07:00
Christian Heimes
7c73e3996d
Fix strict function prototype warnings
...
Fix warning ``warning: function declaration isn’t a prototype`` when
building mimalloc with ``-Wstrict-prototypes`` flag. In C argumentless
functions should be declared as ``func(void)``.
Reproducer:
```shell
$ cmake ../.. -DCMAKE_C_FLAGS="-Wstrict-prototypes"
$ make VERBOSE=1
```
Co-authored-by: Sam Gross <colesbury@gmail.com>
Co-authored-by: Neil Schemenauer <nas@arctrix.com>
Signed-off-by: Christian Heimes <christian@python.org>
2021-10-19 10:48:26 +02:00
Daan Leijen
54659aec9e
merge from dev
2021-10-18 16:28:08 -07:00
Daan Leijen
32c5e4774f
update tests with static
2021-07-26 19:14:29 -07:00
Daan Leijen
a3cf23c19f
add test for #445
2021-07-26 19:10:21 -07:00
Artur Sinila
edb0b93c6f
Fix 'malloc-nomem1' test for 32-bit architectures
2021-06-29 22:38:43 +03:00
Daan Leijen
b3b0fb5832
merge from dev
2021-06-17 20:05:40 -07:00
Daan Leijen
752594e764
add test for #414
2021-06-17 19:47:41 -07:00
Daan Leijen
5869c85749
merge from dev
2021-06-17 19:18:57 -07:00
Daan Leijen
a83bca72b3
fixes for M1; disable interpose use zones; fix pedantic warnings
2021-06-17 19:15:09 -07:00
Daan Leijen
54b2c3525c
merge with dev
2021-05-21 15:36:30 -07:00
Daan Leijen
e2c095fad2
fix installation directories on unix to use /lib, /include, /share; fix issues #399 , #223 , and #89
2021-05-21 15:15:50 -07:00
Daan Leijen
73c339235c
collect in debug mode in stress test
2021-04-28 16:12:32 -07:00
Daan Leijen
10ce8839fa
merge from dev
2021-04-28 13:23:46 -07:00
Jim Huang
5940d3bcce
Bump copyright date
...
Each source file has been changed according to relevant Git activities.
2021-04-24 16:35:11 +00:00
Daan Leijen
4e643b6d31
merge from dev
2021-02-24 15:53:26 -08:00
Daan Leijen
5f596056c9
use 2-6TiB area for hints to accommodate pre-windows8 better
2021-02-24 15:49:43 -08:00
Daan Leijen
ad96d220f4
merge from dev
2021-02-24 15:17:35 -08:00
Daan Leijen
9317256a4f
improved ASLR (issue #372 )
2021-02-24 15:14:17 -08:00
Daan Leijen
47050371a1
fix issue #363 and disable assertion for now
2021-02-22 15:05:47 -08:00
Daan Leijen
bd56782f26
bump version to 2.0.0
2021-01-31 14:02:06 -08:00
Daan Leijen
8bcc60edd9
Merge branch 'dev' into dev-slice
2021-01-31 13:57:35 -08:00
Daan Leijen
92ead2d880
bump version to 1.7.0
2021-01-31 13:51:19 -08:00
Daan Leijen
e314699ee0
add debug view of arenas
2021-01-28 17:32:42 -08:00
Daan Leijen
3c70317393
merge from dev
2020-12-15 16:07:23 -08:00
Daan Leijen
bb386025b5
update override on macOS with interpose of malloc_default_zone (issues #313 )
2020-12-15 16:03:54 -08:00
Daan Leijen
b803095b83
merge from dev
2020-12-10 13:17:56 -08:00
David Carlier
e6c2fd44fc
DragonFly support fix (for 5.8.x and forward).
...
The pthread slot approach is somewhat buggy (pretty visible
with the stress unit test which segfault more or less randomly,
but the stats never show up).
Using the default approach instead, the test passes eventough
it s relatively slow (e.g 1.5 sec on FreeBSD vs 4.5 on DragonFly with same
machine).
2020-10-22 11:15:37 +01:00
daan
7e96634da4
merge from dev
2020-10-11 13:38:12 -07:00
daan
7114d5424a
fix statistics to include padding correctly (issue #301 )
2020-10-11 13:14:43 -07:00
daan
b59abce8ea
Merge branch 'dev' into dev-slice
2020-09-24 10:16:54 -07:00
daan
9d5098c705
bump version to 1.6.7 for further development
2020-09-24 10:16:40 -07:00
daan
f88b4b4c27
extend mi_process_info to include elapsed time
2020-09-24 10:13:25 -07:00
daan
fbaa70e1eb
increase default test load to 25% to increase azure pipeline test load
2020-09-14 11:01:17 -07:00
daan
fa01875eb2
merge from dev (with is_pinned/is_large separation)
2020-09-08 17:54:58 -07:00
daan
364674185e
add option to limit OS allocation and only allow allocation from arenas
2020-09-08 16:56:51 -07:00
daan
371532ff02
merge from dev
2020-09-07 21:43:05 -07:00
daan
c7272afa9a
add mi_reserve_os_memory/mi_manage_os_memory; allow arena allocations to cross multiple bitmap fields
2020-09-07 21:34:34 -07:00
daan
b7046934e5
Merge branch 'dev' into dev-slice
2020-09-06 13:53:30 -07:00
daan
46ee8952eb
update mi_process_info to not use doubles
2020-09-06 13:53:02 -07:00
daan
8c838a949f
Merge branch 'dev' into dev-slice
2020-09-06 13:22:44 -07:00
daan
ee286919d9
add mi_process_info api call
2020-09-06 13:21:19 -07:00
daan
36da7e91c5
Merge branch 'dev' into dev-slice
2020-09-05 18:17:22 -07:00
daan
f09549c98f
use main stats for thread count
2020-09-05 18:00:36 -07:00
daan
0d0b5e3fad
restore stress workload for windows pipeline
2020-09-05 11:19:35 -07:00
daan
78f1f9bd5e
reduce stress workload for windows pipeline
2020-09-05 11:16:40 -07:00
daan
4df01218e2
fix msvc compilation with new atomics
2020-09-05 10:03:37 -07:00
daan
97f56b1e08
merge from dev
2020-09-04 14:21:33 -07:00
daan
d73d6beb71
add aslr test (issue #289 )
2020-09-04 10:41:10 -07:00
daan
03071dec0f
merge from dev-atomic with new atomic interface
2020-09-03 12:13:09 -07:00
daan
900c97664a
merge from dev-atomic
2020-09-03 09:47:01 -07:00
daan
b4825372ab
small compilation warning fixes (extra semicolon etc)
2020-08-29 19:30:38 -07:00
daan
2cffc3b851
merge from dev
2020-08-27 22:43:57 -07:00
daan
a9686d6ecf
avoid link error on non-windows
2020-08-06 13:37:11 -07:00
daan
a468430772
strengthen memory order of bit operations; insert memory fences
2020-07-26 14:19:30 -07:00
daan
8769082d63
add pointer validity check in debug mode for mi_usable_size/mi_realloc/mi_expand. Issue #269
2020-07-20 14:33:03 -07:00
daan
53aa46890a
merge from dev
2020-05-05 10:54:59 -07:00
daan
7c24edfeb0
add thread-id check for thread local FLS callbacks on Windows with static linking; found by @jasongibson
2020-05-04 14:31:32 -07:00
daan
37b43e4cea
improved arena cache
2020-05-02 10:37:33 -07:00
daan
1b0de9b4cf
merge from dev
2020-04-28 16:22:38 -07:00
daan
69a0846478
add MI_PADDING flag to cmake to supress use of padding in debug mode
2020-04-07 10:01:18 -07:00
daan
afc4f79a69
fix for ensuring heap initialization with static linking on windows on huge allocations (issues #221 )
2020-04-06 12:15:12 -07:00
daan
0a3e5bb699
further fixes to compile on mingw without warnings (issue #217 )
2020-04-06 10:56:53 -07:00
daan
faa83a1c47
fix issue number: 212 to #221
2020-04-06 09:19:26 -07:00
daan
c7e9cfd3ed
add test case for issue #212
2020-04-06 08:32:25 -07:00
Daan
1ece3ff6aa
Merge pull request #220 from cormacrelf/usable_size
...
Don't call mi_page_usable_size_of with an aligned pointer
2020-04-06 08:05:34 -07:00
Cormac Relf
414acd49ab
Add test to exercise mi_usable_size on aligned allocations
2020-04-06 22:50:21 +10:00
daan
1f396e64a0
merge from dev
2020-03-16 16:41:21 -07:00
daan
ec61224db0
fix padding issue with zero sized allocation (issue #209 )
2020-02-18 20:05:30 -08:00
daan
baf08e8d54
fix size check on overflow when padding is enabled in debug mode
2020-02-17 09:59:34 -08:00
daan
e981e9227e
ensure thread delayed freeing is correct during heap_absorb; #204
2020-02-13 13:12:19 -08:00
daan
8a2a52843d
delete all thread owned heaps when a thread is terminated (issue #202 )
2020-02-13 12:15:23 -08:00
daan
946a71c4a9
fix issue #204 (and #205 ) by doing thread delayed free after absorbing the pages
2020-02-13 11:37:48 -08:00
daan
f42b8526d0
fix wrong __declspec(restrict) and __attribute__((malloc)) attributes on reallocation functions
2020-02-13 10:36:39 -08:00
daan
04f1c3b1e2
bump version to v1.6.0
2020-02-09 18:53:39 -08:00
daan
b241be7075
reenable mimalloc in the stress test
2020-02-02 22:08:33 -08:00
daan
d516c9f99c
Merge branch 'dev-exp' into dev-exp-tls
2020-02-02 22:02:16 -08:00
daan
f3c47c7c91
improved malloc zone handling on macOSX (not working yet)
2020-02-02 21:03:09 -08:00
daan
f0dc6e7e42
add extra alignment test
2020-02-02 16:21:06 -08:00
daan
bb64634e4e
Merge branch 'dev-exp' into dev-exp-tls
2020-02-01 17:48:57 -08:00
daan
3f17ac287c
add 'nodiscard' attribute to mimalloc interface
2020-02-01 17:29:30 -08:00
daan
0989562c2d
add initial fast tls for macOSX
2020-02-01 16:57:00 -08:00
daan
a169cf0e3f
merge dev-exp; add pthread TLS support for macOSX
2020-02-01 14:10:10 -08:00
daan
40f1e1e07b
byte-precise heap block overflow checking with encoded padding
2020-01-31 23:39:51 -08:00
daan
68112a2751
better padding implementation, more precise statistics
2020-01-31 20:34:24 -08:00
daan
03b363a1c2
first working tls on macOS using interpose; still slow
2020-01-29 22:46:44 -08:00
daan
5d212d688f
add MI_PADDING build option to add padding to each block to detect heap block overflows
2020-01-29 17:10:57 -08:00
daan
b50bec463d
merge from dev-exp; better abandoned reclamation
2020-01-27 22:12:23 -08:00
daan
19a0d9dfa0
clean up stress test
2020-01-25 12:51:56 -08:00
daan
5e32d00aab
add visit count to abandoned to limit list length
2020-01-25 12:26:08 -08:00
daan
b31bc52618
add cache alignment directives for contended variables
2020-01-24 19:02:13 -08:00
daan
e070eba112
fix tagged null encoding, search segment cache before reclaim
2020-01-24 16:31:18 -08:00
daan
8cf4882a85
fix linux build
2020-01-24 10:38:25 -08:00
daan
8b1520f5c1
make stress test deterministic
2020-01-23 21:53:28 -08:00
daan
58fdcbb0cd
fix bug in collect where has_page was not set on free pages
2020-01-23 21:37:14 -08:00
daan
f8ab4bd7dc
add leak test
2020-01-23 19:49:32 -08:00
daan
66818bf632
use atomic yield on delayed-freeing; clarify code
2020-01-23 09:57:55 -08:00
daan
e226ebcc97
Merge branch 'dev' into dev-arena
2020-01-22 20:39:33 -08:00
daan
0f14f431c5
bump version to 1.5 for further development
2020-01-22 18:33:07 -08:00
daan
394a7a92ab
merge from dev
2020-01-20 19:06:08 -08:00
daan
5bc1c52ae6
update documentation
2020-01-20 17:34:29 -08:00
daan
146899af8a
add missing members to stl allocator ( #193 )
2020-01-20 15:27:05 -08:00
daan
9d7ac76d93
fix compilation under Intel C compiler (icc)
2020-01-19 18:35:45 -08:00
daan
e8d7c80c74
fix build warnings on linux
2020-01-19 17:33:36 -08:00
daan
41e717c2e0
fix assertion in mi_block_zero_init (issue #194 )
2020-01-18 20:30:12 -08:00
daan
dc58388968
Add ability to register custom error function called on various error conditions; including ENOMEM
2020-01-17 19:59:55 -08:00
Daan
97bd204c42
Merge branch 'dev' into kile/stl
2020-01-16 15:33:13 -08:00
Kirsten Lee
526bee6843
merge stl and main header
2020-01-16 15:17:15 -08:00
daan
202246425b
bump version to 1.4 for further development
2020-01-15 12:16:53 -08:00
daan
783e3377f7
add output argument to stat printing
2020-01-15 10:53:54 -08:00
daan
4a27ea1643
merge from dev
2020-01-13 18:01:34 -08:00
daan
940df53b0a
fix iteration count display in stress test
2020-01-08 17:57:17 -08:00
daan
683d8998d4
fix potential A-B-A problem with segment abandonment; noticed by Manual Poeter and Sam Gross
2020-01-08 17:45:38 -08:00
daan
5d2f111f64
make the stress test do more iterations under a smaller load to stay under 1GiB committed and increase thread interaction
2020-01-08 16:33:45 -08:00
Kirsten Lee
0a2520490b
only include vector header when compiling c++
2020-01-06 16:44:55 -08:00
Kirsten Lee
743e891738
add stl mimalloc wrapper
2020-01-06 16:18:22 -08:00
daan
128cdd1dfb
merge from dev
2019-11-24 18:51:09 -08:00
Daan Leijen
0d3c195f37
update stress test with more documentation
2019-11-22 11:28:55 -08:00
daan
f45ec667a3
Merge branch 'dev' into dev-arena
2019-11-22 09:29:00 -08:00
daan
24b768363e
bump version to 1.3 for further development
2019-11-22 09:28:48 -08:00
daan
1066be1594
merge from dev-exp
2019-11-21 17:03:30 -08:00
daan
6568059cc6
merge from dev
2019-11-21 16:28:28 -08:00
daan
d55ab50a84
update version to 1.2
2019-11-21 16:10:04 -08:00
daan
b820009df7
update documentation
2019-11-21 16:09:34 -08:00
daan
74dbfc30be
improved security by encoding NULL values; double free mitigation on by default; more precise free list corruption detection
2019-11-21 15:21:23 -08:00
Daan Leijen
56b9fac4bf
merge from dev
2019-11-20 13:31:04 -08:00
Daan Leijen
94bfb47725
update stress test for more realisitic size distribution
2019-11-20 12:59:26 -08:00
daan
fd3ce5dc7d
improve stress test
2019-11-15 16:28:11 -08:00
Daan Leijen
8637f113d5
improve test-stress to run multiple iterations
2019-11-15 14:09:17 -08:00
Daan Leijen
b04206a9d3
add os cache to arena
2019-11-10 10:10:10 -08:00
Daan Leijen
d2279b2a3f
update test-stress with better object distribution
2019-11-10 08:13:40 -08:00
Daan Leijen
268698b9ef
fix vs2019 project
2019-11-10 08:00:51 -08:00
Daan Leijen
fed0068dac
merge from dev-exp; bitmap based arena
2019-11-10 07:56:40 -08:00
Daan Leijen
7b72a4cd50
fix region suitable bug
2019-11-08 11:55:43 -08:00
daan
378716c467
refactor and improve atomic bitmap usage
2019-11-07 10:26:52 -08:00
daan
b0182b2376
Merge branch 'dev-exp' into dev-arena
2019-11-02 10:30:33 -07:00
daan
a69016c33e
improve and document numa support
2019-11-02 10:30:16 -07:00
daan
a74e072a9a
set test-stress scale to 20 again
2019-10-31 19:00:26 -07:00
daan
f7d2c45af3
initial experiment with fixed memory arena and sliced segments
2019-10-31 00:40:41 -07:00
daan
c7ec30ae25
fix secure mode
2019-10-30 15:36:13 -07:00
daan
b73beede34
merge from dev
2019-10-30 15:19:34 -07:00
daan
b052d3b731
enable double free and heap corruption detection in debug mode
2019-10-28 15:54:33 -07:00
daan
28d4ec4c5a
fix statistics accounting of huge pages
2019-10-28 13:14:14 -07:00
daan
9d4f57abf3
merge from dev-win
2019-10-28 12:33:01 -07:00
daan
ff9f29660b
remove double_free call
2019-10-28 12:27:32 -07:00
daan
5dfdc092b5
improve windows warning message
2019-10-28 12:26:57 -07:00
daan
25246070ae
fix double free check in secure = 4 mode; inline _mi_ptr_cookie
2019-10-19 08:34:18 -07:00
daan
2affdbbd2e
stronger secure mode when defining MI_SECURE=4: checks for double free, corrupted free list, and invalid pointer frees. Performance is impacted but not too much -- more perf testing is needed
2019-10-18 18:11:04 -07:00
daan
4b15e2ed97
merge from dev
2019-10-17 18:24:35 -07:00
daan
0e188a18a7
update test to match malloc with free
2019-10-17 09:21:20 -07:00
daan
24777f6a91
limit aligned allocation to power-of-two alignment
2019-09-11 17:49:28 -07:00
daan
8903d7a526
fix tests for aligned allocation
2019-09-09 08:21:35 -07:00
daan
89858ab791
improve page_free_extend performance slightly; do not maintain expensive statistics in release mode
2019-09-06 16:48:48 -07:00
daan
136e120d51
update redirection modules
2019-09-01 17:21:58 -07:00
daan
612b2cc9b7
clean up segment slice handling
2019-08-24 12:20:32 -07:00
daan
e7bd8c5d14
merge with dev-win
2019-08-21 11:11:40 -07:00
daan
cd52d0a6d9
merge dev-win
2019-08-20 17:31:46 -07:00
daan
86d4ded831
Merge branch 'dev' into dev-exp
2019-08-20 08:27:46 -07:00
daan
a5071eb510
Merge branch 'dev' into dev-win
2019-08-20 07:50:03 -07:00
daan
27d794b5f4
fix option_enable call
2019-08-20 07:49:40 -07:00
daan
a8b24472cb
use 1GiB huge pages on windows when reserving upfront
2019-08-19 18:16:12 -07:00
daan
42dedb00ec
initial implementation of mi_os_reserve_huge_pages
2019-08-19 11:10:06 -07:00
daan
f2bafbc57f
wip: new segment allocation
2019-08-15 11:49:56 -07:00
daan
bbd81bbbd1
wip: new segment allocation with flexible large objects
2019-08-15 00:46:45 -07:00
daan
d71e67b689
Merge branch 'dev' into dev-exp
2019-08-11 09:00:39 -07:00
daan
dbe010f2d4
add huge and giant stats; increase bins
2019-08-10 20:51:37 -07:00
daan
3d9d70bce0
add new redirection module; fix environment reading at preloading
2019-08-10 09:39:36 -07:00
daan
7b16aa9302
remove accidental commit of different size bins experiment
2019-08-09 11:22:38 -07:00
daan
442bad9190
add good-fit for allowing larger blocks in smaller segments
2019-08-09 11:18:38 -07:00
daan
bbf97fa02d
merge from 'dev-exp'; add support for MIMALLOC_OVERRIDE environment variable
2019-07-26 12:06:15 -07:00
daan
13364b50b8
fix 32-bit build of stress test
2019-07-23 15:00:13 -07:00
daan
66b8c37ab3
ensure C++ compilation on windows
2019-07-23 15:00:13 -07:00
daan
598ed19c61
more comments
2019-07-23 15:00:13 -07:00
daan
0b4d74a566
merge
2019-07-23 15:00:13 -07:00
daan
219d46ff0c
update test files and overriding
2019-07-23 15:00:13 -07:00
daan
48a3d0c6e2
fix 32-bit build of stress test
2019-07-23 09:37:36 -07:00
daan
7c26ce9280
ensure C++ compilation on windows
2019-07-22 10:27:14 -07:00
daan
80e09ef44e
merge from dev
2019-07-22 10:16:59 -07:00
daan
86cadca059
more comments
2019-07-22 16:11:06 -07:00
daan
e90938fb4b
merge
2019-07-22 10:10:45 -07:00
daan
e4caee5f55
update test files and overriding
2019-07-22 01:36:16 -07:00
daan
2f63964e5c
update stress test to be more deterministic
2019-07-19 08:55:02 -07:00
daan
93c8a5b693
full overriding api supported
2019-07-18 21:12:40 -07:00
daan
306a542336
add mimalloc-override header file and use C++ compilation with msvc
2019-07-18 20:28:29 -07:00
daan
12e0a04052
compile as C++ under msvc
2019-07-18 19:52:29 -07:00
daan
c228ecefd8
update for new dynamic direction on windows 64-bit
2019-07-18 18:59:32 -07:00
daan
7ea9cf8d1f
add region collection
2019-07-15 14:53:03 -07:00
daan
08c873c250
Merge branch 'dev' into dev-exp
2019-07-14 20:35:01 -07:00
daan
461b8aed80
more complete C++ support for compliance and performance
2019-07-14 19:56:33 -07:00
daan
672506a3b3
merged with dev-win
2019-07-14 12:57:47 -07:00
daan
e60a5db908
fix cache eviction of smaller segments
2019-07-14 12:52:58 -07:00
daan
f844665c9f
merge from dev-win
2019-07-10 22:57:37 -07:00
daan
34a4de01b1
add Visual Studio support for new stress target
2019-07-10 21:59:44 -07:00
daan
12d3297db5
add allocator stress test to the test targets
2019-07-10 21:52:28 -07:00
daan
35b590de21
Merge branch 'dev' into dev-exp
2019-07-09 15:12:18 -07:00
daan
cf8815854c
fix cmake issues with OBJECT install
2019-07-09 11:32:24 -07:00
daan
129149977d
Merge branch 'dev' into dev-exp
2019-07-08 17:45:04 -07:00
daan
76023ca45f
fix path max in realpath on unix (pr #69 )
2019-07-08 17:43:10 -07:00
daan
493dfc4b82
merge with dev
2019-07-08 15:42:42 -07:00