Index: xotcl/Makefile =================================================================== diff -u -r2c6cdd4f5d1c45c96e996a70b54ae4c5f46a40fd -r8c47264f39e2e6a65fc0c23d8d856a47cdf27fc4 --- xotcl/Makefile (.../Makefile) (revision 2c6cdd4f5d1c45c96e996a70b54ae4c5f46a40fd) +++ xotcl/Makefile (.../Makefile) (revision 8c47264f39e2e6a65fc0c23d8d856a47cdf27fc4) @@ -12,7 +12,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: Makefile,v 1.22 2004/10/30 20:19:55 neumann Exp $ +# RCS: @(#) $Id: Makefile,v 1.23 2004/11/14 01:07:17 neumann Exp $ #======================================================================== # Add additional lines to handle any additional AC_SUBST cases that @@ -30,13 +30,13 @@ PLATFORM_DIR = $(srcdir)/unix target_doc_dir = ./doc TCL_LIB_SPEC = -L/home/neumann/import/tcl8.4.7/unix -ltcl8.4 -TK_LIB_SPEC = -L/usr/lib -ltk8.4 -subdirs = library/store/XOTclSdbm/ library/store/XOTclGdbm/ library/xml/TclExpat-1.1/ +TK_LIB_SPEC = +subdirs = aol_prefix = /usr/local/aolserver -libdirs = comm lib serialize actiweb rdf registry store xml patterns +libdirs = comm lib serialize libsrc = COPYRIGHT pkgIndex.tcl -appdirs = comm scripts utils actiweb persistence +appdirs = comm scripts utils appsrc = COPYRIGHT DOC_SOURCE = \ @@ -120,7 +120,7 @@ PACKAGE_NAME = xotcl PACKAGE_VERSION = 1.3.3 CC = gcc -pipe -CFLAGS_DEFAULT = -O +CFLAGS_DEFAULT = -g CFLAGS_WARNING = -Wall -Wconversion -Wno-implicit-int CLEANFILES = *.o *.a *.so *~ core gmon.out config.* EXEEXT = @@ -135,7 +135,7 @@ SHLIB_CFLAGS = -fPIC SHLIB_LD = gcc -pipe -shared SHLIB_LD_FLAGS = -SHLIB_LD_LIBS = ${LIBS} -L/home/neumann/import/tcl8.4.7/unix -ltclstub8.4 -L/usr/lib -ltkstub8.4 +SHLIB_LD_LIBS = ${LIBS} -L/home/neumann/import/tcl8.4.7/unix -ltclstub8.4 STLIB_LD = ${AR} cr TCL_DEFS = -DTCL_THREADS=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_PTHREAD_ATFORK=1 -DHAVE_READDIR_R=1 -DPEEK_XCLOSEIM=1 -D_LARGEFILE64_SOURCE=1 -DTCL_WIDE_INT_TYPE=long\ long -DHAVE_STRUCT_STAT64=1 -DHAVE_TYPE_OFF64_T=1 -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRSTR=1 -DHAVE_STRTOL=1 -DHAVE_STRTOLL=1 -DHAVE_STRTOULL=1 -DHAVE_TMPNAM=1 -DHAVE_WAITPID=1 -DHAVE_LIMITS_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_TM_ZONE=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_TM_GMTOFF=1 -DHAVE_TIMEZONE_VAR=1 -DHAVE_ST_BLKSIZE=1 -DSTDC_HEADERS=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_LANGINFO=1 -DHAVE_SYS_IOCTL_H=1 TCL_BIN_DIR = /home/neumann/tcl8.4.7/unix @@ -205,7 +205,7 @@ # of the Makefile, in the "BINARIES" variable. #======================================================================== -binaries: $(BINARIES) xotclsh xowish pkgIndex.tcl +binaries: $(BINARIES) xotclsh pkgIndex.tcl @if test ! "x$(subdirs)" = "x" ; then dirs="$(subdirs)" ; \ for dir in $$dirs ; do \ if (cd $$dir; $(MAKE) $@) ; then true ; else exit 1 ; fi ; \ @@ -299,7 +299,7 @@ done) ; \ fi -test: binaries libraries test-core test-actiweb +test: binaries libraries test-core #TESTFLAGS = -srcdir $(srcdir) test-core: $(TCLSH_PROG) @@ -461,7 +461,7 @@ #======================================================================== clean: - -rm -rf $(BINARIES) $(CLEANFILES) xotclsh xowish pkgIndex.tcl ./receiver \ + -rm -rf $(BINARIES) $(CLEANFILES) xotclsh pkgIndex.tcl ./receiver \ $(target_doc_dir)/*-xotcl.html find ${srcdir} -type f -name \*~ -exec rm \{} \; @if test ! "x$(subdirs)" = "x" ; then dirs="$(subdirs)" ; \ Index: xotcl/configure =================================================================== diff -u -r2c6cdd4f5d1c45c96e996a70b54ae4c5f46a40fd -r8c47264f39e2e6a65fc0c23d8d856a47cdf27fc4 --- xotcl/configure (.../configure) (revision 2c6cdd4f5d1c45c96e996a70b54ae4c5f46a40fd) +++ xotcl/configure (.../configure) (revision 8c47264f39e2e6a65fc0c23d8d856a47cdf27fc4) @@ -9971,8 +9971,8 @@ eval "SHARED_LIB_SUFFIX=${SHARED_LIB_SUFFIX}" eval "UNSHARED_LIB_SUFFIX=${UNSHARED_LIB_SUFFIX}" -eval "SHARED_LIB_SUFFIX=${SHARED_LIB_SUFFIX}" -eval "UNSHARED_LIB_SUFFIX=${UNSHARED_LIB_SUFFIX}" +#eval "SHARED_LIB_SUFFIX=${SHARED_LIB_SUFFIX}" +#eval "UNSHARED_LIB_SUFFIX=${UNSHARED_LIB_SUFFIX}" #-------------------------------------------------------------------- # Set the default compiler switches based on the --enable-symbols Index: xotcl/configure.in =================================================================== diff -u -r2c6cdd4f5d1c45c96e996a70b54ae4c5f46a40fd -r8c47264f39e2e6a65fc0c23d8d856a47cdf27fc4 --- xotcl/configure.in (.../configure.in) (revision 2c6cdd4f5d1c45c96e996a70b54ae4c5f46a40fd) +++ xotcl/configure.in (.../configure.in) (revision 8c47264f39e2e6a65fc0c23d8d856a47cdf27fc4) @@ -290,8 +290,8 @@ eval "SHARED_LIB_SUFFIX=${SHARED_LIB_SUFFIX}" eval "UNSHARED_LIB_SUFFIX=${UNSHARED_LIB_SUFFIX}" -eval "SHARED_LIB_SUFFIX=${SHARED_LIB_SUFFIX}" -eval "UNSHARED_LIB_SUFFIX=${UNSHARED_LIB_SUFFIX}" +#eval "SHARED_LIB_SUFFIX=${SHARED_LIB_SUFFIX}" +#eval "UNSHARED_LIB_SUFFIX=${UNSHARED_LIB_SUFFIX}" #-------------------------------------------------------------------- # Set the default compiler switches based on the --enable-symbols Index: xotcl/doc/xo-daemon.html =================================================================== diff -u -r2c6cdd4f5d1c45c96e996a70b54ae4c5f46a40fd -r8c47264f39e2e6a65fc0c23d8d856a47cdf27fc4 --- xotcl/doc/xo-daemon.html (.../xo-daemon.html) (revision 2c6cdd4f5d1c45c96e996a70b54ae4c5f46a40fd) +++ xotcl/doc/xo-daemon.html (.../xo-daemon.html) (revision 8c47264f39e2e6a65fc0c23d8d856a47cdf27fc4) @@ -76,7 +76,7 @@ Date: - [::xotcl::rcs date {$Date: 2004/10/30 20:19:55 $}] + [::xotcl::rcs date {$Date: 2004/11/14 01:07:17 $}] Index: xotcl/doc/xo-whichPkg.html =================================================================== diff -u -r2c6cdd4f5d1c45c96e996a70b54ae4c5f46a40fd -r8c47264f39e2e6a65fc0c23d8d856a47cdf27fc4 --- xotcl/doc/xo-whichPkg.html (.../xo-whichPkg.html) (revision 2c6cdd4f5d1c45c96e996a70b54ae4c5f46a40fd) +++ xotcl/doc/xo-whichPkg.html (.../xo-whichPkg.html) (revision 8c47264f39e2e6a65fc0c23d8d856a47cdf27fc4) @@ -52,7 +52,7 @@ Date: - [::xotcl::rcs date {$Date: 2004/10/30 20:19:55 $}] + [::xotcl::rcs date {$Date: 2004/11/14 01:07:17 $}] Index: xotcl/generic/xotcl.c =================================================================== diff -u -r2c6cdd4f5d1c45c96e996a70b54ae4c5f46a40fd -r8c47264f39e2e6a65fc0c23d8d856a47cdf27fc4 --- xotcl/generic/xotcl.c (.../xotcl.c) (revision 2c6cdd4f5d1c45c96e996a70b54ae4c5f46a40fd) +++ xotcl/generic/xotcl.c (.../xotcl.c) (revision 8c47264f39e2e6a65fc0c23d8d856a47cdf27fc4) @@ -1,4 +1,4 @@ -/* $Id: xotcl.c,v 1.27 2004/10/30 20:19:55 neumann Exp $ +/* $Id: xotcl.c,v 1.28 2004/11/14 01:07:17 neumann Exp $ * * XOTcl - Extended OTcl * @@ -977,15 +977,16 @@ /* * methods lookup */ - -XOTCLINLINE static Tcl_Command +/*XOTCLINLINE*/ +static Tcl_Command FindMethod(char *methodName, Tcl_Namespace* nsPtr) { Tcl_HashTable *cmdTable; Tcl_HashEntry *entryPtr; Tcl_Command cmd; /* if somebody messes around with the deleteProc, we conclude that the entries of the cmdTable are not ours ... */ cmdTable = Tcl_Namespace_deleteProc(nsPtr) ? Tcl_Namespace_cmdTable(nsPtr) : NULL ; + /*fprintf(stderr,"FindMethod '%s', cmdTable %p ns=%p \n",methodName,cmdTable,nsPtr);*/ if (cmdTable && (entryPtr = Tcl_FindHashEntry(cmdTable, methodName))) { cmd = (Tcl_Command) Tcl_GetHashValue(entryPtr); } else { @@ -1042,11 +1043,11 @@ #if !defined(NDEBUG) {char *cmdName = ObjStr(obj->cmdName); assert(cmdName != NULL); + /*fprintf(stderr,"findCommand %s -> %p obj->id %p\n",cmdName, + Tcl_FindCommand(in, cmdName, NULL, 0),obj->id);*/ /*assert(Tcl_FindCommand(in, cmdName, NULL, 0) != NULL);*/ -#ifdef UWE - fprintf(stderr,"callDestroyMethod: %p command to be destroyed '%s' does not exist\n", - obj, cmdName); -#endif + /*fprintf(stderr,"callDestroyMethod: %p command to be destroyed '%s' does not exist\n", + obj, cmdName);*/ } #endif @@ -1332,9 +1333,6 @@ csc->cmdPtr = NULL; break; } -#ifdef UWE - fprintf(stderr,"DeleteCommandFromToken %p\n",cmd); -#endif return Tcl_DeleteCommandFromToken(in, cmd); } @@ -1372,6 +1370,10 @@ static void NSNamespaceDeleteProc(ClientData clientData) { /* dummy for ns identification by pointer comparison */ + XOTclObject *obj = (XOTclObject*) clientData; + /*fprintf(stderr,"namespacedeleteproc %p\n",clientData);*/ + obj->flags |= XOTCL_NS_DESTROYED; + obj->nsPtr = NULL; } void @@ -1864,9 +1866,6 @@ oid = obj->id; obj->id = 0; if (obj->teardown && oid) { -#ifdef UWE - fprintf(stderr, "DoDestroy %p '%s'\n",obj,ObjStr(obj->cmdName)); -#endif Tcl_DeleteCommandFromToken(in, oid); } } @@ -1879,10 +1878,6 @@ int countSelfs = 0; Tcl_Command oid = obj->id; -#ifdef UWE - fprintf(stderr,"CallStackDestroyObject %p %s\n",obj, ObjStr(obj->cmdName)); -#endif - for (csc = &cs->content[1]; csc <= cs->top; csc++) { if (csc->self == obj) { csc->destroyedCmd = oid; @@ -1907,9 +1902,6 @@ -> children destructors are called before parent's destructor */ if (obj->teardown && obj->nsPtr) { -#ifdef UWE - fprintf(stderr, "DeleteChildren %p '%s'\n",obj,ObjStr(obj->cmdName)); -#endif NSDeleteChildren(in, obj->nsPtr); } } @@ -4100,7 +4092,7 @@ Tcl_Obj *cmdName = obj->cmdName; XOTclRuntimeState *rst = RUNTIME_STATE(in); XOTclCallStack *cs = &rst->cs; - /*int isdestroy = (objv[1] == XOTclGlobalObjects[DESTROY]);*/ + /*int isdestroy = (objv[1] == XOTclGlobalObjects[DESTROY]); */ #ifdef AUTOVARS int isNext; #endif @@ -4192,6 +4184,7 @@ /* if no filter/mixin is found => do ordinary method lookup */ if (proc == 0) { + /*if (obj->nsPtr && !(obj->flags & XOTCL_NS_DESTROYED))*/ if (obj->nsPtr) cmd = FindMethod(methodName, obj->nsPtr); /*fprintf(stderr,"findMethod for proc '%s' in %p returned %p\n",methodName, obj->nsPtr, cmd);*/ @@ -4250,15 +4243,15 @@ obj, mixinStackPushed, obj->mixinStack); #endif - /* - if (!rst->callIsDestroy ) - fprintf(stderr, "obj freed? %p destroy %p self %p %s %d [%d] reference=%d\n",obj, + + /*if (!rst->callIsDestroy ) + fprintf(stderr, "obj freed? %p destroy %p self %p %s %d [%d] reference=%d,%d\n",obj, cs->top->destroyedCmd, cs->top->self, ObjStr(objv[1]), rst->callIsDestroy, cs->top->callType & XOTCL_CSC_CALL_IS_DESTROY, - !rst->callIsDestroy - ); - */ + !rst->callIsDestroy, + isdestroy);*/ + if (!rst->callIsDestroy) { /*!(obj->flags & XOTCL_DESTROY_CALLED)) {*/ @@ -4481,18 +4474,18 @@ Tcl_ListObjAppendElement(in, npaObj, Tcl_NewStringObj(arg+1, j-1)); list = Tcl_NewListObj(0, NULL); start = j+1; - while(start0 && isspace(arg[end-1]); end--); + for (end = l;end>0 && isspace((int)arg[end-1]); end--); Tcl_ListObjAppendElement(in, list, Tcl_NewStringObj(arg+start, end-start)); l++; start = l; - while(start0 && isspace(arg[end-1]); end--); + for (end = l;end>0 && isspace((int)arg[end-1]); end--); Tcl_ListObjAppendElement(in, list, Tcl_NewStringObj(arg+start, end-start)); /* append the whole thing to the list */ Tcl_ListObjAppendElement(in, npaObj, list); @@ -6030,7 +6023,6 @@ */ if (!obj || !obj->teardown) return; in = obj->teardown; - obj->teardown = 0; /* * Don't destroy, if the interpreted is destroyed already @@ -6044,6 +6036,8 @@ if (!(obj->flags & XOTCL_DESTROY_CALLED)) callDestroyMethod(cd, in, obj, 0); + obj->teardown = 0; + CleanupDestroyClass(in, cl); /* Index: xotcl/generic/xotcl.h =================================================================== diff -u -rae1fe95f685e06aa89b09e196cf421ce9ded5891 -r8c47264f39e2e6a65fc0c23d8d856a47cdf27fc4 --- xotcl/generic/xotcl.h (.../xotcl.h) (revision ae1fe95f685e06aa89b09e196cf421ce9ded5891) +++ xotcl/generic/xotcl.h (.../xotcl.h) (revision 8c47264f39e2e6a65fc0c23d8d856a47cdf27fc4) @@ -1,6 +1,6 @@ /* -*- Mode: c++ -*- * - * $Id: xotcl.h,v 1.4 2004/08/22 10:00:19 neumann Exp $ + * $Id: xotcl.h,v 1.5 2004/11/14 01:07:17 neumann Exp $ * * Extended Object Tcl (XOTcl) * @@ -50,9 +50,9 @@ #define KEEP_TCL_CMD_TYPE 1 /* activate/deacticate assert -#define NDEBUG +#define NDEBUG 1 */ -#define NDEBUG +#define NDEBUG 1 /* activate/deacticate memory tracing #define XOTCL_MEM_TRACE 1 Index: xotcl/generic/xotclInt.h =================================================================== diff -u -rab63a4908f87f226de9730e0afa820388c93acc4 -r8c47264f39e2e6a65fc0c23d8d856a47cdf27fc4 --- xotcl/generic/xotclInt.h (.../xotclInt.h) (revision ab63a4908f87f226de9730e0afa820388c93acc4) +++ xotcl/generic/xotclInt.h (.../xotclInt.h) (revision 8c47264f39e2e6a65fc0c23d8d856a47cdf27fc4) @@ -1,5 +1,5 @@ /* -*- Mode: c++ -*- - * $Id: xotclInt.h,v 1.9 2004/10/13 10:35:43 neumann Exp $ + * $Id: xotclInt.h,v 1.10 2004/11/14 01:07:17 neumann Exp $ * Extended Object Tcl (XOTcl) * * Copyright (C) 1999-2002 Gustaf Neumann, Uwe Zdun @@ -424,6 +424,7 @@ #define XOTCL_DESTROYED 0x0080 #define XOTCL_REFCOUNTED 0x0100 #define XOTCL_RECREATE 0x0200 +#define XOTCL_NS_DESTROYED 0x0400 #define XOTclObjectSetClass(obj) \ (obj)->flags |= XOTCL_IS_CLASS Index: xotcl/tests/testx.xotcl =================================================================== diff -u -r2c6cdd4f5d1c45c96e996a70b54ae4c5f46a40fd -r8c47264f39e2e6a65fc0c23d8d856a47cdf27fc4 --- xotcl/tests/testx.xotcl (.../testx.xotcl) (revision 2c6cdd4f5d1c45c96e996a70b54ae4c5f46a40fd) +++ xotcl/tests/testx.xotcl (.../testx.xotcl) (revision 8c47264f39e2e6a65fc0c23d8d856a47cdf27fc4) @@ -1,4 +1,4 @@ -#$Id: testx.xotcl,v 1.18 2004/10/30 20:19:55 neumann Exp $ +#$Id: testx.xotcl,v 1.19 2004/11/14 01:07:17 neumann Exp $ package require XOTcl namespace import -force xotcl::* @@ -2925,7 +2925,6 @@ return "PASSED [self]" } - TestX objectReferences @ TestX objectReferences { description { @@ -3606,6 +3605,7 @@ } puts "XOTcl - Test" + puts "Time used: [time {TestX run} 1]" # toplevel tests ################################################# Index: xotcl/xotclConfig.sh =================================================================== diff -u -r2c6cdd4f5d1c45c96e996a70b54ae4c5f46a40fd -r8c47264f39e2e6a65fc0c23d8d856a47cdf27fc4 --- xotcl/xotclConfig.sh (.../xotclConfig.sh) (revision 2c6cdd4f5d1c45c96e996a70b54ae4c5f46a40fd) +++ xotcl/xotclConfig.sh (.../xotclConfig.sh) (revision 8c47264f39e2e6a65fc0c23d8d856a47cdf27fc4) @@ -61,8 +61,8 @@ XOTCL_SRC_DIR='.' # shared and unshared library suffix -XOTCL_SHARED_LIB_SUFFIX=1.3.3.so -XOTCL_UNSHARED_LIB_SUFFIX=1.3.3.a +XOTCL_SHARED_LIB_SUFFIX=1.3.3${DBGX}.so +XOTCL_UNSHARED_LIB_SUFFIX=1.3.3${DBGX}.a # the shell in whose installation dirs the xotcl package is installed XOTCL_COMPATIBLE_TCLSH=/home/neumann/tcl8.4.7/unix/tclsh