idx_set_allocated
if (idx_set_allocated(chunk, idx, true)) {
if (idx_set_allocated(chunk, retidx, true))
ret = idx_set_allocated(chunk, idx, false);