authorgravatar for mail@isaacfreund.comIsaac Freund <mail@isaacfreund.com> 2020-12-28 15:06:19+01:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2020-12-28 16:15:04+02:00
log7ed499ec4549fa7304b822446b23cff993b8fa6f
treefe343d9e8e5f64102110f4ac8c206c5acfe78dbd
parentc234761eddc2fe932046767756b9e6df82a73b65

std/heap: fix documentation of raw_c_allocator

This is not in fact safe to use with GeneralPurposeAllocator as GPA requires align(page_size) but raw_c_allocator provides only @alignOf(std.c.max_align_t).

1 files changed, 2 insertions(+), 2 deletions(-)

lib/std/heap.zig+2-2
......@@ -160,8 +160,8 @@ var c_allocator_state = Allocator{
160160/// Asserts allocations are within `@alignOf(std.c.max_align_t)` and directly calls
161161/// `malloc`/`free`. Does not attempt to utilize `malloc_usable_size`.
162162/// This allocator is safe to use as the backing allocator with
163/// `ArenaAllocator` and `GeneralPurposeAllocator`, and is more optimal in these cases
164/// than to using `c_allocator`.
163/// `ArenaAllocator` for example and is more optimal in such a case
164/// than `c_allocator`.
165165pub const raw_c_allocator = &raw_c_allocator_state;
166166var raw_c_allocator_state = Allocator{
167167 .allocFn = rawCAlloc,