Daan Leijen
479ef4bf4c
fix precise free size in aligned allocation
2023-03-15 19:07:35 -07:00
Daan Leijen
65bbe4014f
merge from dev-platform
2023-03-15 15:10:12 -07:00
Daan Leijen
84ef963a47
remove conioinclude
2023-03-15 14:43:35 -07:00
Daan Leijen
9a2dbf373e
move thread init to primitives
2023-03-15 13:35:23 -07:00
Daan Leijen
973268bf1e
move random initialization to primitives
2023-03-15 12:40:18 -07:00
Daan Leijen
9b110090b2
move threadid and mi_get_default_heap to primitives
2023-03-14 20:35:00 -07:00
Daan Leijen
3579d3b861
move mi_thread_id to primitives
2023-03-14 19:38:45 -07:00
Daan Leijen
4348a05d0f
small fixes
2023-03-14 18:24:38 -07:00
Daan Leijen
10f62eb5a1
add c primitives, move getenv into primitives
2023-03-14 18:10:00 -07:00
Daan Leijen
69cb30a874
move process info into primitives
2023-03-14 17:15:52 -07:00
Daan Leijen
08a01d26dc
initial commit of new primitive layer
2023-03-14 16:54:46 -07:00
Daan Leijen
a90737a7fa
fix valgrind tracking for zero initialized segments
2023-03-06 10:44:43 -08:00
Daan Leijen
43533fa968
Merge branch 'dev' into dev-slice
2023-03-05 22:29:54 -08:00
Daan Leijen
64fb009695
fix warning with zero padding
2023-03-05 22:27:45 -08:00
Daan Leijen
e912697d90
fix warning with zero padding
2023-03-05 22:26:05 -08:00
Daan Leijen
b3f3a0de3b
include psapi.h instead of defining PROCESS_MEMORY_COUNTERS on windows
2023-03-05 22:22:36 -08:00
Daan Leijen
d0eebedfbf
merge from dev
2023-03-05 22:15:07 -08:00
Daan Leijen
6f31115c7f
fix segment defined memory for valgrind
2023-03-05 22:11:42 -08:00
Daan Leijen
465eb81d30
track free blocks in valgrind for heap_destroy as well
2023-03-05 18:18:41 -08:00
Daan Leijen
82c85d1a13
fix valgrind mem for large alignment
2023-03-05 18:03:04 -08:00
Daan
b3176ada74
merge from dev, fix commit size in asan tracking
2023-03-05 11:17:39 -08:00
Daan
056c2ce45b
match track free size to tracked malloc size
2023-03-05 11:01:51 -08:00
Daan
f32b42e6cc
Merge branch 'dev' into dev-slice
2023-03-04 16:03:22 -08:00
Daan
3c906bde8b
better track_free_size
2023-03-04 15:17:13 -08:00
Daan
e4b9ea918f
merge from dev
2023-03-04 14:52:30 -08:00
Daan
6dcebdc303
fix sizes in memory tracking and padding for huge alignments
2023-03-04 14:49:02 -08:00
Daan
6cc0ad72fc
match declaration of mi_malloc_size_checked on macOS
2023-03-04 09:58:02 -08:00
Daan
0d9e7ab61e
remove extern inline from alloc_new functions to avoid link warnings
2023-03-04 09:27:04 -08:00
Daan Leijen
1e4b6b734e
fix assertion that was too strict (issue #691 )
2023-01-31 16:02:35 -08:00
Daan Leijen
e87badaa1b
Merge branch 'dev' into dev-slice
2022-12-23 13:05:05 -08:00
Daan Leijen
e68f2c1479
fix recursion issue on exit on windows, #672
2022-12-23 13:02:16 -08:00
Daan Leijen
d1fff1119a
reorganize span free code
2022-12-21 12:19:09 -08:00
Daan Leijen
a873ddc4fa
merge from dev
2022-12-21 12:10:46 -08:00
Daan Leijen
37d5ce9498
comment out include
2022-12-21 12:09:52 -08:00
Daan Leijen
aa2d00fde8
make heap_new inline again
2022-12-21 10:28:58 -08:00
Daan Leijen
0f796a56a9
fix bug where eager committed memory would be immediatedy decommitted; possible fix for issue #669
2022-12-20 18:59:55 -08:00
Daan Leijen
11ddba7a06
Merge branch 'dev' into dev-slice
2022-12-19 18:59:45 -08:00
Daan Leijen
ef3f651f3f
change implementation of mi_realpath to be more robust; see issue #660
2022-12-19 18:59:33 -08:00
Daan Leijen
d862c8a3eb
Merge branch 'dev' into dev-slice
2022-12-19 17:53:51 -08:00
Daan Leijen
95b61b8c3d
forward libc interface used by wasi-libc; originally by @anuraaga in PR #667 but rebased to the dev branch
2022-12-19 17:45:15 -08:00
Daan Leijen
35997c0384
Merge branch 'dev' into dev-slice
2022-12-19 17:38:53 -08:00
Daan Leijen
2b0421a25c
fix -Wunused-function for mi_strn-cmp; originally by @rui314 in PR #662 but rebased to dev branch
2022-12-19 17:38:39 -08:00
Daan Leijen
92ffc25d79
merge from dev
2022-12-19 17:08:45 -08:00
Daan Leijen
4f2fdf76a0
add braces
2022-12-19 16:59:24 -08:00
Daan Leijen
dfc95f34c4
first try WriteFile for a redirected stderr
2022-12-19 16:57:50 -08:00
Daan Leijen
505a14bbd8
cleanup on-demand loading of psapi and bcrypt on windows
2022-12-19 16:50:13 -08:00
Johannes Schindelin
089e85b113
Make MIMALLOC_SHOW_STATS work with redirected stderr
...
Setting `MIMALLOC_SHOW_STATS` to ask mimalloc to print out something
after the process is done is the easiest way to verify that a
mimalloc-enabled Git is running.
So it better work and not try to write to a Win32 Console when it got a
regular file handle instead or, as is the case in Git for Windows'
regular Git Bash window, an emulated pseudo terminal.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-12-03 01:13:00 +01:00
Johannes Schindelin
edb181c377
Lazy-link to bcrypt
...
Let's not make `bcrypt.dl` a link-time bound library. Instead, load the
`BCryptGenRandom()` function dynamically. When needed. If needed.
This helps reduce the start-up cost of any mimalloc user because the
time spent on loading dynamic libraries is non-negligible.
Note: In contrast to how `os.c` loads libraries and obtains function
addresses, we cannot call `FreeLibrary(hDll)` here because that would
unload the `bcrypt` library before we want to use it.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-12-03 01:13:00 +01:00
Johannes Schindelin
948a0c44df
Lazy-load psapi.dll
...
Let's load the `GetProcessMemoryInfo()` function dynamically. When
needed. If needed.
This is necessary because the start-up cost spent on loading dynamic
libraries is non-negligible.
Note: In contrast to how `os.c` loads libraries and obtains function
addresses, we cannot call `FreeLibrary(hDll)` here because that would
unload the `bcrypt` library before we want to use it.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-12-03 01:12:59 +01:00
Johannes Schindelin
11cab6a0c0
Avoid %z
format
...
This format is not supported by MSVC runtimes targeted by the mingw-64
toolchain.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2022-12-03 00:24:43 +01:00