4 ms·
Both OS X and iOS have the NSPurgeableData class which implements something like this: https://developer.apple.com/library/mac/documentation/Performance/Concept
by Kristine1975 10y ago
Both OS X and iOS have the NSPurgeableData class which implements something like this: https://developer.apple.com/library/mac/documentation/Performance/Conceptual/ManagingMemory/Articles/CachingandPurgeableMemory.html https://developer.apple.com/library/mac/documentation/Perfor...
Edit: Chromium has this: https://chromium.googlesource.com/chromium/src/base/+/master/memory/discardable_memory.h https://chromium.googlesource.com/chromium/src/base/+/master...
- leni536 10y ago"Discardable memory" doesn't seem to be implemented though, however there is an implementation for "discardable shared memory" [1] which seems to offer this volatile behavior. It uses ashmem_pin_region() and ashmem_unpin_region() for Android, which seems to be the equivalent for iOS's NSPurgeableData. I wonder if it does anything useful for any other OS. [1] https://chromium.googlesource.com/chromium/src/base/+/master/memory/discardable_shared_memory.cc https://chromium.googlesource.com/chromium/src/base/+/master...