| 254 | } // anonymous namespace |
| 255 | |
| 256 | void* slab_allocator_registry_get(fl::size block_size, fl::size slab_size) { |
| 257 | for (int i = 0; i < slab_registry_count; i++) { |
| 258 | if (slab_registry[i].block_size == block_size && |
| 259 | slab_registry[i].slab_size == slab_size) { |
| 260 | return slab_registry[i].allocator; |
| 261 | } |
| 262 | } |
| 263 | return nullptr; |
| 264 | } |
| 265 | |
| 266 | void slab_allocator_registry_set(fl::size block_size, fl::size slab_size, void* allocator) { |
| 267 | // Check if already registered (update) |