move declaration to avoid gcc warning, see issue #919

This commit is contained in:
Daan 2024-08-12 13:51:39 -07:00
parent 349b7dc2f4
commit 01503df7f3

View file

@ -663,7 +663,6 @@ static void mi_segment_span_remove_from_queue(mi_slice_t* slice, mi_segments_tld
static mi_slice_t* mi_segment_span_free_coalesce(mi_slice_t* slice, mi_segments_tld_t* tld) {
mi_assert_internal(slice != NULL && slice->slice_count > 0 && slice->slice_offset == 0);
mi_segment_t* const segment = _mi_ptr_segment(slice);
const bool is_abandoned = (segment->thread_id == 0); // mi_segment_is_abandoned(segment);
// for huge pages, just mark as free but don't add to the queues
if (segment->kind == MI_SEGMENT_HUGE) {
@ -676,6 +675,7 @@ static mi_slice_t* mi_segment_span_free_coalesce(mi_slice_t* slice, mi_segments_
}
// otherwise coalesce the span and add to the free span queues
const bool is_abandoned = (segment->thread_id == 0); // mi_segment_is_abandoned(segment);
size_t slice_count = slice->slice_count;
mi_slice_t* next = slice + slice->slice_count;
mi_assert_internal(next <= mi_segment_slices_end(segment));