alloc: make allocate_alloc_state and clear_alloc_state more consistent