Changes between Initial Version and Version 1 of Ticket #22626, comment 254


Ignore:
Timestamp:
11/19/18 16:38:17 (3 years ago)
Author:
embray
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #22626, comment 254

    initial v1  
    66I'm not sure that's true.  I may be wrong, but the global variable `StackBottomBags` (which in official GAP, as opposed to the old libgap, is declared static so we can't easily do anything with it) is set once, when the `InitBags` function is called from `InitializeGap`.
    77
    8 Garbage collections then either search up from this location if `StackBottomBags` is below the top of the stack.  Or if, for some reason, `StackBottomBags` is above, it will search down from there.  But not both.  And since `InitializeGap` is called in some arbitrary stack frame that may or may no longer exist, this does not seem safe unless we ensure that all future calls to GAP functions happen to occur in a deeper stack frame than when `InitializeGap` is called, which means it needs to be called early in the Python interpreter startup, just for example.
     8Garbage collections then either search up from this location if `StackBottomBags` is below the top of the stack.  Or if, for some reason, `StackBottomBags` is above, it will search down from there.  But not both. ISTM that this implementation detail is just meant to account for both architectures were the stack grows up or down, but it still bakes in an apparent assumption that `StackBottomBags` is initialized from some stack frame outside any where GAP objects are initialized.
     9
     10Since `InitializeGap` is called in some arbitrary stack frame that may be either above or below future stack frames that call GAP functions, this does not seem safe unless we ensure that all future calls to GAP functions happen to occur in a deeper stack frame than when `InitializeGap` is called, which means it needs to be called early in the Python interpreter startup, just for example.
    911
    1012Again, I'm probably missing something but I have my doubts about this...