Hi,
 
Why push a newly created object to the decrement buffer right after it is created? What if the GC runs immediately after the allocation and thus releases the new object just before the program is about to use it? I'm refering to this code in RefCount.java:
 
public final void postAlloc(ObjectReference object, ObjectReference typeRef,
                              int bytes, int allocator)
    throws NoInlinePragma {
    switch (allocator) {
    case ALLOC_RC:
      RefCountLocal.unsyncLiveObject(object);
    case ALLOC_LOS:
      if (WITH_COALESCING_RC) modBuffer.push(object);
      decBuffer.push(object);
      if (RefCountSpace.RC_SANITY_CHECK) RefCountLocal.sanityAllocCount(object);
      RefCountSpace.initializeHeader(object, typeRef, true);
      return;
 
Thanks,
 
Shachar
 


Yahoo! Sports
Rekindle the Rivalries. Sign up for Fantasy Football