Skip to content

v0.3.1: Read File Optimizations - mmap

Latest
Compare
Choose a tag to compare
@recp recp released this 18 Aug 18:23

AssetKit now provides an option to read files with mmap (Windows also supported). This options is enabled as default. To disable mmap

ak_opt_set(AK_OPT_USE_MMAP, false);

New Features:

  • New Option: AK_OPT_USE_MMAP boolean, default is true.
  • Expose mmap api to usable externally
  • mmap-ed memories can be attached to a memory node, unmap will be called before memory node is free-ed
    • ak_mmap_rdonly(int fd, size_t size) - map file as READONLY
    • ak_unmap(void *file, size_t size)- unmap file
    • ak_mmap_attach(void *obj, void *mapped, size_t sized) - attach mmap to memory to unmap automatically
    • ak_unmmap_attached(void *obj) - unmap all attached mmap files

Bugfixes and Improvements:

  • fix ak_strtok_count_fast for READONLY memory
  • util: remove modes from ak_readfile and make it "rb" globally
  • dae: fix writing READONLY memory
  • memory: fix URL memory extension
  • some other improvements