agent/src/share/classes/sun/jvm/hotspot/memory/FreeList.java

Print this page




  24  *
  25  */
  26 
  27 package sun.jvm.hotspot.memory;
  28 
  29 import java.util.*;
  30 import sun.jvm.hotspot.debugger.*;
  31 import sun.jvm.hotspot.types.*;
  32 import sun.jvm.hotspot.runtime.*;
  33 
  34 public class FreeList extends VMObject {
  35    static {
  36       VM.registerVMInitializedObserver(new Observer() {
  37          public void update(Observable o, Object data) {
  38             initialize(VM.getVM().getTypeDataBase());
  39          }
  40       });
  41    }
  42 
  43    private static synchronized void initialize(TypeDataBase db) {
  44       Type type = db.lookupType("FreeList");
  45       sizeField = type.getCIntegerField("_size");
  46       countField = type.getCIntegerField("_count");
  47       headerSize = type.getSize();
  48    }
  49 
  50    // Fields
  51    private static CIntegerField sizeField;
  52    private static CIntegerField countField;
  53    private static long          headerSize;
  54 
  55    //Constructor
  56    public FreeList(Address address) {
  57      super(address);
  58    }
  59 
  60    // Accessors
  61    public long size() {
  62       return sizeField.getValue(addr);
  63    }
  64 


  24  *
  25  */
  26 
  27 package sun.jvm.hotspot.memory;
  28 
  29 import java.util.*;
  30 import sun.jvm.hotspot.debugger.*;
  31 import sun.jvm.hotspot.types.*;
  32 import sun.jvm.hotspot.runtime.*;
  33 
  34 public class FreeList extends VMObject {
  35    static {
  36       VM.registerVMInitializedObserver(new Observer() {
  37          public void update(Observable o, Object data) {
  38             initialize(VM.getVM().getTypeDataBase());
  39          }
  40       });
  41    }
  42 
  43    private static synchronized void initialize(TypeDataBase db) {
  44       Type type = db.lookupType("FreeList<FreeChunk>");
  45       sizeField = type.getCIntegerField("_size");
  46       countField = type.getCIntegerField("_count");
  47       headerSize = type.getSize();
  48    }
  49 
  50    // Fields
  51    private static CIntegerField sizeField;
  52    private static CIntegerField countField;
  53    private static long          headerSize;
  54 
  55    //Constructor
  56    public FreeList(Address address) {
  57      super(address);
  58    }
  59 
  60    // Accessors
  61    public long size() {
  62       return sizeField.getValue(addr);
  63    }
  64