Clear image caches in reaction to system VM warnings
* java/org/gnu/emacs/EmacsNative.java (onLowMemory): * java/org/gnu/emacs/EmacsService.java (onLowMemory): New function. * src/android.c (android_on_low_memory, onLowMemory): New functions called when a VM caution is registered. Clear the image cache and run garbage collection.
This commit is contained in:
@@ -321,6 +321,10 @@ public final class EmacsService extends Service
|
||||
}
|
||||
}
|
||||
|
||||
/* The native functions the subsequent two functions call do nothing
|
||||
in the infrequent case the Emacs thread is awaiting a response
|
||||
for the main thread. Caveat emptor! */
|
||||
|
||||
@Override
|
||||
public void
|
||||
onDestroy ()
|
||||
@@ -333,6 +337,14 @@ public final class EmacsService extends Service
|
||||
super.onDestroy ();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void
|
||||
onLowMemory ()
|
||||
{
|
||||
EmacsNative.onLowMemory ();
|
||||
super.onLowMemory ();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Functions from here on must only be called from the Emacs
|
||||
|
||||
Reference in New Issue
Block a user