daan
26c27fbf58
use uint8_t bit fields, and improve portability of page_flags type
2019-10-17 12:07:26 -07:00
Johannes Schindelin
559688ec64
Suppress warning about unnamed struct
...
This prevents MSVC complaining with
warning C4201: nonstandard extension used: nameless struct/union
The struct might seem unnecessary to the occasional reader (it did seem
so to this commit's author), but it is not! It is required to align the
fields to a boundary, which is verified by the test suite. Removing that
"unnecessary" `struct` results in this failure:
1: Test command: mimalloc-test-api
[...]
1: test: malloc-zero... mimalloc: assertion failed: at src/page.c:591, mi_page_init
1: assertion: "!mi_page_has_aligned(page)"
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-10-17 20:43:18 +02:00
Johannes Schindelin
e747a6f3a6
Use unsigned
for bit-field variables
...
It is actually non-standard to use `bool` with a bit-field quantifier,
and VS 2019 complains about this.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-10-17 20:43:18 +02:00
Daan Leijen
1909cfb346
refine mi_os_good_alloc_size and use it for huge pages (to ensure realloc is bounded as in #153
2019-09-10 13:26:51 -07:00
daan
23155c5d71
add recursion guard to deferred callback
2019-09-09 08:02:41 -07:00
daan
d1bd1644d5
support zero-initialized memory detection
2019-09-02 13:16:52 -07:00
daan
db8d443ae6
track more precisely if memory is fixed or committed
2019-08-26 22:45:26 -07:00
daan
e8664001f7
Use standard _Atomic declarations and clean up atomic operations
2019-08-25 22:59:12 -07:00
daan
a431d80fc3
better object sizes for large objects
2019-08-25 10:20:03 -07:00
daan
6c6fcad242
remove threadid from pages and keep page flags separate (cherry picked)
2019-08-23 21:42:24 -07:00
daan
15552eba79
ensure volatile declaration for abandoned_next field
2019-08-23 21:39:27 -07:00
daan
13ef8a049b
allow larger large objects to better use segment space
2019-08-19 21:22:09 -07:00
Daan Leijen
069c26dbab
fix small object size check in mi_segment_page_alloc
2019-08-16 18:40:30 -07:00
daan
0fd898315c
per thread region search index
2019-08-11 12:15:13 -07:00
daan
2e924150ae
further layout improvement for msvc code generation
2019-08-11 11:30:24 -07:00
daan
7b105c4810
improve layout of page for x64
2019-08-11 10:31:00 -07:00
daan
dbe010f2d4
add huge and giant stats; increase bins
2019-08-10 20:51:37 -07:00
daan
737b05cc25
remove unused fields from OS thread local data
2019-08-10 17:50:27 -07:00
daan
ed785253bf
restructure the page flags to use explicit masks
2019-08-10 17:48:00 -07:00
daan
b1938530af
fix comment
2019-08-09 14:31:45 -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
5e56b40fe6
improve page flags handling
2019-08-08 17:18:49 -07:00
daan
6596e970a5
move in_full and has_aligned into page threadid for a single test in mi_free
2019-08-08 15:23:18 -07:00
daan
55778d2fe4
improved stats
2019-08-08 11:36:13 -07:00
daan
189ad0f81d
small optimizations, use bitwise aligne
2019-07-23 15:00:13 -07:00
Jim Huang
b5e26bedb1
Enforce strict include-what-you-use policy
...
The include-what-you-use (IWYU) policy is beneficial to faster
compilation and fewer recompilations. Many build tools, such as GNU make,
provide a mechanism for automatically figuring out what .h files a .cc
file depends on. These mechanisms typically look at #include lines. When
unnecessary #includes are listed, the build system is more likely to
recompile in cases where it is not necessary.
With the enforcement, header file <include/mimalloc.h> no longer
includes <stdlib.h>.
Reference:
https://github.com/include-what-you-use/include-what-you-use/blob/master/docs/WhyIWYU.md
2019-07-23 14:59:57 -07:00
daan
8dc0b5345b
Merge branch 'dev' into dev-exp
2019-07-14 16:50:38 -07:00
daan
5ad2effb39
use standard compliant compilation of the thread_free atomic field
2019-07-14 16:20:27 -07:00
Daan
b09af48a68
Merge pull request #93 from JulianATA/dev-exp
...
Fix typo numbes -> number
2019-07-14 14:33:37 -07:00
daan
84a292538c
merge with medium pages
2019-07-12 20:39:29 -07:00
daan
a927c07de9
merge medium pages
2019-07-12 20:27:56 -07:00
daan
42cf5e1580
reintroduce support for medium size pages
2019-07-12 20:11:39 -07:00
daan
8a6b474fa0
merge from dev
2019-07-11 16:32:11 -07:00
daan
a932e43650
experiment with larger small pages
2019-07-11 15:44:37 -07:00
daan
9e9208eae8
Merge branch 'dev' into dev-win
2019-07-11 15:22:09 -07:00
daan
1fdb4b288f
more eager handling of non-local frees
2019-07-11 15:21:57 -07:00
daan
6deea16d2d
add segment count to internal statistics
2019-07-10 19:54:46 -07:00
daan
224951695a
enable non eager commit
2019-07-10 07:24:56 -07:00
daan
46a9e51f74
enable non eager-commit flag
2019-07-10 07:17:21 -07:00
Julian Fang
5928f12b15
Fix typo numbes -> number
2019-07-10 08:38:58 +08:00
daan
493dfc4b82
merge with dev
2019-07-08 15:42:42 -07:00
daan
c3528203b5
fix compilation with C++, fix overrides in C++ to adhere to the spec (issue #26 )
2019-07-07 18:11:21 -07:00
daan
663769c512
merge dev branch
2019-07-03 18:12:55 -07:00
daan
5c0ffe9865
merge back changes to OS module from 'dev-exp'
2019-07-02 17:17:03 -07:00
daan
06bcea1761
Initial commit of separate memory region layer and improved large OS pages support, see 'memory.c'
2019-07-02 07:23:24 -07:00
Julian Fang
c19d3a27a8
Remove underscore prefixes to match c lanuguage standard
2019-06-26 12:57:13 +08:00
daan
cd7aa0ce83
improve handling of huge pages in the cache
2019-06-23 23:15:42 -07:00
daan
43568fa422
ensure huge pages are part of the segment cache to avoid mmap calls
2019-06-23 21:37:43 -07:00
Daan
fab7329c7a
Merge pull request #24 from jserv/clarify-license
...
Clarify top-level license file
2019-06-23 10:47:38 -07:00