- /* Invalidate the cache from IDX onwards */
- for ( i = idx ; i < d->cache_size ; ++i )
- {
- g_free(d->variables[i]);
- d->variables[i] = 0;
- }
-
- /* Ensure that the cache is large enough */
- if ( dict_get_var_cnt(d->dict) >= d->cache_size )
- {
- d->variables = g_realloc(d->variables, sizeof(struct PsppireVariable*) *
- (d->cache_size + CACHE_CHUNK));
- d->cache_size += CACHE_CHUNK;
- }
-
- /* Zero the new pointers */
- for ( ; i < d->cache_size ; ++i )
- {
- d->variables[i] = 0;
- }
-
- if ( ! name )
- name = auto_generate_var_name(d);
-
- var = dict_create_var(d->dict, name, 0);