Coverage Report

Created: 2022-10-31 07:00

/src/ghostpdl/pdf/pdf_stack.h
Line
Count
Source
1
/* Copyright (C) 2018-2022 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.,  1305 Grant Avenue - Suite 200, Novato,
13
   CA 94945, U.S.A., +1(415)492-9861, 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
815M
{
40
815M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
59.2M
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
59.2M
        return;
47
59.2M
    }
48
756M
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    dmprintf3(OBJ_MEMORY(o), "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
756M
}
Unexecuted instantiation: zpdfops.c:pdfi_countup_impl
ghostpdf.c:pdfi_countup_impl
Line
Count
Source
39
14.2k
{
40
14.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
14.2k
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    dmprintf3(OBJ_MEMORY(o), "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
14.2k
}
pdf_dict.c:pdfi_countup_impl
Line
Count
Source
39
187M
{
40
187M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
1.04M
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
1.04M
        return;
47
1.04M
    }
48
186M
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    dmprintf3(OBJ_MEMORY(o), "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
186M
}
pdf_array.c:pdfi_countup_impl
Line
Count
Source
39
174M
{
40
174M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
174k
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
174k
        return;
47
174k
    }
48
174M
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    dmprintf3(OBJ_MEMORY(o), "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
174M
}
pdf_xref.c:pdfi_countup_impl
Line
Count
Source
39
15.5k
{
40
15.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
15.5k
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    dmprintf3(OBJ_MEMORY(o), "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
15.5k
}
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
260k
{
40
260k
    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
260k
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    dmprintf3(OBJ_MEMORY(o), "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
260k
}
pdf_pattern.c:pdfi_countup_impl
Line
Count
Source
39
18.5k
{
40
18.5k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
1.14k
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
1.14k
        return;
47
1.14k
    }
48
17.3k
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    dmprintf3(OBJ_MEMORY(o), "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
17.3k
}
pdf_gstate.c:pdfi_countup_impl
Line
Count
Source
39
19.6M
{
40
19.6M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
7.53M
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
7.53M
        return;
47
7.53M
    }
48
12.0M
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    dmprintf3(OBJ_MEMORY(o), "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
12.0M
}
pdf_stack.c:pdfi_countup_impl
Line
Count
Source
39
338M
{
40
338M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
49.5M
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
49.5M
        return;
47
49.5M
    }
48
288M
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    dmprintf3(OBJ_MEMORY(o), "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
288M
}
pdf_image.c:pdfi_countup_impl
Line
Count
Source
39
257k
{
40
257k
    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
257k
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    dmprintf3(OBJ_MEMORY(o), "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
257k
}
pdf_page.c:pdfi_countup_impl
Line
Count
Source
39
130k
{
40
130k
    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
130k
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    dmprintf3(OBJ_MEMORY(o), "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
130k
}
pdf_annot.c:pdfi_countup_impl
Line
Count
Source
39
275k
{
40
275k
    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
275k
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    dmprintf3(OBJ_MEMORY(o), "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
275k
}
pdf_mark.c:pdfi_countup_impl
Line
Count
Source
39
13.5k
{
40
13.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
13.5k
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    dmprintf3(OBJ_MEMORY(o), "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
13.5k
}
pdf_font.c:pdfi_countup_impl
Line
Count
Source
39
18.2M
{
40
18.2M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
0
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
0
        return;
47
0
    }
48
18.2M
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    dmprintf3(OBJ_MEMORY(o), "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
18.2M
}
pdf_font0.c:pdfi_countup_impl
Line
Count
Source
39
4.60k
{
40
4.60k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
0
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
0
        return;
47
0
    }
48
4.60k
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    dmprintf3(OBJ_MEMORY(o), "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
4.60k
}
pdf_font1.c:pdfi_countup_impl
Line
Count
Source
39
30.5M
{
40
30.5M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
986k
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
986k
        return;
47
986k
    }
48
29.5M
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    dmprintf3(OBJ_MEMORY(o), "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
29.5M
}
pdf_font1C.c:pdfi_countup_impl
Line
Count
Source
39
583k
{
40
583k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
686
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
686
        return;
47
686
    }
48
582k
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    dmprintf3(OBJ_MEMORY(o), "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
582k
}
pdf_fontps.c:pdfi_countup_impl
Line
Count
Source
39
34.1M
{
40
34.1M
    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
34.1M
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    dmprintf3(OBJ_MEMORY(o), "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
34.1M
}
pdf_font3.c:pdfi_countup_impl
Line
Count
Source
39
1.15k
{
40
1.15k
    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.15k
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    dmprintf3(OBJ_MEMORY(o), "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
1.15k
}
pdf_fontTT.c:pdfi_countup_impl
Line
Count
Source
39
51.9k
{
40
51.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
51.9k
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    dmprintf3(OBJ_MEMORY(o), "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
51.9k
}
pdf_font11.c:pdfi_countup_impl
Line
Count
Source
39
10.8k
{
40
10.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
10.8k
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    dmprintf3(OBJ_MEMORY(o), "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
10.8k
}
pdf_cmap.c:pdfi_countup_impl
Line
Count
Source
39
107
{
40
107
    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
107
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    dmprintf3(OBJ_MEMORY(o), "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
107
}
pdf_fmap.c:pdfi_countup_impl
Line
Count
Source
39
33.5k
{
40
33.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
33.5k
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    dmprintf3(OBJ_MEMORY(o), "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
33.5k
}
pdf_text.c:pdfi_countup_impl
Line
Count
Source
39
1.58M
{
40
1.58M
    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.58M
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    dmprintf3(OBJ_MEMORY(o), "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
1.58M
}
pdf_shading.c:pdfi_countup_impl
Line
Count
Source
39
57.1k
{
40
57.1k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
0
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
0
        return;
47
0
    }
48
57.1k
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    dmprintf3(OBJ_MEMORY(o), "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
57.1k
}
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
217k
{
40
217k
    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
217k
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    dmprintf3(OBJ_MEMORY(o), "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
217k
}
pdf_check.c:pdfi_countup_impl
Line
Count
Source
39
9.19k
{
40
9.19k
    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
9.19k
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    dmprintf3(OBJ_MEMORY(o), "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
9.19k
}
pdf_sec.c:pdfi_countup_impl
Line
Count
Source
39
5.89k
{
40
5.89k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
0
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
0
        return;
47
0
    }
48
5.89k
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    dmprintf3(OBJ_MEMORY(o), "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
5.89k
}
Unexecuted instantiation: pdf_utf8.c:pdfi_countup_impl
pdf_deref.c:pdfi_countup_impl
Line
Count
Source
39
5.40M
{
40
5.40M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
0
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
0
        return;
47
0
    }
48
5.40M
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    dmprintf3(OBJ_MEMORY(o), "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
5.40M
}
pdf_repair.c:pdfi_countup_impl
Line
Count
Source
39
72.9k
{
40
72.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
72.9k
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    dmprintf3(OBJ_MEMORY(o), "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
72.9k
}
pdf_obj.c:pdfi_countup_impl
Line
Count
Source
39
895k
{
40
895k
    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
895k
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    dmprintf3(OBJ_MEMORY(o), "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
895k
}
pdf_doc.c:pdfi_countup_impl
Line
Count
Source
39
484k
{
40
484k
    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
484k
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    dmprintf3(OBJ_MEMORY(o), "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
484k
}
pdf_fapi.c:pdfi_countup_impl
Line
Count
Source
39
2.81M
{
40
2.81M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
41
0
    {
42
#if REFCNT_DEBUG
43
        if (o == NULL)
44
            dprintf("Incrementing reference count of NULL pointer\n");
45
#endif
46
0
        return;
47
0
    }
48
2.81M
    o->refcnt++;
49
#if REFCNT_DEBUG
50
    dmprintf3(OBJ_MEMORY(o), "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
51
#endif
52
2.81M
}
53
54
static inline void pdfi_countdown_impl(pdf_obj *o)
55
930M
{
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
930M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
173M
        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
756M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    dmprintf3(OBJ_MEMORY(o), "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
756M
    if (o->refcnt != 0)
78
383M
        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
                dmprintf2(OBJ_MEMORY(o), "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    dmprintf2(OBJ_MEMORY(o), "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
        dmprintf1(OBJ_MEMORY(o), "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
372M
    pdfi_free_object(o);
101
372M
}
zpdfops.c:pdfi_countdown_impl
Line
Count
Source
55
1.03M
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
1.03M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
193k
        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
837k
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    dmprintf3(OBJ_MEMORY(o), "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
837k
    if (o->refcnt != 0)
78
793k
        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
                dmprintf2(OBJ_MEMORY(o), "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    dmprintf2(OBJ_MEMORY(o), "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
        dmprintf1(OBJ_MEMORY(o), "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
43.4k
    pdfi_free_object(o);
101
43.4k
}
ghostpdf.c:pdfi_countdown_impl
Line
Count
Source
55
1.23M
{
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.23M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
127k
        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.10M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    dmprintf3(OBJ_MEMORY(o), "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
1.10M
    if (o->refcnt != 0)
78
558k
        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
                dmprintf2(OBJ_MEMORY(o), "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    dmprintf2(OBJ_MEMORY(o), "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
        dmprintf1(OBJ_MEMORY(o), "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
548k
    pdfi_free_object(o);
101
548k
}
pdf_dict.c:pdfi_countdown_impl
Line
Count
Source
55
104M
{
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
104M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
535k
        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
104M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    dmprintf3(OBJ_MEMORY(o), "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
104M
    if (o->refcnt != 0)
78
8.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
                dmprintf2(OBJ_MEMORY(o), "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    dmprintf2(OBJ_MEMORY(o), "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
        dmprintf1(OBJ_MEMORY(o), "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
95.8M
    pdfi_free_object(o);
101
95.8M
}
pdf_array.c:pdfi_countdown_impl
Line
Count
Source
55
149M
{
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
149M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
65.6M
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
83.5M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    dmprintf3(OBJ_MEMORY(o), "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
83.5M
    if (o->refcnt != 0)
78
18.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
                dmprintf2(OBJ_MEMORY(o), "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    dmprintf2(OBJ_MEMORY(o), "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
        dmprintf1(OBJ_MEMORY(o), "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
64.6M
    pdfi_free_object(o);
101
64.6M
}
pdf_xref.c:pdfi_countdown_impl
Line
Count
Source
55
30.9k
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
30.9k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
1.64k
        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
29.3k
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    dmprintf3(OBJ_MEMORY(o), "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
29.3k
    if (o->refcnt != 0)
78
22.9k
        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
                dmprintf2(OBJ_MEMORY(o), "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    dmprintf2(OBJ_MEMORY(o), "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
        dmprintf1(OBJ_MEMORY(o), "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
6.34k
    pdfi_free_object(o);
101
6.34k
}
pdf_int.c:pdfi_countdown_impl
Line
Count
Source
55
2.32M
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
2.32M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
2.30M
        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
16.4k
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    dmprintf3(OBJ_MEMORY(o), "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
16.4k
    if (o->refcnt != 0)
78
0
        return;
79
#if REFCNT_DEBUG
80
    if (ctx != NULL && ctx->cache_entries != 0) {
81
        pdf_obj_cache_entry *entry = ctx->cache_LRU, *next;
82
83
        while(entry) {
84
            next = entry->next;
85
            if (entry->o->object_num != 0 && entry->o->object_num == o->object_num)
86
                dmprintf2(OBJ_MEMORY(o), "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    dmprintf2(OBJ_MEMORY(o), "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
        dmprintf1(OBJ_MEMORY(o), "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
16.4k
    pdfi_free_object(o);
101
16.4k
}
pdf_file.c:pdfi_countdown_impl
Line
Count
Source
55
18.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
18.0M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
15.8M
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
2.21M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    dmprintf3(OBJ_MEMORY(o), "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
2.21M
    if (o->refcnt != 0)
78
2.21M
        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
                dmprintf2(OBJ_MEMORY(o), "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    dmprintf2(OBJ_MEMORY(o), "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
        dmprintf1(OBJ_MEMORY(o), "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
1.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
1.70M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
801k
        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
907k
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    dmprintf3(OBJ_MEMORY(o), "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
907k
    if (o->refcnt != 0)
78
715k
        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
                dmprintf2(OBJ_MEMORY(o), "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    dmprintf2(OBJ_MEMORY(o), "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
        dmprintf1(OBJ_MEMORY(o), "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
192k
    pdfi_free_object(o);
101
192k
}
pdf_pattern.c:pdfi_countdown_impl
Line
Count
Source
55
74.3k
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
74.3k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
19.8k
        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
54.4k
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    dmprintf3(OBJ_MEMORY(o), "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
54.4k
    if (o->refcnt != 0)
78
54.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
                dmprintf2(OBJ_MEMORY(o), "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    dmprintf2(OBJ_MEMORY(o), "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
        dmprintf1(OBJ_MEMORY(o), "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
30.1M
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
30.1M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
17.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
12.5M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    dmprintf3(OBJ_MEMORY(o), "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
12.5M
    if (o->refcnt != 0)
78
12.1M
        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
                dmprintf2(OBJ_MEMORY(o), "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    dmprintf2(OBJ_MEMORY(o), "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
        dmprintf1(OBJ_MEMORY(o), "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
467k
    pdfi_free_object(o);
101
467k
}
pdf_stack.c:pdfi_countdown_impl
Line
Count
Source
55
338M
{
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
338M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
49.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
288M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    dmprintf3(OBJ_MEMORY(o), "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
288M
    if (o->refcnt != 0)
78
114M
        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
                dmprintf2(OBJ_MEMORY(o), "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    dmprintf2(OBJ_MEMORY(o), "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
        dmprintf1(OBJ_MEMORY(o), "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
174M
    pdfi_free_object(o);
101
174M
}
pdf_image.c:pdfi_countdown_impl
Line
Count
Source
55
1.44M
{
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.44M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
452k
        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
991k
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    dmprintf3(OBJ_MEMORY(o), "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
991k
    if (o->refcnt != 0)
78
856k
        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
                dmprintf2(OBJ_MEMORY(o), "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    dmprintf2(OBJ_MEMORY(o), "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
        dmprintf1(OBJ_MEMORY(o), "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
134k
    pdfi_free_object(o);
101
134k
}
pdf_page.c:pdfi_countdown_impl
Line
Count
Source
55
828k
{
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
828k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
134k
        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
693k
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    dmprintf3(OBJ_MEMORY(o), "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
693k
    if (o->refcnt != 0)
78
693k
        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
                dmprintf2(OBJ_MEMORY(o), "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    dmprintf2(OBJ_MEMORY(o), "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
        dmprintf1(OBJ_MEMORY(o), "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
116
    pdfi_free_object(o);
101
116
}
pdf_annot.c:pdfi_countdown_impl
Line
Count
Source
55
4.73M
{
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.73M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
1.48M
        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.25M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    dmprintf3(OBJ_MEMORY(o), "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
3.25M
    if (o->refcnt != 0)
78
3.18M
        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
                dmprintf2(OBJ_MEMORY(o), "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    dmprintf2(OBJ_MEMORY(o), "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
        dmprintf1(OBJ_MEMORY(o), "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
68.4k
    pdfi_free_object(o);
101
68.4k
}
pdf_mark.c:pdfi_countdown_impl
Line
Count
Source
55
1.60M
{
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.60M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
677k
        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
924k
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    dmprintf3(OBJ_MEMORY(o), "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
924k
    if (o->refcnt != 0)
78
917k
        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
                dmprintf2(OBJ_MEMORY(o), "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    dmprintf2(OBJ_MEMORY(o), "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
        dmprintf1(OBJ_MEMORY(o), "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
6.81k
    pdfi_free_object(o);
101
6.81k
}
pdf_font.c:pdfi_countdown_impl
Line
Count
Source
55
74.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
74.0M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
3.08M
        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
70.9M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    dmprintf3(OBJ_MEMORY(o), "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
70.9M
    if (o->refcnt != 0)
78
69.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
                dmprintf2(OBJ_MEMORY(o), "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    dmprintf2(OBJ_MEMORY(o), "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
        dmprintf1(OBJ_MEMORY(o), "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
1.53M
    pdfi_free_object(o);
101
1.53M
}
pdf_font0.c:pdfi_countdown_impl
Line
Count
Source
55
225k
{
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
225k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
32.7k
        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
193k
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    dmprintf3(OBJ_MEMORY(o), "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
193k
    if (o->refcnt != 0)
78
171k
        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
                dmprintf2(OBJ_MEMORY(o), "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    dmprintf2(OBJ_MEMORY(o), "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
        dmprintf1(OBJ_MEMORY(o), "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
21.6k
    pdfi_free_object(o);
101
21.6k
}
pdf_font1.c:pdfi_countdown_impl
Line
Count
Source
55
109M
{
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
109M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
2.23M
        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
107M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    dmprintf3(OBJ_MEMORY(o), "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
107M
    if (o->refcnt != 0)
78
78.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
                dmprintf2(OBJ_MEMORY(o), "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    dmprintf2(OBJ_MEMORY(o), "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
        dmprintf1(OBJ_MEMORY(o), "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
29.1M
    pdfi_free_object(o);
101
29.1M
}
pdf_font1C.c:pdfi_countdown_impl
Line
Count
Source
55
1.13M
{
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.13M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
49.8k
        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.08M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    dmprintf3(OBJ_MEMORY(o), "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
1.08M
    if (o->refcnt != 0)
78
827k
        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
                dmprintf2(OBJ_MEMORY(o), "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    dmprintf2(OBJ_MEMORY(o), "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
        dmprintf1(OBJ_MEMORY(o), "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
252k
    pdfi_free_object(o);
101
252k
}
pdf_fontps.c:pdfi_countdown_impl
Line
Count
Source
55
34.1M
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
34.1M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
47.8k
        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
34.0M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    dmprintf3(OBJ_MEMORY(o), "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
34.0M
    if (o->refcnt != 0)
78
34.0M
        return;
79
#if REFCNT_DEBUG
80
    if (ctx != NULL && ctx->cache_entries != 0) {
81
        pdf_obj_cache_entry *entry = ctx->cache_LRU, *next;
82
83
        while(entry) {
84
            next = entry->next;
85
            if (entry->o->object_num != 0 && entry->o->object_num == o->object_num)
86
                dmprintf2(OBJ_MEMORY(o), "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    dmprintf2(OBJ_MEMORY(o), "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
        dmprintf1(OBJ_MEMORY(o), "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
21.3k
    pdfi_free_object(o);
101
21.3k
}
pdf_font3.c:pdfi_countdown_impl
Line
Count
Source
55
24.3k
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
24.3k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
3.63k
        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.6k
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    dmprintf3(OBJ_MEMORY(o), "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
20.6k
    if (o->refcnt != 0)
78
18.7k
        return;
79
#if REFCNT_DEBUG
80
    if (ctx != NULL && ctx->cache_entries != 0) {
81
        pdf_obj_cache_entry *entry = ctx->cache_LRU, *next;
82
83
        while(entry) {
84
            next = entry->next;
85
            if (entry->o->object_num != 0 && entry->o->object_num == o->object_num)
86
                dmprintf2(OBJ_MEMORY(o), "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    dmprintf2(OBJ_MEMORY(o), "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
        dmprintf1(OBJ_MEMORY(o), "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
1.99k
    pdfi_free_object(o);
101
1.99k
}
pdf_fontTT.c:pdfi_countdown_impl
Line
Count
Source
55
6.68M
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
6.68M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
73.6k
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
6.61M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    dmprintf3(OBJ_MEMORY(o), "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
6.61M
    if (o->refcnt != 0)
78
6.55M
        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
                dmprintf2(OBJ_MEMORY(o), "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    dmprintf2(OBJ_MEMORY(o), "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
        dmprintf1(OBJ_MEMORY(o), "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
54.0k
    pdfi_free_object(o);
101
54.0k
}
pdf_font11.c:pdfi_countdown_impl
Line
Count
Source
55
53.8k
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
53.8k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
17.5k
        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
36.3k
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    dmprintf3(OBJ_MEMORY(o), "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
36.3k
    if (o->refcnt != 0)
78
17.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
                dmprintf2(OBJ_MEMORY(o), "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    dmprintf2(OBJ_MEMORY(o), "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
        dmprintf1(OBJ_MEMORY(o), "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
18.8k
    pdfi_free_object(o);
101
18.8k
}
pdf_cmap.c:pdfi_countdown_impl
Line
Count
Source
55
17.3k
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
17.3k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
17.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
149
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    dmprintf3(OBJ_MEMORY(o), "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
149
    if (o->refcnt != 0)
78
42
        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
                dmprintf2(OBJ_MEMORY(o), "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    dmprintf2(OBJ_MEMORY(o), "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
        dmprintf1(OBJ_MEMORY(o), "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
107
    pdfi_free_object(o);
101
107
}
pdf_fmap.c:pdfi_countdown_impl
Line
Count
Source
55
611k
{
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
611k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
592k
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
19.9k
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    dmprintf3(OBJ_MEMORY(o), "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
19.9k
    if (o->refcnt != 0)
78
19.9k
        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
                dmprintf2(OBJ_MEMORY(o), "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    dmprintf2(OBJ_MEMORY(o), "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
        dmprintf1(OBJ_MEMORY(o), "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
13.5M
{
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
13.5M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
942k
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
12.5M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    dmprintf3(OBJ_MEMORY(o), "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
12.5M
    if (o->refcnt != 0)
78
10.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
                dmprintf2(OBJ_MEMORY(o), "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    dmprintf2(OBJ_MEMORY(o), "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
        dmprintf1(OBJ_MEMORY(o), "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_shading.c:pdfi_countdown_impl
Line
Count
Source
55
160k
{
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
160k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
57.7k
        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
102k
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    dmprintf3(OBJ_MEMORY(o), "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
102k
    if (o->refcnt != 0)
78
45.1k
        return;
79
#if REFCNT_DEBUG
80
    if (ctx != NULL && ctx->cache_entries != 0) {
81
        pdf_obj_cache_entry *entry = ctx->cache_LRU, *next;
82
83
        while(entry) {
84
            next = entry->next;
85
            if (entry->o->object_num != 0 && entry->o->object_num == o->object_num)
86
                dmprintf2(OBJ_MEMORY(o), "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    dmprintf2(OBJ_MEMORY(o), "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
        dmprintf1(OBJ_MEMORY(o), "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
57.1k
    pdfi_free_object(o);
101
57.1k
}
pdf_func.c:pdfi_countdown_impl
Line
Count
Source
55
17.2k
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
17.2k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
0
        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
17.2k
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    dmprintf3(OBJ_MEMORY(o), "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
17.2k
    if (o->refcnt != 0)
78
17.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
                dmprintf2(OBJ_MEMORY(o), "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    dmprintf2(OBJ_MEMORY(o), "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
        dmprintf1(OBJ_MEMORY(o), "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
20.3k
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
20.3k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
7.80k
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
12.5k
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    dmprintf3(OBJ_MEMORY(o), "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
12.5k
    if (o->refcnt != 0)
78
12.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
                dmprintf2(OBJ_MEMORY(o), "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    dmprintf2(OBJ_MEMORY(o), "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
        dmprintf1(OBJ_MEMORY(o), "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
529k
{
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
529k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
196k
        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
333k
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    dmprintf3(OBJ_MEMORY(o), "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
333k
    if (o->refcnt != 0)
78
115k
        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
                dmprintf2(OBJ_MEMORY(o), "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    dmprintf2(OBJ_MEMORY(o), "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
        dmprintf1(OBJ_MEMORY(o), "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
217k
    pdfi_free_object(o);
101
217k
}
pdf_check.c:pdfi_countdown_impl
Line
Count
Source
55
10.6M
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
10.6M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
5.72M
        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.92M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    dmprintf3(OBJ_MEMORY(o), "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
4.92M
    if (o->refcnt != 0)
78
4.91M
        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
                dmprintf2(OBJ_MEMORY(o), "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    dmprintf2(OBJ_MEMORY(o), "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
        dmprintf1(OBJ_MEMORY(o), "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
9.20k
    pdfi_free_object(o);
101
9.20k
}
pdf_sec.c:pdfi_countdown_impl
Line
Count
Source
55
7.15k
{
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.15k
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
712
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
6.44k
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    dmprintf3(OBJ_MEMORY(o), "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
6.44k
    if (o->refcnt != 0)
78
3.55k
        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
                dmprintf2(OBJ_MEMORY(o), "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    dmprintf2(OBJ_MEMORY(o), "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
        dmprintf1(OBJ_MEMORY(o), "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
2.88k
    pdfi_free_object(o);
101
2.88k
}
Unexecuted instantiation: pdf_utf8.c:pdfi_countdown_impl
pdf_deref.c:pdfi_countdown_impl
Line
Count
Source
55
3.30M
{
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.30M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
122k
        return;
65
66
#if defined(DEBUG) || REFCNT_DEBUG
67
    ctx = (pdf_context *)o->ctx;
68
#endif
69
#ifdef DEBUG
70
    if (o->refcnt == 0)
71
        emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
72
#endif
73
3.18M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    dmprintf3(OBJ_MEMORY(o), "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
3.18M
    if (o->refcnt != 0)
78
3.07M
        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
                dmprintf2(OBJ_MEMORY(o), "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    dmprintf2(OBJ_MEMORY(o), "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
        dmprintf1(OBJ_MEMORY(o), "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
103k
    pdfi_free_object(o);
101
103k
}
pdf_repair.c:pdfi_countdown_impl
Line
Count
Source
55
1.66M
{
56
#if defined(DEBUG) || REFCNT_DEBUG
57
    pdf_context *ctx;
58
#endif
59
60
    /* A 'low' pointer value indicates a type that is not an
61
     * actual object (typically keyword). This includes the
62
     * NULL case. Nothing to free in that case. */
63
1.66M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
1.04M
        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
616k
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    dmprintf3(OBJ_MEMORY(o), "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
616k
    if (o->refcnt != 0)
78
564k
        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
                dmprintf2(OBJ_MEMORY(o), "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    dmprintf2(OBJ_MEMORY(o), "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
        dmprintf1(OBJ_MEMORY(o), "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
51.3k
    pdfi_free_object(o);
101
51.3k
}
pdf_obj.c:pdfi_countdown_impl
Line
Count
Source
55
1.60M
{
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.60M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
195k
        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.40M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    dmprintf3(OBJ_MEMORY(o), "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
1.40M
    if (o->refcnt != 0)
78
1.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
                dmprintf2(OBJ_MEMORY(o), "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    dmprintf2(OBJ_MEMORY(o), "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
        dmprintf1(OBJ_MEMORY(o), "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
385k
    pdfi_free_object(o);
101
385k
}
pdf_doc.c:pdfi_countdown_impl
Line
Count
Source
55
7.78M
{
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.78M
    if ((uintptr_t)o < TOKEN__LAST_KEY)
64
4.11M
        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.66M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    dmprintf3(OBJ_MEMORY(o), "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
3.66M
    if (o->refcnt != 0)
78
3.55M
        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
                dmprintf2(OBJ_MEMORY(o), "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    dmprintf2(OBJ_MEMORY(o), "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
        dmprintf1(OBJ_MEMORY(o), "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
115k
    pdfi_free_object(o);
101
115k
}
pdf_fapi.c:pdfi_countdown_impl
Line
Count
Source
55
9.39M
{
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
9.39M
    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
9.39M
    o->refcnt--;
74
#if REFCNT_DEBUG
75
    dmprintf3(OBJ_MEMORY(o), "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
76
#endif
77
9.39M
    if (o->refcnt != 0)
78
6.58M
        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
                dmprintf2(OBJ_MEMORY(o), "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
87
            entry = next;
88
        }
89
    }
90
    dmprintf2(OBJ_MEMORY(o), "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
        dmprintf1(OBJ_MEMORY(o), "Freeing object %d while it is still in the object cache!\n", o->object_num);
98
    }
99
#endif
100
2.81M
    pdfi_free_object(o);
101
2.81M
}
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
815M
#define pdfi_countup(x) pdfi_countup_impl((pdf_obj *)x)
112
113
930M
#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
455M
{
132
455M
    return (ctx->stack_top - ctx->stack_bot);
133
455M
}
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
267k
{
132
267k
    return (ctx->stack_top - ctx->stack_bot);
133
267k
}
pdf_int.c:pdfi_count_total_stack
Line
Count
Source
131
186M
{
132
186M
    return (ctx->stack_top - ctx->stack_bot);
133
186M
}
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
402k
{
132
402k
    return (ctx->stack_top - ctx->stack_bot);
133
402k
}
Unexecuted instantiation: pdf_pattern.c:pdfi_count_total_stack
pdf_gstate.c:pdfi_count_total_stack
Line
Count
Source
131
2.21M
{
132
2.21M
    return (ctx->stack_top - ctx->stack_bot);
133
2.21M
}
pdf_stack.c:pdfi_count_total_stack
Line
Count
Source
131
230M
{
132
230M
    return (ctx->stack_top - ctx->stack_bot);
133
230M
}
pdf_image.c:pdfi_count_total_stack
Line
Count
Source
131
117k
{
132
117k
    return (ctx->stack_top - ctx->stack_bot);
133
117k
}
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
499k
{
132
499k
    return (ctx->stack_top - ctx->stack_bot);
133
499k
}
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
32.6k
{
132
32.6k
    return (ctx->stack_top - ctx->stack_bot);
133
32.6k
}
pdf_text.c:pdfi_count_total_stack
Line
Count
Source
131
1.61M
{
132
1.61M
    return (ctx->stack_top - ctx->stack_bot);
133
1.61M
}
pdf_shading.c:pdfi_count_total_stack
Line
Count
Source
131
57.2k
{
132
57.2k
    return (ctx->stack_top - ctx->stack_bot);
133
57.2k
}
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
117k
{
132
117k
    return (ctx->stack_top - ctx->stack_bot);
133
117k
}
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
9.17M
{
132
9.17M
    return (ctx->stack_top - ctx->stack_bot);
133
9.17M
}
pdf_repair.c:pdfi_count_total_stack
Line
Count
Source
131
23.0M
{
132
23.0M
    return (ctx->stack_top - ctx->stack_bot);
133
23.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
454M
{
137
454M
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
454M
}
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
267k
{
137
267k
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
267k
}
pdf_int.c:pdfi_count_stack
Line
Count
Source
136
186M
{
137
186M
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
186M
}
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
402k
{
137
402k
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
402k
}
Unexecuted instantiation: pdf_pattern.c:pdfi_count_stack
pdf_gstate.c:pdfi_count_stack
Line
Count
Source
136
2.21M
{
137
2.21M
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
2.21M
}
pdf_stack.c:pdfi_count_stack
Line
Count
Source
136
230M
{
137
230M
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
230M
}
pdf_image.c:pdfi_count_stack
Line
Count
Source
136
117k
{
137
117k
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
117k
}
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
499k
{
137
499k
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
499k
}
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
32.6k
{
137
32.6k
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
32.6k
}
pdf_text.c:pdfi_count_stack
Line
Count
Source
136
1.61M
{
137
1.61M
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
1.61M
}
pdf_shading.c:pdfi_count_stack
Line
Count
Source
136
57.2k
{
137
57.2k
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
57.2k
}
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
117k
{
137
117k
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
117k
}
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
9.17M
{
137
9.17M
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
9.17M
}
pdf_repair.c:pdfi_count_stack
Line
Count
Source
136
23.0M
{
137
23.0M
    return (pdfi_count_total_stack(ctx)) - ctx->current_stream_save.stack_count;
138
23.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