diff options
| author | Omar Rizwan <omar@omar.website> | 2023-02-06 00:48:43 +0000 |
|---|---|---|
| committer | Omar Rizwan <omar@omar.website> | 2023-02-06 00:48:43 +0000 |
| commit | 620d7ef6b19e41faef5f92f98c1fa4e298d681fe (patch) | |
| tree | 11453574157d589afd183947cccdb09c4e849c76 /lib | |
| parent | Some README tweaks (diff) | |
| download | folk-620d7ef6b19e41faef5f92f98c1fa4e298d681fe.tar.gz folk-620d7ef6b19e41faef5f92f98c1fa4e298d681fe.zip | |
c-statements: More handle cleanup. Animal test works
Main bug was setting up rtype with ckalloc instead of Tcl_NewObj,
which resulted in weird refcount reuse behavior.
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/c.tcl | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -254,7 +254,7 @@ namespace eval c { variable rtypes rtype $type { - $robj = ckalloc(sizeof(struct Tcl_Obj)); + $robj = Tcl_NewObj(); $robj->bytes = NULL; $robj->typePtr = &$[set rtype]_ObjType; $robj->internalRep.otherValuePtr = ckalloc(sizeof($[set rtype])); @@ -363,7 +363,7 @@ namespace eval c { # puts "=====================\n$sourcecode\n=====================" set cfd [file tempfile cfile cfile.c]; puts $cfd $sourcecode; close $cfd - exec cc -Wall -g -shared -fsanitize=address -fPIC {*}$cflags $cfile -o [file rootname $cfile][info sharedlibextension] + exec cc -Wall -g -shared -fPIC {*}$cflags $cfile -o [file rootname $cfile][info sharedlibextension] load [file rootname $cfile][info sharedlibextension] cfile } ::proc import {scc sname as dest} { |
