diff options
author | Nicholas Noll <nbnoll@eml.cc> | 2020-04-19 09:15:57 -0700 |
---|---|---|
committer | Nicholas Noll <nbnoll@eml.cc> | 2020-04-19 09:15:57 -0700 |
commit | 1ae9a10d56fca8fe585e77533c49e5c9d680ff12 (patch) | |
tree | b6e51a3c385727efca5cd9a2ca83bc770d10a6a4 /src/bufio/buffer.c | |
parent | 21055a1e5d34dda1b8151dd46a6bedca22bd73d9 (diff) |
chore: removed bufio from tree
Diffstat (limited to 'src/bufio/buffer.c')
-rw-r--r-- | src/bufio/buffer.c | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/src/bufio/buffer.c b/src/bufio/buffer.c deleted file mode 100644 index 8963652..0000000 --- a/src/bufio/buffer.c +++ /dev/null @@ -1,24 +0,0 @@ -#include "impl.h" - -// NewBuffer allocates a bytes buffer with size 'size'. -// This is unallocated usage. -// Returns the fat pointer by value. - -void* -newbuffer(uintptr off, uintptr size) -{ - if (size == 0 || size > BUF·max) size = BUF·size; - - void *mem = malloc(off + sizeof(Buffer) + size); - Buffer *buf = mem + off; - - buf->eof = 0; - buf->off = 0; - buf->base = buf->b + BUF·ungets; - buf->end = buf->b + size; - buf->size = buf->end - buf->base; - - memset(buf->b, 0, size); - - return mem; -} |