aboutsummaryrefslogtreecommitdiff
path: root/src/zencore/iobuffer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* avoid new in static IoBuffer (#472)Dan Engelbrecht2025-08-211-1/+19
|
* http client streaming upload (#413)Dan Engelbrecht2025-06-021-35/+7
| | | - Improvement: Add streaming upload from HttpClient to reduce I/O caused by excessive MMap usage
* increase limit for mmap path to 8kb (#270)Dan Engelbrecht2024-12-191-1/+1
|
* added support for dynamic LLM tags (#245)Stefan Boberg2024-12-021-2/+2
| | | | | * added FLLMTag which can be used to register memory tags outside of core * changed `UE_MEMSCOPE` -> `ZEN_MEMSCOPE` for consistency * instrumented some subsystems with dynamic tags
* split zencore/memory.h -> memoryview.h, memcmp.h (#228)Stefan Boberg2024-11-251-1/+1
| | | | | | | minor clean-up `zencore/memory.h` used to contain a variety of things including `Malloc` support along with `MemoryView` etc since the memory allocator stuff moved into `zencore/memory/memory.h` there was basically only `MemoryView` and `MemCmp` in there which seemed better to split out into separate headers to avoid overloading `memory.h`
* Insights-compatible memory tracking (#214)Stefan Boberg2024-11-251-28/+23
| | | | | | | | | | | | | This change introduces support for tracing of memory allocation activity. The code is ported from UE5, and Unreal Insights can be used to analyze the output. This is currently only fully supported on Windows, but will be extended to Mac/Linux in the near future. To activate full memory tracking, pass `--trace=memory` on the commandline alongside `--tracehost=<ip>` or `-tracefile=<path>`. For more control over how much detail is traced you can instead pass some combination of `callstack`, `memtag`, `memalloc` instead. In practice, `--trace=memory` is an alias for `--trace=callstack,memtag,memalloc`). For convenience we also support `--trace=memory_light` which omits call stacks. This change also introduces multiple memory allocators, which may be selected via command-line option `--malloc=<allocator>`: * `mimalloc` - mimalloc (default, same as before) * `rpmalloc` - rpmalloc is another high performance allocator for multithreaded applications which may be a better option than mimalloc (to be evaluated). Due to toolchain limitations this is currently only supported on Windows. * `stomp` - an allocator intended to be used during development/debugging to help track down memory issues such as use-after-free or out-of-bounds access. Currently only supported on Windows. * `ansi` - fallback to default system allocator
* memory/string support cleanup and additions (#220)Stefan Boberg2024-11-191-22/+0
| | | | | | | | | * removed unused memory classes * added align.h alignment helpers used in upcoming changes * added char16_t StringLength * avoid memory alloc in SetCurrentThreadName * added command line parsing helpers to zencore/commandline.h * removed IoBuffer direct VirtualAlloc path
* safer path from handle (#195)Dan Engelbrecht2024-10-161-2/+12
| | | * remove PathFromHandle that throws to give better context on failures
* improve iobuffer read error logs (#100)Dan Engelbrecht2024-08-061-23/+47
| | | * Make IoBufferExtendedCore::Materialize error reporting match Materialize
* workspace shares (#84)Dan Engelbrecht2024-05-291-3/+9
| | | Feature: New 'workspaces' service which allows a user to share a local folder via zenserver. A workspace can have mulitple workspace shares and they provie an HTTP API that is compatible with the project oplog HTTP API. Workspaces and shares are preserved between runs. Workspaces feature is disabled by default - enable with --workspaces-enabled option when launching zenserver.
* iobuffer memstomp fix (#85)Dan Engelbrecht2024-05-211-0/+4
| | | | | * Don't try to validate empty compact binary * Don't try to free fake memory buffer pointer in iobuffer destructor
* use direct file access for large file hash (#63)Dan Engelbrecht2024-04-261-25/+0
| | | - Improvement: Refactor `IoHash::HashBuffer` and `BLAKE3::HashBuffer` to not use memory mapped files. Performs better and saves ~10% of oplog export time on CI
* special treatment large oplog attachments v2 (#5)Dan Engelbrecht2024-03-141-3/+4
| | | | | - Bugfix: Install Ctrl+C handler earlier when doing `zen oplog-export` and `zen oplog-export` to properly cancel jobs - Improvement: Add ability to block a set of CAS entries from GC in project store - Improvement: Large attachments and loose files are now split into smaller chunks and stored in blocks during oplog export
* hashing fixes (#657)Dan Engelbrecht2024-02-261-2/+19
| | | | | * 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
* exception on basicfile read error (#642)Dan Engelbrecht2024-01-291-2/+2
| | | | | * Change BasicFile::Read to throw exception like IoBuffer - Don't ASSERT on dwNumberOfBytesRead == NumberOfBytesToRead - throw exception with details instead - Use proper return type for pread()
* fix leak in IoBuffer for manifested small chunk (#618)Stefan Boberg2023-12-191-2/+2
| | | | * fix leak in IoBuffer for manifested small chunk. previously it would null out the `m_DataPtr` member on every path from `IoBufferExtendedCore::~IoBufferExtendedCore()` but it only really makes sense to null it out when the buffer has been memory mapped
* keep a "null" iobuffer core to reduce redundant memory allocations (#507)Dan Engelbrecht2023-11-061-0/+2
|
* added missing includes (#504)Stefan Boberg2023-10-271-0/+2
| | | | | this change adds some includes to files which "inherit" includes from elsewhere this was exposed on another branch when removing some heavy dependencies from central headers
* ZenCacheMemoryLayer should always store values using memory buffers (#451)Stefan Boberg2023-10-051-2/+5
| | | | | | | | this change fixes a problem where the memory cache layer can inadvertently prevent underlying block store files from being deleted * ensure we get memory buffers on all paths * added more context to error in IoBufferBuilder::ReadFromFileMaybe * fixed problematic pread call success check in IoBufferBuilder::ReadFromFileMaybe which would always report failure on Linux/MacOS
* fixed issue where IoBufferBuilder::ReadFromFileMaybe loses content type (#450)Stefan Boberg2023-10-051-1/+3
|
* Handle OOM and OOD more gracefully to not spam Sentry with error reports (#434)Dan Engelbrecht2023-10-021-13/+13
| | | | | | - Improvement: Catch Out Of Memory and Out Of Disk exceptions and report back to reqeuster without reporting an error to Sentry - Improvement: If creating bucket fails when storing and item in the structured cache, log a warning and propagate error to requester without reporting an error to Sentry - Improvement: Make an explicit flush of the active block written to in blockstore flush - Improvement: Make sure cache and cas MakeIndexSnapshot does not throw exception on failure which would cause and abnormal termniation at exit
* add more trace scopes (#362)Dan Engelbrecht2023-09-151-0/+14
| | | | | * more trace scopes * Make sure ReplayLogEntries uses the correct size for oplog buffer * changelog
* Make sure error logging or destructors don't throw exception when trying to ↵Dan Engelbrecht2023-09-121-7/+10
| | | | | get file name from handle (#393) - Bugfix: Make sure error logging or destructors don't throw exception when trying to get file name from handle
* stream oplog attachments from jupiter (#384)Dan Engelbrecht2023-09-061-13/+16
| | | | | | | | | | * stream large downloads from jupiter to temporary file * rework DeleteOnClose - top level marks file for delete and if lower level parts wants to keep it it clears that flag * changelog * log number of attachments to download * add delay on jupiter request failure when retrying * make sure we upload all attachments even if Needs are empty when ForceUpload is true release TempAttachment as soon as it is used * sort attachments so we get predictable blocks for the same oplog
* use better hash function for better distribution in IoBuffer g_MappingLocks ↵Dan Engelbrecht2023-08-211-1/+10
| | | | | | (#370) * use better hash function for better distribution in IoBuffer g_MappingLocks * changelog
* use exception when allocations fail rather than asserts (#319)Dan Engelbrecht2023-05-231-4/+10
| | | | * use exception when allocations fail rather than asserts * changelog
* brought over minor IoBuffer changes from sb/scrubStefan Boberg2023-05-151-0/+1
| | | | no actual code changes, just comments
* added IoBuffer.mmap test caseStefan Boberg2023-05-151-0/+27
| | | | | | this verifies that attempting to map a range outside the underlying file fails. Posix appears to offer different semantics so it silently accepts it still however.
* Remove ATL header usage (#306)Stefan Boberg2023-05-151-3/+3
| | | ATL has been used here and there as a convenience. Given that this is a legacy component and not always something which gets installed along with the compiler we hereby remove the dependency altogether in favour of our own simple wrappers
* better logging/exception when reading file in IoBuffer::Materialize fails (#294)Dan Engelbrecht2023-05-121-8/+37
| | | | * better logging/exception when reading file in IoBuffer::Materialize fails * changelog
* add context to MapViewOfFile errors (#282)Stefan Boberg2023-05-091-3/+6
| | | | * added FileSizeFromHandle function * added file size to error message when MapViewOfFile fails
* moved source directories into `/src` (#264)Stefan Boberg2023-05-021-0/+653
* moved source directories into `/src` * updated bundle.lua for new `src` path * moved some docs, icon * removed old test trees