From xemacs-m  Thu Jul  3 03:00:28 1997
Received: from jagor.srce.hr (hniksic@jagor.srce.hr [161.53.2.130])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id DAA17152
	for <xemacs-beta@xemacs.org>; Thu, 3 Jul 1997 03:00:26 -0500 (CDT)
Received: (from hniksic@localhost)
          by jagor.srce.hr (8.8.5/8.8.4)
	  id KAA12807; Thu, 3 Jul 1997 10:00:25 +0200 (MET DST)
To: XEmacs Developers <xemacs-beta@xemacs.org>
Subject: Re: Repeatable crash with union type
References: <kigk9jfu3w6.fsf@jagor.srce.hr> <199707030128.SAA01713@xemacs.eng.sun.com> <87bu4kiw7w.fsf@bittersweet.inetarena.com>
X-Attribution: Hrv
X-Face: Mie8:rOV<\c/~z{s.X4A{!?vY7{drJ([U]0O=W/<W*SMo/Mv:58:*_y~ki>xDi&N7XG
        KV^$k0m3Oe/)'e%3=$PCR&3ITUXH,cK>]bci&<qQ>Ff%x_>1`T(+M2Gg/fgndU%k*ft
        [(7._6e0n-V%|%'[c|q:;}td$#INd+;?!-V=c8Pqf}3J
From: Hrvoje Niksic <hniksic@srce.hr>
Date: 03 Jul 1997 10:00:25 +0200
In-Reply-To: karlheg+xemacs@inetarena.com's message of "02 Jul 1997 21:41:07 -0700"
Message-ID: <kigwwn8pnty.fsf@jagor.srce.hr>
Lines: 33
X-Mailer: Gnus v5.4.59/XEmacs 20.3(beta10) - "Athens"

karlheg+xemacs@inetarena.com (Karl M. Hegbloom) writes:

>     Martin> Use @samp{--with-union-type=yes} occasionally to build
>     Martin> XEmacs, for improved compile-time type checking.  This is
>     Martin> not the default, because it is a little slower, [...]
> 
>  Why is it slower with union type?  Can you briefly explain?

The homework/FM is in this case the excellent (albeit unfinished)
Internals info written by Ben Wing:

    Lisp objects use the typedef `Lisp_Object', but the actual C type
    used for the Lisp object can vary.  It can be either a simple type
    (`long' on the DEC Alpha, `int' on other machines) or a structure
    whose fields are bit fields that line up properly (actually, it's
    a union of structures that's used).  Generally the simple integral
    type is preferable because it ensures that the compiler will
    actually use a machine word to represent the object (some
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    compilers will use more general and less efficient code for unions
    and structs even if they can fit in a machine word).  The union
    type, however, has the advantage of stricter type checking (if you
    accidentally pass an integer where a Lisp object is desired, you
    get a compile error), and it makes it easier to decode Lisp
    objects when debugging.  The choice of which type to use is
    determined by the presence or absence of the preprocessor constant
    `NO_UNION_TYPE'.  (Shouldn't it be `USE_UNION_TYPE', with opposite
    semantics?  "Hysterical reasons", of course.)

-- 
Hrvoje Niksic <hniksic@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
ED WILL NOT CORRUPT YOUR PRECIOUS BODILY FLUIDS!!

