diff options
| author | Omar Rizwan <omar@omar.website> | 2023-04-24 08:12:08 +0000 |
|---|---|---|
| committer | Omar Rizwan <omar@omar.website> | 2023-04-24 08:12:08 +0000 |
| commit | d66fa174f01310189c0daba1efaeee00bb50d1de (patch) | |
| tree | 8847c9540f2478a29693cef84e00fe535074ad4d /lib | |
| parent | Only flamegraph the main thread (diff) | |
| download | folk-d66fa174f01310189c0daba1efaeee00bb50d1de.tar.gz folk-d66fa174f01310189c0daba1efaeee00bb50d1de.zip | |
WIP (most tests pass): Move recollect into C
(Its Tcl implementation was the last bottleneck)
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/c.tcl | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -42,6 +42,7 @@ namespace eval c { #include <tcl.h> #include <inttypes.h> #include <stdint.h> + #include <stdbool.h> } variable code [list] variable objtypes [list] @@ -64,7 +65,9 @@ namespace eval c { variable argtypes { int { expr {{ int $argname; Tcl_GetIntFromObj(interp, $obj, &$argname); }}} + bool { expr {{ int $argname; Tcl_GetIntFromObj(interp, $obj, &$argname); }}} int32_t { expr {{ int $argname; Tcl_GetIntFromObj(interp, $obj, &$argname); }}} + char { expr {{ char $argname = Tcl_GetString($obj)[0]; }}} size_t { expr {{ size_t $argname; Tcl_GetLongFromObj(interp, $obj, (long *)&$argname); }}} intptr_t { expr {{ intptr_t $argname; Tcl_GetLongFromObj(interp, $obj, (long *)&$argname); }}} uint16_t { expr {{ uint16_t $argname; Tcl_GetIntFromObj(interp, $obj, (int *)&$argname); }}} @@ -110,6 +113,7 @@ namespace eval c { variable rtypes { int { expr {{ $robj = Tcl_NewIntObj($rvalue); }}} int32_t { expr {{ $robj = Tcl_NewIntObj($rvalue); }}} + char { expr {{ $robj = Tcl_ObjPrintf("%c", $rvalue); }}} bool { expr {{ $robj = Tcl_NewIntObj($rvalue); }}} uint16_t { expr {{ $robj = Tcl_NewIntObj($rvalue); }}} uint32_t { expr {{ $robj = Tcl_NewIntObj($rvalue); }}} |
