allocators: add a name field for easier debugging
This commit is contained in:
parent
6e1d2df74e
commit
57b49cc509
1 changed files with 2 additions and 0 deletions
|
|
@ -18,6 +18,7 @@ type
|
||||||
realloc*: proc (a: Allocator; p: pointer; oldSize, newSize: int): pointer {.nimcall.}
|
realloc*: proc (a: Allocator; p: pointer; oldSize, newSize: int): pointer {.nimcall.}
|
||||||
deallocAll*: proc (a: Allocator) {.nimcall.}
|
deallocAll*: proc (a: Allocator) {.nimcall.}
|
||||||
flags*: set[AllocatorFlag]
|
flags*: set[AllocatorFlag]
|
||||||
|
name*: cstring
|
||||||
allocCount: int
|
allocCount: int
|
||||||
deallocCount: int
|
deallocCount: int
|
||||||
|
|
||||||
|
|
@ -40,6 +41,7 @@ proc getLocalAllocator*(): Allocator =
|
||||||
result = system.realloc(p, newSize)
|
result = system.realloc(p, newSize)
|
||||||
result.deallocAll = nil
|
result.deallocAll = nil
|
||||||
result.flags = {ThreadLocal}
|
result.flags = {ThreadLocal}
|
||||||
|
result.name = "nim_local"
|
||||||
localAllocator = result
|
localAllocator = result
|
||||||
|
|
||||||
proc setLocalAllocator*(a: Allocator) =
|
proc setLocalAllocator*(a: Allocator) =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue