[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] Mint Bug?



On Mon, 2005-09-05 at 03:05 +0200, Ingo Schmidt wrote:
> Hi Mark!
> 
> > So I ran a test.  It allocates 1 megabyte every 1 second, tells you if
> > the pointer is null or not, and then runs "free".
> 
> Could u post the source code?
> I just wrote a little GFA program that does the same (I think) but I
> dont get this behaviour that you describe (Milan 060).
> 
> To me it sounds really weird that MALLOC fails?!
> 
> Cheers, Ingo =;->

No problem...

malloctest.c:
#include <stdio.h>

int main(void)
{
        int count=0;
        void *stuff;

        while (1)
        {
                count++;
                printf("Malloc %d, allocating 1 megabyte\n", count);
                stuff=malloc(sizeof(char)*1024000);
                if (stuff==NULL)
                        printf("ERROR!: pointer is NULL on count: %d\n",
count);                system("/bin/free");
                sleep(1);
        }
}

Also attached is my compiled binary - in case someone compiles it and it
works for them and my compiled binary doesn't, then we know it's my
mintlib.

Thanks,
Mark

Attachment: malloctest.gz
Description: GNU Zip compressed data