get size of malloc'd object

Ken Arnold%CGL arnold at ucsfcgl.UUCP
Thu Jun 26 07:15:06 AEST 1986


In article <9894 at 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



More information about the Comp.unix mailing list