Coverage Report

Created: 2025-11-16 07:40

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/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.66G
{
40
2.66G
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
190M
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
190M
        return;
47
190M
    }
48
2.47G
    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.47G
}
Unexecuted instantiation: zpdfops.c:pdfi_countup_impl
ghostpdf.c:pdfi_countup_impl
Line
Count
Source
39
49.5k
{
40
49.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
49.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
49.5k
}
pdf_dict.c:pdfi_countup_impl
Line
Count
Source
39
596M
{
40
596M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
3.57M
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
3.57M
        return;
47
3.57M
    }
48
593M
    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
593M
}
pdf_array.c:pdfi_countup_impl
Line
Count
Source
39
684M
{
40
684M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
1.02M
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
1.02M
        return;
47
1.02M
    }
48
683M
    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
683M
}
pdf_xref.c:pdfi_countup_impl
Line
Count
Source
39
55.8k
{
40
55.8k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
0
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
0
        return;
47
0
    }
48
55.8k
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    outprintf(ctx->memory, "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
55.8k
}
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
1.03M
{
40
1.03M
    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
1.03M
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    outprintf(ctx->memory, "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
1.03M
}
pdf_pattern.c:pdfi_countup_impl
Line
Count
Source
39
80.9k
{
40
80.9k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
7.26k
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
7.26k
        return;
47
7.26k
    }
48
73.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
73.6k
}
pdf_gstate.c:pdfi_countup_impl
Line
Count
Source
39
90.1M
{
40
90.1M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
24.4M
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
24.4M
        return;
47
24.4M
    }
48
65.6M
    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
65.6M
}
pdf_stack.c:pdfi_countup_impl
Line
Count
Source
39
944M
{
40
944M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
155M
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
155M
        return;
47
155M
    }
48
788M
    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
788M
}
pdf_image.c:pdfi_countup_impl
Line
Count
Source
39
1.28M
{
40
1.28M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
9
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
9
        return;
47
9
    }
48
1.28M
    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.28M
}
pdf_page.c:pdfi_countup_impl
Line
Count
Source
39
546k
{
40
546k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
9
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
9
        return;
47
9
    }
48
546k
    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
546k
}
pdf_annot.c:pdfi_countup_impl
Line
Count
Source
39
505k
{
40
505k
    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
505k
    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
505k
}
pdf_mark.c:pdfi_countup_impl
Line
Count
Source
39
40.2k
{
40
40.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
40.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
40.2k
}
pdf_font.c:pdfi_countup_impl
Line
Count
Source
39
62.6M
{
40
62.6M
    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
62.6M
    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
62.6M
}
pdf_font0.c:pdfi_countup_impl
Line
Count
Source
39
22.8k
{
40
22.8k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
0
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
0
        return;
47
0
    }
48
22.8k
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    outprintf(ctx->memory, "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
22.8k
}
pdf_font1.c:pdfi_countup_impl
Line
Count
Source
39
109M
{
40
109M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
5.69M
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
5.69M
        return;
47
5.69M
    }
48
103M
    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
103M
}
pdf_font1C.c:pdfi_countup_impl
Line
Count
Source
39
3.80M
{
40
3.80M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
4.50k
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
4.50k
        return;
47
4.50k
    }
48
3.79M
    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.79M
}
pdf_fontps.c:pdfi_countup_impl
Line
Count
Source
39
112M
{
40
112M
    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
112M
    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
112M
}
pdf_font3.c:pdfi_countup_impl
Line
Count
Source
39
6.16k
{
40
6.16k
    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
6.16k
    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
6.16k
}
pdf_fontTT.c:pdfi_countup_impl
Line
Count
Source
39
10.2M
{
40
10.2M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
17.8k
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
17.8k
        return;
47
17.8k
    }
48
10.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
10.1M
}
pdf_font11.c:pdfi_countup_impl
Line
Count
Source
39
62.9k
{
40
62.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
62.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
62.9k
}
pdf_cmap.c:pdfi_countup_impl
Line
Count
Source
39
788
{
40
788
    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
788
    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
788
}
pdf_fmap.c:pdfi_countup_impl
Line
Count
Source
39
139k
{
40
139k
    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
139k
    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
139k
}
pdf_text.c:pdfi_countup_impl
Line
Count
Source
39
6.48M
{
40
6.48M
    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
6.48M
    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
6.48M
}
pdf_shading.c:pdfi_countup_impl
Line
Count
Source
39
366k
{
40
366k
    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
366k
    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
366k
}
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.34M
{
40
1.34M
    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.34M
    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.34M
}
pdf_check.c:pdfi_countup_impl
Line
Count
Source
39
37.5k
{
40
37.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
37.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
37.5k
}
pdf_sec.c:pdfi_countup_impl
Line
Count
Source
39
40.8k
{
40
40.8k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
0
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
0
        return;
47
0
    }
48
40.8k
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    outprintf(ctx->memory, "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
40.8k
}
Unexecuted instantiation: pdf_utf8.c:pdfi_countup_impl
pdf_deref.c:pdfi_countup_impl
Line
Count
Source
39
11.5M
{
40
11.5M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
333
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
333
        return;
47
333
    }
48
11.5M
    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
11.5M
}
pdf_repair.c:pdfi_countup_impl
Line
Count
Source
39
253k
{
40
253k
    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
253k
    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
253k
}
pdf_obj.c:pdfi_countup_impl
Line
Count
Source
39
3.97M
{
40
3.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
3.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
3.97M
}
pdf_doc.c:pdfi_countup_impl
Line
Count
Source
39
1.71M
{
40
1.71M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
5.37k
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
5.37k
        return;
47
5.37k
    }
48
1.70M
    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.70M
}
pdf_fapi.c:pdfi_countup_impl
Line
Count
Source
39
22.7M
{
40
22.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
22.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
22.7M
}
53
54
static inline void pdfi_countdown_impl(pdf_obj *o)
55
3.07G
{
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.07G
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
596M
        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.47G
    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.47G
    if (o->refcnt != 0)
78
1.37G
        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.10G
    pdfi_free_object(o);
101
1.10G
}
zpdfops.c:pdfi_countdown_impl
Line
Count
Source
55
3.08M
{
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.08M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
613k
        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.47M
    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.47M
    if (o->refcnt != 0)
78
2.33M
        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
136k
    pdfi_free_object(o);
101
136k
}
ghostpdf.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
351k
        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.96M
    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.96M
    if (o->refcnt != 0)
78
1.38M
        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.58M
    pdfi_free_object(o);
101
1.58M
}
pdf_dict.c:pdfi_countdown_impl
Line
Count
Source
55
323M
{
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
323M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
1.75M
        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
321M
    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
321M
    if (o->refcnt != 0)
78
22.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
298M
    pdfi_free_object(o);
101
298M
}
pdf_array.c:pdfi_countdown_impl
Line
Count
Source
55
478M
{
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
478M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
204M
        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
274M
    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
274M
    if (o->refcnt != 0)
78
76.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
197M
    pdfi_free_object(o);
101
197M
}
pdf_xref.c:pdfi_countdown_impl
Line
Count
Source
55
101k
{
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
101k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
15.4k
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
85.5k
    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.5k
    if (o->refcnt != 0)
78
67.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
18.1k
    pdfi_free_object(o);
101
18.1k
}
pdf_int.c:pdfi_countdown_impl
Line
Count
Source
55
43.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
43.3M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
43.2M
        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.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
85.2k
    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
85.2k
    pdfi_free_object(o);
101
85.2k
}
pdf_file.c:pdfi_countdown_impl
Line
Count
Source
55
33.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
33.0M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
29.3M
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
3.70M
    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.70M
    if (o->refcnt != 0)
78
3.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
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
5.70M
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
5.70M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
2.43M
        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.27M
    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.27M
    if (o->refcnt != 0)
78
2.45M
        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
811k
    pdfi_free_object(o);
101
811k
}
pdf_pattern.c:pdfi_countdown_impl
Line
Count
Source
55
371k
{
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
371k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
137k
        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
234k
    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
234k
    if (o->refcnt != 0)
78
234k
        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
137M
{
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
137M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
69.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
67.5M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    outprintf(ctx->memory, "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
67.5M
    if (o->refcnt != 0)
78
65.2M
        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.25M
    pdfi_free_object(o);
101
2.25M
}
pdf_stack.c:pdfi_countdown_impl
Line
Count
Source
55
944M
{
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
944M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
155M
        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
788M
    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
788M
    if (o->refcnt != 0)
78
335M
        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
452M
    pdfi_free_object(o);
101
452M
}
pdf_image.c:pdfi_countdown_impl
Line
Count
Source
55
5.26M
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
5.26M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
1.36M
        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.90M
    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.90M
    if (o->refcnt != 0)
78
2.71M
        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.19M
    pdfi_free_object(o);
101
1.19M
}
pdf_page.c:pdfi_countdown_impl
Line
Count
Source
55
2.62M
{
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.62M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
397k
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
2.22M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    outprintf(ctx->memory, "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
2.22M
    if (o->refcnt != 0)
78
2.22M
        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.33k
    pdfi_free_object(o);
101
1.33k
}
pdf_annot.c:pdfi_countdown_impl
Line
Count
Source
55
7.24M
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
7.24M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
2.56M
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
4.68M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    outprintf(ctx->memory, "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
4.68M
    if (o->refcnt != 0)
78
4.61M
        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
69.2k
    pdfi_free_object(o);
101
69.2k
}
pdf_mark.c:pdfi_countdown_impl
Line
Count
Source
55
1.69M
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
1.69M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
719k
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
973k
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    outprintf(ctx->memory, "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
973k
    if (o->refcnt != 0)
78
930k
        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
43.6k
    pdfi_free_object(o);
101
43.6k
}
pdf_font.c:pdfi_countdown_impl
Line
Count
Source
55
365M
{
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
365M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
21.9M
        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
343M
    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
343M
    if (o->refcnt != 0)
78
334M
        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.81M
    pdfi_free_object(o);
101
8.81M
}
pdf_font0.c:pdfi_countdown_impl
Line
Count
Source
55
2.24M
{
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.24M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
399k
        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.84M
    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.84M
    if (o->refcnt != 0)
78
1.71M
        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
127k
    pdfi_free_object(o);
101
127k
}
pdf_font1.c:pdfi_countdown_impl
Line
Count
Source
55
361M
{
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
361M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
12.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
349M
    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
349M
    if (o->refcnt != 0)
78
251M
        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
97.0M
    pdfi_free_object(o);
101
97.0M
}
pdf_font1C.c:pdfi_countdown_impl
Line
Count
Source
55
8.17M
{
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
8.17M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
648k
        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
7.53M
    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
7.53M
    if (o->refcnt != 0)
78
4.88M
        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.64M
    pdfi_free_object(o);
101
2.64M
}
pdf_fontps.c:pdfi_countdown_impl
Line
Count
Source
55
112M
{
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
112M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
477k
        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
111M
    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
111M
    if (o->refcnt != 0)
78
111M
        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
72.4k
    pdfi_free_object(o);
101
72.4k
}
pdf_font3.c:pdfi_countdown_impl
Line
Count
Source
55
228k
{
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
228k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
61.0k
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
167k
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    outprintf(ctx->memory, "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
167k
    if (o->refcnt != 0)
78
157k
        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
10.0k
    pdfi_free_object(o);
101
10.0k
}
pdf_fontTT.c:pdfi_countdown_impl
Line
Count
Source
55
24.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
24.9M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
4.09M
        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
20.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
20.9M
    if (o->refcnt != 0)
78
16.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
4.22M
    pdfi_free_object(o);
101
4.22M
}
pdf_font11.c:pdfi_countdown_impl
Line
Count
Source
55
384k
{
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
384k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
194k
        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
190k
    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
190k
    if (o->refcnt != 0)
78
89.5k
        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_cmap.c:pdfi_countdown_impl
Line
Count
Source
55
105k
{
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
105k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
103k
        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.16k
    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.16k
    if (o->refcnt != 0)
78
381
        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
788
    pdfi_free_object(o);
101
788
}
pdf_fmap.c:pdfi_countdown_impl
Line
Count
Source
55
4.01M
{
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.01M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
3.89M
        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
118k
    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
118k
    if (o->refcnt != 0)
78
118k
        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
54.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
54.2M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
3.40M
        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.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
50.8M
    if (o->refcnt != 0)
78
44.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
6.48M
    pdfi_free_object(o);
101
6.48M
}
pdf_shading.c:pdfi_countdown_impl
Line
Count
Source
55
961k
{
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
961k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
259k
        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
702k
    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
702k
    if (o->refcnt != 0)
78
335k
        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
366k
    pdfi_free_object(o);
101
366k
}
pdf_func.c:pdfi_countdown_impl
Line
Count
Source
55
208k
{
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
208k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
28
        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
208k
    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
208k
    if (o->refcnt != 0)
78
208k
        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
212k
{
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
212k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
99.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
113k
    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
113k
    if (o->refcnt != 0)
78
113k
        return;
79
#if REFCNT_DEBUG
80
    if (ctx != NULL && ctx->cache_entries != 0) {
81
        pdf_obj_cache_entry *entry = ctx->cache_LRU, *next;
82
83
        while(entry) {
84
            next = entry->next;
85
            if (entry->o->object_num != 0 && entry->o->object_num == o->object_num)
86
                outprintf(ctx->memory, "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    outprintf(ctx->memory, "Freeing object %d, UID %lu\n", o->object_num, o->UID);
91
#endif
92
#ifdef DEBUG
93
    if (ctx->xref_table != NULL && o->object_num > 0 &&
94
        o->object_num < ctx->xref_table->xref_size &&
95
        ctx->xref_table->xref[o->object_num].cache != NULL &&
96
        ctx->xref_table->xref[o->object_num].cache->o == o) {
97
        outprintf(ctx->memory, "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
0
    pdfi_free_object(o);
101
0
}
Unexecuted instantiation: pdf_device.c:pdfi_countdown_impl
Unexecuted instantiation: pdf_misc.c:pdfi_countdown_impl
pdf_optcontent.c:pdfi_countdown_impl
Line
Count
Source
55
3.92M
{
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.92M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
1.99M
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
1.93M
    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.93M
    if (o->refcnt != 0)
78
586k
        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.34M
    pdfi_free_object(o);
101
1.34M
}
pdf_check.c:pdfi_countdown_impl
Line
Count
Source
55
19.8M
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
19.8M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
9.99M
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
9.84M
    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
9.84M
    if (o->refcnt != 0)
78
9.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
37.5k
    pdfi_free_object(o);
101
37.5k
}
pdf_sec.c:pdfi_countdown_impl
Line
Count
Source
55
48.7k
{
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
48.7k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
5.01k
        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
43.7k
    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
43.7k
    if (o->refcnt != 0)
78
23.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
20.4k
    pdfi_free_object(o);
101
20.4k
}
Unexecuted instantiation: pdf_utf8.c:pdfi_countdown_impl
pdf_deref.c:pdfi_countdown_impl
Line
Count
Source
55
5.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
5.45M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
173k
        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
5.27M
    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
5.27M
    if (o->refcnt != 0)
78
5.02M
        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
249k
    pdfi_free_object(o);
101
249k
}
pdf_repair.c:pdfi_countdown_impl
Line
Count
Source
55
4.21M
{
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.21M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
2.20M
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
2.00M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    outprintf(ctx->memory, "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
2.00M
    if (o->refcnt != 0)
78
1.88M
        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
124k
    pdfi_free_object(o);
101
124k
}
pdf_obj.c:pdfi_countdown_impl
Line
Count
Source
55
2.76M
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
2.76M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
290k
        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.47M
    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.47M
    if (o->refcnt != 0)
78
1.51M
        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
963k
    pdfi_free_object(o);
101
963k
}
pdf_doc.c:pdfi_countdown_impl
Line
Count
Source
55
36.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
36.9M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
20.9M
        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
15.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
15.9M
    if (o->refcnt != 0)
78
15.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
393k
    pdfi_free_object(o);
101
393k
}
pdf_fapi.c:pdfi_countdown_impl
Line
Count
Source
55
75.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
75.4M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
212
        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
75.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
75.4M
    if (o->refcnt != 0)
78
52.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
22.7M
    pdfi_free_object(o);
101
22.7M
}
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.66G
#define pdfi_countup(x) pdfi_countup_impl((pdf_obj *)x)
112
113
3.07G
#define pdfi_countdown(x) pdfi_countdown_impl((pdf_obj *)x)
114
115
/* Why two functions ? The difference is that when interpreting 'sub' streams
116
 * such as the content stream for a Form XObject, we may have entries on the
117
 * stack at the start of the stream interpretation, and we don't want to
118
 * pop any of those off during the course of the stream. The stack depth stored in
119
 * the context is used to prevent this in pdfi_pop().
120
 * This means that, during the course of a stream, the stack top - bottom may
121
 * not be an accurate reflection of the number of available items on the stack.
122
 *
123
 * So pdfi_count_stack() returns the number of available items, and
124
 * pdfi_count_stack_total() returns the entire size of the stack, and is used to
125
 * record the saved stack depth when we start a stream.
126
 *
127
 * Although these are currently simple calculations, they are abstracted in order
128
 * to facilitate later replacement if required.
129
 */
130
static inline int pdfi_count_total_stack(pdf_context *ctx)
131
1.33G
{
132
1.33G
    return (ctx->stack_top - ctx->stack_bot);
133
1.33G
}
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
689k
{
132
689k
    return (ctx->stack_top - ctx->stack_bot);
133
689k
}
pdf_int.c:pdfi_count_total_stack
Line
Count
Source
131
522M
{
132
522M
    return (ctx->stack_top - ctx->stack_bot);
133
522M
}
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.56M
{
132
1.56M
    return (ctx->stack_top - ctx->stack_bot);
133
1.56M
}
Unexecuted instantiation: pdf_pattern.c:pdfi_count_total_stack
pdf_gstate.c:pdfi_count_total_stack
Line
Count
Source
131
14.0M
{
132
14.0M
    return (ctx->stack_top - ctx->stack_bot);
133
14.0M
}
pdf_stack.c:pdfi_count_total_stack
Line
Count
Source
131
696M
{
132
696M
    return (ctx->stack_top - ctx->stack_bot);
133
696M
}
pdf_image.c:pdfi_count_total_stack
Line
Count
Source
131
443k
{
132
443k
    return (ctx->stack_top - ctx->stack_bot);
133
443k
}
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.56M
{
132
2.56M
    return (ctx->stack_top - ctx->stack_bot);
133
2.56M
}
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
114k
{
132
114k
    return (ctx->stack_top - ctx->stack_bot);
133
114k
}
pdf_text.c:pdfi_count_total_stack
Line
Count
Source
131
6.70M
{
132
6.70M
    return (ctx->stack_top - ctx->stack_bot);
133
6.70M
}
pdf_shading.c:pdfi_count_total_stack
Line
Count
Source
131
383k
{
132
383k
    return (ctx->stack_top - ctx->stack_bot);
133
383k
}
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
707k
{
132
707k
    return (ctx->stack_top - ctx->stack_bot);
133
707k
}
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
25.9M
{
132
25.9M
    return (ctx->stack_top - ctx->stack_bot);
133
25.9M
}
pdf_repair.c:pdfi_count_total_stack
Line
Count
Source
131
63.0M
{
132
63.0M
    return (ctx->stack_top - ctx->stack_bot);
133
63.0M
}
Unexecuted instantiation: pdf_obj.c:pdfi_count_total_stack
Unexecuted instantiation: pdf_doc.c:pdfi_count_total_stack
Unexecuted instantiation: pdf_fapi.c:pdfi_count_total_stack
134
135
static inline int pdfi_count_stack(pdf_context *ctx)
136
1.33G
{
137
1.33G
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
1.33G
}
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
689k
{
137
689k
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
689k
}
pdf_int.c:pdfi_count_stack
Line
Count
Source
136
521M
{
137
521M
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
521M
}
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.56M
{
137
1.56M
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
1.56M
}
Unexecuted instantiation: pdf_pattern.c:pdfi_count_stack
pdf_gstate.c:pdfi_count_stack
Line
Count
Source
136
14.0M
{
137
14.0M
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
14.0M
}
pdf_stack.c:pdfi_count_stack
Line
Count
Source
136
696M
{
137
696M
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
696M
}
pdf_image.c:pdfi_count_stack
Line
Count
Source
136
443k
{
137
443k
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
443k
}
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.56M
{
137
2.56M
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
2.56M
}
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
114k
{
137
114k
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
114k
}
pdf_text.c:pdfi_count_stack
Line
Count
Source
136
6.70M
{
137
6.70M
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
6.70M
}
pdf_shading.c:pdfi_count_stack
Line
Count
Source
136
383k
{
137
383k
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
383k
}
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
707k
{
137
707k
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
707k
}
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
25.9M
{
137
25.9M
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
25.9M
}
pdf_repair.c:pdfi_count_stack
Line
Count
Source
136
63.0M
{
137
63.0M
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
63.0M
}
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