Coverage Report

Created: 2025-11-16 09:57

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/sal/rtl/alloc_fini.cxx
Line
Count
Source
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/*
3
 * This file is part of the LibreOffice project.
4
 *
5
 * This Source Code Form is subject to the terms of the Mozilla Public
6
 * License, v. 2.0. If a copy of the MPL was not distributed with this
7
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
 *
9
 * This file incorporates work covered by the following license notice:
10
 *
11
 *   Licensed to the Apache Software Foundation (ASF) under one or more
12
 *   contributor license agreements. See the NOTICE file distributed
13
 *   with this work for additional information regarding copyright
14
 *   ownership. The ASF licenses this file to you under the Apache
15
 *   License, Version 2.0 (the "License"); you may not use this file
16
 *   except in compliance with the License. You may obtain a copy of
17
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
18
 */
19
20
#include <rtllifecycle.h>
21
22
namespace
23
{
24
    struct rtlCacheSingleton
25
    {
26
        rtlCacheSingleton()
27
0
        {
28
0
            rtl_cache_init();
29
0
        }
30
        ~rtlCacheSingleton()
31
0
        {
32
0
            rtl_cache_fini();
33
0
        }
34
    };
35
    rtlCacheSingleton& theCacheSingleton()
36
0
    {
37
0
        static rtlCacheSingleton SINGLETON;
38
0
        return SINGLETON;
39
0
    }
40
}
41
42
void ensureCacheSingleton()
43
0
{
44
0
    theCacheSingleton();
45
0
}
46
47
namespace
48
{
49
    struct rtlArenaSingleton
50
    {
51
        rtlArenaSingleton()
52
0
        {
53
0
            rtl_arena_init();
54
0
        }
55
        ~rtlArenaSingleton()
56
0
        {
57
0
            rtl_arena_fini();
58
0
        }
59
    };
60
    rtlArenaSingleton& theArenaSingleton()
61
0
    {
62
0
        static rtlArenaSingleton SINGLETON;
63
0
        return SINGLETON;
64
0
    }
65
}
66
67
void ensureArenaSingleton()
68
0
{
69
0
    theArenaSingleton();
70
0
}
71
72
namespace
73
{
74
    struct rtlLocaleSingleton
75
    {
76
        rtlLocaleSingleton()
77
109
        {
78
109
            rtl_locale_init();
79
109
        }
80
        ~rtlLocaleSingleton()
81
109
        {
82
109
            rtl_locale_fini();
83
109
        }
84
    };
85
    rtlLocaleSingleton& theLocaleSingleton()
86
109
    {
87
109
        static rtlLocaleSingleton SINGLETON;
88
109
        return SINGLETON;
89
109
    }
90
}
91
92
void ensureLocaleSingleton()
93
109
{
94
109
    theLocaleSingleton();
95
109
}
96
97
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */