Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!usc!chaph.usc.edu!alcor.usc.edu!jjung From: jjung@alcor.usc.edu (John Jung) Newsgroups: comp.sys.atari.st Subject: Malloc() in C and the 40-folder bug Message-ID: <8672@chaph.usc.edu> Date: 17 Mar 90 07:28:43 GMT Sender: news@chaph.usc.edu Organization: University of $outhern California, Los Angeles, CA Lines: 20 There's been a bit of discussion in this newsgroup recently about how the infamous "40 folder bug" can be induced if too many memory blocks are allocated with Malloc(). I'm currently developing an application for the ST in C that uses dynamic storage of linked lists. As a consequence, I'm Malloc()ing blocks of memory left and right. Since I don't want to encounter this bug, I'd like to know if anyone has a solution for me to use? Someone posted in this thread that a solution is to Malloc() one large block at the start of the application, then divide it into smaller blocks with malloc() calls. Does anyone have a sample program or actual code to demonstrate this principle? I'm developing with Laser C; the documentation does not specify any problems with using Malloc(), and the entry for malloc() gives me the impression that it is just a UN*X-compatable alias. Any information will be truly apprciated, either by mail or by a posted reply. Thanks in advance. John