summaryrefslogtreecommitdiff
path: root/pdf/pdf_shade.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2011-12-16 16:26:48 +0000
committerRobin Watts <robin.watts@artifex.com>2011-12-16 16:26:48 +0000
commit09a016ee7c5c81580b27db3bd193b38cb3bd4f0e (patch)
tree90d0fad103f7aa592451f493a3d091ca9db7c866 /pdf/pdf_shade.c
parent1f8cccdeca9cf9082061b40d66fc8201c8b3ce80 (diff)
downloadmupdf-09a016ee7c5c81580b27db3bd193b38cb3bd4f0e.tar.xz
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.
Diffstat (limited to 'pdf/pdf_shade.c')
-rw-r--r--pdf/pdf_shade.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pdf/pdf_shade.c b/pdf/pdf_shade.c
index 52e2f199..a2f0e945 100644
--- a/pdf/pdf_shade.c
+++ b/pdf/pdf_shade.c
@@ -975,7 +975,7 @@ pdf_load_shading_dict(pdf_xref *xref, fz_obj *dict, fz_matrix transform)
fz_try(ctx)
{
- shade = fz_malloc(ctx, sizeof(fz_shade));
+ shade = fz_malloc_struct(ctx, fz_shade);
FZ_INIT_STORABLE(shade, 1, fz_free_shade_imp);
shade->type = FZ_MESH;
shade->use_background = 0;