Jan Vroonhof <vroonhof(a)math.ethz.ch> writes:
Yes [I'll reread again to be sure]. You mean
#define XSETCAR(conscell, newcar) do {
CHECK_IMPURE (conscell);
XCAR (conscell) = newcar;
} while (0)
Yes.
int
purified (Lisp_Object obj)
{
return POINTER_TYPE_P (XGCTYPE (obj)) && PURIFIED (XPNTR (obj));
}
I'll trivially recode this as a macro.
i.e. you might have eliminated the call to Fsetcar, but there is
still
a function call involved. Note that the 'PURIFIED' macro ALSO involves
a function call. However that one will be hopefully be inlined when
compiled at -O3
It won't, because the function definition is in another file.
However, I can recode that as a macro too.
So I think if you want to go that way, you should at the very least
eliminate the function calls from all those macros. Also the
POINTER_TYPE_P (XGCTYPE (obj) check is completely unneeded in
XSETCAR.
Yup. I might make a CHECK_IMPURE_UNSAFE macro or something; I'll
think about it. Thanks for the tips.