harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From x..@apache.org
Subject svn commit: r566916 - in /harmony/enhanced/drlvm/trunk/vm/gc_gen/src/los: lspace.h lspace_alloc_collect.cpp
Date Fri, 17 Aug 2007 04:40:45 GMT
Author: xli
Date: Thu Aug 16 21:40:44 2007
New Revision: 566916

URL: http://svn.apache.org/viewvc?view=rev&rev=566916
Log:
fix an issue in Runtime.freeMemory

Modified:
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/los/lspace.h
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/los/lspace_alloc_collect.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/los/lspace.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/los/lspace.h?view=diff&rev=566916&r1=566915&r2=566916
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/los/lspace.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/los/lspace.h Thu Aug 16 21:40:44 2007
@@ -50,7 +50,7 @@
   /*LOS_Shrink:This field stands for sliding compact to lspace */
   Boolean move_object;
 
-  /* Size allocted since last minor collection. */
+  /* Size allocted since last collection. */
   volatile uint64 last_alloced_size;
   /* Size allocted since last major collection. */
   uint64 accumu_alloced_size;
@@ -86,7 +86,8 @@
 
 inline POINTER_SIZE_INT lspace_free_memory_size(Lspace* lspace)
 { /* FIXME:: */
-  return (lspace->committed_heap_size - (POINTER_SIZE_INT)lspace->last_surviving_size);
+  assert(lspace->committed_heap_size > (POINTER_SIZE_INT)lspace->last_surviving_size
+ (POINTER_SIZE_INT)lspace->last_alloced_size);
+  return (lspace->committed_heap_size - (POINTER_SIZE_INT)lspace->last_surviving_size
- (POINTER_SIZE_INT)lspace->last_alloced_size);
 }
 inline POINTER_SIZE_INT lspace_committed_size(Lspace* lspace){ return lspace->committed_heap_size;
}
 

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/los/lspace_alloc_collect.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/los/lspace_alloc_collect.cpp?view=diff&rev=566916&r1=566915&r2=566916
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/los/lspace_alloc_collect.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/los/lspace_alloc_collect.cpp Thu Aug 16 21:40:44
2007
@@ -285,7 +285,6 @@
   
   lspace->scompact_fa_start = dest_addr;
   lspace->scompact_fa_end= lspace->heap_end;
-  lspace->last_surviving_size = (POINTER_SIZE_INT)dest_addr - (POINTER_SIZE_INT)lspace->heap_start;
   return;
 }
 
@@ -372,6 +371,7 @@
 //    lspace->accumu_alloced_size = 0;    
 //    lspace->last_alloced_size = 0;        
     lspace->period_surviving_size = (POINTER_SIZE_INT)lspace->scompact_fa_start - (POINTER_SIZE_INT)lspace->heap_start;
+    lspace->last_surviving_size = lspace->period_surviving_size;
     lspace->survive_ratio = (float)lspace->accumu_alloced_size / (float)lspace->committed_heap_size;
 
     los_boundary = lspace->heap_end;



Mime
View raw message