Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions include/bitcoin/database/impl/query/objects.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ typename CLASS::inputs_ptr CLASS::get_inputs(
if (fks.empty())
return {};

const auto inputs = to_shared<chain::input_cptrs>();
const auto inputs = make_shared<chain::input_cptrs>();
inputs->reserve(fks.size());

for (const auto& fk: fks)
Expand All @@ -73,7 +73,7 @@ typename CLASS::outputs_ptr CLASS::get_outputs(
if (fks.empty())
return {};

const auto outputs = to_shared<chain::output_cptrs>();
const auto outputs = make_shared<chain::output_cptrs>();
outputs->reserve(fks.size());

for (const auto& fk: fks)
Expand All @@ -93,7 +93,7 @@ typename CLASS::transactions_ptr CLASS::get_transactions(
if (txs.empty())
return {};

const auto transactions = to_shared<chain::transaction_cptrs>();
const auto transactions = make_shared<chain::transaction_cptrs>();
transactions->reserve(txs.size());

for (const auto& tx_fk: txs)
Expand Down Expand Up @@ -165,8 +165,8 @@ typename CLASS::transaction::cptr CLASS::get_transaction(const tx_link& link,
if (!store_.outs.get(tx.outs_fk, outs))
return {};

const auto inputs = to_shared<chain::input_cptrs>();
const auto outputs = to_shared<chain::output_cptrs>();
const auto inputs = make_shared<chain::input_cptrs>();
const auto outputs = make_shared<chain::output_cptrs>();
inputs->reserve(tx.ins_count);
outputs->reserve(tx.outs_count);

Expand Down Expand Up @@ -209,11 +209,11 @@ typename CLASS::point::cptr CLASS::make_point(hash_digest&& hash,
uint32_t index) NOEXCEPT
{
// Share null point instances to reduce memory consumption.
static const auto null_point = system::to_shared<const point>();
static const auto null_point = system::make_shared<const point>();
if (index == point::null_index)
return null_point;

return system::to_shared<point>(std::move(hash), index);
return system::make_shared<point>(std::move(hash), index);
}

TEMPLATE
Expand Down Expand Up @@ -259,7 +259,7 @@ typename CLASS::inputs_ptr CLASS::get_spenders(
{
using namespace system;
const auto point_fks = to_spenders(link);
const auto inputs = to_shared<chain::input_cptrs>();
const auto inputs = make_shared<chain::input_cptrs>();
inputs->reserve(point_fks.size());

// TODO: eliminate shared memory pointer reallocation.
Expand Down
8 changes: 5 additions & 3 deletions src/memory/mman-win32/mman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,12 +259,14 @@ int ftruncate(int fd, oft__ size) noexcept
// sets errno
return -1;
}

// "UnmapViewOfFile must be called first to unmap all views and call
// CloseHandle to close file mapping object before can call SetEndOfFile." -
// we have earlier called CloseHandle to close file mapping object (in mmap)
// CloseHandle to close file mapping object before can call SetEndOfFile."
// We have earlier called CloseHandle to close file mapping object (in mmap)
// but have not called UnmapViewOfFile before calling this from remap_() and
// it is apparently working.

// This sets the physical size of the file, making this an fallocate.
if (SetEndOfFile(handle) == FALSE)
{
errno = last_error(EIO);
Expand Down
Loading