diff options
| author | Simon Tatham <anakin@pobox.com> | 1999-09-02 12:35:02 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 1999-09-02 12:35:02 +0000 |
| commit | d3c026f08f629659b5efe23fe8bffd3cf9b845f6 (patch) | |
| tree | e81d86bf7d706e0ac4c7a9a644ab193cd4f03e3c /misc.c | |
| parent | 5842eaaf51d9045bc0b199f0b5e82dfc614b2e0c (diff) | |
| download | halibut-d3c026f08f629659b5efe23fe8bffd3cf9b845f6.zip halibut-d3c026f08f629659b5efe23fe8bffd3cf9b845f6.tar.gz halibut-d3c026f08f629659b5efe23fe8bffd3cf9b845f6.tar.bz2 halibut-d3c026f08f629659b5efe23fe8bffd3cf9b845f6.tar.xz | |
Redo memory allocation to use mknew macro
[originally from svn r214]
Diffstat (limited to 'misc.c')
| -rw-r--r-- | misc.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -13,7 +13,7 @@ struct stackTag { stack stk_new(void) { stack s; - s = smalloc(sizeof(*s)); + s = mknew(stack); s->sp = 0; s->size = 0; s->data = NULL; @@ -29,7 +29,7 @@ void stk_free(stack s) { void stk_push(stack s, void *item) { if (s->size <= s->sp) { s->size = s->sp + 32; - s->data = srealloc(s->data, s->size * sizeof(*s->data)); + s->data = resize(s->data, s->size); } s->data[s->sp++] = item; } |