Pre-allocating key segments