Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle negative pointer in garbage collector
Previously, the garbage collection in `mgc.x` used two pseudo values for organizational issues: implicitly initialized NULL for the end of the `MGC` buffer, and negative values for pointers that are already freed. Since pointers may be negative (they are relative to the `Mem` common block), this patch changes this behaviour: we now use NULL for pointers that are already freed, and an additional variable `bmax` in the `/nmemio/` common block to determine current the end of the `MGC` buffer. Note that this could not be fully tested, since the garbage collector is active only when the environment variable `MEMIO_COLLECT` is set to 1. This mode is however already buggy with the precompiled version 2.16.1: ``` $ MEMIO_COLLECT=1 cl setting terminal type to 'xgterm' ... PANIC in `/iraf/iraf/bin/64/bin.linux64/x_system.e': invalid SET in IRAF Main ```
- Loading branch information
Showing
3 changed files
with
19 additions
and
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,7 @@ begin | |
nleaked = 0 | ||
nalloc = 0 | ||
nfree = 0 | ||
bmax = 0 | ||
|
||
in_task = 1 | ||
end | ||
|
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