diff options
| author | Jack O'Connor <[email protected]> | 2025-03-09 11:29:19 -0700 |
|---|---|---|
| committer | Jack O'Connor <[email protected]> | 2025-03-09 16:15:39 -0700 |
| commit | 063dda6837e1e944c5bb57b8405bf68cae196012 (patch) | |
| tree | 084eaf5c83dd690390cd171b59275685bc6b45d5 /c/blake3_llfio.cpp | |
| parent | 6d0531352bd9352fab9d78c8a8670a9979c30ba3 (diff) | |
llfio support in blake3_c_rust_bindingsrust_bindings_tbb_llfio
Requires a CPLUS_INCLUDE_PATH setting similar to:
export CPLUS_INCLUDE_PATH=/tmp/llfio/include:/tmp/outcome/include:/tmp/quickcpplib/include
Diffstat (limited to 'c/blake3_llfio.cpp')
| -rw-r--r-- | c/blake3_llfio.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/c/blake3_llfio.cpp b/c/blake3_llfio.cpp index 1d5ba33..e2adac8 100644 --- a/c/blake3_llfio.cpp +++ b/c/blake3_llfio.cpp @@ -13,10 +13,9 @@ template <class... Ts> struct overloads : Ts... { // NOTE: deduction guide only needed for Apple Clang now. template <class... Ts> overloads(Ts...) -> overloads<Ts...>; -INLINE auto copy_wide(blake3_hasher *self, llfio::path_view path, - llfio::file_handle &file) noexcept +INLINE auto copy_wide(blake3_hasher *self, llfio::file_handle &file) noexcept -> llfio::result<std::uint64_t> { - std::array<std::byte, 65535> buffer{}; + std::array<std::byte, 65536> buffer{}; std::uint64_t total = 0; while (true) { auto result = llfio::read(file, total, {buffer}); @@ -75,7 +74,7 @@ INLINE void blake3_hasher_update_mmap_base(blake3_hasher *self, return llfio::success(); }, [=](llfio::file_handle &file) -> llfio::result<void> { - OUTCOME_TRY(copy_wide(self, path, file)); + OUTCOME_TRY(copy_wide(self, file)); return llfio::success(); }, }, @@ -89,14 +88,15 @@ INLINE void blake3_hasher_update_mmap_base(blake3_hasher *self, } } -void blake3_hasher_update_mmap(blake3_hasher *self, char const *path) noexcept { +extern "C" void blake3_hasher_update_mmap(blake3_hasher *self, + char const *path) noexcept { bool use_tbb = false; blake3_hasher_update_mmap_base(self, path, use_tbb); } #if defined(BLAKE3_USE_TBB) -void blake3_hasher_update_mmap_tbb(blake3_hasher *self, - char const *path) noexcept { +extern "C" void blake3_hasher_update_mmap_tbb(blake3_hasher *self, + char const *path) noexcept { bool use_tbb = true; blake3_hasher_update_mmap_base(self, path, use_tbb); } |
