[RFA] JVMTI/JDWP GetAllLoadedClasses

Tom Tromey tromey@redhat.com
Tue Apr 24 21:42:00 GMT 2007

>>>>> "Kyle" == Kyle Galloway <kgallowa@redhat.com> writes:

Kyle> In order to avoid problems with circular class loading(try to
Kyle> load a class, then try to add it to the class list, whihc
Kyle> requires WeakReference to be loaded, which needs to be stored in
Kyle> the list, whichi requires WeakReference to be loaded...and so
Kyle> on), until it can be assured that WeakReference is loaded (which
Kyle> is checked in ClassList::setup ()), the classes that have been
Kyle> loaded are stored in a temporary linked list of jclass *.  When
Kyle> setup is called, these classes are transferred over to the
Kyle> WeakReference list, and the memory used by this temporary list
Kyle> is freed.

There's some code like this already in the VM startup sequence, to
handle handoff to the bootstrap class loader after it is created.
Maybe we could reuse this somehow.

Kyle> +  return (::java::util::Collection *) (cls_lst);

Just for future reference, there's no need to cast from a subclass to
a superclass.  This can be done implicitly.


More information about the Java-patches mailing list