diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/libbio.h | 4 | ||||
-rw-r--r-- | include/libn.h | 17 |
2 files changed, 6 insertions, 15 deletions
diff --git a/include/libbio.h b/include/libbio.h index 7b28a55..558c163 100644 --- a/include/libbio.h +++ b/include/libbio.h @@ -63,8 +63,8 @@ typedef struct bio·Seq char *q; } bio·Seq; -bio·SeqReader *bio·open(io·Reader io, void *rdr, mem·Allocator mem, void *heap); -error bio·close(bio·SeqReader *rdr); +bio·SeqReader *bio·openseq(io·Reader io, void *rdr, mem·Allocator mem, void *heap); +error bio·closeseq(bio·SeqReader *rdr); error bio·readfasta(bio·SeqReader *rdr, bio·Seq *seq); error bio·readfastq(bio·SeqReader *rdr, bio·Seq *seq); diff --git a/include/libn.h b/include/libn.h index 30b4c87..2b8dc4c 100644 --- a/include/libn.h +++ b/include/libn.h @@ -52,31 +52,22 @@ void* bufgrow(void*, vlong, vlong); void _bufpop(void*, int, vlong); // ----------------------------------------------------------------------------- -// interfaces -// TODO(nnoll): Think about this idea -/* -typedef struct Iface { - void* impl; - byte fcn[]; -} Iface; -*/ -// ----------------------------------------------------------------------------- // memory allocation // TODO(nnoll): Allow for nil iterfaces? /* allocator interface */ typedef struct mem·Allocator { - void *(*alloc)(void *iface, uint n, ulong size); - void (*free)(void *iface, void *ptr); + void *(*alloc)(void *heap, uint n, ulong size); + void (*free)(void *heap, void *ptr); } mem·Allocator; -extern mem·Allocator mem·System; +extern mem·Allocator sys·Memory; typedef struct mem·Reallocator { void *(*alloc)(void *iface, uint n, ulong size); void *(*realloc)(void *iface, void *ptr, uint n, ulong size); void (*free)(void *iface, void *ptr); } mem·Reallocator; -extern mem·Reallocator mem·FullSystem; +extern mem·Reallocator sys·Relocator; /* simple memory arena */ typedef struct mem·Arena mem·Arena; |