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
4 changes: 2 additions & 2 deletions builds/cmake/CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
"hidden": true,
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_C_FLAGS": "$env{CMAKE_C_FLAGS} -Og -g --coverage -fprofile-update=atomic",
"CMAKE_CXX_FLAGS": "$env{CMAKE_CXX_FLAGS} -Og -g --coverage -fprofile-update=atomic"
"CMAKE_C_FLAGS": "$env{CMAKE_C_FLAGS} -Og -g1 --coverage -fprofile-update=atomic",
"CMAKE_CXX_FLAGS": "$env{CMAKE_CXX_FLAGS} -Og -g1 --coverage -fprofile-update=atomic"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion builds/cmake/install-cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ main()
msg_verbose "*** Build config specified, calculating flags..."

if [[ "${BUILD_CONFIG}" == "debug" ]]; then
BUILD_FLAGS="-Og -g"
BUILD_FLAGS="-Og -g1"
elif [[ "${BUILD_CONFIG}" == "release" ]]; then
BUILD_FLAGS="-O3"
fi
Expand Down
2 changes: 1 addition & 1 deletion builds/cmake/install-presets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ main()
msg_verbose "*** Build config specified, calculating flags..."

if [[ "${BUILD_CONFIG}" == "debug" ]]; then
BUILD_FLAGS="-Og -g"
BUILD_FLAGS="-Og -g1"
elif [[ "${BUILD_CONFIG}" == "release" ]]; then
BUILD_FLAGS="-O3"
fi
Expand Down
2 changes: 1 addition & 1 deletion builds/gnu/install-gnu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ main()
msg_verbose "*** Build config specified, calculating flags..."

if [[ "${BUILD_CONFIG}" == "debug" ]]; then
BUILD_FLAGS="-Og -g"
BUILD_FLAGS="-Og -g1"
elif [[ "${BUILD_CONFIG}" == "release" ]]; then
BUILD_FLAGS="-O3"
fi
Expand Down
3 changes: 3 additions & 0 deletions builds/msvc/properties/Debug.props
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<!-- Inline explicit-inline functions so header-inline template accessors
are not emitted out-of-line in every TU (debug .lib image size). -->
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
Expand Down
37 changes: 11 additions & 26 deletions include/bitcoin/database/impl/memory/mmap_private.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ template <size_t... Index>
bool CLASS::remap_all_(size_t capacity, std::index_sequence<Index...>,
bool final) NOEXCEPT
{
// Probe the wave's disk requirement before touching any column file: a
// refused wave then retains no surplus provisioning (columns cannot be
// trimmed after a partial wave, as msc cannot shrink a mapped file).
// Probed before touching any column file: a refused wave then retains no
// surplus provisioning (a partial wave cannot be trimmed, as msc cannot
// shrink a mapped file).
if (!probe_(capacity))
{
if (final)
Expand Down Expand Up @@ -377,39 +377,24 @@ bool CLASS::resize_(size_t size, bool final) NOEXCEPT
}

// The wave probe reserves the whole extension plus headroom on the store
// volume (column widths sum to the stride), released upon the grant: a
// refused wave touches no column file, and a granted one leaves the
// headroom unclaimed.
// volume (column widths sum to the stride) leaves the headroom unclaimed.
// An unmeasurable volume admits the wave: growth failure is the store's own
// disk full detection, and a query failure is not an exhaustion signal.
TEMPLATE
bool CLASS::probe_(size_t capacity) NOEXCEPT
{
using namespace system;
const auto bytes = ceilinged_multiply(
floored_subtract(capacity, file_.load()), stride);

if (is_zero(bytes))
if (is_zero(bytes) || is_zero(headroom_))
return true;

auto name = filenames_.front();
name += ".probe";
auto probe = file::invalid;
if (file::create_file(name))
probe = file::open(name);

const auto reserve = ceilinged_add(bytes, headroom_);
#if !defined(WITHOUT_FALLOCATE)
const auto held = (probe != file::invalid) &&
(::fallocate(probe, 0, zero, reserve) != fail);
#else
const auto held = (probe != file::invalid) &&
(::ftruncate(probe, reserve) != fail);
#endif

if (probe != file::invalid)
file::close(probe);
size_t available{};
if (!file::space(available, filenames_.front()))
return true;

file::remove(name);
return held;
return available >= ceilinged_add(bytes, headroom_);
}

// Finalize failure results in unmapped.
Expand Down
Loading