authorgravatar for pfg@pfg.pwpfg <pfg@pfg.pw> 2020-09-03 16:33:47-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2020-09-03 16:33:47-07:00
logabe672956ed037077b23ac6aa29df3dd99795539
tree0bd56436befbded9a26ccf6c3d59229f5c59835d
parentbf1d83482b581e49499e545cc625155c1043ef0c
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Test 0 bit allocation


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

lib/std/heap.zig+4
......@@ -915,6 +915,10 @@ pub fn testAllocator(base_allocator: *mem.Allocator) !void {
915915 testing.expect(slice.len == 10);
916916
917917 allocator.free(slice);
918
919 const zero_bit_ptr = try allocator.create(u0);
920 zero_bit_ptr.* = 0;
921 allocator.destroy(zero_bit_ptr);
918922}
919923
920924pub fn testAllocatorAligned(base_allocator: *mem.Allocator, comptime alignment: u29) !void {