Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

msvc: Compile test\fuzz\bitdeque.cpp #29983

Merged
merged 2 commits into from May 1, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions build_msvc/fuzz/fuzz.vcxproj
Expand Up @@ -9,8 +9,8 @@
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
</PropertyGroup>
<ItemGroup>
<!-- TODO: Fix the code and remove bitdeque.cpp and miniscript.cpp exclusion. -->
<ClCompile Include="..\..\src\test\fuzz\*.cpp" Exclude="..\..\src\test\fuzz\bitdeque.cpp;..\..\src\test\fuzz\miniscript.cpp" />
<!-- TODO: Fix the code and remove miniscript.cpp exclusion. -->
<ClCompile Include="..\..\src\test\fuzz\*.cpp" Exclude="..\..\src\test\fuzz\miniscript.cpp" />
<ClCompile Include="..\..\src\test\fuzz\util\descriptor.cpp">
<ObjectFileName>$(IntDir)test_fuzz_util_descriptor.obj</ObjectFileName>
</ClCompile>
Expand Down
9 changes: 4 additions & 5 deletions src/util/bitdeque.h
Expand Up @@ -14,18 +14,17 @@

/** Class that mimics std::deque<bool>, but with std::vector<bool>'s bit packing.
*
* BlobSize selects the (minimum) number of bits that are allocated at once.
* BITS_PER_WORD selects the (minimum) number of bits that are allocated at once.
* Larger values reduce the asymptotic memory usage overhead, at the cost of
* needing larger up-front allocations. The default is 4096 bytes.
*/
template<int BlobSize = 4096 * 8>
template<int BITS_PER_WORD = 4096 * 8>
class bitdeque
{
// Internal definitions
using word_type = std::bitset<BlobSize>;
using word_type = std::bitset<BITS_PER_WORD>;
using deque_type = std::deque<word_type>;
static_assert(BlobSize > 0);
static constexpr int BITS_PER_WORD = BlobSize;
static_assert(BITS_PER_WORD > 0);

// Forward and friend declarations of iterator types.
template<bool Const> class Iterator;
Expand Down