summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2019-02-04 21:06:23 +0100
committerAndreas Rumpf <rumpf_a@web.de>2019-02-04 21:06:23 +0100
commit57b49cc509cf569935878648526ecc80efd5f347 (patch)
tree99e5b81d5eb48969e3abc309c9c03853ac8a7bbb
parent6e1d2df74ea37756a78c0cf8b776365a38d22f5d (diff)
downloadNim-57b49cc509cf569935878648526ecc80efd5f347.tar.gz
allocators: add a name field for easier debugging
-rw-r--r--lib/core/allocators.nim2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/core/allocators.nim b/lib/core/allocators.nim
index 5189bb762..b8d575422 100644
--- a/lib/core/allocators.nim
+++ b/lib/core/allocators.nim
@@ -18,6 +18,7 @@ type
     realloc*: proc (a: Allocator; p: pointer; oldSize, newSize: int): pointer {.nimcall.}
     deallocAll*: proc (a: Allocator) {.nimcall.}
     flags*: set[AllocatorFlag]
+    name*: cstring
     allocCount: int
     deallocCount: int
 
@@ -40,6 +41,7 @@ proc getLocalAllocator*(): Allocator =
       result = system.realloc(p, newSize)
     result.deallocAll = nil
     result.flags = {ThreadLocal}
+    result.name = "nim_local"
     localAllocator = result
 
 proc setLocalAllocator*(a: Allocator) =