authorgravatar for quae@daurnimator.comdaurnimator <quae@daurnimator.com> 2019-02-20 13:28:56+11:00
committergravatar for quae@daurnimator.comdaurnimator <quae@daurnimator.com> 2019-02-20 16:52:23+11:00
logd68ae35c1153c6263292d60e4f5f6b828d7c8e8f
tree12a2d5c18b20fa33ea5f403d6e2c9f85b5914a77
parentda7880b4cf1b909c68aed2d1f6c702cca0807ee8
signature Commit is signed but in an unrecognized format.

std: when a FixedBufferAllocator is initialised, set the buffer to undefined


1 files changed, 4 insertions(+), 0 deletions(-)

std/heap.zig+4
...@@ -273,6 +273,10 @@ pub const FixedBufferAllocator = struct {...@@ -273,6 +273,10 @@ pub const FixedBufferAllocator = struct {
273 buffer: []u8,273 buffer: []u8,
274274
275 pub fn init(buffer: []u8) FixedBufferAllocator {275 pub fn init(buffer: []u8) FixedBufferAllocator {
276 // This loop gets optimized out in ReleaseFast mode
277 for (buffer) |*byte| {
278 byte.* = undefined;
279 }
276 return FixedBufferAllocator{280 return FixedBufferAllocator{
277 .allocator = Allocator{281 .allocator = Allocator{
278 .allocFn = alloc,282 .allocFn = alloc,