diff options
author | Nicholas Noll <nbnoll@eml.cc> | 2020-06-06 12:30:48 -0700 |
---|---|---|
committer | Nicholas Noll <nbnoll@eml.cc> | 2020-06-06 12:30:48 -0700 |
commit | e02e1403b432f8cd6d07ebbdd235627f20f01cfb (patch) | |
tree | e479b02d2ede4d34270889a8c2d1f627f3701e1e /sys/cmd/cc | |
parent | eeb5831bb4d62c35eca6db333137a9b8bf682e6e (diff) |
small changes to exposure of allocation functions
Diffstat (limited to 'sys/cmd/cc')
-rw-r--r-- | sys/cmd/cc/cc.c | 18 | ||||
-rw-r--r-- | sys/cmd/cc/lex.c | 18 |
2 files changed, 36 insertions, 0 deletions
diff --git a/sys/cmd/cc/cc.c b/sys/cmd/cc/cc.c index 3246292..3602643 100644 --- a/sys/cmd/cc/cc.c +++ b/sys/cmd/cc/cc.c @@ -54,6 +54,24 @@ getstr(string key, int *ok) return idx; } +static +void +·free(void* _, void* ptr) { + return free(ptr); +} + +static +void * +·alloc(void* _, uint n, ulong size) { + return malloc(n*size); +} + +static +void * +·calloc(void* _, uint n, ulong size) { + return calloc(n, size); +} + static int morestrtab(StrTab *tab, int n) diff --git a/sys/cmd/cc/lex.c b/sys/cmd/cc/lex.c index 1396358..0963fb9 100644 --- a/sys/cmd/cc/lex.c +++ b/sys/cmd/cc/lex.c @@ -791,6 +791,24 @@ Nospace: #define PTR_HASH(p) (uintptr)(p) #define PTR_EQUAL(p1, p2) ((uintptr)(p1) == (uintptr)(p2)) +static +void +·free(void* _, void* ptr) { + return free(ptr); +} + +static +void * +·alloc(void* _, uint n, ulong size) { + return malloc(n*size); +} + +static +void * +·calloc(void* _, uint n, ulong size) { + return calloc(n, size); +} + static int moresymtab(SymTab *tab, int n) |