summaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>1999-09-02 12:35:02 +0000
committerSimon Tatham <anakin@pobox.com>1999-09-02 12:35:02 +0000
commitd3c026f08f629659b5efe23fe8bffd3cf9b845f6 (patch)
treee81d86bf7d706e0ac4c7a9a644ab193cd4f03e3c /misc.c
parent5842eaaf51d9045bc0b199f0b5e82dfc614b2e0c (diff)
downloadhalibut-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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/misc.c b/misc.c
index ec38016..96b0e53 100644
--- a/misc.c
+++ b/misc.c
@@ -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;
}