]> 4ch.mooo.com Git - 16.git/commitdiff
major instability issues with memory manager!
authorsparky4 <sparky4@cock.li>
Wed, 22 Jul 2015 12:23:18 +0000 (07:23 -0500)
committersparky4 <sparky4@cock.li>
Wed, 22 Jul 2015 12:23:18 +0000 (07:23 -0500)
modified:   DEBUG.TXT
modified:   MMDUMP.TXT
modified:   awoo.sh
modified:   exmmtest.exe
modified:   src/exmmtest.c
modified:   src/lib/16_mm.c

DEBUG.TXT
MMDUMP.TXT
awoo.sh
exmmtest.exe
src/exmmtest.c
src/lib/16_mm.c

index ead23ca7615c946a0573873f9f23b0fd1580ec70..74c756b62f3f60cc990c6a8971fac537bdb7cb9f 100644 (file)
--- a/DEBUG.TXT
+++ b/DEBUG.TXT
@@ -1,4 +1,3 @@
-Seg:0  Size:88400      Owner:0x0\r
-Seg:1595       Size:4096       Owner:0x420\r
-Seg:1a3a       Size:810080     Owner:0x0\r
-Seg:e000       Size:-917520    Owner:0x0\r
+Seg:ffff       Size:917520     Owner:0x0\r
+\r
+MM_ShowMemory: Memory block order currupted!\r
index 6d15b6f7b7b23b1e41a446c6131c7386b17520af..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
Binary files a/MMDUMP.TXT and b/MMDUMP.TXT differ
diff --git a/awoo.sh b/awoo.sh
index 8a4cebd9349282518d7efca4dde125e5e9bd6329..5ef0ca1556a539dedbc726c179d6a5ea5b3884af 100644 (file)
--- a/awoo.sh
+++ b/awoo.sh
@@ -1,4 +1,4 @@
 #!/bin/bash
 git add .
 bash ./boop.sh
-cp mmtest.exe /var/www/html/
+cp exmmtest.exe /var/www/html/
index bcec52f85a74625411dd840e134e6f05f0204b73..eed1cb67409e746acadbf89a480312efccc866a7 100644 (file)
Binary files a/exmmtest.exe and b/exmmtest.exe differ
index 690851f055be01b708f2a24829b5d292c56729a0..e2f8d5de4e66f8b5a0f24f2de6c84e7856057a21 100644 (file)
 #include "src/lib/16_ca.h"
 #include "src/lib/16_mm.h"
 //#include "src/lib/modex16.h"
+#pragma hdrstop\r
+\r
+#pragma warn -pro\r
+#pragma warn -use
 
-//#define FILERL
+#define FILERL
 //#define FILEINIT
 
 void
 main(int argc, char *argv[])
 {
-       static mminfo_t mm; mminfotype mmi;
-       static const __segment segu;
-       static memptr   bigbuffer;
+       mminfo_t mm; mminfotype mmi;
+       __segment segu;
+#ifdef FILERL
+       memptr  bigbuffer;
        static char *bakapee;
        word baka;
+#endif
        //static page_t screen;
 
        //mmi.segu=FP_SEG(segu);
@@ -49,12 +55,16 @@ main(int argc, char *argv[])
        printf("&segu=%p\n", (segu));
        //printf("mmi.segu=%p\n", (mmi.segu));
 
-       bakapee = _nmalloc(64);
+#ifdef FILERL
+       bakapee = malloc(64);
 //     memset(bakapee, 0, 64);
+#endif
        mm.mmstarted=0;
 
+#ifdef FILERL
        if(argv[1]) bakapee = argv[1];
        else bakapee = "data/koishi~~.pcx";
+#endif
 
        textInit();\r
 
@@ -89,9 +99,9 @@ main(int argc, char *argv[])
                baka=1;
        else
                baka=0;
-#endif
        //hmm functions in cache system use the buffered stuff
        printf("size of big buffer~=%lu\n", _bmsize(segu, bigbuffer));
+#endif
        printf("dark purple = purgable\n");
        printf("medium blue = non purgable\n");
        printf("red = locked\n");
index b1a56ad46ef077727c5e2db9536d7b6511180528..548efc098356a8c2d95899896b966e92f3f0de91 100644 (file)
@@ -647,7 +647,7 @@ void MM_Startup(mminfo_t *mm, mminfotype *mmi)
 //
 // 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++)
@@ -660,7 +660,7 @@ void MM_Startup(mminfo_t *mm, mminfotype *mmi)
 //
 // 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;
@@ -673,11 +673,11 @@ void MM_Startup(mminfo_t *mm, mminfotype *mmi)
 //
 // get all available near conventional memory segments
 //
-       //printf("              nearheap making!\n");
+       printf("                nearheap making!\n");
 //---- length=coreleft();
-       //_nheapgrow();
-       length=_memmax();
-       start = (void huge *)(mm->nearheap = _nmalloc(length));
+       _nheapgrow();
+       length=GetFreeSize();//_memmax();
+       start = /*(void huge *)*/(mm->nearheap = _nmalloc(length));
        length -= 16-(FP_OFF(start)&15);
        length -= SAVENEARHEAP;
        seglength = length / 16;                        // now in paragraphs
@@ -698,23 +698,23 @@ void MM_Startup(mminfo_t *mm, mminfotype *mmi)
                        printf( "ERROR - bad node in nearheap\n" );
                break;
        }*/
-       //printf("              near heap ok!\n");
+       printf("                near heap ok!\n");
 
 //
 // get all available far conventional memory segments
 //
 //---- length=farcoreleft();
-       //printf("              farheap making!\n");
-       /*_fheapgrow();
-       length=0xff;//UL*4UL;//_memavl();
+       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);
        length -= SAVEFARHEAP;
        seglength = length / 16;                        // now in paragraphs
        segstart = FP_SEG(start)+(FP_OFF(start)+15)/16;
-       MML_UseSpace(segstart,seglength, mm);*/
-       mmi->farheap = 0;//length;
+       MML_UseSpace(segstart,seglength, mm);
+       mmi->farheap = length;
        mmi->mainmem = mmi->nearheap + mmi->farheap;
        /*switch( _fheapchk() ) {
                case _HEAPOK:
@@ -730,12 +730,12 @@ void MM_Startup(mminfo_t *mm, mminfotype *mmi)
                        printf( "ERROR - bad node in farheap\n" );
                break;
        }*/
-       //printf("              far heap ok!\n");
+       printf("                far heap ok!\n");
 
 //
 // detect EMS and allocate up to 64K at page frame
 //
-printf("               EMS1\n");
+/*printf("             EMS1\n");
 printf("\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0");    //bug!
        mmi->EMSmem = 0;
        for(i = 1;i < __argc;i++)
@@ -782,11 +782,11 @@ printf("          XMS!\n");
 //
 // allocate the misc buffer
 //
-xmsskip:
+xmsskip:*/
 /*mmi->nearheap = 0;
-mmi->farheap = 0;
+mmi->farheap = 0;*/
 mmi->EMSmem = 0;
-mmi->XMSmem = 0;*/
+mmi->XMSmem = 0;
        mm->mmrover = mm->mmhead;               // start looking for space after low block
 
        MM_GetPtr(&(mm->bufferseg),BUFFERSIZE, mm, mmi);