mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 22:10:33 +00:00
newruntime: make 'discard new RootObj' work
This commit is contained in:
@@ -48,7 +48,7 @@ proc nimNewObj(size: int): pointer {.compilerRtl.} =
|
||||
discard
|
||||
elif defined(useMalloc):
|
||||
var orig = c_malloc(s)
|
||||
nimZeroMem(result, s)
|
||||
nimZeroMem(orig, s)
|
||||
result = orig +! sizeof(RefHeader)
|
||||
else:
|
||||
result = alloc0(s) +! sizeof(RefHeader)
|
||||
|
||||
Reference in New Issue
Block a user