mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-19 19:17:15 +00:00
Don't zeroMem result of boehmAlloc() (#7029)
From the man page: "Unlike the standard implementations of malloc, GC_malloc clears the newly allocated storage. GC_malloc_atomic does not."
This commit is contained in:
committed by
Andreas Rumpf
parent
464d037c17
commit
9f943dbc8e
@@ -109,7 +109,6 @@ when defined(boehmgc):
|
||||
if result == nil: raiseOutOfMem()
|
||||
proc alloc0(size: Natural): pointer =
|
||||
result = alloc(size)
|
||||
zeroMem(result, size)
|
||||
proc realloc(p: pointer, newsize: Natural): pointer =
|
||||
result = boehmRealloc(p, newsize)
|
||||
if result == nil: raiseOutOfMem()
|
||||
@@ -119,8 +118,7 @@ when defined(boehmgc):
|
||||
result = boehmAlloc(size)
|
||||
if result == nil: raiseOutOfMem()
|
||||
proc allocShared0(size: Natural): pointer =
|
||||
result = alloc(size)
|
||||
zeroMem(result, size)
|
||||
result = allocShared(size)
|
||||
proc reallocShared(p: pointer, newsize: Natural): pointer =
|
||||
result = boehmRealloc(p, newsize)
|
||||
if result == nil: raiseOutOfMem()
|
||||
|
||||
Reference in New Issue
Block a user