| author | |
| committer | |
| log | 9d7082972e8df9105b48a806e7bfabca90d4dc1b |
| tree | 002f93ef63b51f8459b0d9c77520aab593d31d3d |
| parent | f6af773578e20dbae3bf2a350c036558fea84803 |
std.heap.c_allocator was already doing this, however,
std.heap.raw_c_allocator, which asserts no allocations more than 16
bytes aligned, was not.
The zig compiler uses std.heap.raw_c_allocator, so it is affected by
this.1 files changed, 10 insertions(+), 1 deletions(-)
lib/std/heap.zig+10-1| ... | ... | @@ -196,7 +196,16 @@ fn rawCResize( |
| 196 | 196 | ) bool { |
| 197 | 197 | _ = log2_old_align; |
| 198 | 198 | _ = ret_addr; |
| 199 | return new_len <= buf.len; | |
| 199 | ||
| 200 | if (new_len <= buf.len) | |
| 201 | return true; | |
| 202 | ||
| 203 | if (CAllocator.supports_malloc_size) { | |
| 204 | const full_len = CAllocator.malloc_size(buf.ptr); | |
| 205 | if (new_len <= full_len) return true; | |
| 206 | } | |
| 207 | ||
| 208 | return false; | |
| 200 | 209 | } |
| 201 | 210 | |
| 202 | 211 | fn rawCFree( |