Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: M. van Wijk <m.vanwijk@student.utwente.nl>
Subject: RE: swap/malloc problem
Date: 1996/06/08	[thread overview]
Message-ID: <01bb5549.273b6c80$b6de5982@Baldrick.student.utwente.nl> (raw)
In-Reply-To: 4p9kis$6sg@netnews.upenn.edu



On Friday, June 07, 1996, George Grevera wrote...
> The program that bombs is simply:
> 
>     #include <assert.h>
>     #include <stdio.h>
>     #include <stdlib.h>
> 
>     int main ( int argc, char* argv[] ) {
>         char* cp = malloc(135000000);
>         assert(cp != NULL);
>     }
> 
> I can't understand why this fails.  Thanks for your help.
I'm afraid I can't understand either. I think they assumed nobody wants to
allocate such an amount of memory. But I found a workaround!

Surprisingly, it works if you link with -lpthreads -lmach. The ptreads
library contains thread safe versions of some libc calls, including
malloc. Somehow that malloc can handle bigger requests.

Marc van Wijk
m.vanwijk@student.utwente.nl




  reply	other threads:[~1996-06-08  4:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-06-07  4:00 swap/malloc problem George Grevera
1996-06-08  4:00 ` M. van Wijk [this message]
1996-06-09  4:00 ` Dan Pop
1996-06-10  4:00 ` Alan Rollow - Dr. File System's Home for Wayward Inodes.
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox