mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-03 22:19:32 +03:00
Compare commits
5 commits
648d7715f0
...
2d194a0e7c
Author | SHA1 | Date | |
---|---|---|---|
![]() |
2d194a0e7c | ||
![]() |
fae61ed946 | ||
![]() |
a5298dd48f | ||
![]() |
7543e8989a | ||
![]() |
1cede1c9ee |
2 changed files with 5 additions and 1 deletions
|
@ -340,7 +340,10 @@ mi_decl_nodiscard size_t mi_usable_size(const void* p) mi_attr_noexcept {
|
|||
|
||||
void mi_free_size(void* p, size_t size) mi_attr_noexcept {
|
||||
MI_UNUSED_RELEASE(size);
|
||||
mi_assert(p == NULL || size <= _mi_usable_size(p,"mi_free_size"));
|
||||
#if MI_DEBUG
|
||||
const size_t available = _mi_usable_size(p,"mi_free_size");
|
||||
mi_assert(p == NULL || size <= available || available == 0 /* invalid pointer */ );
|
||||
#endif
|
||||
mi_free(p);
|
||||
}
|
||||
|
||||
|
|
|
@ -207,6 +207,7 @@ static void mi_heap_main_init(void) {
|
|||
if (_mi_heap_main.cookie == 0) {
|
||||
_mi_heap_main.thread_id = _mi_thread_id();
|
||||
_mi_heap_main.cookie = 1;
|
||||
mi_thread_init();
|
||||
#if defined(_WIN32) && !defined(MI_SHARED_LIB)
|
||||
_mi_random_init_weak(&_mi_heap_main.random); // prevent allocation failure during bcrypt dll initialization with static linking
|
||||
#else
|
||||
|
|
Loading…
Add table
Reference in a new issue