slot_allocator: rearrange helper function