-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #665 from evoskuil/master
Stub in block_memory.
- Loading branch information
Showing
11 changed files
with
149 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/** | ||
* Copyright (c) 2011-2024 libbitcoin developers (see AUTHORS) | ||
* | ||
* This file is part of libbitcoin. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
#ifndef LIBBITCOIN_NODE_BLOCK_ARENA_HPP | ||
#define LIBBITCOIN_NODE_BLOCK_ARENA_HPP | ||
|
||
#include <bitcoin/system.hpp> | ||
#include <bitcoin/node/define.hpp> | ||
|
||
namespace libbitcoin { | ||
namespace node { | ||
|
||
class BCN_API block_arena final | ||
: public arena | ||
{ | ||
public: | ||
block_arena() NOEXCEPT; | ||
|
||
private: | ||
void* do_allocate(size_t bytes, size_t align) THROWS override; | ||
void do_deallocate(void* ptr, size_t bytes, size_t align) NOEXCEPT override; | ||
bool do_is_equal(const arena& other) const NOEXCEPT override; | ||
}; | ||
} // namespace node | ||
} // namespace libbitcoin | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/** | ||
* Copyright (c) 2011-2024 libbitcoin developers (see AUTHORS) | ||
* | ||
* This file is part of libbitcoin. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
#include <bitcoin/node/block_arena.hpp> | ||
|
||
#include <bitcoin/system.hpp> | ||
|
||
namespace libbitcoin { | ||
namespace node { | ||
|
||
block_arena::block_arena() NOEXCEPT | ||
{ | ||
} | ||
|
||
BC_PUSH_WARNING(NO_NEW_OR_DELETE) | ||
|
||
void* block_arena::do_allocate(size_t bytes, size_t) THROWS | ||
{ | ||
return ::operator new(bytes); | ||
} | ||
|
||
void block_arena::do_deallocate(void* ptr, size_t, size_t) NOEXCEPT | ||
{ | ||
::operator delete(ptr); | ||
} | ||
|
||
BC_POP_WARNING() | ||
|
||
bool block_arena::do_is_equal(const arena& other) const NOEXCEPT | ||
{ | ||
// Do not cross the streams. | ||
return &other == this; | ||
} | ||
|
||
} // namespace node | ||
} // namespace libbitcoin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters