rewrite get_allocated_field