The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Newsgroups: comp.lang.fortran
From: glen herrmannsfeldt <g...@ugcs.caltech.edu>
Date: Mon, 09 Apr 2007 11:55:30 -0800
Local: Mon, Apr 9 2007 3:55 pm
Subject: Re: Transfer and variables that don't use all their storage space.
Richard Maine wrote: (snip) > In some senses, I'm not sure this is as good an example of problems as There is an old trick of to save memory for doubly linked lists, > the allocatable one. But this is one that I actually got bit (um, pun > not intended, or even noticed until I reread this) by in the early 90's. > It is what made me start thinking about the possibility of cases where > just naively copying the bits might not have the effect of copying all > the information correctly. One example that occurred to me (but I don't > think I've seen) would be relative addressing of pointers. If you have > relative addressing, then copying the same bits to another location > doesn't preserve their meaning. I believe sometimes used in C programs. Instead of storing the two pointers (next and previous list element) you instead store the exclusive OR of the two. In traversing the list, you know where you are coming from, exclusive OR that with the stored value gives the pointer to the next element. I would probably use the difference instead, but then you need to know which direction you are going. Neither are legal in standard C. Pointer comparison and subtraction Assuming relative pointers are legal Fortran, it would seem to -- glen You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||