daan
5bbb2ff416
reenable the use of sbrk on wasm as it seems more stable than direct memory_grow
2021-12-16 15:34:52 -08:00
daan
27e24e619b
use wasm_memory_grow instead of sbrk on wasm
2021-12-16 15:11:47 -08:00
daan
b0a866685d
improve sbrk/wasm_memory_grow implementation
2021-12-16 14:54:10 -08:00
daan
55ccc94707
wip: fix zero init for sbrk; add lock around sbrk
2021-12-15 19:28:34 -08:00
Daan
8612d1228a
wip: initial fix for race condition on sbrk/wasm_memory_grow; issue #497
2021-12-15 18:04:02 -08:00
daan
0be71a2cac
fix prefix
2021-11-24 12:54:54 -08:00
daan
09c658dd40
try to allocate within our hint space (partially addresses issue #360 )
2021-11-15 10:10:47 -08:00
daan
4b0cda2012
take overcommit into account for eager commit delay
2021-11-14 11:23:11 -08:00
daan
09e59e0610
use size_t instead of uintptr_t where appropiate
2021-11-13 15:13:16 -08:00
daan
28896e5b19
prefix UNUSED,KiB,MiB,GiB; add mi_threadid_t type; add mi_ssize_t
2021-11-13 14:46:03 -08:00
Daan
f72e5688f5
remove assign in while condition
2021-11-10 11:58:04 -08:00
Daan
fd61997cef
improve aligned support on BSD and MAP_ALIGN systems
2021-11-10 11:26:36 -08:00
Daan
89abbe75d8
improve aligned support on BSD and MAP_ALIGN systems
2021-11-10 11:23:11 -08:00
Daan
8c9ccea2f5
fix huge page madvise in case mmap failed
2021-11-10 10:46:06 -08:00
Daan
e96614961f
fix printf format type mismatches (issue #486 )
2021-11-06 14:19:14 -07:00
Daan
5fd77aa198
refactor os_overcommit detection
2021-10-27 17:39:11 -07:00
Daan
0335d32766
Merge branch 'dev' of https://github.com/microsoft/mimalloc into dev
2021-10-27 17:25:09 -07:00
Daan
13b30bf2dd
Merge branch 'dev' into overcommit_if_the_system_approves
2021-10-27 17:12:18 -07:00
Daan
6ccf7e87c0
minor edits
2021-10-27 17:08:00 -07:00
David Carlier
00edd9201b
proposal to not overcommit page unconditionally on Linux and FreeBSD,
...
respecting userland settings.
2021-10-24 20:57:58 +01:00
David Carlier
2d2d9af5c6
while at it, doing dragonflybsd too
2021-10-24 11:37:20 +01:00
David Carlier
fc7777ee8c
NUMA base detection on FreeBSD.
2021-10-22 10:11:20 +01:00
David CARLIER
b5b52b8879
Haiku build update, since the beta3 few more posix functions are available e.g. madvise
2021-10-20 18:33:12 +00:00
Daan
bb00a5a32e
remove MADV_FREE_REUSABLE from mi_os_reset as it needs MADV_FREE_REUSE to reuse the memory again.
2021-10-19 13:11:11 -07:00
Daan
75987e4590
Merge pull request #410 from jserv/enforce-binary-prefix
...
Distinguish SI and Binary Prefixes
2021-10-19 12:28:33 -07:00
Daan
adeef8d403
formatting
2021-10-19 10:31:49 -07:00
Daan
4b52ce4095
Merge pull request #450 from bmalrat/FixStatOnWindowsRealloc
...
Fixed stats in mi_os_mem_alloc_aligned on windows when re-allocate
2021-10-19 10:29:16 -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
6ef15943cc
fix comments
2021-10-18 16:59:19 -07:00
Daan Leijen
bd8e3fd8e1
increase robustness of primitive windows allocation by always using a fallback to VirtualAlloc
2021-10-18 16:46:06 -07:00
Daan Leijen
679aad0659
update wasm support with emscripten compilation; now using sbrk instead of wasm_memory_grow
2021-10-01 15:05:01 -07:00
bmalrat
ee0b01c84d
Fixed stats in mi_os_mem_alloc_aligned on windows when re-allocate
...
In the last try the previous mi_os_mem_free decrease stat and mi_win_virtual_alloc doesn't increase it
2021-08-04 17:46:58 -04:00
Daan Leijen
728be93977
fix for #414 making numa node count atomic
2021-06-17 19:38:51 -07:00
Daan Leijen
bb957fcd81
Merge branch 'dev' of https://github.com/microsoft/mimalloc into dev
2021-06-07 17:00:35 -07:00
Daan
cd633b2e2a
Merge pull request #411 from jserv/predict-alloc_size
...
Add branch hint for _mi_os_good_alloc_size
2021-06-07 16:55:39 -07:00
Daan Leijen
4ba32c3160
Revert "make all includes relative"
...
This reverts commit 1feb6123d9
.
2021-06-07 16:47:57 -07:00
Daan Leijen
1feb6123d9
make all includes relative
2021-06-06 20:31:36 -07:00
Jim Huang
d48c93af2c
Add branch hint for _mi_os_good_alloc_size
...
In _mi_os_good_alloc_size, overflow caused by alignment size is rare,
and this patch added the appropriate branch hint during range checks.
2021-05-31 12:01:35 +08:00
Jim Huang
0f57425f80
Distinguish SI and Binary Prefixes
...
SI prefixes [the decimal prefixes] refer strictly to powers of 10. They
should not be used to indicate powers of 2. e.g., one kilobit
represents 1000 bits instead of 1024 bits. IEC 60027‐2 symbols are
formed adding a "i" to the SI symbol (e.g. G + i = Gi).
2021-05-30 20:13:28 +08:00
Daan
16b3329bd4
Merge pull request #396 from jserv/fix-copyright-date
...
Bump copyright date
2021-04-28 13:11:11 -07:00
Daan Leijen
29ea7a89ab
add braces
2021-04-28 13:08:59 -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
Jim Huang
52943917ad
Rewrite align_down with bitwise operations
...
mi_align_down_ptr was implemented with multiplication and division,
which can be converted to equivalent and deterministic bit operations.
2021-04-21 13:14:53 +00: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
e64474e06b
add virtiual gaps between hinted allocations in secure mode
2021-02-24 15:30:39 -08:00
Daan Leijen
9317256a4f
improved ASLR (issue #372 )
2021-02-24 15:14:17 -08:00
Daan Leijen
71ac98ab08
rename <Windows.h> include to <windows.h> for mingw compatibility (see pr #367 )
2021-02-22 13:04:11 -08:00
Daan Leijen
0091a641a7
undo previous commit dcae918
due to wrong logic (issue #289 )
2021-02-01 09:55:18 -08:00
Daan Leijen
dcae918b84
always do ASLR in secure mode even in debug mode (issue #289 )
2021-02-01 09:49:12 -08:00