implement Android M_PURGE mallopt via malloc_trim

This commit is contained in:
Daniel Micay 2019-04-07 03:35:26 -04:00
parent 4f08e40fe5
commit 3d18fb8074

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) {
#ifdef __ANDROID__
if (param == M_PURGE) {
h_malloc_trim(0);
return 1;
}
#endif
return 0;
}