if(segstart == scan->start)
{
last->next = scan->next; // unlink block
- MM_FreeBlock(scan, mm);
+ FREEBLOCK(scan);
scan = last;
}
else
if(extra > 0)
{
- MM_GetNewBlock(mm);
+ //MM_GetNewBlock(mm);
+ GETNEWBLOCK;
mm->mmnew->next = scan->next;
scan->next = mm->mmnew;
mm->mmnew->start = segstart+seglength;
// locked block of all memory until we punch out free space
//
//printf(" newblock making!\n");
- MM_GetNewBlock(mm);
+ //MM_GetNewBlock(mm);
+ GETNEWBLOCK;
mm->mmhead = mm->mmnew; // this will allways be the first node
mm->mmnew->start = 0;
mm->mmnew->length = 0xffff;
#ifdef __WATCOMC__
_nheapgrow();
length=(dword)_memmax();//(dword)GetFreeSize();
- start = (void huge *)(mm->nearheap = _nmalloc(length));
+ start = (mm->nearheap = (void huge *)_nmalloc(length));
#endif
#ifdef __BORLANDC__
length=coreleft();
- start = (void huge *)(mm->nearheap = malloc(length));
+ start = (mm->nearheap = malloc(length));
#endif
length -= 16-(FP_OFF(start)&15);
length -= SAVENEARHEAP;
needed = (size+15)/16; // convert size from bytes to paragraphs
printf("."); //0000
- MM_GetNewBlock(mm); // fill in start and next after a spot is found
+ //MM_GetNewBlock(mm);
+ GETNEWBLOCK; // fill in start and next after a spot is found
mm->mmnew->length = needed;
mm->mmnew->useptr = baseptr;
mm->mmnew->attributes = BASEATTRIBUTES;
{ // free the purgable block
printf(" freeing block~\n"); //0000
next = purge->next;
- MM_FreeBlock(purge, mm);
+ FREEBLOCK(purge);
+ //MM_FreeBlock(purge, mm);
purge = next; // purge another if not at scan
}
mm->mmrover = mm->mmnew;
last->next = scan->next;
- MM_FreeBlock(scan, mm);
+ FREEBLOCK(scan);
+ //MM_FreeBlock(scan, mm);
}
//==========================================================================
// throw out the purgable block
//
next = scan->next;
- MM_FreeBlock(scan, mm);
+ FREEBLOCK(scan);
+ //MM_FreeBlock(scan, mm);
last->next = next;
scan = next;
continue;
void MM_DumpData(mminfo_t *mm)
{
- mmblocktype far *scan,far *best;
+ mmblocktype huge *scan,huge *best;
long lowest,oldlowest;
word owner;
byte lock,purge;
mm->bombonerror = bomb;
}
-void MM_GetNewBlock(mminfo_t *mm)
+/*void MM_GetNewBlock(mminfo_t *mm)
{
if(!mm->mmfree)
MML_ClearBlock(mm);
x->next=mm->mmfree;
mm->mmfree=x;
mm->endid--; //end of list
-}
+}*/
void MM_seguin(void)
{