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

libbitcoin / libbitcoin-system / 10242457962

05 Aug 2024 04:11AM UTC coverage: 83.138% (-0.03%) from 83.166%
10242457962

push

github

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

Add disabled retainer allocated parameter and arena::get_capacity().

3 of 7 new or added lines in 2 files covered. (42.86%)

10093 of 12140 relevant lines covered (83.14%)

4756609.59 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

45
    return ::operator new(bytes);
3,977,533✔
46
}
47

48
void default_arena::do_deallocate(void* ptr, size_t, size_t) NOEXCEPT
3,977,532✔
49
{
50
    ////if (align > __STDCPP_DEFAULT_NEW_ALIGNMENT__)
51
    ////    ::operator delete(ptr, std::align_val_t{ align });
52

53
    ::operator delete(ptr);
3,977,532✔
54
}
3,977,532✔
55

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

NEW
62
size_t default_arena::do_get_capacity() const NOEXCEPT
×
63
{
NEW
64
    return max_size_t;
×
65
}
66

67
BC_POP_WARNING()
68

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