mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 04:42:32 +00:00
Give defspaces some backing memory.
I'm not sure I want all defspaces to have backing memory, but this will do for now.
This commit is contained in:
parent
34ffce50fa
commit
27c5139612
1 changed files with 6 additions and 1 deletions
|
@ -65,10 +65,15 @@ typedef struct locref_s {
|
|||
static defspace_t *free_spaces;
|
||||
static locref_t *free_locrefs;
|
||||
|
||||
#define GROW 1024
|
||||
|
||||
static int
|
||||
grow_space (defspace_t *space)
|
||||
{
|
||||
space->max_size += 1024;
|
||||
int size = space->max_size + GROW;
|
||||
space->data = realloc (space->data, size * sizeof (pr_type_t));
|
||||
memset (space->data + space->max_size, 0, GROW * sizeof (pr_type_t));
|
||||
space->max_size = size;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue