#0 0x4011378d in __libc_free (mem=0xbffed744) at malloc.c:2861 #1 0x804a84b in AutoLoaderDP (cd=0xbffed744) at otcl.c:492 #2 0x804aa35 in RemoveMethod (methods=0x80fc514, nm=0x8100920 "1", cd=0x80fc4c0) at otcl.c:571 #3 0x804c9e0 in OTclCInstProcMethod (cd=0x80fc4c0, in=0x8099f90, argc=7, argv=0xbfff00f4) at otcl.c:1769 #4 0x804a674 in OTclDispatch (cd=0x80fc4c0, in=0x8099f90, argc=5, argv=0xbfff0144) at otcl.c:421 #5 0x804e523 in TclInvokeStringCommand ()This does not appear to be critical for ns, because it does not uses autoloading.
In AddMethod(), procedures are now created as ::otcl::pn where n is a running number. The deleteproc of the created procedure (OTclDeleteProc) now uses Tcl_FindCommand() to delete the procedure from tcl if it still exists.
Some simple experiments show that the impact on speed and memory is small.