From 138fb272fae79587de3469493b55e4d18eadc722 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Sat, 20 Nov 2021 20:12:21 -0800 Subject: Feat: added buffered io from plan9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As we no longer have the FILE type, we need to buffer our reading and writing so that we don't have to make so many syscalls. The API is nice so that we can buffer other readers. We will update it so that it eats io·Readers/io·Writers. --- src/base/mem/arena.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/base/mem/arena.c') diff --git a/src/base/mem/arena.c b/src/base/mem/arena.c index b2ce044..37e7b56 100644 --- a/src/base/mem/arena.c +++ b/src/base/mem/arena.c @@ -25,15 +25,13 @@ struct mem·Arena struct Block first; }; -static -void* +static void* ·arenaalloc(void *heap, uint n, ulong size) { return mem·arenaalloc(heap, n, size); } -static -void +static void ·arenafree(void *heap, void *ptr) { /* no-op */ @@ -45,8 +43,7 @@ mem·Allocator mem·ArenaAllocator = { }; -static -void +static void grow(mem·Arena *a, vlong min) { uintptr size; -- cgit v1.2.1