implement Android M_PURGE mallopt via malloc_trim

pull/87/head
Daniel Micay 2019-04-07 03:35:26 -04:00
parent 4f08e40fe5
commit 3d18fb8074
1 changed files with 6 additions and 0 deletions

View File

@ -1557,6 +1557,12 @@ EXPORT size_t h_malloc_object_size_fast(void *p) {
} }
EXPORT int h_mallopt(UNUSED int param, UNUSED int value) { 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; return 0;
} }