Andrey Rachitskiy <[email protected]> writes:
> Tom, I've put together a SvGETMAGIC version on top of your last patch.
> Thoughts?

I've not read the whole thing, but I noticed

 /*
  * Convert a HE (hash entry) key to a cstr in the current database encoding.
  * The result is palloc'd.
+ *
+ * Uses FREETMPS, so call this before hv_iterval() if both are needed.
  */
 static inline char *
 hek2cstr(HE *he)

and you had a similar comment in your earlier draft.  I think this is
nonsense though.  hek2cstr does the full ENTER; SAVETMPS; FREETMPS;
LEAVE; dance, so unless I totally misunderstand that API, it's
destroying only its own temps not any pre-existing ones.  Also,
if there actually is an ordering dependency there, how is the existing
coding working (where the two callers of hek2cstr do so in randomly
different orders?)  I changed that ordering in my patch only for
cosmetic reasons, not because I expect it to make a difference.

                        regards, tom lane


Reply via email to