diff options
| author | Dan Engelbrecht <[email protected]> | 2022-05-08 00:11:11 +0200 |
|---|---|---|
| committer | Dan Engelbrecht <[email protected]> | 2022-05-08 00:11:11 +0200 |
| commit | 308d60e0289b2adc5c0738fe25273176e780735f (patch) | |
| tree | de40771ed96d013992eb0c502317ea76940827fe /zencore/include | |
| parent | Initialize upstream apply in background thread (#88) (diff) | |
| download | zen-308d60e0289b2adc5c0738fe25273176e780735f.tar.xz zen-308d60e0289b2adc5c0738fe25273176e780735f.zip | |
Make sure blockstore owner and block store state does not get out of sync when fetching a chunk
Move MarkAsDeleteOnClose() to IoBuffer(ExtendedCore) and set it on close, SetFileInformationByHandle sometimes fails if done in parallel with FileMapping
Diffstat (limited to 'zencore/include')
| -rw-r--r-- | zencore/include/zencore/iobuffer.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/zencore/include/zencore/iobuffer.h b/zencore/include/zencore/iobuffer.h index bc8cfdc0f..5d9daa1c7 100644 --- a/zencore/include/zencore/iobuffer.h +++ b/zencore/include/zencore/iobuffer.h @@ -276,12 +276,14 @@ struct IoBufferExtendedCore : public IoBufferCore void Materialize() const; bool GetFileReference(IoBufferFileReference& OutRef) const; + void MarkAsDeleteOnClose(); private: void* m_FileHandle = nullptr; uint64_t m_FileOffset = 0; mutable void* m_MmapHandle = nullptr; mutable void* m_MappedPointer = nullptr; + bool m_DeleteOnClose = false; }; inline IoBufferExtendedCore* @@ -377,6 +379,7 @@ public: inline void SetContentType(ZenContentType ContentType) { m_Core->SetContentType(ContentType); } [[nodiscard]] inline ZenContentType GetContentType() const { return m_Core->GetContentType(); } [[nodiscard]] ZENCORE_API bool GetFileReference(IoBufferFileReference& OutRef) const; + void MarkAsDeleteOnClose(); inline MemoryView GetView() const { return MemoryView(m_Core->DataPointer(), m_Core->DataBytes()); } inline MutableMemoryView GetMutableView() { return MutableMemoryView(m_Core->MutableDataPointer(), m_Core->DataBytes()); } |