| author | |
| committer | |
| log | 4f7170f8a34f39ce32abaa1d6d3357e597e3863a |
| tree | d81269815d986a7160975ee666b974cdb730a182 |
| parent | b0f124d46dfd719fc138ab140622f5f6b1aa65f0 |
Attempting to allocate > (1 GiB - @sizeOf(usize)) would previously hit index out-of-bounds due to the slot index coming out to 15 which is the same as the length of the big_frees array. The log2 gives the max index, not the count, so it needs the +1.1 files changed, 1 insertions(+), 1 deletions(-)
lib/std/heap/BrkAllocator.zig+1-1| ... | ... | @@ -45,7 +45,7 @@ const size_class_count = math.log2(bigpage_size) - min_class; |
| 45 | 45 | /// 1 - 2 bigpages |
| 46 | 46 | /// 2 - 4 bigpages |
| 47 | 47 | /// etc. |
| 48 | const big_size_class_count = math.log2(bigpage_count); | |
| 48 | const big_size_class_count = math.log2(bigpage_count) + 1; | |
| 49 | 49 | |
| 50 | 50 | fn alloc(ctx: *anyopaque, len: usize, alignment: Alignment, return_address: usize) ?[*]u8 { |
| 51 | 51 | _ = ctx; |