View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum ↗

iraf-v216 · Code · Issues (50) · Pull requests (81)

iraf.net pull request #105

Handle negative pointers in sys/nmemio

merge olebole merged 4 commits to iraf-community/iraf


olebole commented on 2017-10-15

Negative pointers may appear when the address of the Mem common block is larger than the handled address. Usually, the address of the Mem common block is set to zero in zsvjmp.s. However, this is not always the case; f.e. currently this is disabled on the linux64 platform. The big problem for the future here is however the introduction of Position Independent Executables, which make such a setting impossible by design.

The sign of the pointers was used as a flag to mark a freed space, so that a second attempt to free it will be discovered and properly handled. The sign was also used as a marker in the garbage collector to re-use positions that are already freed.

This PR uses in both cases NULL as the marker.
The nmemio module was checked carefully for other sign dependent behaviour of the pointer. The garbage collector code is however unused in the moment.

This fixes #103.
As always, it is tested against new and old compilers, MacOS and Linux, 32 and 64 bit, with and without PIE.


Commits


Last updated on 2017-10-27