summary refs log tree commit diff stats
path: root/lib/system/alloc.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2017-01-31 08:55:18 +0100
committerAndreas Rumpf <rumpf_a@web.de>2017-01-31 08:55:18 +0100
commit51c764e048fd49647dcac15b793ff956ae93f320 (patch)
tree1b372d382cc0edf7916bd79812674608443f89a8 /lib/system/alloc.nim
parent79f4b37d3b251ede2704d278a0914daa42d361c9 (diff)
downloadNim-51c764e048fd49647dcac15b793ff956ae93f320.tar.gz
fix the racy allocator properly
Diffstat (limited to 'lib/system/alloc.nim')
-rw-r--r--lib/system/alloc.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/system/alloc.nim b/lib/system/alloc.nim
index 37fd07719..95566129d 100644
--- a/lib/system/alloc.nim
+++ b/lib/system/alloc.nim
@@ -55,6 +55,7 @@ type
     prevSize: int        # size of previous chunk; for coalescing
     size: int            # if < PageSize it is a small chunk
     origSize: int        # 0th bit == 1 if 'used'
+    heapLink: PBigChunk      # linked list of all chunks for bulk 'deallocPages'
 
   SmallChunk = object of BaseChunk
     next, prev: PSmallChunk  # chunks of the same size
@@ -65,7 +66,6 @@ type
 
   BigChunk = object of BaseChunk # not necessarily > PageSize!
     next, prev: PBigChunk    # chunks of the same (or bigger) size
-    heapLink: PBigChunk      # linked list of all chunks for bulk 'deallocPages'
     data: AlignType      # start of usable memory
 
 template smallChunkOverhead(): untyped = sizeof(SmallChunk)-sizeof(AlignType)