== default ==
- USED block at 1bd30016 of size 88
- USED block at 1bd3009e of size 42
- FREE block at 1bd300e0 of size 1f1e
- USED block at 1bd31ffe of size 14
- FREE block at 1bd32012 of size 1fea
+ USED block at 1bda0016 of size 88
+ USED block at 1bda009e of size 42
+ USED block at 1bda00e0 of size 1f1e
+ FREE block at 1bda1ffe of size 1ffe
OK - end of heap
== near ==
USED block at 0 of size 0
USED block at 0 of size 0
USED block at 0 of size 0
- USED block at 0 of size 0
OK - end of heap
Memory Type Total Used Free
---------------- -------- -------- --------
-Default 16358 222 16136
-Near 31286 436 30850
-Far 16358 222 16136
+Default 16358 8168 8190
+Near 31286 31286 0
+Far 16358 8168 8190
---------------- -------- -------- --------
-coreleft = 30848
-farcoreleft = 46788
-GetFreeSize = 15960
-GetNearFreeSize = 30850
-GetFarFreeSize = 15960
-memavl = 30848
-stackavail = 17135
+coreleft = 0
+farcoreleft = 7996
+GetFreeSize = 8014
+GetNearFreeSize = 0
+GetFarFreeSize = 8014
+memavl = 0
+stackavail = 17041
}
//find out how many blocks it spans!
- if(seglength>0xffffu)
+ if((word)seglength>0xffffu)
{
// segm=seglength/0x4000u;
- segm=seglength/0xffffu;
+ segm=(word)seglength/0xffffu;
}
else segm=1;
mm->mmstarted = true;
mm->bombonerror = true;
+ mm->endid=0;
//
// set up the linked list (everything in the free list;
{
mmblocktype huge *scan,huge *lastscan,huge *endscan,huge *purge,huge *next;
int search;
- unsigned needed,startseg;
+ dword needed;
+ word startseg;
needed = (size+15)/16; // convert size from bytes to paragraphs
printf("."); //0000
mm->mmnew->useptr = baseptr;
mm->mmnew->attributes = BASEATTRIBUTES;
printf("."); //0000
- for(search = 0; search<3; search++)
+ for(search = 0; search<mm->endid; search++)
{
-printf("|[case]"); //0000
+printf(" [case]"); //0000
//
// first search: try to allocate right after the rover, then on up
// second search: search from the head pointer up to the rover
switch(search)
{
case 0:
-printf("0"); //0000
+printf("0 "); //0000
lastscan = mm->mmrover;
scan = mm->mmrover->next;
endscan = NULL;
break;
case 1:
-printf("1"); //0000
+printf("1 "); //0000
lastscan = mm->mmhead;
scan = mm->mmhead->next;
endscan = mm->mmrover;
break;
case 2:
-printf("2"); //0000
+printf("2 "); //0000
MM_SortMem(mm);
lastscan = mm->mmhead;
scan = mm->mmhead->next;
break;
}
- startseg = lastscan->start + lastscan->length;
+ startseg = lastscan->start + (word)lastscan->length;
while(scan != endscan)
{
-printf(","); //0000
+//printf(","); //0000
if(scan->start - startseg >= needed)
{
-printf("\\"); //0000
+printf("."); //0000
//
// got enough space between the end of lastscan and
// the start of scan, so throw out anything in the middle
//
purge = lastscan->next;
lastscan->next = mm->mmnew;
- mm->mmnew->start = *(unsigned *)baseptr = startseg;
+ mm->mmnew->start = *(word *)baseptr = startseg;
mm->mmnew->next = scan;
while(purge != scan)
{ // free the purgable block
if((scan->attributes & LOCKBIT)
|| !(scan->attributes & PURGEBITS) )
{
-printf("/[lock]"); //0000
+printf(" [lock] "); //0000
+printf("len=%lu ", scan->length);
lastscan = scan;
- startseg = lastscan->start + lastscan->length;
+ startseg = lastscan->start + (word)lastscan->length;
}
-
+printf("\n");
scan=scan->next; // look at next line
}
}
heapdump();
printf(OUT_OF_MEM_MSG,(size-mmi->nearheap));
printf("for stability reasons the program will shut down! wwww\n");
+ printf(" endid=%u\n",(mm->endid));
MM_Shutdown(mm);
exit(-1);
}
return;
}
mm->mmfree=mm->mmfree->next;
+ mm->endid++; //end of list
}
void MM_FreeBlock(mmblocktype *x, mminfo_t *mm)
x->useptr=NULL;
x->next=mm->mmfree;
mm->mmfree=x;
+ mm->endid--; //end of list
}
void MM_seguin(void)
unsigned totalEMSpages,freeEMSpages,EMSpageframe,EMSpagesmapped,EMShandle;
unsigned int EMSVer;
word numUMBs,UMBbase[MAXUMBS];
+ word endid; //end of list
//dword numUMBs,UMBbase[MAXUMBS];
mmblocktype huge mmblocks[MAXBLOCKS],huge *mmhead,huge *mmfree,huge *mmrover,huge *mmnew;
} mminfo_t;