Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 3bf440c993aa2f25c2b73e3a31b16e159a3abba9
Ticket: 1938497fffffffffffffffffffffffffffffffff
Make stubs tables static const
User & Date: das on 2008-04-09 23:56:35
Changes

  1. icomment:
    Logged In: YES 
    user_id=90580
    Originator: YES
    
    The notifier part of this patch is independent of the stubs changes and should be applied regardless of the decision on const stubs as the current code is buggy IMO.
    
    There should be no change in functionality for the notifier, whether hooked or not, the main difference after the patch is that in a few cases the check for hooks has moved from before the call to a notifier proc to inside the call, which will lead to an extra function call when the notifier is hooked. Only doing the check before the call was arguably a bug anyway as it was not going to catch all cases of calls to the function...
    
    Tcl_SetNotifier as a whole is a bit of a hack anyway, it is really only safe to use before Tcl is initialized, TkAqua was using it at Tk load time before I implemented the CoreFoundation notifier and had to call the internals TclFinalizeNotifier() and TclInitNotifier() to get things to work (and even then starting and immediately killing the threading unix notifier never worked all that well):
        http://fisheye.categorifiedcoder.info/changelog/Tk?cs=MAIN:das:20050514204814
    
    As far as const stubs go, IMO the only way a modifiable stubs table could ever become reliably useful would be if we could assure that all calls from inside tcl (resp tk) as well as through the normal shared library function calls go through the stubs table (if this work is ever done inside the core, the stubs table can easily be made non-const again at that time...)
    Given that this is not the case now, writable stubs tables only give the incorrect impression that modifying them might be a useful thing to do.
    
    IMO now is an opportune time to make this change, alongside the other recent stubs changes (in particular stubsPtrs constification), if it causes any problems we will hopefully find out before 8.6.0 final...
    
    
  2. login: "das"
  3. mimetype: "text/plain"
  4. username: "das"