From 9f943dbc8e929f9df2bb14ad3b6ee9da138a44ac Mon Sep 17 00:00:00 2001 From: Mathias Stearn Date: Fri, 5 Jan 2018 02:58:42 -0500 Subject: [PATCH] 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." --- lib/system/mmdisp.nim | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/system/mmdisp.nim b/lib/system/mmdisp.nim index 9ac039e192..45e0c74c0e 100644 --- a/lib/system/mmdisp.nim +++ b/lib/system/mmdisp.nim @@ -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()