Skip to content

Commit

Permalink
Improve c3t, c3b load
Browse files Browse the repository at this point in the history
- Use simdjson to load c3t
- Use yasio::ibstream to c3b
  • Loading branch information
halx99 committed Jan 19, 2025
1 parent a43e363 commit 07a1b55
Show file tree
Hide file tree
Showing 14 changed files with 961 additions and 1,391 deletions.
17 changes: 16 additions & 1 deletion 3rdparty/yasio/yasio/ibstream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class binary_reader_impl {
}

binary_reader_impl& operator=(const binary_reader_impl&) = delete;
binary_reader_impl& operator=(binary_reader_impl&&) = delete;
binary_reader_impl& operator=(binary_reader_impl&&) = delete;

/* read 7bit encoded variant integer value
** @dotnet BinaryReader.Read7BitEncodedInt(64)
Expand Down Expand Up @@ -189,6 +189,21 @@ class binary_reader_impl {
read_bytes(&oav.front(), len);
}
}
template <typename _Ty>
size_t read_any(_Ty& out)
{
return read_any(&out, static_cast<int>(sizeof(_Ty)), 1);
}
template <typename _Ty, size_t _N>
size_t read_any(_Ty (&out)[_N])
{
return read_any(out, static_cast<int>(sizeof(_Ty)), static_cast<int>(_N));
}
size_t read_any(void* out, int item_size, int item_count)
{
read_bytes(out, item_size * item_count);
return item_count;
}
void read_bytes(void* oav, int len)
{
if (len > 0)
Expand Down
Loading

0 comments on commit 07a1b55

Please # to comment.