diff options
Diffstat (limited to 'src/zencore/iobuffer.cpp')
| -rw-r--r-- | src/zencore/iobuffer.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/zencore/iobuffer.cpp b/src/zencore/iobuffer.cpp index e1e8750a1..29f643105 100644 --- a/src/zencore/iobuffer.cpp +++ b/src/zencore/iobuffer.cpp @@ -53,12 +53,12 @@ IoBufferCore::AllocateBuffer(size_t InSize, size_t Alignment) const } #endif // ZEN_PLATFORM_WINDOWS -#if ZEN_USE_MIMALLOC - void* Ptr = mi_aligned_alloc(Alignment, RoundUp(InSize, Alignment)); - m_Flags.fetch_or(kIoBufferAlloc, std::memory_order_relaxed); -#else + //#if ZEN_USE_MIMALLOC + // void* Ptr = zen_new_aligned(Alignment, RoundUp(InSize, Alignment)); + // m_Flags.fetch_or(kIoBufferAlloc, std::memory_order_relaxed); + //#else void* Ptr = Memory::Alloc(InSize, Alignment); -#endif + //#endif if (!Ptr) { @@ -85,12 +85,12 @@ IoBufferCore::FreeBuffer() } #endif // ZEN_PLATFORM_WINDOWS -#if ZEN_USE_MIMALLOC - if (LocalFlags & kIoBufferAlloc) - { - return mi_free(const_cast<void*>(m_DataPtr)); - } -#endif + //#if ZEN_USE_MIMALLOC + // if (LocalFlags & kIoBufferAlloc) + // { + // return zen_free(const_cast<void*>(m_DataPtr)); + // } + //#endif ZEN_UNUSED(LocalFlags); return Memory::Free(const_cast<void*>(m_DataPtr)); @@ -559,8 +559,8 @@ IoBufferBuilder::ReadFromFileMaybe(const IoBuffer& InBuffer) DWORD dwNumberOfBytesRead = 0; BOOL Success = ::ReadFile(FileRef.FileHandle, OutBuffer.MutableData(), DWORD(NumberOfBytesToRead), &dwNumberOfBytesRead, &Ovl); #else - int Fd = int(intptr_t(FileRef.FileHandle)); - int Result = pread(Fd, OutBuffer.MutableData(), size_t(FileRef.FileChunkSize), off_t(FileRef.FileChunkOffset)); + int Fd = int(intptr_t(FileRef.FileHandle)); + int Result = pread(Fd, OutBuffer.MutableData(), size_t(FileRef.FileChunkSize), off_t(FileRef.FileChunkOffset)); bool Success = (Result >= 0); uint32_t dwNumberOfBytesRead = uint32_t(Result); @@ -615,7 +615,7 @@ IoBufferBuilder::MakeFromFile(const std::filesystem::path& FileName, uint64_t Of DataFile.GetSize((ULONGLONG&)FileSize); #else int Flags = O_RDONLY | O_CLOEXEC; - int Fd = open(FileName.c_str(), Flags); + int Fd = open(FileName.c_str(), Flags); if (Fd < 0) { return {}; @@ -684,7 +684,7 @@ IoBufferBuilder::MakeFromTemporaryFile(const std::filesystem::path& FileName) Handle = DataFile.Detach(); #else - int Fd = open(FileName.native().c_str(), O_RDONLY); + int Fd = open(FileName.native().c_str(), O_RDONLY); if (Fd < 0) { return {}; |