summaryrefslogtreecommitdiff
path: root/fitz/dev_text.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 /fitz/dev_text.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 'fitz/dev_text.c')
-rw-r--r--fitz/dev_text.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fitz/dev_text.c b/fitz/dev_text.c
index bf304778..d5b6ccf7 100644
--- a/fitz/dev_text.c
+++ b/fitz/dev_text.c
@@ -20,7 +20,7 @@ fz_text_span *
fz_new_text_span(fz_context *ctx)
{
fz_text_span *span;
- span = fz_malloc(ctx, sizeof(fz_text_span));
+ span = fz_malloc_struct(ctx, fz_text_span);
span->font = NULL;
span->wmode = 0;
span->size = 0;
@@ -409,7 +409,7 @@ fz_device *
fz_new_text_device(fz_context *ctx, fz_text_span *root)
{
fz_device *dev;
- fz_text_device *tdev = fz_malloc(ctx, sizeof(fz_text_device));
+ fz_text_device *tdev = fz_malloc_struct(ctx, fz_text_device);
tdev->head = root;
tdev->span = root;
tdev->point.x = -1;