On Wed, May 14, 2014 at 2:04 PM, Stephen J. Turnbull <stephen(a)xemacs.org> wrote:
I believe it does work differently than it does, though -- in
--with-union-type builds. In that case, a *new* Lisp_Object (union)
is created (on the stack) and the appropriate member set to the
argument being wrapped, then that new Lisp_Object is returned.
I forget exactly what the semantics of this are, I suppose the
returned union object is copied by the compiler, but I can't see any
possible way that the return value is the pointer that was passed in.
In the --with-union-type case, the size of Lisp_Object is equal to the
size of EMACS_INT. When an Lisp_Object on the stack is created and
one of the wrap() funtions is called on a pointer, the ui field of the
Lisp_Object is set to the pointer. That fills all of the bits, so its
value is exactly the pointer. Then, when the Lisp_Object is returned,
the contents of that stack area (i.e, the pointer) is returned.
So, yes, the return value is exactly the pointer. It really was
nonsense. Call the same wrap_foo() function as many times as you want
on a pointer, and you'll get the same value out of all of those calls.
--
Jerry James
http://www.jamezone.org/
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-beta