From bc53100f1ef063e09d77e8670e1796bc67017411 Mon Sep 17 00:00:00 2001 From: Nicholas Noll Date: Tue, 28 Sep 2021 13:39:24 -0700 Subject: Checkin: various small changes --- include/libbio.h | 6 +++--- include/libn.h | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/libbio.h b/include/libbio.h index f84b081..9438b74 100644 --- a/include/libbio.h +++ b/include/libbio.h @@ -18,8 +18,8 @@ typedef struct bio·Tree bio·Node *root; int nleaf; - mem·Allocator heap; - void *h; + mem·Allocator mem; + void *heap; } bio·Tree; /* clade manipulation */ @@ -42,7 +42,7 @@ void *phylo·preorder(bio·Node *clade, void *(*op)(bio·Node*, void*), void *ct void phylo·getleafs(bio·Tree tree, bio·Node **leafs); /* newick i/o */ -error bio·readnewick(io·Peeker stream, void*, bio·Tree* tree); +error bio·readnewick(io·Peeker io, void* rdr, bio·Tree* tree); error bio·writenewick(bio·Tree tree, io·Putter out, void*); // ----------------------------------------------------------------------- diff --git a/include/libn.h b/include/libn.h index 2cf29c7..699786f 100644 --- a/include/libn.h +++ b/include/libn.h @@ -57,6 +57,7 @@ typedef struct mem·Allocator { void *(*alloc)(void *heap, uint n, ulong size); void (*free)(void *heap, void *ptr); } mem·Allocator; + extern mem·Allocator sys·Memory; typedef struct mem·Reallocator { @@ -64,6 +65,7 @@ typedef struct mem·Reallocator { void *(*realloc)(void *iface, void *ptr, uint n, ulong size); void (*free)(void *iface, void *ptr); } mem·Reallocator; + extern mem·Reallocator sys·Relocator; /* simple memory arena */ @@ -73,6 +75,8 @@ mem·Arena *mem·makearena(mem·Allocator from, void*); void *mem·arenaalloc(mem·Arena *A, uint n, ulong size); void mem·freearena(mem·Arena *A); +extern mem·Allocator mem·ArenaAllocator; + /* generalized memxxx functions */ void memset64(void *dst, uint64 val, uintptr size); -- cgit v1.2.1