home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / std / cplus / 2032 < prev    next >
Encoding:
Internet Message Format  |  1993-01-12  |  3.5 KB

  1. From: pabloh@hpwala.wal.hp.com (Pablo Halpern )
  2. Date: Mon, 11 Jan 1993 23:15:23 GMT
  3. Subject: Re: Nested functions (was: Re: Zero-length structures and pointer comparisons)
  4. Message-ID: <4070@hpwala.wal.hp.com>
  5. Organization: Hewlett-Packard Company
  6. Path: sparky!uunet!usc!sdd.hp.com!hpscit.sc.hp.com!hplextra!hpcss01!hpwala!pabloh
  7. Newsgroups: comp.std.c++
  8. References: <1992Dec16.150144.6004@ucc.su.OZ.AU> <BzDJHu.t2@fru <4048@hpwala.wal.hp.com> <1993Jan06.193256.6590@microsoft.com>
  9. Sender: netnews@hpwala.wal.hp.com
  10. Lines: 55
  11.  
  12. In article <1993Jan06.193256.6590@microsoft.com>, jimad@microsoft.com (Jim Adcock) writes:
  13. |> In article <4048@hpwala.wal.hp.com> pabloh@hpwala.wal.hp.com (Pablo Halpern ) writes:
  14. |> |Absolute orderings are a slightly different matter.  In the case of < and
  15. |> |>, one might expect a significant performance improvement if the pointers
  16. |> |are assumed to point into the same array, since the segment part can be
  17. |> |ignored even for far pointers.  A ptrcmp() function might be worthwhile and
  18. |> |should present no special implementation problems for segmented
  19. |> |architectures.  However, systems (like the lisp machine) where pointers
  20. |> |change behind the program's back DO present a problem since the
  21. |> |bit-pattern-based ordering could change even if the equality/inequality
  22. |> |property does not change.  This would argue against *requiring* a ptrcmp()
  23. |> |function.
  24. |> 
  25. |> Except some OS's using segmented architectures implement movable segments, 
  26. |> in which case the problem becomes the same as lisp machines --
  27. |> "pointers change behind the programmers back"
  28.  
  29. Perhaps, but not usually.  Part of the power of segments is to be able to
  30. change the physical location of a segment without changing pointers to that
  31. segment.  Never the less, the problem DOES exist on some architectures,
  32. both segmented and not.
  33.  
  34. |> 
  35. |> My claim is that in either of these cases the pointers *aren't* changing --
  36. |> they still point at the same objects.  What is changing is the underlying
  37. |> implementation of the pointer, which is an implementation issue not
  38. |> a language issue.  Casting pointers to and from int remains as always
  39. |> implementation dependent.  The only issue in question is whether we
  40. |> should introduce a new requirement on OS's that the OS must maintain
  41. |> a total ordering on their objects.  Clearly IMHO this would represent
  42. |> a stumbling block to many OS's, such a the lisp machines, movable segment
  43. |> OS's and OO databases.  Making such a new requirement on C++ would make
  44. |> C++ not reasonably portable to these systems.  The question then is
  45. |> whether or not the standard C++ language should exist on such machines.
  46.  
  47. Exactly.  Maintaining a total ordering of objects based on pointers to
  48. those objects is not resonable in some OS's.  IMHO, the need for a total
  49. ordering of pointers is not as compelling as the ability to implement the
  50. C++ standard on the widest variety of architectures.  A function like
  51. ptrcmp() should fall into the "common extentions" catagory.  Most
  52. systems could implement this function using a varient bit-by-bit
  53. comparison.  Systems that patch pointers in running code could not
  54. implement this function.
  55.  
  56. -- 
  57.  
  58. - Pablo
  59.  
  60. ------------------------------------------------------------------------
  61. Pablo Halpern             (617) 290-3542
  62. HP Waltham                pabloh@hpwarq.wal.hp.com
  63.  
  64. I am self-employed, so my opinions *do* reflect those of my employer.
  65. However, they may not reflect the opinions of my client.
  66. ------------------------------------------------------------------------
  67.