merge from remote
This commit is contained in:
commit
5c912f16d4
@ -17,7 +17,7 @@ terms of the MIT license. A copy of the license can be found in the file
|
|||||||
#if (MI_DEBUG>0)
|
#if (MI_DEBUG>0)
|
||||||
#define mi_trace_message(...) _mi_trace_message(__VA_ARGS__)
|
#define mi_trace_message(...) _mi_trace_message(__VA_ARGS__)
|
||||||
#else
|
#else
|
||||||
#define mi_trace_message(...)
|
#define mi_trace_message(...)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@ -146,8 +146,8 @@ bool _mi_page_is_valid(mi_page_t* page);
|
|||||||
Inlined definitions
|
Inlined definitions
|
||||||
----------------------------------------------------------- */
|
----------------------------------------------------------- */
|
||||||
#define UNUSED(x) (void)(x)
|
#define UNUSED(x) (void)(x)
|
||||||
#if (MI_DEBUG>0)
|
#if (MI_DEBUG>0)
|
||||||
#define UNUSED_RELEASE(x)
|
#define UNUSED_RELEASE(x)
|
||||||
#else
|
#else
|
||||||
#define UNUSED_RELEASE(x) UNUSED(x)
|
#define UNUSED_RELEASE(x) UNUSED(x)
|
||||||
#endif
|
#endif
|
||||||
@ -264,7 +264,7 @@ static inline mi_segment_t* _mi_page_segment(const mi_page_t* page) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline mi_slice_t* mi_slice_first(const mi_slice_t* slice) {
|
static inline mi_slice_t* mi_slice_first(const mi_slice_t* slice) {
|
||||||
mi_slice_t* start = (mi_slice_t*)((uint8_t*)slice - slice->slice_offset);
|
mi_slice_t* start = (mi_slice_t*)((uint8_t*)slice - slice->slice_offset);
|
||||||
mi_assert_internal(start >= _mi_ptr_segment(slice)->slices);
|
mi_assert_internal(start >= _mi_ptr_segment(slice)->slices);
|
||||||
mi_assert_internal(start->slice_offset == 0);
|
mi_assert_internal(start->slice_offset == 0);
|
||||||
mi_assert_internal(start + start->slice_count > slice);
|
mi_assert_internal(start + start->slice_count > slice);
|
||||||
@ -277,8 +277,8 @@ static inline mi_page_t* _mi_segment_page_of(const mi_segment_t* segment, const
|
|||||||
mi_assert_internal(diff >= 0 && diff < (ptrdiff_t)MI_SEGMENT_SIZE);
|
mi_assert_internal(diff >= 0 && diff < (ptrdiff_t)MI_SEGMENT_SIZE);
|
||||||
uintptr_t idx = (uintptr_t)diff >> MI_SEGMENT_SLICE_SHIFT;
|
uintptr_t idx = (uintptr_t)diff >> MI_SEGMENT_SLICE_SHIFT;
|
||||||
mi_assert_internal(idx < segment->slice_count);
|
mi_assert_internal(idx < segment->slice_count);
|
||||||
mi_slice_t* slice0 = (mi_slice_t*)&segment->slices[idx];
|
mi_slice_t* slice0 = (mi_slice_t*)&segment->slices[idx];
|
||||||
mi_slice_t* slice = mi_slice_first(slice0); // adjust to the block that holds the page data
|
mi_slice_t* slice = mi_slice_first(slice0); // adjust to the block that holds the page data
|
||||||
mi_assert_internal(slice->slice_offset == 0);
|
mi_assert_internal(slice->slice_offset == 0);
|
||||||
mi_assert_internal(slice >= segment->slices && slice < segment->slices + segment->slice_count);
|
mi_assert_internal(slice >= segment->slices && slice < segment->slices + segment->slice_count);
|
||||||
return mi_slice_to_page(slice);
|
return mi_slice_to_page(slice);
|
||||||
|
@ -105,7 +105,6 @@ terms of the MIT license. A copy of the license can be found in the file
|
|||||||
// Maximum number of size classes. (spaced exponentially in 12.5% increments)
|
// Maximum number of size classes. (spaced exponentially in 12.5% increments)
|
||||||
#define MI_BIN_HUGE (73U)
|
#define MI_BIN_HUGE (73U)
|
||||||
|
|
||||||
|
|
||||||
#if (MI_MEDIUM_OBJ_WSIZE_MAX >= 655360)
|
#if (MI_MEDIUM_OBJ_WSIZE_MAX >= 655360)
|
||||||
#error "define more bins"
|
#error "define more bins"
|
||||||
#endif
|
#endif
|
||||||
|
@ -140,7 +140,7 @@ static void mi_page_queue_delete(mi_page_queue_t* pq, mi_page_t* page) {
|
|||||||
----------------------------------------------------------- */
|
----------------------------------------------------------- */
|
||||||
|
|
||||||
#if (MI_DEBUG > 1)
|
#if (MI_DEBUG > 1)
|
||||||
static bool mi_page_queue_contains(mi_page_queue_t* pq, mi_page_t* page) {
|
static bool mi_segment_page_queue_contains(mi_page_queue_t* pq, mi_page_t* page) {
|
||||||
for (mi_page_t* p = pq->first; p != NULL; p = p->next) {
|
for (mi_page_t* p = pq->first; p != NULL; p = p->next) {
|
||||||
if (p==page) return true;
|
if (p==page) return true;
|
||||||
}
|
}
|
||||||
@ -176,7 +176,7 @@ static bool mi_segment_is_valid(mi_segment_t* segment, mi_segments_tld_t* tld) {
|
|||||||
mi_assert_internal(end->block_size == 0);
|
mi_assert_internal(end->block_size == 0);
|
||||||
if (segment->kind == MI_SEGMENT_NORMAL && segment->thread_id != 0) {
|
if (segment->kind == MI_SEGMENT_NORMAL && segment->thread_id != 0) {
|
||||||
pq = mi_page_queue_for(slice->slice_count,tld);
|
pq = mi_page_queue_for(slice->slice_count,tld);
|
||||||
mi_assert_internal(mi_page_queue_contains(pq,mi_slice_to_page(slice)));
|
mi_assert_internal(mi_segment_page_queue_contains(pq,mi_slice_to_page(slice)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
slice = &segment->slices[maxindex+1];
|
slice = &segment->slices[maxindex+1];
|
||||||
|
Loading…
Reference in New Issue
Block a user