[Gc] Finalization cycle involving Tcl_DString?

S M Ryan wyrmwif at rawbw.com
Sat Jan 12 22:02:21 PST 2008


I am allocating a finalised Tcl_DString (finalisation tells Tcl to  
release the string)
	Tcl_DString *ds = GC_NEW(Tcl_DString);
	Tcl_DStringInit(ds);
	GC_REGISTER_FINALIZER(ds, releaseDString, 0, &ofn, &ocd);

And I get
	GC Warning: Finalization cycle involving 2cc990

The declaration of Tcl_DString is
	/*
	 * The structure defined below is used to hold dynamic strings.  The  
only
	 * field that clients should use is the string field, accessible via  
the
	 * macro Tcl_DStringValue.
	 */
	#define TCL_DSTRING_STATIC_SIZE 200
	typedef struct Tcl_DString {
	    char *string;		/* Points to beginning of string:  either
					 * staticSpace below or a malloced array. */
	    int length;			/* Number of non-NULL characters in the
					 * string. */
	    int spaceAvl;		/* Total number of bytes available for the
					 * string and its terminating NULL char. */
	    char staticSpace[TCL_DSTRING_STATIC_SIZE];
					/* Space to use in common case where string
					 * is small. */
	} Tcl_DString;

I was wondering if anyone can guess what the issue is? Is that the  
allocated block contents can have a pointer into itself?



More information about the Gc mailing list