> I see that palloc.h says:
>
> The result of palloc() is always word-aligned
void *
repalloc(void *pointer, Size size)
{
... /* * Try to detect bogus pointers handed to us, poorly though we can. * Presumably, a pointer that isn't
MAXALIGNEDisn't pointing at an * allocated chunk. */ Assert(pointer != NULL); Assert(pointer == (void *)
MAXALIGN(pointer));
...
>
>
> so maybe my alignment fear is misplaced. So my remaining question is
> whether this is OK stylistically.
Something like this?
initStringInfoVarlena()/makeStringInfoVarlena()
{initStringInfo()appendStringInfoSpaces(jtext, VARHDRSZ);
}
char*
formStringInfoVarlena()
{SET_VARSIZE(jtext->data, jtext->len);return jtext->data;
}
--
Teodor Sigaev E-mail: teodor@sigaev.ru WWW:
http://www.sigaev.ru/