modified: DEBUG.TXT
modified: MMDUMP.TXT
modified: exmmtest.exe
modified: src/exmmtest.c
modified: src/lib/16_mm.c
modified: src/lib/16_mm.h
-Seg:ffff Size:917520 Owner:0x0\r
-\r
-MM_ShowMemory: Memory block order currupted!\r
+Seg:0 Size:105968 Owner:0x46f6\r
+Seg:19df Size:4096 Owner:0x56f8\r
+Seg:216f Size:8592 Owner:0x2ef7\r
+Seg:6386 Size:640912 Owner:0x8003\r
#pragma warn -pro\r
#pragma warn -use
#pragma warn -pro\r
#pragma warn -use
{
int i;
dword length,seglength;
{
int i;
dword length,seglength;
+ //dword length; word seglength;
- unsigned segstart,endfree;
+ word segstart;//,endfree;
- //printf("mmi->segu=%Fp\n", (mmi->segu));
if(mm->mmstarted)
MM_Shutdown(mm);
if(mm->mmstarted)
MM_Shutdown(mm);
//
// set up the linked list (everything in the free list;
//
//
// set up the linked list (everything in the free list;
//
- printf(" linked list making!\n");
+ //printf(" linked list making!\n");
mm->mmhead = NULL;
mm->mmfree = &(mm->mmblocks[0]);
for(i=0;i<MAXBLOCKS-1;i++)
mm->mmhead = NULL;
mm->mmfree = &(mm->mmblocks[0]);
for(i=0;i<MAXBLOCKS-1;i++)
mm->mmblocks[i].next = &(mm->mmblocks[i+1]);
}
mm->mmblocks[i].next = NULL;
mm->mmblocks[i].next = &(mm->mmblocks[i+1]);
}
mm->mmblocks[i].next = NULL;
- //printf("mmi->segu=%Fp\n", (mmi->segu));
//
// locked block of all memory until we punch out free space
//
//
// locked block of all memory until we punch out free space
//
- printf(" newblock making!\n");
+ //printf(" newblock making!\n");
MM_GetNewBlock(mm);
mm->mmhead = mm->mmnew; // this will allways be the first node
mm->mmnew->start = 0;
MM_GetNewBlock(mm);
mm->mmhead = mm->mmnew; // this will allways be the first node
mm->mmnew->start = 0;
mm->mmnew->attributes = LOCKBIT;
mm->mmnew->next = NULL;
mm->mmrover = mm->mmhead;
mm->mmnew->attributes = LOCKBIT;
mm->mmnew->next = NULL;
mm->mmrover = mm->mmhead;
- //printf("mmi->segu=%Fp\n", (mmi->segu));
//
// get all available near conventional memory segments
//
// get all available near conventional memory segments
printf(" nearheap making!\n");
//---- length=coreleft();
_nheapgrow();
printf(" nearheap making!\n");
//---- length=coreleft();
_nheapgrow();
- length=GetFreeSize();//_memmax();
- start = /*(void huge *)*/(mm->nearheap = _nmalloc(length));
+ length=_memmax();
+ start = (void huge *)(mm->nearheap = malloc(length));
length -= 16-(FP_OFF(start)&15);
length -= SAVENEARHEAP;
seglength = length / 16; // now in paragraphs
segstart = FP_SEG(start)+(FP_OFF(start)+15)/16;
MML_UseSpace(segstart,seglength, mm);
mmi->nearheap = length;
length -= 16-(FP_OFF(start)&15);
length -= SAVENEARHEAP;
seglength = length / 16; // now in paragraphs
segstart = FP_SEG(start)+(FP_OFF(start)+15)/16;
MML_UseSpace(segstart,seglength, mm);
mmi->nearheap = length;
+ printf("start=%Fp segstart=%x seglen=%lu len=%lu\n", start, segstart, seglength, length);
/*switch( _nheapchk() ) {
case _HEAPOK:
printf( "OK - nearheap is good\n" );
/*switch( _nheapchk() ) {
case _HEAPOK:
printf( "OK - nearheap is good\n" );
//---- length=farcoreleft();
printf(" farheap making!\n");
_fheapgrow();
//---- length=farcoreleft();
printf(" farheap making!\n");
_fheapgrow();
- length=_memavl();//0xffffUL*4UL;
start = mm->farheap = halloc(length, sizeof(byte));
//start = mm->farheap = _fmalloc(length);
length -= 16-(FP_OFF(start)&15);
start = mm->farheap = halloc(length, sizeof(byte));
//start = mm->farheap = _fmalloc(length);
length -= 16-(FP_OFF(start)&15);
MML_UseSpace(segstart,seglength, mm);
mmi->farheap = length;
mmi->mainmem = mmi->nearheap + mmi->farheap;
MML_UseSpace(segstart,seglength, mm);
mmi->farheap = length;
mmi->mainmem = mmi->nearheap + mmi->farheap;
+ printf("start=%Fp segstart=%x seglen=%lu len=%lu\n", start, segstart, seglength, length);
/*switch( _fheapchk() ) {
case _HEAPOK:
printf( "OK - farheap is good\n" );
/*switch( _fheapchk() ) {
case _HEAPOK:
printf( "OK - farheap is good\n" );
{
dword nearheap,farheap,EMSmem,XMSmem,mainmem;
//__segment segu;
{
dword nearheap,farheap,EMSmem,XMSmem,mainmem;
//__segment segu;
} mminfotype;
//==========================================================================
} mminfotype;
//==========================================================================
#define BASEATTRIBUTES 0 // unlocked, non purgable
#define MAXUMBS 12
#define BASEATTRIBUTES 0 // unlocked, non purgable
#define MAXUMBS 12
-#define MAPPAGES 4//mm->EMSpagesmapped
+#define MAPPAGES mm->EMSpagesmapped
typedef struct mmblockstruct
{
typedef struct mmblockstruct
{
- word start;//,length;
- //dword start,length;
- //word start;
- dword length;
- //byte segm; //how many 64kb segment blocks it takes up if there is many data!
+ //word start,length;
+ word start; dword length;
unsigned attributes;
memptr *useptr; // pointer to the segment start
struct mmblockstruct huge *next;
unsigned attributes;
memptr *useptr; // pointer to the segment start
struct mmblockstruct huge *next;