mirror of
https://git.planet-casio.com/Lephenixnoir/gint.git
synced 2024-12-28 04:23:36 +01:00
kmalloc: add kmalloc_remove_arena() function
This commit is contained in:
parent
542b4f0a81
commit
e50769c824
2 changed files with 14 additions and 0 deletions
|
@ -108,6 +108,11 @@ void kmalloc_init_arena(kmalloc_arena_t *a, bool enable_statistics);
|
||||||
success, false if the maximum number of arenas has been reached. */
|
success, false if the maximum number of arenas has been reached. */
|
||||||
bool kmalloc_add_arena(kmalloc_arena_t *arena);
|
bool kmalloc_add_arena(kmalloc_arena_t *arena);
|
||||||
|
|
||||||
|
/* kmalloc_remove_arena(): Remove an arena from the heap source
|
||||||
|
Removes an arena from the heap source. The arena should certainly be empty,
|
||||||
|
although this function will not check that. */
|
||||||
|
void kmalloc_remove_arena(kmalloc_arena_t *arena);
|
||||||
|
|
||||||
//---
|
//---
|
||||||
// Internal functions
|
// Internal functions
|
||||||
//---
|
//---
|
||||||
|
|
|
@ -184,3 +184,12 @@ bool kmalloc_add_arena(kmalloc_arena_t *arena)
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void kmalloc_remove_arena(kmalloc_arena_t *arena)
|
||||||
|
{
|
||||||
|
for(int i = 0; i < KMALLOC_ARENA_MAX; i++)
|
||||||
|
{
|
||||||
|
if(arenas[i] == arena)
|
||||||
|
arenas[i] = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue