DescriptionRe-land: base: Replace PurgeAndTruncate with Shrink function.
This cleans up the API a bit and allows the code to be unit tested.
This also prevents ftruncate from being used on Android where
shared memory is backed by Ashmem. Ashmem doesn't support ftruncate.
BUG=466509
TEST=base_unittests --gtest_filter=DiscardableSharedMemoryTest.Shrink
Committed: https://crrev.com/59d32f501694975c4011ea85a67060a41140d0f4
Cr-Commit-Position: refs/heads/master@{#323941}
Patch Set 1 #Patch Set 2 : avoid using ftruncate on android #
Total comments: 2
Patch Set 3 : remove IsShrinkingSupported #
Total comments: 2
Patch Set 4 : add DISCARDABLE_SHARED_MEMORY_SHRINKING define #
Total comments: 2
Patch Set 5 : move define #Patch Set 6 : avoid changes in behavior #Patch Set 7 : fix typo #
Messages
Total messages: 24 (6 generated)
|