mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-06 23:39:31 +03:00
fix mi_cfree assertion failure for NULL pointer, issue #478
This commit is contained in:
parent
6d9e79a498
commit
54b65a556c
1 changed files with 1 additions and 0 deletions
|
@ -267,6 +267,7 @@ void _mi_segment_map_freed_at(const mi_segment_t* segment) {
|
|||
// Determine the segment belonging to a pointer or NULL if it is not in a valid segment.
|
||||
static mi_segment_t* _mi_segment_of(const void* p) {
|
||||
mi_segment_t* segment = _mi_ptr_segment(p);
|
||||
if (segment == NULL) return NULL;
|
||||
size_t bitidx;
|
||||
size_t index = mi_segment_map_index_of(segment, &bitidx);
|
||||
// fast path: for any pointer to valid small/medium/large object or first MI_SEGMENT_SIZE in huge
|
||||
|
|
Loading…
Add table
Reference in a new issue