mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-04-11 20:03:11 +00:00
[set] Allow a set pool to be cleaned up
In the end, I couldn't use it (due to needing to hold onto the sets), but it balances the init.
This commit is contained in:
parent
e477148a9b
commit
2768606f1d
2 changed files with 9 additions and 2 deletions
|
@ -125,6 +125,7 @@ typedef struct set_pool_s {
|
|||
} set_pool_t;
|
||||
|
||||
void set_pool_init (set_pool_t *set_pool);
|
||||
void set_pool_clear (set_pool_t *set_pool);
|
||||
|
||||
/** Delete a set iterator that is no longer needed.
|
||||
|
||||
|
|
|
@ -86,6 +86,13 @@ set_pool_init (set_pool_t *set_pool)
|
|||
};
|
||||
}
|
||||
|
||||
void
|
||||
set_pool_clear (set_pool_t *set_pool)
|
||||
{
|
||||
ALLOC_FREE_BLOCKS (set_pool->set);
|
||||
ALLOC_FREE_BLOCKS (set_pool->set_iter);
|
||||
}
|
||||
|
||||
inline set_t *
|
||||
set_new_r (set_pool_t *set_pool)
|
||||
{
|
||||
|
@ -835,8 +842,7 @@ set_as_string (const set_t *set)
|
|||
static void
|
||||
set_shutdown (void *data)
|
||||
{
|
||||
ALLOC_FREE_BLOCKS (static_set_pool.set);
|
||||
ALLOC_FREE_BLOCKS (static_set_pool.set_iter);
|
||||
set_pool_clear (&static_set_pool);
|
||||
}
|
||||
|
||||
static void __attribute__((constructor))
|
||||
|
|
Loading…
Reference in a new issue