• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

libbitcoin / libbitcoin-system / 13069453084

31 Jan 2025 08:55AM UTC coverage: 82.728% (-0.007%) from 82.735%
13069453084

push

github

web-flow
Merge pull request #1604 from evoskuil/master

Set _CRTDBG_MAP_ALLOC for vc++ debug mode leak tracking.

2 of 2 new or added lines in 1 file covered. (100.0%)

15 existing lines in 11 files now uncovered.

10039 of 12135 relevant lines covered (82.73%)

3871639.49 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

55.56
/src/arena.cpp
1
/**
2
 * Copyright (c) 2011-2025 libbitcoin developers (see AUTHORS)
3
 *
4
 * This file is part of libbitcoin.
5
 *
6
 * This program is free software: you can redistribute it and/or modify
7
 * it under the terms of the GNU Affero General Public License as published by
8
 * the Free Software Foundation, either version 3 of the License, or
9
 * (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU Affero General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU Affero General Public License
17
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
 */
19
#include <bitcoin/system/arena.hpp>
20

21
#include <cstdlib>
22
#include <bitcoin/system/constants.hpp>
23

24
namespace libbitcoin {
25

UNCOV
26
bool operator==(const arena& left, const arena& right) NOEXCEPT
×
27
{
28
    return &left == &right || left.is_equal(right);
×
29
}
30

31
// static
32
// use bc::default_arena::get() vs. std::pmr::get_default_resource()
33
arena* default_arena::get() NOEXCEPT
3,878,236✔
34
{
35
    static default_arena resource{};
3,878,236✔
36
    return &resource;
3,878,236✔
37
}
38

39
void* default_arena::do_allocate(size_t bytes, size_t) THROWS
4,062,313✔
40
{
41
    ////if (align > __STDCPP_DEFAULT_NEW_ALIGNMENT__)
42
    ////    return ::operator new(bytes, std::align_val_t{ align });
43
    BC_PUSH_WARNING(NO_MALLOC_OR_FREE)
44
    return std::malloc(bytes);
4,062,313✔
45
    BC_POP_WARNING()
46
}
47

48
void default_arena::do_deallocate(void* ptr, size_t, size_t) NOEXCEPT
4,062,312✔
49
{
50
    ////if (align > __STDCPP_DEFAULT_NEW_ALIGNMENT__)
51
    ////    ::operator delete(ptr, std::align_val_t{ align });
52
    BC_PUSH_WARNING(NO_MALLOC_OR_FREE)
53
    std::free(ptr);
4,062,312✔
54
    BC_POP_WARNING()
55
}
4,062,312✔
56

57
bool default_arena::do_is_equal(const arena& other) const NOEXCEPT
1,913,789✔
58
{
59
    // Do not cross the streams.
60
    return &other == this;
1,913,789✔
61
}
62

63
// null return indicates that this arena is not detachable.
UNCOV
64
void* default_arena::start(size_t) THROWS
×
65
{
66
    return nullptr;
×
67
}
68

69
size_t default_arena::detach() NOEXCEPT
×
70
{
71
    return zero;
×
72
}
73

74
void default_arena::release(void*) NOEXCEPT
×
75
{
76
}
×
77

78
} // namespace libbitcoin
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc