aboutsummaryrefslogtreecommitdiff
path: root/src/zencore/include
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2024-02-26 19:08:27 +0100
committerGitHub <[email protected]>2024-02-26 19:08:27 +0100
commit8672d2235e73545abde15f075934f68495adeaf3 (patch)
tree421443b0eb76910c612bb219354a9306081cca10 /src/zencore/include
parentadding context to http.sys error message (diff)
downloadzen-8672d2235e73545abde15f075934f68495adeaf3.tar.xz
zen-8672d2235e73545abde15f075934f68495adeaf3.zip
hashing fixes (#657)
* move structuredcachestore tests to zenstore-test * Don't materialize entire files when hashing if it is a large files * rewrite CompositeBuffer::Mid to never materialize buffers
Diffstat (limited to 'src/zencore/include')
-rw-r--r--src/zencore/include/zencore/sharedbuffer.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/zencore/include/zencore/sharedbuffer.h b/src/zencore/include/zencore/sharedbuffer.h
index 618bd2937..e31da27ec 100644
--- a/src/zencore/include/zencore/sharedbuffer.h
+++ b/src/zencore/include/zencore/sharedbuffer.h
@@ -114,6 +114,18 @@ public:
[[nodiscard]] bool IsOwned() const { return !m_Buffer || m_Buffer->IsOwned(); }
[[nodiscard]] inline bool IsNull() const { return !m_Buffer; }
inline void Reset() { m_Buffer = nullptr; }
+ inline bool IsFileReference() const
+ {
+ if (const IoBufferExtendedCore* Core = m_Buffer->ExtendedCore())
+ {
+ IoBufferFileReference _;
+ return Core->GetFileReference(_);
+ }
+ else
+ {
+ return false;
+ }
+ }
[[nodiscard]] MemoryView GetView() const
{