|
From: Andreas L. <av...@lo...> - 2008-11-17 21:07:03
|
Joe English <jen...@fl...> noticed: > Andreas Leitgeb wrote: > > typedef void (Tcl_FreeProcRO) _ANSI_ARGS_((const char *blockPtr)); > > and TCL_STATIC would be eventually be typed as Tcl_FreeProcRO, so > > it could be passed to the const char* taking Tcl_SetResultRO(). > A read-only free procedure "void (*Tcl_FreeProcRO)(const char *blockPtr);" > is oxymoronic -- "const" means "I will not modify this argument" > and freeing memory counts as modification. It surely would be oxymoronic for a real free()-ing function, but isn't so for mere dummy values dressed up like pointers to such a function, or for special custom handlers that just want to be notified when the object *would* be freed. > Simpler: Tcl_SetResultRO wouldn't need or take a third 'freeProc' > argument, ... My point was, that the Tcl_SetResultRO would only take those freeProcs that declared themselves as not ever harming the target of the pointer. Whether that is limited to TCL_STATIC and TCL_VOLATILE (as far as I've gathered from this thread), or also may include special custom handlers is currently beyond me, but even if it's just those two, then these two cases still have to be separated for Tcl_SetResultRO(). |