Odin icon indicating copy to clipboard operation
Odin copied to clipboard

Using maps with dynamic pool allocator causes panic

Open abseee opened this issue 1 year ago • 3 comments

Context

  • Operating System & Odin Version: Odin: dev-2024-08 OS: Arch Linux, Linux 6.10.7-arch1-1 CPU: Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz RAM: 15932 MiB Backend: LLVM 18.1.8

Expected Behavior

The dynamic pool allocator should work with maps by default

Current Behavior

Inserting into a map causes a panic panic: allocation not aligned to a cache line from map_alloc_dynamic

Steps to Reproduce

    pool := mem.Dynamic_Pool{}
    mem.dynamic_pool_init(&pool)
    // pool.alignment = 64
    defer mem.dynamic_pool_destroy(&pool)
    pool_alloc := mem.dynamic_pool_allocator(&pool)
    context.allocator = pool_alloc
    my_map := map[string]bool {}
    defer delete(my_map)
    my_map["foo"] = true

abseee avatar Sep 03 '24 22:09 abseee