summaryrefslogtreecommitdiff
path: root/source/fitz
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2015-02-10 20:26:33 +0000
committerRobin Watts <robin.watts@artifex.com>2015-02-10 20:29:20 +0000
commit4fe9caafead64704a16c7093b72115893be3087f (patch)
tree219c4d52f49500c491681ecb06457caab582f86e /source/fitz
parent65ada9d7fc252f3dad9b2d3a4a9e571d16358cbd (diff)
downloadmupdf-4fe9caafead64704a16c7093b72115893be3087f.tar.xz
Add some Memento_labels to aid debugging of leaks.
Diffstat (limited to 'source/fitz')
-rw-r--r--source/fitz/colorspace.c2
-rw-r--r--source/fitz/context.c4
-rw-r--r--source/fitz/draw-device.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/source/fitz/colorspace.c b/source/fitz/colorspace.c
index 8b8f3f96..87b49413 100644
--- a/source/fitz/colorspace.c
+++ b/source/fitz/colorspace.c
@@ -15,7 +15,7 @@ fz_free_colorspace_imp(fz_context *ctx, fz_storable *cs_)
fz_colorspace *
fz_new_colorspace(fz_context *ctx, char *name, int n)
{
- fz_colorspace *cs = fz_malloc(ctx, sizeof(fz_colorspace));
+ fz_colorspace *cs = Memento_label(fz_malloc(ctx, sizeof(fz_colorspace)), "fz_colorspace");
FZ_INIT_STORABLE(cs, 1, fz_free_colorspace_imp);
cs->size = sizeof(fz_colorspace);
fz_strlcpy(cs->name, name, sizeof cs->name);
diff --git a/source/fitz/context.c b/source/fitz/context.c
index 6a986e59..36ad879f 100644
--- a/source/fitz/context.c
+++ b/source/fitz/context.c
@@ -90,14 +90,14 @@ new_context_phase1(fz_alloc_context *alloc, fz_locks_context *locks)
ctx->glyph_cache = NULL;
- ctx->error = fz_malloc_no_throw(ctx, sizeof(fz_error_context));
+ ctx->error = Memento_label(fz_malloc_no_throw(ctx, sizeof(fz_error_context)), "fz_error_context");
if (!ctx->error)
goto cleanup;
ctx->error->top = -1;
ctx->error->errcode = FZ_ERROR_NONE;
ctx->error->message[0] = 0;
- ctx->warn = fz_malloc_no_throw(ctx, sizeof(fz_warn_context));
+ ctx->warn = Memento_label(fz_malloc_no_throw(ctx, sizeof(fz_warn_context)), "fz_warn_context");
if (!ctx->warn)
goto cleanup;
ctx->warn->message[0] = 0;
diff --git a/source/fitz/draw-device.c b/source/fitz/draw-device.c
index 4592f8cf..f927e1b5 100644
--- a/source/fitz/draw-device.c
+++ b/source/fitz/draw-device.c
@@ -107,7 +107,7 @@ static void fz_grow_stack(fz_draw_device *dev)
if (dev->stack == &dev->init_stack[0])
{
- stack = fz_malloc(dev->ctx, sizeof(*stack) * max);
+ stack = Memento_label(fz_malloc(dev->ctx, sizeof(*stack) * max), "draw device stack");
memcpy(stack, dev->stack, sizeof(*stack) * dev->stack_cap);
}
else