diff options
author | Mathias Stearn <redbeard0531@gmail.com> | 2018-01-05 02:58:42 -0500 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-01-05 08:58:42 +0100 |
commit | 9f943dbc8e929f9df2bb14ad3b6ee9da138a44ac (patch) | |
tree | 1f5fa00a962d4232acac5e11e8b0db99f236fb13 /lib | |
parent | 464d037c1758243664d46595ab4bd800d86e041f (diff) | |
download | Nim-9f943dbc8e929f9df2bb14ad3b6ee9da138a44ac.tar.gz |
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."
Diffstat (limited to 'lib')
-rw-r--r-- | lib/system/mmdisp.nim | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/system/mmdisp.nim b/lib/system/mmdisp.nim index 9ac039e19..45e0c74c0 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() |