Coverage Report

Created: 2025-06-10 07:27

/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.02G
{
40
2.02G
    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
1.89G
    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.89G
}
Unexecuted instantiation: zpdfops.c:pdfi_countup_impl
ghostpdf.c:pdfi_countup_impl
Line
Count
Source
39
37.0k
{
40
37.0k
    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
37.0k
    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
37.0k
}
pdf_dict.c:pdfi_countup_impl
Line
Count
Source
39
473M
{
40
473M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
2.40M
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
2.40M
        return;
47
2.40M
    }
48
471M
    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
471M
}
pdf_array.c:pdfi_countup_impl
Line
Count
Source
39
540M
{
40
540M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
775k
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
775k
        return;
47
775k
    }
48
539M
    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
539M
}
pdf_xref.c:pdfi_countup_impl
Line
Count
Source
39
43.3k
{
40
43.3k
    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.3k
    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.3k
}
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
814k
{
40
814k
    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
814k
    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
814k
}
pdf_pattern.c:pdfi_countup_impl
Line
Count
Source
39
63.5k
{
40
63.5k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
5.01k
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
5.01k
        return;
47
5.01k
    }
48
58.5k
    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
58.5k
}
pdf_gstate.c:pdfi_countup_impl
Line
Count
Source
39
66.4M
{
40
66.4M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
17.2M
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
17.2M
        return;
47
17.2M
    }
48
49.1M
    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
49.1M
}
pdf_stack.c:pdfi_countup_impl
Line
Count
Source
39
664M
{
40
664M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
110M
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
110M
        return;
47
110M
    }
48
554M
    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
554M
}
pdf_image.c:pdfi_countup_impl
Line
Count
Source
39
889k
{
40
889k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
8
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
8
        return;
47
8
    }
48
889k
    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
889k
}
pdf_page.c:pdfi_countup_impl
Line
Count
Source
39
414k
{
40
414k
    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
414k
    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
414k
}
pdf_annot.c:pdfi_countup_impl
Line
Count
Source
39
341k
{
40
341k
    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
341k
    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
341k
}
pdf_mark.c:pdfi_countup_impl
Line
Count
Source
39
30.2k
{
40
30.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
30.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
30.2k
}
pdf_font.c:pdfi_countup_impl
Line
Count
Source
39
47.7M
{
40
47.7M
    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
47.7M
    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
47.7M
}
pdf_font0.c:pdfi_countup_impl
Line
Count
Source
39
17.9k
{
40
17.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
17.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
17.9k
}
pdf_font1.c:pdfi_countup_impl
Line
Count
Source
39
99.9M
{
40
99.9M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
4.63M
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
4.63M
        return;
47
4.63M
    }
48
95.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
95.2M
}
pdf_font1C.c:pdfi_countup_impl
Line
Count
Source
39
3.30M
{
40
3.30M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
3.37k
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
3.37k
        return;
47
3.37k
    }
48
3.30M
    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.30M
}
pdf_fontps.c:pdfi_countup_impl
Line
Count
Source
39
86.3M
{
40
86.3M
    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
86.3M
    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
86.3M
}
pdf_font3.c:pdfi_countup_impl
Line
Count
Source
39
5.18k
{
40
5.18k
    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.18k
    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.18k
}
pdf_fontTT.c:pdfi_countup_impl
Line
Count
Source
39
5.91M
{
40
5.91M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
12.4k
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
12.4k
        return;
47
12.4k
    }
48
5.89M
    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.89M
}
pdf_font11.c:pdfi_countup_impl
Line
Count
Source
39
50.0k
{
40
50.0k
    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.0k
    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.0k
}
pdf_cmap.c:pdfi_countup_impl
Line
Count
Source
39
558
{
40
558
    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
558
    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
558
}
pdf_fmap.c:pdfi_countup_impl
Line
Count
Source
39
109k
{
40
109k
    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
109k
    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
109k
}
pdf_text.c:pdfi_countup_impl
Line
Count
Source
39
4.97M
{
40
4.97M
    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
4.97M
    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
4.97M
}
pdf_shading.c:pdfi_countup_impl
Line
Count
Source
39
362k
{
40
362k
    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
362k
    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
362k
}
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.02M
{
40
1.02M
    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.02M
    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.02M
}
pdf_check.c:pdfi_countup_impl
Line
Count
Source
39
18.6k
{
40
18.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
18.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
18.6k
}
pdf_sec.c:pdfi_countup_impl
Line
Count
Source
39
28.5k
{
40
28.5k
    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
28.5k
    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
28.5k
}
Unexecuted instantiation: pdf_utf8.c:pdfi_countup_impl
pdf_deref.c:pdfi_countup_impl
Line
Count
Source
39
8.84M
{
40
8.84M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
428
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
428
        return;
47
428
    }
48
8.84M
    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
8.84M
}
pdf_repair.c:pdfi_countup_impl
Line
Count
Source
39
200k
{
40
200k
    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
200k
    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
200k
}
pdf_obj.c:pdfi_countup_impl
Line
Count
Source
39
2.88M
{
40
2.88M
    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
2.88M
    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.88M
}
pdf_doc.c:pdfi_countup_impl
Line
Count
Source
39
1.20M
{
40
1.20M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
4.29k
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
4.29k
        return;
47
4.29k
    }
48
1.20M
    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.20M
}
pdf_fapi.c:pdfi_countup_impl
Line
Count
Source
39
17.2M
{
40
17.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
17.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
17.2M
}
53
54
static inline void pdfi_countdown_impl(pdf_obj *o)
55
2.32G
{
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.32G
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
433M
        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.89G
    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.89G
    if (o->refcnt != 0)
78
1.08G
        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
805M
    pdfi_free_object(o);
101
805M
}
zpdfops.c:pdfi_countdown_impl
Line
Count
Source
55
2.27M
{
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.27M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
461k
        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.81M
    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.81M
    if (o->refcnt != 0)
78
1.70M
        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
103k
    pdfi_free_object(o);
101
103k
}
ghostpdf.c:pdfi_countdown_impl
Line
Count
Source
55
2.45M
{
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.45M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
283k
        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.16M
    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.16M
    if (o->refcnt != 0)
78
863k
        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.30M
    pdfi_free_object(o);
101
1.30M
}
pdf_dict.c:pdfi_countdown_impl
Line
Count
Source
55
235M
{
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
235M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
1.18M
        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
233M
    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
233M
    if (o->refcnt != 0)
78
15.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
218M
    pdfi_free_object(o);
101
218M
}
pdf_array.c:pdfi_countdown_impl
Line
Count
Source
55
355M
{
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
355M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
152M
        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
202M
    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
202M
    if (o->refcnt != 0)
78
55.5M
        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
146M
    pdfi_free_object(o);
101
146M
}
pdf_xref.c:pdfi_countdown_impl
Line
Count
Source
55
79.8k
{
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
79.8k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
12.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
67.6k
    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
67.6k
    if (o->refcnt != 0)
78
53.2k
        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
14.4k
    pdfi_free_object(o);
101
14.4k
}
pdf_int.c:pdfi_countdown_impl
Line
Count
Source
55
30.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
30.9M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
30.8M
        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
67.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
67.8k
    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
67.8k
    pdfi_free_object(o);
101
67.8k
}
pdf_file.c:pdfi_countdown_impl
Line
Count
Source
55
21.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
21.0M
    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
2.36M
    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.36M
    if (o->refcnt != 0)
78
2.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
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.20M
{
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.20M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
1.76M
        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.44M
    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.44M
    if (o->refcnt != 0)
78
1.80M
        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
635k
    pdfi_free_object(o);
101
635k
}
pdf_pattern.c:pdfi_countdown_impl
Line
Count
Source
55
294k
{
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
294k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
109k
        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
185k
    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
185k
    if (o->refcnt != 0)
78
185k
        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
100M
{
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
100M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
50.5M
        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
50.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
50.4M
    if (o->refcnt != 0)
78
48.8M
        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.63M
    pdfi_free_object(o);
101
1.63M
}
pdf_stack.c:pdfi_countdown_impl
Line
Count
Source
55
664M
{
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
664M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
110M
        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
554M
    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
554M
    if (o->refcnt != 0)
78
245M
        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
308M
    pdfi_free_object(o);
101
308M
}
pdf_image.c:pdfi_countdown_impl
Line
Count
Source
55
3.49M
{
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.49M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
889k
        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.60M
    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.60M
    if (o->refcnt != 0)
78
1.81M
        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
787k
    pdfi_free_object(o);
101
787k
}
pdf_page.c:pdfi_countdown_impl
Line
Count
Source
55
1.96M
{
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.96M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
302k
        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.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
1.66M
    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
1.09k
    pdfi_free_object(o);
101
1.09k
}
pdf_annot.c:pdfi_countdown_impl
Line
Count
Source
55
4.88M
{
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.88M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
1.77M
        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.11M
    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.11M
    if (o->refcnt != 0)
78
3.06M
        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
49.1k
    pdfi_free_object(o);
101
49.1k
}
pdf_mark.c:pdfi_countdown_impl
Line
Count
Source
55
1.22M
{
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.22M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
519k
        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
704k
    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
704k
    if (o->refcnt != 0)
78
672k
        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
32.7k
    pdfi_free_object(o);
101
32.7k
}
pdf_font.c:pdfi_countdown_impl
Line
Count
Source
55
299M
{
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
299M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
16.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
283M
    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
283M
    if (o->refcnt != 0)
78
276M
        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.11M
    pdfi_free_object(o);
101
7.11M
}
pdf_font0.c:pdfi_countdown_impl
Line
Count
Source
55
1.66M
{
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.66M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
314k
        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.35M
    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.35M
    if (o->refcnt != 0)
78
1.25M
        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
100k
    pdfi_free_object(o);
101
100k
}
pdf_font1.c:pdfi_countdown_impl
Line
Count
Source
55
330M
{
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
330M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
10.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
320M
    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
320M
    if (o->refcnt != 0)
78
230M
        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
89.7M
    pdfi_free_object(o);
101
89.7M
}
pdf_font1C.c:pdfi_countdown_impl
Line
Count
Source
55
6.88M
{
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.88M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
532k
        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.35M
    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.35M
    if (o->refcnt != 0)
78
3.99M
        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.35M
    pdfi_free_object(o);
101
2.35M
}
pdf_fontps.c:pdfi_countdown_impl
Line
Count
Source
55
86.3M
{
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
86.3M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
370k
        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
85.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
85.9M
    if (o->refcnt != 0)
78
85.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
57.1k
    pdfi_free_object(o);
101
57.1k
}
pdf_font3.c:pdfi_countdown_impl
Line
Count
Source
55
188k
{
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
188k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
49.1k
        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
139k
    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
139k
    if (o->refcnt != 0)
78
131k
        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
8.50k
    pdfi_free_object(o);
101
8.50k
}
pdf_fontTT.c:pdfi_countdown_impl
Line
Count
Source
55
16.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
16.0M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
2.66M
        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.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
13.4M
    if (o->refcnt != 0)
78
10.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
2.69M
    pdfi_free_object(o);
101
2.69M
}
pdf_font11.c:pdfi_countdown_impl
Line
Count
Source
55
305k
{
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
305k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
154k
        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
150k
    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
150k
    if (o->refcnt != 0)
78
70.7k
        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
80.2k
    pdfi_free_object(o);
101
80.2k
}
pdf_cmap.c:pdfi_countdown_impl
Line
Count
Source
55
80.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
80.4k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
79.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
827
    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
827
    if (o->refcnt != 0)
78
269
        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
558
    pdfi_free_object(o);
101
558
}
pdf_fmap.c:pdfi_countdown_impl
Line
Count
Source
55
3.31M
{
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.31M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
3.21M
        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
94.2k
    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
94.2k
    if (o->refcnt != 0)
78
94.2k
        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
40.4M
{
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
40.4M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
2.63M
        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
37.8M
    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
37.8M
    if (o->refcnt != 0)
78
32.8M
        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.97M
    pdfi_free_object(o);
101
4.97M
}
pdf_shading.c:pdfi_countdown_impl
Line
Count
Source
55
831k
{
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
831k
    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
607k
    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
607k
    if (o->refcnt != 0)
78
244k
        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
362k
    pdfi_free_object(o);
101
362k
}
pdf_func.c:pdfi_countdown_impl
Line
Count
Source
55
143k
{
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
143k
    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
143k
    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
143k
    if (o->refcnt != 0)
78
143k
        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
152k
{
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
152k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
73.1k
        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.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
79.8k
    if (o->refcnt != 0)
78
79.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
2.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
2.89M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
1.46M
        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.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
1.42M
    if (o->refcnt != 0)
78
400k
        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.02M
    pdfi_free_object(o);
101
1.02M
}
pdf_check.c:pdfi_countdown_impl
Line
Count
Source
55
12.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
12.6M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
6.49M
        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.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
6.18M
    if (o->refcnt != 0)
78
6.16M
        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.6k
    pdfi_free_object(o);
101
18.6k
}
pdf_sec.c:pdfi_countdown_impl
Line
Count
Source
55
34.1k
{
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
34.1k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
3.67k
        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
30.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
30.4k
    if (o->refcnt != 0)
78
16.4k
        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
14.0k
    pdfi_free_object(o);
101
14.0k
}
Unexecuted instantiation: pdf_utf8.c:pdfi_countdown_impl
pdf_deref.c:pdfi_countdown_impl
Line
Count
Source
55
3.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
3.54M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
117k
        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.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
3.42M
    if (o->refcnt != 0)
78
3.20M
        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
218k
    pdfi_free_object(o);
101
218k
}
pdf_repair.c:pdfi_countdown_impl
Line
Count
Source
55
3.03M
{
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.03M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
1.53M
        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.49M
    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.49M
    if (o->refcnt != 0)
78
1.40M
        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
91.8k
    pdfi_free_object(o);
101
91.8k
}
pdf_obj.c:pdfi_countdown_impl
Line
Count
Source
55
1.95M
{
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.95M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
209k
        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.74M
    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.74M
    if (o->refcnt != 0)
78
1.05M
        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
684k
    pdfi_free_object(o);
101
684k
}
pdf_doc.c:pdfi_countdown_impl
Line
Count
Source
55
29.3M
{
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.3M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
16.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
12.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
12.6M
    if (o->refcnt != 0)
78
12.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
302k
    pdfi_free_object(o);
101
302k
}
pdf_fapi.c:pdfi_countdown_impl
Line
Count
Source
55
57.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
57.2M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
144
        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
57.2M
    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
57.2M
    if (o->refcnt != 0)
78
40.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
17.2M
    pdfi_free_object(o);
101
17.2M
}
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.02G
#define pdfi_countup(x) pdfi_countup_impl((pdf_obj *)x)
112
113
2.32G
#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
939M
{
132
939M
    return (ctx->stack_top - ctx->stack_bot);
133
939M
}
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
546k
{
132
546k
    return (ctx->stack_top - ctx->stack_bot);
133
546k
}
pdf_int.c:pdfi_count_total_stack
Line
Count
Source
131
352M
{
132
352M
    return (ctx->stack_top - ctx->stack_bot);
133
352M
}
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.20M
{
132
1.20M
    return (ctx->stack_top - ctx->stack_bot);
133
1.20M
}
Unexecuted instantiation: pdf_pattern.c:pdfi_count_total_stack
pdf_gstate.c:pdfi_count_total_stack
Line
Count
Source
131
10.3M
{
132
10.3M
    return (ctx->stack_top - ctx->stack_bot);
133
10.3M
}
pdf_stack.c:pdfi_count_total_stack
Line
Count
Source
131
497M
{
132
497M
    return (ctx->stack_top - ctx->stack_bot);
133
497M
}
pdf_image.c:pdfi_count_total_stack
Line
Count
Source
131
323k
{
132
323k
    return (ctx->stack_top - ctx->stack_bot);
133
323k
}
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.03M
{
132
2.03M
    return (ctx->stack_top - ctx->stack_bot);
133
2.03M
}
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
89.1k
{
132
89.1k
    return (ctx->stack_top - ctx->stack_bot);
133
89.1k
}
pdf_text.c:pdfi_count_total_stack
Line
Count
Source
131
5.14M
{
132
5.14M
    return (ctx->stack_top - ctx->stack_bot);
133
5.14M
}
pdf_shading.c:pdfi_count_total_stack
Line
Count
Source
131
378k
{
132
378k
    return (ctx->stack_top - ctx->stack_bot);
133
378k
}
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
540k
{
132
540k
    return (ctx->stack_top - ctx->stack_bot);
133
540k
}
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
19.4M
{
132
19.4M
    return (ctx->stack_top - ctx->stack_bot);
133
19.4M
}
pdf_repair.c:pdfi_count_total_stack
Line
Count
Source
131
49.4M
{
132
49.4M
    return (ctx->stack_top - ctx->stack_bot);
133
49.4M
}
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
938M
{
137
938M
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
938M
}
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
546k
{
137
546k
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
546k
}
pdf_int.c:pdfi_count_stack
Line
Count
Source
136
352M
{
137
352M
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
352M
}
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.20M
{
137
1.20M
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
1.20M
}
Unexecuted instantiation: pdf_pattern.c:pdfi_count_stack
pdf_gstate.c:pdfi_count_stack
Line
Count
Source
136
10.3M
{
137
10.3M
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
10.3M
}
pdf_stack.c:pdfi_count_stack
Line
Count
Source
136
496M
{
137
496M
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
496M
}
pdf_image.c:pdfi_count_stack
Line
Count
Source
136
323k
{
137
323k
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
323k
}
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.03M
{
137
2.03M
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
2.03M
}
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
89.1k
{
137
89.1k
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
89.1k
}
pdf_text.c:pdfi_count_stack
Line
Count
Source
136
5.14M
{
137
5.14M
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
5.14M
}
pdf_shading.c:pdfi_count_stack
Line
Count
Source
136
378k
{
137
378k
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
378k
}
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
540k
{
137
540k
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
540k
}
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
19.4M
{
137
19.4M
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
19.4M
}
pdf_repair.c:pdfi_count_stack
Line
Count
Source
136
49.4M
{
137
49.4M
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
49.4M
}
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