aboutsummaryrefslogtreecommitdiff
path: root/src/zencore/memory.cpp
Commit message (Collapse)AuthorAgeFilesLines
* split zencore/memory.h -> memoryview.h, memcmp.h (#228)Stefan Boberg2024-11-251-45/+0
| | | | | | | 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-54/+1
| | | | | | | | | | | | | 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-115/+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
* use mimalloc where available (#601)Stefan Boberg2023-12-121-15/+11
| | | enabling mimalloc path for `Memory::Alloc` and `Memory::Free`
* make sure we validate pointers returned from zen::Memory::Alloc (#341)Dan Engelbrecht2023-08-011-2/+8
| | | * make sure we validate pointers returned from zen::Memory::Alloc
* moved source directories into `/src` (#264)Stefan Boberg2023-05-021-0/+211
* moved source directories into `/src` * updated bundle.lua for new `src` path * moved some docs, icon * removed old test trees