Fix build issues with VS 2017

This commit is contained in:
Dan Cristoloveanu 2020-09-04 22:09:22 -07:00
parent 97f56b1e08
commit c3ef5d5a7a
2 changed files with 2 additions and 2 deletions

View file

@ -274,7 +274,7 @@ static mi_page_t* mi_page_fresh(mi_heap_t* heap, mi_page_queue_t* pq) {
void _mi_heap_delayed_free(mi_heap_t* heap) {
// take over the list (note: no atomic exchange since it is often NULL)
mi_block_t* block = mi_atomic_load_ptr_relaxed(mi_block_t, &heap->thread_delayed_free);
while (block != NULL && !mi_atomic_cas_ptr_weak_acq_rel(mi_block_t, &heap->thread_delayed_free, &block, NULL)) { /* nothing */ };
while (block != NULL && !mi_atomic_cas_ptr_weak_acq_rel(mi_block_t, &heap->thread_delayed_free, (void**)&block, NULL)) { /* nothing */ };
// and free them all
while(block != NULL) {

View file

@ -921,7 +921,7 @@ static bool mi_abandoned_visited_revisit(void)
if (mi_atomic_load_ptr_relaxed(mi_segment_t, &abandoned_visited) == NULL) return false;
// grab the whole visited list
mi_segment_t* first = mi_atomic_exchange_ptr_acq_rel(mi_segment_t, &abandoned_visited, NULL);
mi_segment_t* first = (mi_segment_t*)mi_atomic_exchange_ptr_acq_rel(mi_segment_t, &abandoned_visited, NULL);
if (first == NULL) return false;
// first try to swap directly if the abandoned list happens to be NULL