mirror of
https://github.com/GrapheneOS/hardened_malloc.git
synced 2025-04-20 06:20:20 +02:00
implement Android M_PURGE mallopt via malloc_trim
This commit is contained in:
parent
4f08e40fe5
commit
3d18fb8074
1 changed files with 6 additions and 0 deletions
|
@ -1557,6 +1557,12 @@ EXPORT size_t h_malloc_object_size_fast(void *p) {
|
|||
}
|
||||
|
||||
EXPORT int h_mallopt(UNUSED int param, UNUSED int value) {
|
||||
#ifdef __ANDROID__
|
||||
if (param == M_PURGE) {
|
||||
h_malloc_trim(0);
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue