Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site ucbvax.BERKELEY.EDU Path: utzoo!watmath!clyde!burl!ulysses!ucbvax!brahms!desj From: desj@brahms.BERKELEY.EDU (David desJardins) Newsgroups: net.unix,net.unix-wizards,net.arch,net.lang.c Subject: Re: get size of malloc'd object Message-ID: <14589@ucbvax.BERKELEY.EDU> Date: Wed, 25-Jun-86 21:36:59 EDT Article-I.D.: ucbvax.14589 Posted: Wed Jun 25 21:36:59 1986 Date-Received: Sat, 28-Jun-86 01:41:46 EDT References: <165@daisy.UUCP> <334@valid.UUCP> <2206@peora.UUCP> <2081@umcp-cs.UUCP> <9894@ucsfcgl.ucsfcgl.UUCP> Sender: usenet@ucbvax.BERKELEY.EDU Reply-To: desj@brahms.UUCP (David desJardins) Organization: University of California, Berkeley Lines: 11 Xref: watmath net.unix:8414 net.unix-wizards:18618 net.arch:3591 net.lang.c:9601 In article <9894@ucsfcgl.UUCP> arnold@ucsfcgl.UUCP (Ken Arnold) writes: >So put the int at the end of the space, after increasing the size >to be allocated by sizeof (int) + enough space to align the int >on a byte which is a multiple of sizeof (int). Then return the >original malloc()ed pointer. This is the silliest thing I've seen yet. If you have a pointer to the beginning of a region, and store the size of the region at the end of the region, how are you ever going to be able to recover this information?? -- David desJardins