mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 23:32:09 +00:00
Give reusable temps their own linked list.
The next field is used for linking all defs in a space. Oops.
This commit is contained in:
parent
1af4d5eeed
commit
158e261a8f
2 changed files with 4 additions and 3 deletions
|
@ -37,6 +37,7 @@
|
|||
typedef struct def_s {
|
||||
struct def_s *next; ///< general purpose linking
|
||||
|
||||
struct def_s *temp_next; ///< linked list of "free" temp defs
|
||||
struct type_s *type;
|
||||
const char *name;
|
||||
struct defspace_s *space;
|
||||
|
|
|
@ -163,8 +163,8 @@ temp_def (etype_t type, int size)
|
|||
defspace_t *space = current_func->symtab->space;
|
||||
|
||||
if ((temp = current_func->temp_defs[size - 1])) {
|
||||
current_func->temp_defs[size - 1] = temp->next;
|
||||
temp->next = 0;
|
||||
current_func->temp_defs[size - 1] = temp->temp_next;
|
||||
temp->temp_next = 0;
|
||||
} else {
|
||||
ALLOC (16384, def_t, defs, temp);
|
||||
temp->offset = defspace_alloc_loc (space, size);
|
||||
|
@ -185,7 +185,7 @@ void
|
|||
free_temp_def (def_t *temp)
|
||||
{
|
||||
int size = type_size (temp->type) - 1;
|
||||
temp->next = current_func->temp_defs[size];
|
||||
temp->temp_next = current_func->temp_defs[size];
|
||||
current_func->temp_defs[size] = temp;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue