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

libbitcoin / libbitcoin-system / 10381167030

14 Aug 2024 04:00AM UTC coverage: 83.273%. Remained the same
10381167030

push

github

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

Change arena require to initialize, default to nullptr.

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

10066 of 12088 relevant lines covered (83.27%)

4777044.26 hits per line

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

71.43
/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,877,874✔
35
{
36
    static default_arena resource{};
3,877,874✔
37
    return &resource;
3,877,874✔
38
}
39

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

47
void default_arena::do_deallocate(void* ptr, size_t, size_t) NOEXCEPT
3,977,532✔
48
{
49
    ////if (align > __STDCPP_DEFAULT_NEW_ALIGNMENT__)
50
    ////    ::operator delete(ptr, std::align_val_t{ align });
51
    ::operator delete(ptr);
3,977,532✔
52
}
3,977,532✔
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::initialize() NOEXCEPT
×
61
{
62
    return nullptr;
×
63
}
64

65
BC_POP_WARNING()
66

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