2. I don't like the "palloc_ptrtype" name at all. I see that you borrowed that name from talloc, but I doubt that's a precedent that very many people are familiar with.
To me it sounds like it might allocate something that's the size of a pointer, not the size of the pointed-to object. I have to confess though that I don't have an obviously better name to suggest. "palloc_pointed_to" would be clear perhaps, but it's kind of long.
I agree that ptrtype reads "the type of a pointer".
This may not be a C-idiom but the pointed-to thing is a "reference" (hence pass by value vs pass by reference). So:
palloc_ref(myvariablepointer)
will allocate using the type of the referenced object. Just like _array and _obj, which name the thing being used as a size template as opposed to instantiate which seems more like another word for "allocate/palloc".
David J.
P.S.
Admittedly I'm still getting my head around reading pointer-using code (I get the general concept but haven't had to code them)....