Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!sundc!sun!imagen!qubix!wjvax!brett From: brett@wjvax.UUCP (Brett Galloway) Newsgroups: comp.lang.c Subject: Re: Optimizing use of malloc Message-ID: <1105@wjvax.UUCP> Date: Mon, 19-Oct-87 14:44:07 EDT Article-I.D.: wjvax.1105 Posted: Mon Oct 19 14:44:07 1987 Date-Received: Wed, 21-Oct-87 07:04:48 EDT References: <4753@oberon.USC.EDU> Reply-To: brett@wjvax.UUCP (Brett Galloway) Organization: Watkins-Johnson Co., San Jose, Calif. Lines: 19 In article <4753@oberon.USC.EDU> blarson@skat.usc.edu (Bob Larson) writes: >Most versions of malloc will round the amount of memory you request to >some number convienient for it. Since the pointer returned must be >maximally alligned, this is normally a multiple of the size of the >largest type. What I need to know what sizes of memory requests to >malloc will reduce wasted space for a variety of systems: bsd 4.2, bsd >4.3, sun 3.*, ultrix 32, sys v (various releases & systems) I am curious if any work has been done by the ANSI group with regard to malloc(). I don't see any portable way to optimize the use of malloc() *before* using it. However, it seems to me that a function to return the actual amount of room provided *by* a malloc() (greater than or equal to what you asked for) would be feasible, and could be used partially to address the problem alluded to by Bob above. -- ------------- Brett Galloway {pesnta,twg,ios,qubix,turtlevax,tymix,vecpyr,certes,isi}!wjvax!brett