Skip to content

Commit 51cb0fb

Browse files
process zero-sized file I/O requests immediately
1 parent e047a16 commit 51cb0fb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/nbl/system/IFile.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class IFile : public IFileBase, private ISystem::IFutureManipulator
1414
{
1515
const IFileBase* constThis = this;
1616
const auto* ptr = reinterpret_cast<const std::byte*>(constThis->getMappedPointer());
17-
if (ptr)
17+
if (ptr || sizeToRead==0ull)
1818
{
1919
const size_t size = getSize();
2020
if (offset+sizeToRead>size)
@@ -28,7 +28,7 @@ class IFile : public IFileBase, private ISystem::IFutureManipulator
2828
inline void write(ISystem::future_t<size_t>& fut, const void* buffer, size_t offset, size_t sizeToWrite)
2929
{
3030
auto* ptr = reinterpret_cast<std::byte*>(getMappedPointer());
31-
if (ptr)
31+
if (ptr || sizeToWrite==0ull)
3232
{
3333
// TODO: growable mappings
3434
if (offset+sizeToWrite>getSize())

0 commit comments

Comments
 (0)