guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SCM_PTR_LE ?


From: Han-Wen Nienhuys
Subject: Re: SCM_PTR_LE ?
Date: Thu, 1 Aug 2002 19:16:53 +0200

address@hidden writes:
> > I think that pointer comparison is pretty well defined in ANSI C; can
> > you think of a solid reason to support them?
> 
> What is that definition?  I think ANSI C only defines the outcome of
> comparisons for pointers that point into the same object, i.e., the

I stand corrected, I looked it up in the N843 document
(http://www.dkuug.dk/JTC1/SC22/WG14/www/docs/n843.htm), and you're
right.

> same array or a single block returned from malloc.  A consequence
> would be that you can not reliably test whether a pointer does point
> into some object, since the results are not defined when it points
> outside.  For example, is the following guaranteed to print "sane"?

However, that point is completely moot, since the binary search code
in heap_segment () (new GC: scm_find_heap_segment_containing_object)
is full of code that compares pointers outside their blocks.  Unless
that is scrapped (not), SCM_PTR_* can go.



-- 
Han-Wen Nienhuys   |   address@hidden    | http://www.cs.uu.nl/~hanwen/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]