clean up and standardize types across the codebase, unify atomic operations, improve UTF-8 handling throughout the system, remove obsolete input and named queue interfaces, redesign process preparation and creation, tighten IPC and service boundaries, improve error handling and reliability, minor documentation cleanup, fix doom surfaces, fix panic in ini parsing.
This commit is contained in:
1 parent
899225f551
commit
c0ad63c27f
226 files changed
+6562
-4147
No files matched your search
@@ -1,5 +1,7 @@
|
||||
// User-mode page-backed heap. This file owns segment allocation, block splitting, coalescing, and exported allocation primitives.
|
||||
|
||||
#include <ntlite/atomic.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
@@ -31,12 +33,12 @@ typedef struct HEAP_SEGMENT {
|
||||
HEAP_BLOCK* First;
|
||||
} HEAP_SEGMENT;
|
||||
|
||||
static volatile long gHeapLock;
|
||||
static volatile int32_t gHeapLock;
|
||||
static HEAP_SEGMENT* gSegments;
|
||||
|
||||
// Acquires the process-local heap lock.
|
||||
static void HeapLock(void) {
|
||||
while (_InterlockedCompareExchange(&gHeapLock, 1, 0) != 0)
|
||||
while (NtlAtomicCompareExchange32(&gHeapLock, 1, 0) != 0)
|
||||
_mm_pause();
|
||||
_ReadWriteBarrier();
|
||||
}
|
||||
@@ -44,7 +46,7 @@ static void HeapLock(void) {
|
||||
// Releases the process-local heap lock.
|
||||
static void HeapUnlock(void) {
|
||||
_ReadWriteBarrier();
|
||||
_InterlockedExchange(&gHeapLock, 0);
|
||||
NtlAtomicExchange32(&gHeapLock, 0);
|
||||
}
|
||||
|
||||
// Rounds requested allocation sizes up to the heap alignment while preserving non-zero allocation semantics.
|
||||
|
||||
Reference in new issue
Block a user