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:
Mathias Stearn
2018-01-05 02:58:42 -05:00
committed by Andreas Rumpf
parent 464d037c17
commit 9f943dbc8e

View File

@@ -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()