extract size_t in test/ffi/test.bqn

This commit is contained in:
dzaima 2024-02-06 14:46:46 +02:00
parent 5a8ad03ff5
commit d73fbbab99

View File

@ -1,4 +1,5 @@
f@ f@
sizet "u64"
Section {•Out 𝕩˜@+10} Section {•Out 𝕩˜@+10}
f "lib.so" •FFI """do_nothing" •Show F f "lib.so" •FFI """do_nothing" •Show F
@ -85,7 +86,7 @@ f ↩ "lib.so" •FFI ⟨s1, "incMembers", ">"∾s1⟩ ⋄ •Show F ⟨200, 2e9
f "lib.so" •FFI "&", "incMany", "&"s2, "u64" •Show¨ F 036+3<01+2<200, 2e9, ¯30000, 1234, 3.25, 3 f "lib.so" •FFI "&", "incMany", "&"s2, "u64" •Show¨ F 036+3<01+2<200, 2e9, ¯30000, 1234, 3.25, 3
{ {
calloc @•FFI"*:i32""calloc""u64""u64" mem Calloc 34 calloc @•FFI"*:i32""calloc"sizetsizet mem Calloc 34
f "lib.so" •FFI "i32""arrayRefOp"">&{*:i32,u64}" f "lib.so" •FFI "i32""arrayRefOp"">&{*:i32,u64}"
{𝕊: sum, arrsz F mem3 •Show sum arr-mem}¨ 2 {𝕊: sum, arrsz F mem3 •Show sum arr-mem}¨ 2
} }
@ -94,7 +95,7 @@ Section "# self-ffi"
•term.Flush@ •term.Flush@
f @ •FFI "i32", "putchar", ">i32" F¨ 10˜"text"-@ f @ •FFI "i32", "putchar", ">i32" F¨ 10˜"text"-@
•term.Flush@ •term.Flush@
f @ •FFI "a", "bqn_makeChar", ">u64" •Show F 120169 f @ •FFI "a", "bqn_makeChar", ">u32" •Show F 120169
Section "# array types" Section "# array types"
@ -114,7 +115,7 @@ f ↩ "lib.so"•FFI ""‿"manyargs"‿"{f32,*i8,[5]i8}"‿"*[7]i8"‿"[4]i8"
Section "# nested" Section "# nested"
{ {
f "lib.so"•FFI "i32""callWithinMutated""a""&i32" f "lib.so"•FFI "i32""callWithinMutated""a""&i32"
g @ •FFI "*:i8""memcpy""&i8""*i8""u64" g @ •FFI "*:i8""memcpy""&i8""*i8"sizet
Fn { Fn {
! 𝕩fn ! 𝕩fn
•Show 1G 50, 3+5, 4 •Show 1G 50, 3+5, 4
@ -125,7 +126,7 @@ Section "# nested"
Section "# Struct of pointers" Section "# Struct of pointers"
{ {
malloc "lib.so" •FFI "*u8", "malloc", ">u64" malloc "lib.so" •FFI "*u8", "malloc", ">"sizet
p Malloc 100 p Malloc 100
sop "{*,*i32,[2]*}" sop "{*,*i32,[2]*}"
f "lib.so"•FFI sop, "operateOnStructOfPtrs", sop, "[2]"sop f "lib.so"•FFI sop, "operateOnStructOfPtrs", sop, "[2]"sop