From 4e1ec8b35647d238632e2adc17a47bbee3dbaaa1 Mon Sep 17 00:00:00 2001 From: iranrmrf Date: Wed, 12 Oct 2022 17:29:01 +0200 Subject: [PATCH] yield fix and remove static_assert and formatting --- heap_replacer/locks/nlock.h | 2 +- heap_replacer/mheap/mheap.h | 1 - heap_replacer/sheap/sheap.h | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/heap_replacer/locks/nlock.h b/heap_replacer/locks/nlock.h index e953014..cf1f72f 100644 --- a/heap_replacer/locks/nlock.h +++ b/heap_replacer/locks/nlock.h @@ -16,7 +16,7 @@ void nlock_lock(struct nlock *lock) { while (InterlockedCompareExchange(&lock->locked, 1, 0)) { - Sleep(0); + YieldProcessor(); }; } diff --git a/heap_replacer/mheap/mheap.h b/heap_replacer/mheap/mheap.h index 267c5eb..b1cce89 100644 --- a/heap_replacer/mheap/mheap.h +++ b/heap_replacer/mheap/mheap.h @@ -123,7 +123,6 @@ void *mheap_malloc(struct mheap *heap, size_t size) } } - end: return addr; } diff --git a/heap_replacer/sheap/sheap.h b/heap_replacer/sheap/sheap.h index 51dea19..9f4e03c 100644 --- a/heap_replacer/sheap/sheap.h +++ b/heap_replacer/sheap/sheap.h @@ -12,7 +12,6 @@ struct schnk }; struct schnk *prev; }; -static_assert(sizeof(struct schnk) == 8, ""); struct sheap {