*/
#include "src/lib/16_mm.h"
+#include "src/lib/16_ca.h"
#pragma hdrstop
#pragma warn -pro
if(extra > 0)
{
GETNEWBLOCK;
+ mm->mmnew->useptr = NULL;
+
mm->mmnew->next = scan->next;
scan->next = mm->mmnew;
mm->mmnew->start = segstart+seglength;
mm->mmstarted = true;
mm->bombonerror = true;
- mm->endid=0;
//
// set up the linked list (everything in the free list;
// detect EMS and allocate up to 64K at page frame
//
mmi->EMSmem = 0;
+//goto emsskip; //0000
for(i = 1;i <
#ifdef __WATCOMC__
__argc
word startseg;
needed = (size+15)/16; // convert size from bytes to paragraphs
-printf("."); //0000
+//printf("."); //0000
GETNEWBLOCK; // fill in start and next after a spot is found
mm->mmnew->length = needed;
mm->mmnew->useptr = baseptr;
mm->mmnew->attributes = BASEATTRIBUTES;
-printf("."); //0000
- for(search = 0; search<mm->endid; search++)
+//printf("."); //0000
+ for(search = 0; search<3; search++)
{
-printf(" [case]"); //0000
+printf("\n [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
break;
}
- startseg = lastscan->start + (word)lastscan->length;
-
+ startseg = lastscan->start + lastscan->length;
+printf(" %x\n", startseg);
while(scan != endscan)
{
-//printf(","); //0000
+printf(","); //0000
if(scan->start - startseg >= needed)
{
printf("."); //0000
printf(" freeing block~\n"); //0000
next = purge->next;
FREEBLOCK(purge);
- //MM_FreeBlock(purge, mm);
purge = next; // purge another if not at scan
}
mm->mmrover = mm->mmnew;
|| !(scan->attributes & PURGEBITS) )
{
printf(" [lock] "); //0000
-printf("len=%lu ", scan->length);
lastscan = scan;
- startseg = lastscan->start + (word)lastscan->length;
+printf("start=%x ", lastscan->start);
+printf("len=%x ", lastscan->length);
+printf("\n"); //0000
+printf(" %x", lastscan->start + lastscan->length); //0000
+printf(" %x", lastscan->start + (word)lastscan->length); //0000
+printf(" %x", (word)lastscan->start + (word)lastscan->length); //0000
+printf("\n"); //0000
+ startseg = (word)lastscan->start + (word)lastscan->length+1;
+printf("startseg =%x ok", startseg); //0000
}
-printf("\n");
+printf(" end\n");
scan=scan->next; // look at next line
+printf("boop\n");//0000
}
}
#endif
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)