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 ucsfcgl.ucsfcgl.UUCP Path: utzoo!watmath!clyde!burl!ulysses!ucbvax!ucsfcgl!arnold From: arnold@ucsfcgl.UUCP (Ken Arnold%CGL) Newsgroups: net.unix,net.unix-wizards,net.arch,net.lang.c Subject: Re: get size of malloc'd object Message-ID: <9895@ucsfcgl.ucsfcgl.UUCP> Date: Wed, 25-Jun-86 17:15:06 EDT Article-I.D.: ucsfcgl.9895 Posted: Wed Jun 25 17:15:06 1986 Date-Received: Sat, 28-Jun-86 03:20:34 EDT References: <165@daisy.UUCP> <334@valid.UUCP> <2206@peora.UUCP> <2081@umcp-cs.UUCP> <9894@ucsfcgl.ucsfcgl.UUCP> Reply-To: arnold@ucsfcgl.UUCP (Ken Arnold%CGL) Organization: Computer Graphics Laboratory, UCSF Lines: 14 Xref: watmath net.unix:8412 net.unix-wizards:18614 net.arch:3589 net.lang.c:9598 In article <9894@ucsfcgl.ucsfcgl.UUCP> I write: >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. > >Can we say "hack"? I don't know what came over me. I only wish I could say that I was on drugs at the time I wrote this, since at least my embarassment could have been partially compensated by the entertainment. Please forgive my obvious error, and just chalk it up to a long, tired day. Ken Arnold