We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
GC.malloc
gc_none
1 parent 5cf6df9 commit 70ed2d0Copy full SHA for 70ed2d0
src/gc/none.cr
@@ -10,7 +10,9 @@ module GC
10
# :nodoc:
11
def self.malloc(size : LibC::SizeT) : Void*
12
Crystal.trace :gc, "malloc", size: size
13
- LibC.malloc(size)
+ # libc malloc is not guaranteed to return cleared memory, so we need to
14
+ # explicitly clear it. Ref: https://github.com/crystal-lang/crystal/issues/14678
15
+ LibC.malloc(size).tap(&.clear)
16
end
17
18
0 commit comments