OSDN Git Service

Replace collect with clear for the SoftReference policy.
authorCarl Shapiro <cshapiro@google.com>
Sun, 23 Jan 2011 23:58:31 +0000 (15:58 -0800)
committerCarl Shapiro <cshapiro@google.com>
Mon, 24 Jan 2011 00:02:16 +0000 (16:02 -0800)
commita371fad368c4d697b2906079bfbe8059269ed362
treea9ec6e970865f276ebdc5fa9d81c35399acaf8e8
parent6ff6ec6b6361db707e4b0318075fc38dd319a49a
Replace collect with clear for the SoftReference policy.

The garbage collector is invoked with a parameter that changes the
SoftReference clearing policy.  This parameter is normally false,
meaning the garbage collector will attempt to preserve some
softly-reachable referents of SoftReference instances.  When true, the
garbage collector will treat SoftReference instances as WeakReference
instances and always clearly referent fields with softly-reachable
referents.

The code refers to this action as collecting soft references which is
misleading.  The change to the garbage collector policy has an effect
on the referent field of SoftReference instances and any SoftReference
instance which is unreachable is subject collection like any other
object.  With this change we now use the description clearing soft
refernces to describe the policy.

Bug: 3381480

Change-Id: Ie179514e68d4621237b08658c1c55811a49f1210
vm/alloc/Alloc.c
vm/alloc/Alloc.h
vm/alloc/Heap.c