Seems the #else is always enabled here, perhaps inline this function into alloc_code() below?