From 5b51234f58db1087ed0cb37389c7743af1f18bce Mon Sep 17 00:00:00 2001 From: bdemsky Date: Thu, 14 Jul 2011 11:48:25 +0000 Subject: [PATCH] 1- bug fix 2- pad out empty objects... --- Robust/src/Runtime/bamboo/pmc_forward.c | 14 +++++++++++++- Robust/src/Runtime/bamboo/pmc_refupdate.c | 4 ++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Robust/src/Runtime/bamboo/pmc_forward.c b/Robust/src/Runtime/bamboo/pmc_forward.c index 14788db4..d886b552 100644 --- a/Robust/src/Runtime/bamboo/pmc_forward.c +++ b/Robust/src/Runtime/bamboo/pmc_forward.c @@ -21,6 +21,8 @@ void pmc_count() { void pmc_countbytes(struct pmc_unit * unit, void *bottomptr, void *topptr) { void *tmpptr=bottomptr; unsigned int totalbytes=0; + void * lastunmarked=NULL; + bool padokay=false; while(tmpptrmarked) + if (((struct ___Object___ *)tmpptr)->marked) { + if (lastunmarked!=NULL) { + if (padokay) + padspace(lastunmarked, (unsigned INTPTR) (tmpptr-lastunmarked)); + padokay=false; + lastunmarked=NULL; + } totalbytes+=size; + } else if (lastunmarked!=NULL) + lastunmarked=tmpptr; + else + padokay=true; tmpptr+=size; } unit->numbytes=totalbytes; diff --git a/Robust/src/Runtime/bamboo/pmc_refupdate.c b/Robust/src/Runtime/bamboo/pmc_refupdate.c index 603dc9c9..078c2270 100644 --- a/Robust/src/Runtime/bamboo/pmc_refupdate.c +++ b/Robust/src/Runtime/bamboo/pmc_refupdate.c @@ -245,8 +245,8 @@ void movebackward(void *dstptr, void *origptr, unsigned int length) { void *endtoptr=dstptr+length; if(origptr < endtoptr&&dstptr < origptr+length) { - unsigned int *sptr=origptr+length; - unsigned int *dptr=endtoptr; + unsigned int *sptr=origptr+length-4; + unsigned int *dptr=endtoptr-4; unsigned int len=length; //we will never have an object of size 0.... -- 2.34.1