From: Eli Zaretskii <eliz@gnu.org>
To: David Kastrup <dak@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Intervals crash
Date: Mon, 27 Sep 2010 07:02:54 -0400 [thread overview]
Message-ID: <E1P0BTy-0007Hy-Gu@fencepost.gnu.org> (raw)
In-Reply-To: <87y6anblv9.fsf@lola.goethe.zz> (message from David Kastrup on Mon, 27 Sep 2010 11:02:02 +0200)
> From: David Kastrup <dak@gnu.org>
> Date: Mon, 27 Sep 2010 11:02:02 +0200
>
> > We can get rid of almost all of them, if we believe that size_t and
> > EMACS_UINT are always of the same size.
>
> Why wouldn't we be using size_t when we needed something of size size_t?
We do, as a matter of habit. What I meant was to use size_t where we
now use EMACS_UINT, because almost all of those places have nothing to
do with Emacs integers. We simply use EMACS_UINT as a portable
unsigned data type large enough to accommodate both size_t and a
pointer.
> > In any case, I think we cannot get rid of using an unsigned data type
> > in most of the 70+ places we do now, because of one or more of the
> > following reasons:
> >
> > . the value is a bit mask or a bit map
>
> We have the assumption of two's complement arithmetic hardwired in a lot
> of other places. So bit operations should work on signed numbers
> reasonably well. Possible exception are right shifts when indeed the
> full range of an EMACS_UINT over an EMACS_INT is being employed, but
> then the number will not convert into an Elisp integer readily anyhow,
> so why use EMACS_UINT at all?
I obviously didn't make myself clear: these are _not_ reasons to use
EMACS_UINT, these are reasons why we sometimes need an unsigned
integer data type.
>> > . the value is a pointer that is subject to bitwise operations
>
> Why would a pointer be put into an EMACS_UINT?
Again, not into EMACS_UINT, but rather into an unsigned data type.
The reason is, of course, that almost every Lisp_Object is a pointer
in disguise, and alloc.c was why I put this reason in the list.
> > . the value is an unsigned data type forced by external hardware or
> > software API
>
> Again, why an EMACS_UINT rather than the appropriate unsigned data type
> forced by the external hardware?
See above, this isn't about EMACS_UINT. We will need some unsigned
data type that is portable between 32- and 64-bit architectures.
> If we use this as a Lisp integer
We don't, and I didn't say we should. I was talking about unsigned
data types that we would need even if we get rid of EMACS_UINT.
next prev parent reply other threads:[~2010-09-27 11:02 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-23 18:23 Intervals crash Chong Yidong
2010-09-23 18:52 ` Chong Yidong
2010-09-23 19:01 ` Eli Zaretskii
2010-09-23 19:09 ` Chong Yidong
2010-09-23 19:32 ` Eli Zaretskii
2010-09-23 18:57 ` Eli Zaretskii
2010-09-24 6:12 ` Stephen J. Turnbull
2010-09-24 8:16 ` Eli Zaretskii
2010-09-24 8:52 ` Stephen J. Turnbull
2010-09-24 10:03 ` Eli Zaretskii
2010-09-25 14:34 ` Stephen J. Turnbull
2010-09-25 16:10 ` Eli Zaretskii
2010-09-25 18:54 ` Stephen J. Turnbull
2010-09-25 22:07 ` Eli Zaretskii
2010-09-26 13:08 ` Stephen J. Turnbull
2010-09-26 19:22 ` Miles Bader
2010-09-26 19:33 ` David Kastrup
2010-09-27 4:53 ` Stephen J. Turnbull
2010-09-27 6:55 ` David Kastrup
2010-09-27 7:42 ` Jan Djärv
2010-09-27 8:34 ` Eli Zaretskii
2010-09-27 9:02 ` David Kastrup
2010-09-27 11:02 ` Eli Zaretskii [this message]
2010-09-27 8:36 ` Eli Zaretskii
2010-09-27 8:50 ` Stephen J. Turnbull
2010-09-27 9:39 ` David Kastrup
2010-09-27 9:45 ` Lars Magne Ingebrigtsen
2010-09-27 10:11 ` Stephen J. Turnbull
2010-09-24 10:31 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1P0BTy-0007Hy-Gu@fencepost.gnu.org \
--to=eliz@gnu.org \
--cc=dak@gnu.org \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.