[PATCH 2/2] Class loader local storage (original) (raw)

David M. Lloyd david.lloyd at redhat.com
Thu Feb 26 16:07:00 UTC 2009


This second patch adds a ClassLoaderLocal mechanism. The cost is one reference per class loader, plus one WeakHashMap for every class class loader which has local information associated with it. The map has one key for every ClassLoaderLocal which is currently storing data on this ClassLoaderLocal.

-- diff -r dde3fe2e8164 src/share/classes/java/lang/ClassLoader.java --- a/src/share/classes/java/lang/ClassLoader.java Wed Feb 25 14:32:01 2009 +0000 +++ b/src/share/classes/java/lang/ClassLoader.java Thu Feb 26 09:53:12 2009 -0600 @@ -48,6 +48,7 @@ import java.util.Stack; import java.util.Map; import java.util.Vector; +import java.util.WeakHashMap; import sun.misc.ClassFileTransformer; import sun.misc.CompoundEnumeration; import sun.misc.Resource; @@ -2012,6 +2013,17 @@

  // Retrieves the assertion directives from the VM.
  private static native AssertionStatusDirectives retrieveDirectives();

this.classLoaderLocalMap;

Object>());

}

diff -r dde3fe2e8164 src/share/classes/java/lang/ClassLoaderLocal.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/share/classes/java/lang/ClassLoaderLocal.java Thu Feb 26 09:53:12 2009 -0600 @@ -0,0 +1,211 @@ +/*

(even

this

null}

there

null}

loader

variable

null}

given

null}

given

+} \ No newline at end of file



More information about the core-libs-dev mailing list