aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsaac Freund <ifreund@ifreund.xyz>2020-12-28 15:06:19 +0100
committerVeikka Tuominen <git@vexu.eu>2020-12-28 16:15:04 +0200
commit7ed499ec4549fa7304b822446b23cff993b8fa6f (patch)
treefe343d9e8e5f64102110f4ac8c206c5acfe78dbd
parentc234761eddc2fe932046767756b9e6df82a73b65 (diff)
downloadzig-7ed499ec4549fa7304b822446b23cff993b8fa6f.tar.gz
zig-7ed499ec4549fa7304b822446b23cff993b8fa6f.zip
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).
-rw-r--r--lib/std/heap.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/std/heap.zig b/lib/std/heap.zig
index fddef10cd3..209712edc5 100644
--- a/lib/std/heap.zig
+++ b/lib/std/heap.zig
@@ -160,8 +160,8 @@ var c_allocator_state = Allocator{
/// Asserts allocations are within `@alignOf(std.c.max_align_t)` and directly calls
/// `malloc`/`free`. Does not attempt to utilize `malloc_usable_size`.
/// This allocator is safe to use as the backing allocator with
-/// `ArenaAllocator` and `GeneralPurposeAllocator`, and is more optimal in these cases
-/// than to using `c_allocator`.
+/// `ArenaAllocator` for example and is more optimal in such a case
+/// than `c_allocator`.
pub const raw_c_allocator = &raw_c_allocator_state;
var raw_c_allocator_state = Allocator{
.allocFn = rawCAlloc,