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

libbitcoin / libbitcoin-system / 10443685514

18 Aug 2024 08:53PM UTC coverage: 83.217% (-0.03%) from 83.245%
10443685514

Pull #1522

github

web-flow
Merge d9f38d854 into f47d84ad5
Pull Request #1522: Modify arena custom interface for detachment.

0 of 5 new or added lines in 1 file covered. (0.0%)

10056 of 12084 relevant lines covered (83.22%)

4778865.99 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-2024 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 <bitcoin/system/constants.hpp>
22

23
namespace libbitcoin {
24

25
BC_PUSH_WARNING(NO_NEW_OR_DELETE)
26

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

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

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

47
void default_arena::do_deallocate(void* ptr, size_t, size_t) NOEXCEPT
4,062,526✔
48
{
49
    ////if (align > __STDCPP_DEFAULT_NEW_ALIGNMENT__)
50
    ////    ::operator delete(ptr, std::align_val_t{ align });
51
    ::operator delete(ptr);
4,062,526✔
52
}
4,062,526✔
53

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

NEW
60
void* default_arena::start() NOEXCEPT
×
61
{
62
    return nullptr;
×
63
}
64

NEW
65
size_t default_arena::detach() NOEXCEPT
×
66
{
NEW
67
    return zero;
×
68
}
69

NEW
70
void default_arena::release(void*, size_t) NOEXCEPT
×
71
{
NEW
72
}
×
73

74
BC_POP_WARNING()
75

76
} // 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