When writing a function in C for use in a Postgres extension, you allocate memory using palloc().
Is there any way to know how much memory you allocated? For example,
char *foo = palloc(10);
int size = some_size_of_function(foo);
Or do I have to remember the size in my application code?