From 09a016ee7c5c81580b27db3bd193b38cb3bd4f0e Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Fri, 16 Dec 2011 16:26:48 +0000 Subject: Add fz_malloc_struct, and make code use it. The new fz_malloc_struct(A,B) macro allocates sizeof(B) bytes using fz_malloc, and then passes the resultant pointer to Memento_label to label it with "B". This costs nothing in non-memento builds, but gives much nicer listings of leaked blocks when memento is enabled. --- pdf/pdf_interpret.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pdf/pdf_interpret.c') diff --git a/pdf/pdf_interpret.c b/pdf/pdf_interpret.c index b6089ca0..674cccc4 100644 --- a/pdf/pdf_interpret.c +++ b/pdf/pdf_interpret.c @@ -844,7 +844,7 @@ pdf_new_csi(pdf_xref *xref, fz_device *dev, fz_matrix ctm, char *event) { pdf_csi *csi; - csi = fz_malloc(dev->ctx, sizeof(pdf_csi)); + csi = fz_malloc_struct(dev->ctx, pdf_csi); csi->xref = xref; csi->dev = dev; csi->event = event; -- cgit v1.2.3