Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hds: Change the way fortran locators work
Locators in Fortran are (oddly) string buffers and not simple integers. Previously the contents of "struct LOC" was copied into the buffer on "export" and copied from the buffer on "import". This worked okay except that the size of the struct governed the value of DAT__SZLOC. Any changes meant a full recompile. It also seems excessive to risk have each locator use tens of bytes of string buffer when only a few bytes are really needed. This current implementation stores the pointer in the Fortran buffer and reads the pointer out of the buffer on import. It's not very efficient as it currently really does store a formatted version of the pointer (via sprintf %p) and uses strtol() to convert that number back to a pointer. It does work though and DAT__SZLOC is now invariant to the structure size. This will be important for HDS v5. Obviously at some point we should just store the 8 bytes into the buffer and cast the 8 bytes back to a pointer again but first having to check that the string locators (<NOT A LOCATOR>) still work. Note that this patch adds a dependency to ONE. This may just be temporary.
- Loading branch information
Showing
5 changed files
with
146 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.