summaryrefslogtreecommitdiff
path: root/fitz/fitz.h
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2012-02-03 13:58:07 +0100
committerTor Andersson <tor.andersson@artifex.com>2012-02-03 14:00:55 +0100
commit977ad5326276de29f0b2ae212a1cb4c09d8d94e0 (patch)
treec3b4a55e14117c9efdddecb631736d3a307579c2 /fitz/fitz.h
parentd5b9e3c95500c159a2dfc40657ab95da5f2777dd (diff)
downloadmupdf-977ad5326276de29f0b2ae212a1cb4c09d8d94e0.tar.xz
Make fz_malloc_struct return zeroed memory.
Diffstat (limited to 'fitz/fitz.h')
-rw-r--r--fitz/fitz.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/fitz/fitz.h b/fitz/fitz.h
index 3eebaf59..8483817d 100644
--- a/fitz/fitz.h
+++ b/fitz/fitz.h
@@ -400,8 +400,8 @@ fz_unlock(fz_context *ctx)
/* The following throw exceptions on failure to allocate */
void *fz_malloc(fz_context *ctx, unsigned int size);
-void *fz_malloc_array(fz_context *ctx, unsigned int count, unsigned int size);
void *fz_calloc(fz_context *ctx, unsigned int count, unsigned int size);
+void *fz_malloc_array(fz_context *ctx, unsigned int count, unsigned int size);
void *fz_resize_array(fz_context *ctx, void *p, unsigned int count, unsigned int size);
char *fz_strdup(fz_context *ctx, char *s);
@@ -414,9 +414,9 @@ void *fz_calloc_no_throw(fz_context *ctx, unsigned int count, unsigned int size)
void *fz_resize_array_no_throw(fz_context *ctx, void *p, unsigned int count, unsigned int size);
char *fz_strdup_no_throw(fz_context *ctx, char *s);
+/* alloc and zero a struct, and tag it for memento */
#define fz_malloc_struct(CTX, STRUCT) \
- Memento_label(fz_malloc(CTX,sizeof(STRUCT)), #STRUCT)
-
+ Memento_label(fz_calloc(CTX,1,sizeof(STRUCT)), #STRUCT)
/* runtime (hah!) test for endian-ness */
int fz_is_big_endian(void);