Path: utzoo!mnetor!uunet!husc6!cmcl2!phri!manhat!mancol!marob!daveh From: daveh@marob.MASA.COM (Dave Hammond) Newsgroups: comp.lang.c Subject: Re: Malloc problems Message-ID: <272@marob.MASA.COM> Date: 5 May 88 20:43:54 GMT References: <10575@steinmetz.ge.com> Reply-To: daveh@marob.UUCP (Dave Hammond) Organization: 18th Street Construction Co NY NY Lines: 29 Keywords: malloc, core dump, Xenix Help! I am currently working on an application which requires repeated allocation of small chunks of memory to dynamically build various structure lists. It is quite conceivable that the program will attempt to allocate hundreds (even thousands) of small blocks within a tight loop. The application the goes thru one pass successfully. Problem: on subsequent passes (free old, read data, allocate new space) malloc() core dumps. Traces show that the structure addresses have not moved since the first pass (i.e. no pointer address screwups) and the problem does not appear in smaller versions of the application (its currently running on an Intel 286 machine under SCO Xenix, as a Large model program - about 100K binary file size). As a remedy I've written a set of routines which allocate large chunks of memory on startup and then parcel out portions as necessary. This seems to work, but should I have to do this? Is the problem with a)Xenix, b)the malloc() package, c) ?? Thanks for any Help! in advance. Dave Hammond DSI Communications 333 W. Merrick Rd. Valley Stream, NY 11580 E-Mail: ...!marob!daveh