- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The description of MOVE_ALLOC (at least in the .034 Release Notes) is incorrect:
"If TO
is currently allocated, it is deallocated. Then, if FROM
is allocated, TO
becomes allocated with the same bounds and value identical to that of FROM
. Lastly, FROM
is deallocated. If TO
has the TARGET
attribute, any pointer associated with FROM
at the time of the call to MOVE_ALLOC
is now associated with TO
."
FROM is not deallocated, it is dissassociated. If FROM were deallocated then TO would reference deallocated memory.
Jim Dempsey
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As far as the Standard is concerned, MOVE_ALLOC could work like:
* Allocate new memory for TO
* Copy all the contents from FROM to TO
* Deallocate FROM
* Go through the list of associated pointers (yes I know it doesn't exist in IFC) to FROM and "redirect" them to TO.
I don't have a fresh enough Standard handy, but I'd betcha it doesn't mention "disassociated" in this context.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well, no, that's not how MOVE_ALLOC works. The wording in the standard is actually:
The allocation status of FROM becomes unallocated.
You're correct that it does not say disassociated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Although (by your words) the standard does not use disassociated to describe the behavior of FROM after MOVE_ALLOC, disassociated is likely the correct adjective to use. Look at NULLIFY in regards to pointers: "Disassociates a pointer from a target".
Disassociated, means there is no associated data accompanying the token (no allocation for allocatable, null pointer or null descriptor for pointer).
Part of my reasons for this thread is to obtain top performance on multi-core systems. To do this, it is desireable to take full advantage of vectorization. And, to do this, it is desireable to eliminate the test for alignment (e.g. so short iteration counts can take advantage of vectorizations).
Pointers are convienently use to point to array slices as well as for link pointers in object collections. Having the pointer carry the alignment attribute (for the data to which it points) reduces the probibility of coding error as well as increases the probability of compiler opportunity to vectorize without generating code to test for and advance to alignment (and perform vectorization of low iteration count loops).
Jim Dempsey

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page