summaryrefslogtreecommitdiff
path: root/buttress.h
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 /buttress.h
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 'buttress.h')
-rw-r--r--buttress.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/buttress.h b/buttress.h
index aec26d0..673af56 100644
--- a/buttress.h
+++ b/buttress.h
@@ -16,8 +16,6 @@
#define FALSE 0
#endif
-#define lenof(x) ( sizeof((x)) / sizeof(*(x)) )
-
/*
* Structure tags
*/
@@ -161,6 +159,11 @@ void free_word_list(word *w);
void free_para_list(paragraph *p);
word *dup_word_list(word *w);
+#define mknew(type) ( (type *) smalloc (sizeof (type)) )
+#define mknewa(type, number) ( (type *) smalloc ((number) * sizeof (type)) )
+#define resize(array, len) ( srealloc ((array), (len) * sizeof (*(array))) )
+#define lenof(array) ( sizeof(array) / sizeof(*(array)) )
+
/*
* ustring.c
*/