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 /buttress.h | |
| 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 'buttress.h')
| -rw-r--r-- | buttress.h | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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 */ |