Coverage Report

Created: 2025-08-28 07:06

/src/ghostpdl/pdf/pdf_stack.h
Line
Count
Source
1
/* Copyright (C) 2018-2025 Artifex Software, Inc.
2
   All Rights Reserved.
3
4
   This software is provided AS-IS with no warranty, either express or
5
   implied.
6
7
   This software is distributed under license and may not be copied,
8
   modified or distributed except as expressly authorized under the terms
9
   of the license contained in the file LICENSE in this distribution.
10
11
   Refer to licensing information at http://www.artifex.com or contact
12
   Artifex Software, Inc.,  39 Mesa Street, Suite 108A, San Francisco,
13
   CA 94129, USA, for further information.
14
*/
15
16
/* Stack operations for the PDF interpreter */
17
18
#ifndef PDF_STACK_OPERATIONS
19
#define PDF_STACK_OPERATIONS
20
21
#include "pdf_int.h"
22
#include "pdf_types.h"
23
#include "ghostpdf.h"
24
#include "pdf_obj.h"
25
26
int pdfi_pop(pdf_context *ctx, int num);
27
int pdfi_push(pdf_context *ctx, pdf_obj *o);
28
int pdfi_mark_stack(pdf_context *ctx, pdf_obj_type type);
29
void pdfi_clearstack(pdf_context *ctx);
30
int pdfi_count_to_mark(pdf_context *ctx, uint64_t *count);
31
int pdfi_clear_to_mark(pdf_context *ctx);
32
int pdfi_destack_real(pdf_context *ctx, double *d);
33
int pdfi_destack_reals(pdf_context *ctx, double *d, int n);
34
int pdfi_destack_floats(pdf_context *ctx, float *d, int n);
35
int pdfi_destack_int(pdf_context *ctx, int64_t *i);
36
int pdfi_destack_ints(pdf_context *ctx, int64_t *i, int n);
37
38
static inline void pdfi_countup_impl(pdf_obj *o)
39
2.40G
{
40
2.40G
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
166M
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
166M
        return;
47
166M
    }
48
2.23G
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    outprintf(ctx->memory, "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
2.23G
}
Unexecuted instantiation: zpdfops.c:pdfi_countup_impl
ghostpdf.c:pdfi_countup_impl
Line
Count
Source
39
43.7k
{
40
43.7k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
0
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
0
        return;
47
0
    }
48
43.7k
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    outprintf(ctx->memory, "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
43.7k
}
pdf_dict.c:pdfi_countup_impl
Line
Count
Source
39
566M
{
40
566M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
2.97M
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
2.97M
        return;
47
2.97M
    }
48
563M
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    outprintf(ctx->memory, "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
563M
}
pdf_array.c:pdfi_countup_impl
Line
Count
Source
39
600M
{
40
600M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
866k
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
866k
        return;
47
866k
    }
48
599M
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    outprintf(ctx->memory, "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
599M
}
pdf_xref.c:pdfi_countup_impl
Line
Count
Source
39
50.1k
{
40
50.1k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
0
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
0
        return;
47
0
    }
48
50.1k
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    outprintf(ctx->memory, "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
50.1k
}
Unexecuted instantiation: pdf_int.c:pdfi_countup_impl
Unexecuted instantiation: pdf_file.c:pdfi_countup_impl
Unexecuted instantiation: pdf_path.c:pdfi_countup_impl
pdf_colour.c:pdfi_countup_impl
Line
Count
Source
39
878k
{
40
878k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
0
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
0
        return;
47
0
    }
48
878k
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    outprintf(ctx->memory, "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
878k
}
pdf_pattern.c:pdfi_countup_impl
Line
Count
Source
39
67.4k
{
40
67.4k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
5.55k
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
5.55k
        return;
47
5.55k
    }
48
61.9k
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    outprintf(ctx->memory, "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
61.9k
}
pdf_gstate.c:pdfi_countup_impl
Line
Count
Source
39
76.4M
{
40
76.4M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
21.3M
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
21.3M
        return;
47
21.3M
    }
48
55.0M
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    outprintf(ctx->memory, "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
55.0M
}
pdf_stack.c:pdfi_countup_impl
Line
Count
Source
39
830M
{
40
830M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
135M
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
135M
        return;
47
135M
    }
48
694M
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    outprintf(ctx->memory, "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
694M
}
pdf_image.c:pdfi_countup_impl
Line
Count
Source
39
1.03M
{
40
1.03M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
10
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
10
        return;
47
10
    }
48
1.03M
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    outprintf(ctx->memory, "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
1.03M
}
pdf_page.c:pdfi_countup_impl
Line
Count
Source
39
493k
{
40
493k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
4
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
4
        return;
47
4
    }
48
493k
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    outprintf(ctx->memory, "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
493k
}
pdf_annot.c:pdfi_countup_impl
Line
Count
Source
39
467k
{
40
467k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
0
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
0
        return;
47
0
    }
48
467k
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    outprintf(ctx->memory, "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
467k
}
pdf_mark.c:pdfi_countup_impl
Line
Count
Source
39
36.9k
{
40
36.9k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
0
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
0
        return;
47
0
    }
48
36.9k
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    outprintf(ctx->memory, "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
36.9k
}
pdf_font.c:pdfi_countup_impl
Line
Count
Source
39
56.2M
{
40
56.2M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
0
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
0
        return;
47
0
    }
48
56.2M
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    outprintf(ctx->memory, "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
56.2M
}
pdf_font0.c:pdfi_countup_impl
Line
Count
Source
39
19.8k
{
40
19.8k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
0
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
0
        return;
47
0
    }
48
19.8k
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    outprintf(ctx->memory, "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
19.8k
}
pdf_font1.c:pdfi_countup_impl
Line
Count
Source
39
113M
{
40
113M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
5.21M
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
5.21M
        return;
47
5.21M
    }
48
108M
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    outprintf(ctx->memory, "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
108M
}
pdf_font1C.c:pdfi_countup_impl
Line
Count
Source
39
3.42M
{
40
3.42M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
3.81k
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
3.81k
        return;
47
3.81k
    }
48
3.42M
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    outprintf(ctx->memory, "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
3.42M
}
pdf_fontps.c:pdfi_countup_impl
Line
Count
Source
39
102M
{
40
102M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
0
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
0
        return;
47
0
    }
48
102M
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    outprintf(ctx->memory, "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
102M
}
pdf_font3.c:pdfi_countup_impl
Line
Count
Source
39
5.63k
{
40
5.63k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
0
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
0
        return;
47
0
    }
48
5.63k
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    outprintf(ctx->memory, "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
5.63k
}
pdf_fontTT.c:pdfi_countup_impl
Line
Count
Source
39
9.48M
{
40
9.48M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
15.1k
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
15.1k
        return;
47
15.1k
    }
48
9.46M
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    outprintf(ctx->memory, "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
9.46M
}
pdf_font11.c:pdfi_countup_impl
Line
Count
Source
39
55.6k
{
40
55.6k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
0
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
0
        return;
47
0
    }
48
55.6k
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    outprintf(ctx->memory, "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
55.6k
}
pdf_cmap.c:pdfi_countup_impl
Line
Count
Source
39
689
{
40
689
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
0
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
0
        return;
47
0
    }
48
689
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    outprintf(ctx->memory, "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
689
}
pdf_fmap.c:pdfi_countup_impl
Line
Count
Source
39
128k
{
40
128k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
0
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
0
        return;
47
0
    }
48
128k
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    outprintf(ctx->memory, "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
128k
}
pdf_text.c:pdfi_countup_impl
Line
Count
Source
39
5.53M
{
40
5.53M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
0
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
0
        return;
47
0
    }
48
5.53M
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    outprintf(ctx->memory, "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
5.53M
}
pdf_shading.c:pdfi_countup_impl
Line
Count
Source
39
337k
{
40
337k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
0
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
0
        return;
47
0
    }
48
337k
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    outprintf(ctx->memory, "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
337k
}
Unexecuted instantiation: pdf_func.c:pdfi_countup_impl
Unexecuted instantiation: pdf_trans.c:pdfi_countup_impl
Unexecuted instantiation: pdf_device.c:pdfi_countup_impl
Unexecuted instantiation: pdf_misc.c:pdfi_countup_impl
pdf_optcontent.c:pdfi_countup_impl
Line
Count
Source
39
1.15M
{
40
1.15M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
1
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
1
        return;
47
1
    }
48
1.15M
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    outprintf(ctx->memory, "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
1.15M
}
pdf_check.c:pdfi_countup_impl
Line
Count
Source
39
31.1k
{
40
31.1k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
0
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
0
        return;
47
0
    }
48
31.1k
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    outprintf(ctx->memory, "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
31.1k
}
pdf_sec.c:pdfi_countup_impl
Line
Count
Source
39
32.2k
{
40
32.2k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
0
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
0
        return;
47
0
    }
48
32.2k
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    outprintf(ctx->memory, "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
32.2k
}
Unexecuted instantiation: pdf_utf8.c:pdfi_countup_impl
pdf_deref.c:pdfi_countup_impl
Line
Count
Source
39
10.2M
{
40
10.2M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
278
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
278
        return;
47
278
    }
48
10.2M
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    outprintf(ctx->memory, "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
10.2M
}
pdf_repair.c:pdfi_countup_impl
Line
Count
Source
39
234k
{
40
234k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
0
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
0
        return;
47
0
    }
48
234k
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    outprintf(ctx->memory, "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
234k
}
pdf_obj.c:pdfi_countup_impl
Line
Count
Source
39
3.45M
{
40
3.45M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
0
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
0
        return;
47
0
    }
48
3.45M
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    outprintf(ctx->memory, "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
3.45M
}
pdf_doc.c:pdfi_countup_impl
Line
Count
Source
39
1.43M
{
40
1.43M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
5.28k
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
5.28k
        return;
47
5.28k
    }
48
1.43M
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    outprintf(ctx->memory, "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
1.43M
}
pdf_fapi.c:pdfi_countup_impl
Line
Count
Source
39
18.8M
{
40
18.8M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
0
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
0
        return;
47
0
    }
48
18.8M
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    outprintf(ctx->memory, "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
18.8M
}
53
54
static inline void pdfi_countdown_impl(pdf_obj *o)
55
2.75G
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
2.75G
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
519M
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
2.23G
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    outprintf(ctx->memory, "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
2.23G
    if (o->refcnt != 0)
78
1.24G
        return;
79
#if REFCNT_DEBUG
80
    if (ctx != NULL && ctx->cache_entries != 0) {
81
        pdf_obj_cache_entry *entry = ctx->cache_LRU, *next;
82
83
        while(entry) {
84
            next = entry->next;
85
            if (entry->o->object_num != 0 && entry->o->object_num == o->object_num)
86
                outprintf(ctx->memory, "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    outprintf(ctx->memory, "Freeing object %d, UID %lu\n", o->object_num, o->UID);
91
#endif
92
#ifdef DEBUG
93
    if (ctx->xref_table != NULL && o->object_num > 0 &&
94
        o->object_num < ctx->xref_table->xref_size &&
95
        ctx->xref_table->xref[o->object_num].cache != NULL &&
96
        ctx->xref_table->xref[o->object_num].cache->o == o) {
97
        outprintf(ctx->memory, "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
989M
    pdfi_free_object(o);
101
989M
}
zpdfops.c:pdfi_countdown_impl
Line
Count
Source
55
2.77M
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
2.77M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
551k
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
2.22M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    outprintf(ctx->memory, "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
2.22M
    if (o->refcnt != 0)
78
2.09M
        return;
79
#if REFCNT_DEBUG
80
    if (ctx != NULL && ctx->cache_entries != 0) {
81
        pdf_obj_cache_entry *entry = ctx->cache_LRU, *next;
82
83
        while(entry) {
84
            next = entry->next;
85
            if (entry->o->object_num != 0 && entry->o->object_num == o->object_num)
86
                outprintf(ctx->memory, "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    outprintf(ctx->memory, "Freeing object %d, UID %lu\n", o->object_num, o->UID);
91
#endif
92
#ifdef DEBUG
93
    if (ctx->xref_table != NULL && o->object_num > 0 &&
94
        o->object_num < ctx->xref_table->xref_size &&
95
        ctx->xref_table->xref[o->object_num].cache != NULL &&
96
        ctx->xref_table->xref[o->object_num].cache->o == o) {
97
        outprintf(ctx->memory, "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
123k
    pdfi_free_object(o);
101
123k
}
ghostpdf.c:pdfi_countdown_impl
Line
Count
Source
55
3.00M
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
3.00M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
333k
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
2.66M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    outprintf(ctx->memory, "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
2.66M
    if (o->refcnt != 0)
78
1.24M
        return;
79
#if REFCNT_DEBUG
80
    if (ctx != NULL && ctx->cache_entries != 0) {
81
        pdf_obj_cache_entry *entry = ctx->cache_LRU, *next;
82
83
        while(entry) {
84
            next = entry->next;
85
            if (entry->o->object_num != 0 && entry->o->object_num == o->object_num)
86
                outprintf(ctx->memory, "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    outprintf(ctx->memory, "Freeing object %d, UID %lu\n", o->object_num, o->UID);
91
#endif
92
#ifdef DEBUG
93
    if (ctx->xref_table != NULL && o->object_num > 0 &&
94
        o->object_num < ctx->xref_table->xref_size &&
95
        ctx->xref_table->xref[o->object_num].cache != NULL &&
96
        ctx->xref_table->xref[o->object_num].cache->o == o) {
97
        outprintf(ctx->memory, "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
1.41M
    pdfi_free_object(o);
101
1.41M
}
pdf_dict.c:pdfi_countdown_impl
Line
Count
Source
55
288M
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
288M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
1.47M
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
286M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    outprintf(ctx->memory, "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
286M
    if (o->refcnt != 0)
78
19.9M
        return;
79
#if REFCNT_DEBUG
80
    if (ctx != NULL && ctx->cache_entries != 0) {
81
        pdf_obj_cache_entry *entry = ctx->cache_LRU, *next;
82
83
        while(entry) {
84
            next = entry->next;
85
            if (entry->o->object_num != 0 && entry->o->object_num == o->object_num)
86
                outprintf(ctx->memory, "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    outprintf(ctx->memory, "Freeing object %d, UID %lu\n", o->object_num, o->UID);
91
#endif
92
#ifdef DEBUG
93
    if (ctx->xref_table != NULL && o->object_num > 0 &&
94
        o->object_num < ctx->xref_table->xref_size &&
95
        ctx->xref_table->xref[o->object_num].cache != NULL &&
96
        ctx->xref_table->xref[o->object_num].cache->o == o) {
97
        outprintf(ctx->memory, "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
266M
    pdfi_free_object(o);
101
266M
}
pdf_array.c:pdfi_countdown_impl
Line
Count
Source
55
411M
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
411M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
176M
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
234M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    outprintf(ctx->memory, "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
234M
    if (o->refcnt != 0)
78
63.0M
        return;
79
#if REFCNT_DEBUG
80
    if (ctx != NULL && ctx->cache_entries != 0) {
81
        pdf_obj_cache_entry *entry = ctx->cache_LRU, *next;
82
83
        while(entry) {
84
            next = entry->next;
85
            if (entry->o->object_num != 0 && entry->o->object_num == o->object_num)
86
                outprintf(ctx->memory, "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    outprintf(ctx->memory, "Freeing object %d, UID %lu\n", o->object_num, o->UID);
91
#endif
92
#ifdef DEBUG
93
    if (ctx->xref_table != NULL && o->object_num > 0 &&
94
        o->object_num < ctx->xref_table->xref_size &&
95
        ctx->xref_table->xref[o->object_num].cache != NULL &&
96
        ctx->xref_table->xref[o->object_num].cache->o == o) {
97
        outprintf(ctx->memory, "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
171M
    pdfi_free_object(o);
101
171M
}
pdf_xref.c:pdfi_countdown_impl
Line
Count
Source
55
93.3k
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
93.3k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
14.2k
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
79.0k
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    outprintf(ctx->memory, "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
79.0k
    if (o->refcnt != 0)
78
62.1k
        return;
79
#if REFCNT_DEBUG
80
    if (ctx != NULL && ctx->cache_entries != 0) {
81
        pdf_obj_cache_entry *entry = ctx->cache_LRU, *next;
82
83
        while(entry) {
84
            next = entry->next;
85
            if (entry->o->object_num != 0 && entry->o->object_num == o->object_num)
86
                outprintf(ctx->memory, "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    outprintf(ctx->memory, "Freeing object %d, UID %lu\n", o->object_num, o->UID);
91
#endif
92
#ifdef DEBUG
93
    if (ctx->xref_table != NULL && o->object_num > 0 &&
94
        o->object_num < ctx->xref_table->xref_size &&
95
        ctx->xref_table->xref[o->object_num].cache != NULL &&
96
        ctx->xref_table->xref[o->object_num].cache->o == o) {
97
        outprintf(ctx->memory, "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
16.8k
    pdfi_free_object(o);
101
16.8k
}
pdf_int.c:pdfi_countdown_impl
Line
Count
Source
55
36.8M
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
36.8M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
36.7M
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
77.4k
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    outprintf(ctx->memory, "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
77.4k
    if (o->refcnt != 0)
78
0
        return;
79
#if REFCNT_DEBUG
80
    if (ctx != NULL && ctx->cache_entries != 0) {
81
        pdf_obj_cache_entry *entry = ctx->cache_LRU, *next;
82
83
        while(entry) {
84
            next = entry->next;
85
            if (entry->o->object_num != 0 && entry->o->object_num == o->object_num)
86
                outprintf(ctx->memory, "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    outprintf(ctx->memory, "Freeing object %d, UID %lu\n", o->object_num, o->UID);
91
#endif
92
#ifdef DEBUG
93
    if (ctx->xref_table != NULL && o->object_num > 0 &&
94
        o->object_num < ctx->xref_table->xref_size &&
95
        ctx->xref_table->xref[o->object_num].cache != NULL &&
96
        ctx->xref_table->xref[o->object_num].cache->o == o) {
97
        outprintf(ctx->memory, "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
77.4k
    pdfi_free_object(o);
101
77.4k
}
pdf_file.c:pdfi_countdown_impl
Line
Count
Source
55
29.7M
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
29.7M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
26.3M
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
3.39M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    outprintf(ctx->memory, "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
3.39M
    if (o->refcnt != 0)
78
3.39M
        return;
79
#if REFCNT_DEBUG
80
    if (ctx != NULL && ctx->cache_entries != 0) {
81
        pdf_obj_cache_entry *entry = ctx->cache_LRU, *next;
82
83
        while(entry) {
84
            next = entry->next;
85
            if (entry->o->object_num != 0 && entry->o->object_num == o->object_num)
86
                outprintf(ctx->memory, "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    outprintf(ctx->memory, "Freeing object %d, UID %lu\n", o->object_num, o->UID);
91
#endif
92
#ifdef DEBUG
93
    if (ctx->xref_table != NULL && o->object_num > 0 &&
94
        o->object_num < ctx->xref_table->xref_size &&
95
        ctx->xref_table->xref[o->object_num].cache != NULL &&
96
        ctx->xref_table->xref[o->object_num].cache->o == o) {
97
        outprintf(ctx->memory, "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
0
    pdfi_free_object(o);
101
0
}
Unexecuted instantiation: pdf_path.c:pdfi_countdown_impl
pdf_colour.c:pdfi_countdown_impl
Line
Count
Source
55
4.89M
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
4.89M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
2.12M
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
2.77M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    outprintf(ctx->memory, "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
2.77M
    if (o->refcnt != 0)
78
2.08M
        return;
79
#if REFCNT_DEBUG
80
    if (ctx != NULL && ctx->cache_entries != 0) {
81
        pdf_obj_cache_entry *entry = ctx->cache_LRU, *next;
82
83
        while(entry) {
84
            next = entry->next;
85
            if (entry->o->object_num != 0 && entry->o->object_num == o->object_num)
86
                outprintf(ctx->memory, "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    outprintf(ctx->memory, "Freeing object %d, UID %lu\n", o->object_num, o->UID);
91
#endif
92
#ifdef DEBUG
93
    if (ctx->xref_table != NULL && o->object_num > 0 &&
94
        o->object_num < ctx->xref_table->xref_size &&
95
        ctx->xref_table->xref[o->object_num].cache != NULL &&
96
        ctx->xref_table->xref[o->object_num].cache->o == o) {
97
        outprintf(ctx->memory, "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
690k
    pdfi_free_object(o);
101
690k
}
pdf_pattern.c:pdfi_countdown_impl
Line
Count
Source
55
318k
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
318k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
122k
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
196k
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    outprintf(ctx->memory, "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
196k
    if (o->refcnt != 0)
78
196k
        return;
79
#if REFCNT_DEBUG
80
    if (ctx != NULL && ctx->cache_entries != 0) {
81
        pdf_obj_cache_entry *entry = ctx->cache_LRU, *next;
82
83
        while(entry) {
84
            next = entry->next;
85
            if (entry->o->object_num != 0 && entry->o->object_num == o->object_num)
86
                outprintf(ctx->memory, "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    outprintf(ctx->memory, "Freeing object %d, UID %lu\n", o->object_num, o->UID);
91
#endif
92
#ifdef DEBUG
93
    if (ctx->xref_table != NULL && o->object_num > 0 &&
94
        o->object_num < ctx->xref_table->xref_size &&
95
        ctx->xref_table->xref[o->object_num].cache != NULL &&
96
        ctx->xref_table->xref[o->object_num].cache->o == o) {
97
        outprintf(ctx->memory, "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
0
    pdfi_free_object(o);
101
0
}
pdf_gstate.c:pdfi_countdown_impl
Line
Count
Source
55
116M
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
116M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
59.7M
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
56.5M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    outprintf(ctx->memory, "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
56.5M
    if (o->refcnt != 0)
78
54.6M
        return;
79
#if REFCNT_DEBUG
80
    if (ctx != NULL && ctx->cache_entries != 0) {
81
        pdf_obj_cache_entry *entry = ctx->cache_LRU, *next;
82
83
        while(entry) {
84
            next = entry->next;
85
            if (entry->o->object_num != 0 && entry->o->object_num == o->object_num)
86
                outprintf(ctx->memory, "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    outprintf(ctx->memory, "Freeing object %d, UID %lu\n", o->object_num, o->UID);
91
#endif
92
#ifdef DEBUG
93
    if (ctx->xref_table != NULL && o->object_num > 0 &&
94
        o->object_num < ctx->xref_table->xref_size &&
95
        ctx->xref_table->xref[o->object_num].cache != NULL &&
96
        ctx->xref_table->xref[o->object_num].cache->o == o) {
97
        outprintf(ctx->memory, "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
1.92M
    pdfi_free_object(o);
101
1.92M
}
pdf_stack.c:pdfi_countdown_impl
Line
Count
Source
55
830M
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
830M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
135M
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
694M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    outprintf(ctx->memory, "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
694M
    if (o->refcnt != 0)
78
292M
        return;
79
#if REFCNT_DEBUG
80
    if (ctx != NULL && ctx->cache_entries != 0) {
81
        pdf_obj_cache_entry *entry = ctx->cache_LRU, *next;
82
83
        while(entry) {
84
            next = entry->next;
85
            if (entry->o->object_num != 0 && entry->o->object_num == o->object_num)
86
                outprintf(ctx->memory, "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    outprintf(ctx->memory, "Freeing object %d, UID %lu\n", o->object_num, o->UID);
91
#endif
92
#ifdef DEBUG
93
    if (ctx->xref_table != NULL && o->object_num > 0 &&
94
        o->object_num < ctx->xref_table->xref_size &&
95
        ctx->xref_table->xref[o->object_num].cache != NULL &&
96
        ctx->xref_table->xref[o->object_num].cache->o == o) {
97
        outprintf(ctx->memory, "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
402M
    pdfi_free_object(o);
101
402M
}
pdf_image.c:pdfi_countdown_impl
Line
Count
Source
55
4.32M
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
4.32M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
1.14M
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
3.18M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    outprintf(ctx->memory, "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
3.18M
    if (o->refcnt != 0)
78
2.27M
        return;
79
#if REFCNT_DEBUG
80
    if (ctx != NULL && ctx->cache_entries != 0) {
81
        pdf_obj_cache_entry *entry = ctx->cache_LRU, *next;
82
83
        while(entry) {
84
            next = entry->next;
85
            if (entry->o->object_num != 0 && entry->o->object_num == o->object_num)
86
                outprintf(ctx->memory, "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    outprintf(ctx->memory, "Freeing object %d, UID %lu\n", o->object_num, o->UID);
91
#endif
92
#ifdef DEBUG
93
    if (ctx->xref_table != NULL && o->object_num > 0 &&
94
        o->object_num < ctx->xref_table->xref_size &&
95
        ctx->xref_table->xref[o->object_num].cache != NULL &&
96
        ctx->xref_table->xref[o->object_num].cache->o == o) {
97
        outprintf(ctx->memory, "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
908k
    pdfi_free_object(o);
101
908k
}
pdf_page.c:pdfi_countdown_impl
Line
Count
Source
55
2.37M
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
2.37M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
361k
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
2.00M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    outprintf(ctx->memory, "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
2.00M
    if (o->refcnt != 0)
78
2.00M
        return;
79
#if REFCNT_DEBUG
80
    if (ctx != NULL && ctx->cache_entries != 0) {
81
        pdf_obj_cache_entry *entry = ctx->cache_LRU, *next;
82
83
        while(entry) {
84
            next = entry->next;
85
            if (entry->o->object_num != 0 && entry->o->object_num == o->object_num)
86
                outprintf(ctx->memory, "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    outprintf(ctx->memory, "Freeing object %d, UID %lu\n", o->object_num, o->UID);
91
#endif
92
#ifdef DEBUG
93
    if (ctx->xref_table != NULL && o->object_num > 0 &&
94
        o->object_num < ctx->xref_table->xref_size &&
95
        ctx->xref_table->xref[o->object_num].cache != NULL &&
96
        ctx->xref_table->xref[o->object_num].cache->o == o) {
97
        outprintf(ctx->memory, "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
1.12k
    pdfi_free_object(o);
101
1.12k
}
pdf_annot.c:pdfi_countdown_impl
Line
Count
Source
55
6.79M
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
6.79M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
2.37M
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
4.42M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    outprintf(ctx->memory, "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
4.42M
    if (o->refcnt != 0)
78
4.36M
        return;
79
#if REFCNT_DEBUG
80
    if (ctx != NULL && ctx->cache_entries != 0) {
81
        pdf_obj_cache_entry *entry = ctx->cache_LRU, *next;
82
83
        while(entry) {
84
            next = entry->next;
85
            if (entry->o->object_num != 0 && entry->o->object_num == o->object_num)
86
                outprintf(ctx->memory, "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    outprintf(ctx->memory, "Freeing object %d, UID %lu\n", o->object_num, o->UID);
91
#endif
92
#ifdef DEBUG
93
    if (ctx->xref_table != NULL && o->object_num > 0 &&
94
        o->object_num < ctx->xref_table->xref_size &&
95
        ctx->xref_table->xref[o->object_num].cache != NULL &&
96
        ctx->xref_table->xref[o->object_num].cache->o == o) {
97
        outprintf(ctx->memory, "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
67.1k
    pdfi_free_object(o);
101
67.1k
}
pdf_mark.c:pdfi_countdown_impl
Line
Count
Source
55
1.69M
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
1.69M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
716k
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
973k
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    outprintf(ctx->memory, "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
973k
    if (o->refcnt != 0)
78
935k
        return;
79
#if REFCNT_DEBUG
80
    if (ctx != NULL && ctx->cache_entries != 0) {
81
        pdf_obj_cache_entry *entry = ctx->cache_LRU, *next;
82
83
        while(entry) {
84
            next = entry->next;
85
            if (entry->o->object_num != 0 && entry->o->object_num == o->object_num)
86
                outprintf(ctx->memory, "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    outprintf(ctx->memory, "Freeing object %d, UID %lu\n", o->object_num, o->UID);
91
#endif
92
#ifdef DEBUG
93
    if (ctx->xref_table != NULL && o->object_num > 0 &&
94
        o->object_num < ctx->xref_table->xref_size &&
95
        ctx->xref_table->xref[o->object_num].cache != NULL &&
96
        ctx->xref_table->xref[o->object_num].cache->o == o) {
97
        outprintf(ctx->memory, "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
38.7k
    pdfi_free_object(o);
101
38.7k
}
pdf_font.c:pdfi_countdown_impl
Line
Count
Source
55
324M
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
324M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
18.7M
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
305M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    outprintf(ctx->memory, "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
305M
    if (o->refcnt != 0)
78
297M
        return;
79
#if REFCNT_DEBUG
80
    if (ctx != NULL && ctx->cache_entries != 0) {
81
        pdf_obj_cache_entry *entry = ctx->cache_LRU, *next;
82
83
        while(entry) {
84
            next = entry->next;
85
            if (entry->o->object_num != 0 && entry->o->object_num == o->object_num)
86
                outprintf(ctx->memory, "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    outprintf(ctx->memory, "Freeing object %d, UID %lu\n", o->object_num, o->UID);
91
#endif
92
#ifdef DEBUG
93
    if (ctx->xref_table != NULL && o->object_num > 0 &&
94
        o->object_num < ctx->xref_table->xref_size &&
95
        ctx->xref_table->xref[o->object_num].cache != NULL &&
96
        ctx->xref_table->xref[o->object_num].cache->o == o) {
97
        outprintf(ctx->memory, "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
7.83M
    pdfi_free_object(o);
101
7.83M
}
pdf_font0.c:pdfi_countdown_impl
Line
Count
Source
55
1.94M
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
1.94M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
358k
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
1.59M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    outprintf(ctx->memory, "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
1.59M
    if (o->refcnt != 0)
78
1.47M
        return;
79
#if REFCNT_DEBUG
80
    if (ctx != NULL && ctx->cache_entries != 0) {
81
        pdf_obj_cache_entry *entry = ctx->cache_LRU, *next;
82
83
        while(entry) {
84
            next = entry->next;
85
            if (entry->o->object_num != 0 && entry->o->object_num == o->object_num)
86
                outprintf(ctx->memory, "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    outprintf(ctx->memory, "Freeing object %d, UID %lu\n", o->object_num, o->UID);
91
#endif
92
#ifdef DEBUG
93
    if (ctx->xref_table != NULL && o->object_num > 0 &&
94
        o->object_num < ctx->xref_table->xref_size &&
95
        ctx->xref_table->xref[o->object_num].cache != NULL &&
96
        ctx->xref_table->xref[o->object_num].cache->o == o) {
97
        outprintf(ctx->memory, "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
112k
    pdfi_free_object(o);
101
112k
}
pdf_font1.c:pdfi_countdown_impl
Line
Count
Source
55
382M
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
382M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
11.6M
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
370M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    outprintf(ctx->memory, "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
370M
    if (o->refcnt != 0)
78
268M
        return;
79
#if REFCNT_DEBUG
80
    if (ctx != NULL && ctx->cache_entries != 0) {
81
        pdf_obj_cache_entry *entry = ctx->cache_LRU, *next;
82
83
        while(entry) {
84
            next = entry->next;
85
            if (entry->o->object_num != 0 && entry->o->object_num == o->object_num)
86
                outprintf(ctx->memory, "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    outprintf(ctx->memory, "Freeing object %d, UID %lu\n", o->object_num, o->UID);
91
#endif
92
#ifdef DEBUG
93
    if (ctx->xref_table != NULL && o->object_num > 0 &&
94
        o->object_num < ctx->xref_table->xref_size &&
95
        ctx->xref_table->xref[o->object_num].cache != NULL &&
96
        ctx->xref_table->xref[o->object_num].cache->o == o) {
97
        outprintf(ctx->memory, "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
102M
    pdfi_free_object(o);
101
102M
}
pdf_font1C.c:pdfi_countdown_impl
Line
Count
Source
55
7.29M
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
7.29M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
583k
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
6.71M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    outprintf(ctx->memory, "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
6.71M
    if (o->refcnt != 0)
78
4.31M
        return;
79
#if REFCNT_DEBUG
80
    if (ctx != NULL && ctx->cache_entries != 0) {
81
        pdf_obj_cache_entry *entry = ctx->cache_LRU, *next;
82
83
        while(entry) {
84
            next = entry->next;
85
            if (entry->o->object_num != 0 && entry->o->object_num == o->object_num)
86
                outprintf(ctx->memory, "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    outprintf(ctx->memory, "Freeing object %d, UID %lu\n", o->object_num, o->UID);
91
#endif
92
#ifdef DEBUG
93
    if (ctx->xref_table != NULL && o->object_num > 0 &&
94
        o->object_num < ctx->xref_table->xref_size &&
95
        ctx->xref_table->xref[o->object_num].cache != NULL &&
96
        ctx->xref_table->xref[o->object_num].cache->o == o) {
97
        outprintf(ctx->memory, "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
2.40M
    pdfi_free_object(o);
101
2.40M
}
pdf_fontps.c:pdfi_countdown_impl
Line
Count
Source
55
102M
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
102M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
433k
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
102M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    outprintf(ctx->memory, "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
102M
    if (o->refcnt != 0)
78
102M
        return;
79
#if REFCNT_DEBUG
80
    if (ctx != NULL && ctx->cache_entries != 0) {
81
        pdf_obj_cache_entry *entry = ctx->cache_LRU, *next;
82
83
        while(entry) {
84
            next = entry->next;
85
            if (entry->o->object_num != 0 && entry->o->object_num == o->object_num)
86
                outprintf(ctx->memory, "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    outprintf(ctx->memory, "Freeing object %d, UID %lu\n", o->object_num, o->UID);
91
#endif
92
#ifdef DEBUG
93
    if (ctx->xref_table != NULL && o->object_num > 0 &&
94
        o->object_num < ctx->xref_table->xref_size &&
95
        ctx->xref_table->xref[o->object_num].cache != NULL &&
96
        ctx->xref_table->xref[o->object_num].cache->o == o) {
97
        outprintf(ctx->memory, "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
66.7k
    pdfi_free_object(o);
101
66.7k
}
pdf_font3.c:pdfi_countdown_impl
Line
Count
Source
55
198k
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
198k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
53.2k
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
145k
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    outprintf(ctx->memory, "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
145k
    if (o->refcnt != 0)
78
136k
        return;
79
#if REFCNT_DEBUG
80
    if (ctx != NULL && ctx->cache_entries != 0) {
81
        pdf_obj_cache_entry *entry = ctx->cache_LRU, *next;
82
83
        while(entry) {
84
            next = entry->next;
85
            if (entry->o->object_num != 0 && entry->o->object_num == o->object_num)
86
                outprintf(ctx->memory, "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    outprintf(ctx->memory, "Freeing object %d, UID %lu\n", o->object_num, o->UID);
91
#endif
92
#ifdef DEBUG
93
    if (ctx->xref_table != NULL && o->object_num > 0 &&
94
        o->object_num < ctx->xref_table->xref_size &&
95
        ctx->xref_table->xref[o->object_num].cache != NULL &&
96
        ctx->xref_table->xref[o->object_num].cache->o == o) {
97
        outprintf(ctx->memory, "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
9.17k
    pdfi_free_object(o);
101
9.17k
}
pdf_fontTT.c:pdfi_countdown_impl
Line
Count
Source
55
24.0M
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
24.0M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
4.13M
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
19.9M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    outprintf(ctx->memory, "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
19.9M
    if (o->refcnt != 0)
78
15.7M
        return;
79
#if REFCNT_DEBUG
80
    if (ctx != NULL && ctx->cache_entries != 0) {
81
        pdf_obj_cache_entry *entry = ctx->cache_LRU, *next;
82
83
        while(entry) {
84
            next = entry->next;
85
            if (entry->o->object_num != 0 && entry->o->object_num == o->object_num)
86
                outprintf(ctx->memory, "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    outprintf(ctx->memory, "Freeing object %d, UID %lu\n", o->object_num, o->UID);
91
#endif
92
#ifdef DEBUG
93
    if (ctx->xref_table != NULL && o->object_num > 0 &&
94
        o->object_num < ctx->xref_table->xref_size &&
95
        ctx->xref_table->xref[o->object_num].cache != NULL &&
96
        ctx->xref_table->xref[o->object_num].cache->o == o) {
97
        outprintf(ctx->memory, "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
4.18M
    pdfi_free_object(o);
101
4.18M
}
pdf_font11.c:pdfi_countdown_impl
Line
Count
Source
55
339k
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
339k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
172k
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
167k
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    outprintf(ctx->memory, "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
167k
    if (o->refcnt != 0)
78
78.8k
        return;
79
#if REFCNT_DEBUG
80
    if (ctx != NULL && ctx->cache_entries != 0) {
81
        pdf_obj_cache_entry *entry = ctx->cache_LRU, *next;
82
83
        while(entry) {
84
            next = entry->next;
85
            if (entry->o->object_num != 0 && entry->o->object_num == o->object_num)
86
                outprintf(ctx->memory, "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    outprintf(ctx->memory, "Freeing object %d, UID %lu\n", o->object_num, o->UID);
91
#endif
92
#ifdef DEBUG
93
    if (ctx->xref_table != NULL && o->object_num > 0 &&
94
        o->object_num < ctx->xref_table->xref_size &&
95
        ctx->xref_table->xref[o->object_num].cache != NULL &&
96
        ctx->xref_table->xref[o->object_num].cache->o == o) {
97
        outprintf(ctx->memory, "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
88.6k
    pdfi_free_object(o);
101
88.6k
}
pdf_cmap.c:pdfi_countdown_impl
Line
Count
Source
55
91.4k
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
91.4k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
90.4k
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
1.02k
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    outprintf(ctx->memory, "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
1.02k
    if (o->refcnt != 0)
78
335
        return;
79
#if REFCNT_DEBUG
80
    if (ctx != NULL && ctx->cache_entries != 0) {
81
        pdf_obj_cache_entry *entry = ctx->cache_LRU, *next;
82
83
        while(entry) {
84
            next = entry->next;
85
            if (entry->o->object_num != 0 && entry->o->object_num == o->object_num)
86
                outprintf(ctx->memory, "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    outprintf(ctx->memory, "Freeing object %d, UID %lu\n", o->object_num, o->UID);
91
#endif
92
#ifdef DEBUG
93
    if (ctx->xref_table != NULL && o->object_num > 0 &&
94
        o->object_num < ctx->xref_table->xref_size &&
95
        ctx->xref_table->xref[o->object_num].cache != NULL &&
96
        ctx->xref_table->xref[o->object_num].cache->o == o) {
97
        outprintf(ctx->memory, "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
689
    pdfi_free_object(o);
101
689
}
pdf_fmap.c:pdfi_countdown_impl
Line
Count
Source
55
3.68M
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
3.68M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
3.57M
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
108k
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    outprintf(ctx->memory, "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
108k
    if (o->refcnt != 0)
78
108k
        return;
79
#if REFCNT_DEBUG
80
    if (ctx != NULL && ctx->cache_entries != 0) {
81
        pdf_obj_cache_entry *entry = ctx->cache_LRU, *next;
82
83
        while(entry) {
84
            next = entry->next;
85
            if (entry->o->object_num != 0 && entry->o->object_num == o->object_num)
86
                outprintf(ctx->memory, "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    outprintf(ctx->memory, "Freeing object %d, UID %lu\n", o->object_num, o->UID);
91
#endif
92
#ifdef DEBUG
93
    if (ctx->xref_table != NULL && o->object_num > 0 &&
94
        o->object_num < ctx->xref_table->xref_size &&
95
        ctx->xref_table->xref[o->object_num].cache != NULL &&
96
        ctx->xref_table->xref[o->object_num].cache->o == o) {
97
        outprintf(ctx->memory, "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
0
    pdfi_free_object(o);
101
0
}
pdf_text.c:pdfi_countdown_impl
Line
Count
Source
55
43.2M
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
43.2M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
2.85M
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
40.4M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    outprintf(ctx->memory, "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
40.4M
    if (o->refcnt != 0)
78
34.9M
        return;
79
#if REFCNT_DEBUG
80
    if (ctx != NULL && ctx->cache_entries != 0) {
81
        pdf_obj_cache_entry *entry = ctx->cache_LRU, *next;
82
83
        while(entry) {
84
            next = entry->next;
85
            if (entry->o->object_num != 0 && entry->o->object_num == o->object_num)
86
                outprintf(ctx->memory, "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    outprintf(ctx->memory, "Freeing object %d, UID %lu\n", o->object_num, o->UID);
91
#endif
92
#ifdef DEBUG
93
    if (ctx->xref_table != NULL && o->object_num > 0 &&
94
        o->object_num < ctx->xref_table->xref_size &&
95
        ctx->xref_table->xref[o->object_num].cache != NULL &&
96
        ctx->xref_table->xref[o->object_num].cache->o == o) {
97
        outprintf(ctx->memory, "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
5.53M
    pdfi_free_object(o);
101
5.53M
}
pdf_shading.c:pdfi_countdown_impl
Line
Count
Source
55
835k
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
835k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
224k
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
610k
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    outprintf(ctx->memory, "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
610k
    if (o->refcnt != 0)
78
273k
        return;
79
#if REFCNT_DEBUG
80
    if (ctx != NULL && ctx->cache_entries != 0) {
81
        pdf_obj_cache_entry *entry = ctx->cache_LRU, *next;
82
83
        while(entry) {
84
            next = entry->next;
85
            if (entry->o->object_num != 0 && entry->o->object_num == o->object_num)
86
                outprintf(ctx->memory, "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    outprintf(ctx->memory, "Freeing object %d, UID %lu\n", o->object_num, o->UID);
91
#endif
92
#ifdef DEBUG
93
    if (ctx->xref_table != NULL && o->object_num > 0 &&
94
        o->object_num < ctx->xref_table->xref_size &&
95
        ctx->xref_table->xref[o->object_num].cache != NULL &&
96
        ctx->xref_table->xref[o->object_num].cache->o == o) {
97
        outprintf(ctx->memory, "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
337k
    pdfi_free_object(o);
101
337k
}
pdf_func.c:pdfi_countdown_impl
Line
Count
Source
55
167k
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
167k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
14
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
167k
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    outprintf(ctx->memory, "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
167k
    if (o->refcnt != 0)
78
167k
        return;
79
#if REFCNT_DEBUG
80
    if (ctx != NULL && ctx->cache_entries != 0) {
81
        pdf_obj_cache_entry *entry = ctx->cache_LRU, *next;
82
83
        while(entry) {
84
            next = entry->next;
85
            if (entry->o->object_num != 0 && entry->o->object_num == o->object_num)
86
                outprintf(ctx->memory, "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    outprintf(ctx->memory, "Freeing object %d, UID %lu\n", o->object_num, o->UID);
91
#endif
92
#ifdef DEBUG
93
    if (ctx->xref_table != NULL && o->object_num > 0 &&
94
        o->object_num < ctx->xref_table->xref_size &&
95
        ctx->xref_table->xref[o->object_num].cache != NULL &&
96
        ctx->xref_table->xref[o->object_num].cache->o == o) {
97
        outprintf(ctx->memory, "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
0
    pdfi_free_object(o);
101
0
}
pdf_trans.c:pdfi_countdown_impl
Line
Count
Source
55
171k
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
171k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
82.6k
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
88.8k
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    outprintf(ctx->memory, "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
88.8k
    if (o->refcnt != 0)
78
88.8k
        return;
79
#if REFCNT_DEBUG
80
    if (ctx != NULL && ctx->cache_entries != 0) {
81
        pdf_obj_cache_entry *entry = ctx->cache_LRU, *next;
82
83
        while(entry) {
84
            next = entry->next;
85
            if (entry->o->object_num != 0 && entry->o->object_num == o->object_num)
86
                outprintf(ctx->memory, "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    outprintf(ctx->memory, "Freeing object %d, UID %lu\n", o->object_num, o->UID);
91
#endif
92
#ifdef DEBUG
93
    if (ctx->xref_table != NULL && o->object_num > 0 &&
94
        o->object_num < ctx->xref_table->xref_size &&
95
        ctx->xref_table->xref[o->object_num].cache != NULL &&
96
        ctx->xref_table->xref[o->object_num].cache->o == o) {
97
        outprintf(ctx->memory, "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
0
    pdfi_free_object(o);
101
0
}
Unexecuted instantiation: pdf_device.c:pdfi_countdown_impl
Unexecuted instantiation: pdf_misc.c:pdfi_countdown_impl
pdf_optcontent.c:pdfi_countdown_impl
Line
Count
Source
55
3.29M
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
3.29M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
1.67M
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
1.61M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    outprintf(ctx->memory, "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
1.61M
    if (o->refcnt != 0)
78
459k
        return;
79
#if REFCNT_DEBUG
80
    if (ctx != NULL && ctx->cache_entries != 0) {
81
        pdf_obj_cache_entry *entry = ctx->cache_LRU, *next;
82
83
        while(entry) {
84
            next = entry->next;
85
            if (entry->o->object_num != 0 && entry->o->object_num == o->object_num)
86
                outprintf(ctx->memory, "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    outprintf(ctx->memory, "Freeing object %d, UID %lu\n", o->object_num, o->UID);
91
#endif
92
#ifdef DEBUG
93
    if (ctx->xref_table != NULL && o->object_num > 0 &&
94
        o->object_num < ctx->xref_table->xref_size &&
95
        ctx->xref_table->xref[o->object_num].cache != NULL &&
96
        ctx->xref_table->xref[o->object_num].cache->o == o) {
97
        outprintf(ctx->memory, "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
1.15M
    pdfi_free_object(o);
101
1.15M
}
pdf_check.c:pdfi_countdown_impl
Line
Count
Source
55
17.9M
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
17.9M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
9.16M
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
8.75M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    outprintf(ctx->memory, "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
8.75M
    if (o->refcnt != 0)
78
8.72M
        return;
79
#if REFCNT_DEBUG
80
    if (ctx != NULL && ctx->cache_entries != 0) {
81
        pdf_obj_cache_entry *entry = ctx->cache_LRU, *next;
82
83
        while(entry) {
84
            next = entry->next;
85
            if (entry->o->object_num != 0 && entry->o->object_num == o->object_num)
86
                outprintf(ctx->memory, "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    outprintf(ctx->memory, "Freeing object %d, UID %lu\n", o->object_num, o->UID);
91
#endif
92
#ifdef DEBUG
93
    if (ctx->xref_table != NULL && o->object_num > 0 &&
94
        o->object_num < ctx->xref_table->xref_size &&
95
        ctx->xref_table->xref[o->object_num].cache != NULL &&
96
        ctx->xref_table->xref[o->object_num].cache->o == o) {
97
        outprintf(ctx->memory, "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
31.1k
    pdfi_free_object(o);
101
31.1k
}
pdf_sec.c:pdfi_countdown_impl
Line
Count
Source
55
39.4k
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
39.4k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
4.36k
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
35.1k
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    outprintf(ctx->memory, "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
35.1k
    if (o->refcnt != 0)
78
19.6k
        return;
79
#if REFCNT_DEBUG
80
    if (ctx != NULL && ctx->cache_entries != 0) {
81
        pdf_obj_cache_entry *entry = ctx->cache_LRU, *next;
82
83
        while(entry) {
84
            next = entry->next;
85
            if (entry->o->object_num != 0 && entry->o->object_num == o->object_num)
86
                outprintf(ctx->memory, "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    outprintf(ctx->memory, "Freeing object %d, UID %lu\n", o->object_num, o->UID);
91
#endif
92
#ifdef DEBUG
93
    if (ctx->xref_table != NULL && o->object_num > 0 &&
94
        o->object_num < ctx->xref_table->xref_size &&
95
        ctx->xref_table->xref[o->object_num].cache != NULL &&
96
        ctx->xref_table->xref[o->object_num].cache->o == o) {
97
        outprintf(ctx->memory, "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
15.4k
    pdfi_free_object(o);
101
15.4k
}
Unexecuted instantiation: pdf_utf8.c:pdfi_countdown_impl
pdf_deref.c:pdfi_countdown_impl
Line
Count
Source
55
5.06M
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
5.06M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
165k
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
4.89M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    outprintf(ctx->memory, "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
4.89M
    if (o->refcnt != 0)
78
4.67M
        return;
79
#if REFCNT_DEBUG
80
    if (ctx != NULL && ctx->cache_entries != 0) {
81
        pdf_obj_cache_entry *entry = ctx->cache_LRU, *next;
82
83
        while(entry) {
84
            next = entry->next;
85
            if (entry->o->object_num != 0 && entry->o->object_num == o->object_num)
86
                outprintf(ctx->memory, "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    outprintf(ctx->memory, "Freeing object %d, UID %lu\n", o->object_num, o->UID);
91
#endif
92
#ifdef DEBUG
93
    if (ctx->xref_table != NULL && o->object_num > 0 &&
94
        o->object_num < ctx->xref_table->xref_size &&
95
        ctx->xref_table->xref[o->object_num].cache != NULL &&
96
        ctx->xref_table->xref[o->object_num].cache->o == o) {
97
        outprintf(ctx->memory, "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
219k
    pdfi_free_object(o);
101
219k
}
pdf_repair.c:pdfi_countdown_impl
Line
Count
Source
55
3.76M
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
3.76M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
1.99M
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
1.76M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    outprintf(ctx->memory, "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
1.76M
    if (o->refcnt != 0)
78
1.65M
        return;
79
#if REFCNT_DEBUG
80
    if (ctx != NULL && ctx->cache_entries != 0) {
81
        pdf_obj_cache_entry *entry = ctx->cache_LRU, *next;
82
83
        while(entry) {
84
            next = entry->next;
85
            if (entry->o->object_num != 0 && entry->o->object_num == o->object_num)
86
                outprintf(ctx->memory, "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    outprintf(ctx->memory, "Freeing object %d, UID %lu\n", o->object_num, o->UID);
91
#endif
92
#ifdef DEBUG
93
    if (ctx->xref_table != NULL && o->object_num > 0 &&
94
        o->object_num < ctx->xref_table->xref_size &&
95
        ctx->xref_table->xref[o->object_num].cache != NULL &&
96
        ctx->xref_table->xref[o->object_num].cache->o == o) {
97
        outprintf(ctx->memory, "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
112k
    pdfi_free_object(o);
101
112k
}
pdf_obj.c:pdfi_countdown_impl
Line
Count
Source
55
2.54M
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
2.54M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
279k
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
2.26M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    outprintf(ctx->memory, "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
2.26M
    if (o->refcnt != 0)
78
1.39M
        return;
79
#if REFCNT_DEBUG
80
    if (ctx != NULL && ctx->cache_entries != 0) {
81
        pdf_obj_cache_entry *entry = ctx->cache_LRU, *next;
82
83
        while(entry) {
84
            next = entry->next;
85
            if (entry->o->object_num != 0 && entry->o->object_num == o->object_num)
86
                outprintf(ctx->memory, "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    outprintf(ctx->memory, "Freeing object %d, UID %lu\n", o->object_num, o->UID);
91
#endif
92
#ifdef DEBUG
93
    if (ctx->xref_table != NULL && o->object_num > 0 &&
94
        o->object_num < ctx->xref_table->xref_size &&
95
        ctx->xref_table->xref[o->object_num].cache != NULL &&
96
        ctx->xref_table->xref[o->object_num].cache->o == o) {
97
        outprintf(ctx->memory, "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
866k
    pdfi_free_object(o);
101
866k
}
pdf_doc.c:pdfi_countdown_impl
Line
Count
Source
55
31.8M
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
31.8M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
18.1M
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
13.7M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    outprintf(ctx->memory, "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
13.7M
    if (o->refcnt != 0)
78
13.3M
        return;
79
#if REFCNT_DEBUG
80
    if (ctx != NULL && ctx->cache_entries != 0) {
81
        pdf_obj_cache_entry *entry = ctx->cache_LRU, *next;
82
83
        while(entry) {
84
            next = entry->next;
85
            if (entry->o->object_num != 0 && entry->o->object_num == o->object_num)
86
                outprintf(ctx->memory, "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    outprintf(ctx->memory, "Freeing object %d, UID %lu\n", o->object_num, o->UID);
91
#endif
92
#ifdef DEBUG
93
    if (ctx->xref_table != NULL && o->object_num > 0 &&
94
        o->object_num < ctx->xref_table->xref_size &&
95
        ctx->xref_table->xref[o->object_num].cache != NULL &&
96
        ctx->xref_table->xref[o->object_num].cache->o == o) {
97
        outprintf(ctx->memory, "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
354k
    pdfi_free_object(o);
101
354k
}
pdf_fapi.c:pdfi_countdown_impl
Line
Count
Source
55
62.6M
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
62.6M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
174
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
62.6M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    outprintf(ctx->memory, "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
62.6M
    if (o->refcnt != 0)
78
43.7M
        return;
79
#if REFCNT_DEBUG
80
    if (ctx != NULL && ctx->cache_entries != 0) {
81
        pdf_obj_cache_entry *entry = ctx->cache_LRU, *next;
82
83
        while(entry) {
84
            next = entry->next;
85
            if (entry->o->object_num != 0 && entry->o->object_num == o->object_num)
86
                outprintf(ctx->memory, "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    outprintf(ctx->memory, "Freeing object %d, UID %lu\n", o->object_num, o->UID);
91
#endif
92
#ifdef DEBUG
93
    if (ctx->xref_table != NULL && o->object_num > 0 &&
94
        o->object_num < ctx->xref_table->xref_size &&
95
        ctx->xref_table->xref[o->object_num].cache != NULL &&
96
        ctx->xref_table->xref[o->object_num].cache->o == o) {
97
        outprintf(ctx->memory, "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
18.8M
    pdfi_free_object(o);
101
18.8M
}
102
103
/* These two macros are present simply to add a cast to the generic object type, so that
104
 * we don't get warnings in the implementation routines, the alternative would be to use
105
 * a cast everywhere we use the inline functions above, or to have them take a void *
106
 *
107
 * Ordinarily we would capitalise the name of a macro to differentiate it from a function
108
 * we make an exception in this case because hte macro descends to an inline function which
109
 * can be debugged without expanding macros.
110
 */
111
2.40G
#define pdfi_countup(x) pdfi_countup_impl((pdf_obj *)x)
112
113
2.75G
#define pdfi_countdown(x) pdfi_countdown_impl((pdf_obj *)x)
114
115
/* Why two functions ? The difference is that when interpreting 'sub' streams
116
 * such as the content stream for a Form XObject, we may have entries on the
117
 * stack at the start of the stream interpretation, and we don't want to
118
 * pop any of those off during the course of the stream. The stack depth stored in
119
 * the context is used to prevent this in pdfi_pop().
120
 * This means that, during the course of a stream, the stack top - bottom may
121
 * not be an accurate reflection of the number of available items on the stack.
122
 *
123
 * So pdfi_count_stack() returns the number of available items, and
124
 * pdfi_count_stack_total() returns the entire size of the stack, and is used to
125
 * record the saved stack depth when we start a stream.
126
 *
127
 * Although these are currently simple calculations, they are abstracted in order
128
 * to facilitate later replacement if required.
129
 */
130
static inline int pdfi_count_total_stack(pdf_context *ctx)
131
1.16G
{
132
1.16G
    return (ctx->stack_top - ctx->stack_bot);
133
1.16G
}
Unexecuted instantiation: zpdfops.c:pdfi_count_total_stack
Unexecuted instantiation: ghostpdf.c:pdfi_count_total_stack
Unexecuted instantiation: pdf_dict.c:pdfi_count_total_stack
Unexecuted instantiation: pdf_array.c:pdfi_count_total_stack
pdf_xref.c:pdfi_count_total_stack
Line
Count
Source
131
641k
{
132
641k
    return (ctx->stack_top - ctx->stack_bot);
133
641k
}
pdf_int.c:pdfi_count_total_stack
Line
Count
Source
131
453M
{
132
453M
    return (ctx->stack_top - ctx->stack_bot);
133
453M
}
Unexecuted instantiation: pdf_file.c:pdfi_count_total_stack
Unexecuted instantiation: pdf_path.c:pdfi_count_total_stack
pdf_colour.c:pdfi_count_total_stack
Line
Count
Source
131
1.32M
{
132
1.32M
    return (ctx->stack_top - ctx->stack_bot);
133
1.32M
}
Unexecuted instantiation: pdf_pattern.c:pdfi_count_total_stack
pdf_gstate.c:pdfi_count_total_stack
Line
Count
Source
131
11.8M
{
132
11.8M
    return (ctx->stack_top - ctx->stack_bot);
133
11.8M
}
pdf_stack.c:pdfi_count_total_stack
Line
Count
Source
131
608M
{
132
608M
    return (ctx->stack_top - ctx->stack_bot);
133
608M
}
pdf_image.c:pdfi_count_total_stack
Line
Count
Source
131
380k
{
132
380k
    return (ctx->stack_top - ctx->stack_bot);
133
380k
}
Unexecuted instantiation: pdf_page.c:pdfi_count_total_stack
Unexecuted instantiation: pdf_annot.c:pdfi_count_total_stack
Unexecuted instantiation: pdf_mark.c:pdfi_count_total_stack
pdf_font.c:pdfi_count_total_stack
Line
Count
Source
131
2.22M
{
132
2.22M
    return (ctx->stack_top - ctx->stack_bot);
133
2.22M
}
Unexecuted instantiation: pdf_font0.c:pdfi_count_total_stack
Unexecuted instantiation: pdf_font1.c:pdfi_count_total_stack
Unexecuted instantiation: pdf_font1C.c:pdfi_count_total_stack
Unexecuted instantiation: pdf_fontps.c:pdfi_count_total_stack
Unexecuted instantiation: pdf_font3.c:pdfi_count_total_stack
Unexecuted instantiation: pdf_fontTT.c:pdfi_count_total_stack
Unexecuted instantiation: pdf_font11.c:pdfi_count_total_stack
Unexecuted instantiation: pdf_cmap.c:pdfi_count_total_stack
pdf_fmap.c:pdfi_count_total_stack
Line
Count
Source
131
105k
{
132
105k
    return (ctx->stack_top - ctx->stack_bot);
133
105k
}
pdf_text.c:pdfi_count_total_stack
Line
Count
Source
131
5.71M
{
132
5.71M
    return (ctx->stack_top - ctx->stack_bot);
133
5.71M
}
pdf_shading.c:pdfi_count_total_stack
Line
Count
Source
131
353k
{
132
353k
    return (ctx->stack_top - ctx->stack_bot);
133
353k
}
Unexecuted instantiation: pdf_func.c:pdfi_count_total_stack
Unexecuted instantiation: pdf_trans.c:pdfi_count_total_stack
Unexecuted instantiation: pdf_device.c:pdfi_count_total_stack
Unexecuted instantiation: pdf_misc.c:pdfi_count_total_stack
pdf_optcontent.c:pdfi_count_total_stack
Line
Count
Source
131
611k
{
132
611k
    return (ctx->stack_top - ctx->stack_bot);
133
611k
}
Unexecuted instantiation: pdf_check.c:pdfi_count_total_stack
Unexecuted instantiation: pdf_sec.c:pdfi_count_total_stack
Unexecuted instantiation: pdf_utf8.c:pdfi_count_total_stack
pdf_deref.c:pdfi_count_total_stack
Line
Count
Source
131
23.1M
{
132
23.1M
    return (ctx->stack_top - ctx->stack_bot);
133
23.1M
}
pdf_repair.c:pdfi_count_total_stack
Line
Count
Source
131
55.6M
{
132
55.6M
    return (ctx->stack_top - ctx->stack_bot);
133
55.6M
}
Unexecuted instantiation: pdf_obj.c:pdfi_count_total_stack
Unexecuted instantiation: pdf_doc.c:pdfi_count_total_stack
Unexecuted instantiation: pdf_fapi.c:pdfi_count_total_stack
134
135
static inline int pdfi_count_stack(pdf_context *ctx)
136
1.16G
{
137
1.16G
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
1.16G
}
Unexecuted instantiation: zpdfops.c:pdfi_count_stack
Unexecuted instantiation: ghostpdf.c:pdfi_count_stack
Unexecuted instantiation: pdf_dict.c:pdfi_count_stack
Unexecuted instantiation: pdf_array.c:pdfi_count_stack
pdf_xref.c:pdfi_count_stack
Line
Count
Source
136
641k
{
137
641k
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
641k
}
pdf_int.c:pdfi_count_stack
Line
Count
Source
136
453M
{
137
453M
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
453M
}
Unexecuted instantiation: pdf_file.c:pdfi_count_stack
Unexecuted instantiation: pdf_path.c:pdfi_count_stack
pdf_colour.c:pdfi_count_stack
Line
Count
Source
136
1.32M
{
137
1.32M
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
1.32M
}
Unexecuted instantiation: pdf_pattern.c:pdfi_count_stack
pdf_gstate.c:pdfi_count_stack
Line
Count
Source
136
11.8M
{
137
11.8M
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
11.8M
}
pdf_stack.c:pdfi_count_stack
Line
Count
Source
136
607M
{
137
607M
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
607M
}
pdf_image.c:pdfi_count_stack
Line
Count
Source
136
380k
{
137
380k
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
380k
}
Unexecuted instantiation: pdf_page.c:pdfi_count_stack
Unexecuted instantiation: pdf_annot.c:pdfi_count_stack
Unexecuted instantiation: pdf_mark.c:pdfi_count_stack
pdf_font.c:pdfi_count_stack
Line
Count
Source
136
2.22M
{
137
2.22M
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
2.22M
}
Unexecuted instantiation: pdf_font0.c:pdfi_count_stack
Unexecuted instantiation: pdf_font1.c:pdfi_count_stack
Unexecuted instantiation: pdf_font1C.c:pdfi_count_stack
Unexecuted instantiation: pdf_fontps.c:pdfi_count_stack
Unexecuted instantiation: pdf_font3.c:pdfi_count_stack
Unexecuted instantiation: pdf_fontTT.c:pdfi_count_stack
Unexecuted instantiation: pdf_font11.c:pdfi_count_stack
Unexecuted instantiation: pdf_cmap.c:pdfi_count_stack
pdf_fmap.c:pdfi_count_stack
Line
Count
Source
136
105k
{
137
105k
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
105k
}
pdf_text.c:pdfi_count_stack
Line
Count
Source
136
5.71M
{
137
5.71M
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
5.71M
}
pdf_shading.c:pdfi_count_stack
Line
Count
Source
136
353k
{
137
353k
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
353k
}
Unexecuted instantiation: pdf_func.c:pdfi_count_stack
Unexecuted instantiation: pdf_trans.c:pdfi_count_stack
Unexecuted instantiation: pdf_device.c:pdfi_count_stack
Unexecuted instantiation: pdf_misc.c:pdfi_count_stack
pdf_optcontent.c:pdfi_count_stack
Line
Count
Source
136
611k
{
137
611k
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
611k
}
Unexecuted instantiation: pdf_check.c:pdfi_count_stack
Unexecuted instantiation: pdf_sec.c:pdfi_count_stack
Unexecuted instantiation: pdf_utf8.c:pdfi_count_stack
pdf_deref.c:pdfi_count_stack
Line
Count
Source
136
23.1M
{
137
23.1M
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
23.1M
}
pdf_repair.c:pdfi_count_stack
Line
Count
Source
136
55.6M
{
137
55.6M
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
55.6M
}
Unexecuted instantiation: pdf_obj.c:pdfi_count_stack
Unexecuted instantiation: pdf_doc.c:pdfi_count_stack
Unexecuted instantiation: pdf_fapi.c:pdfi_count_stack
139
140
#endif