Skip to content

Commit

Permalink
Update ffi README files (#243)
Browse files Browse the repository at this point in the history
  • Loading branch information
qwreey committed Nov 9, 2024
1 parent 7a7ccf7 commit 461ab26
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
4 changes: 2 additions & 2 deletions crates/lune-std-ffi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Define C-ABI type information and provide conversion and casting
- [**Struct `CStructInfo`:**](./src/c/struct_info.rs) Represents C Struct type
- [**Struct `CTypeInfo<T>`:**](./src/c/type_info.rs) Represents C type, extended in `/c/types`

<details><summary><a href="./src/c/helper.rs"><strong>Mod <code>helper.rs</code>: C ABI type helper</strong></a></summary>
<details><summary><a href="./src/c/helper.rs"><strong>Mod <code>helper.rs</code>:</strong></a> C ABI type helper</summary>

- **Function `get_conv`, `get_conv_list`:**
get `FfiConvert` from userdata (CStruct, CArr, CPtr, CTypes)
Expand All @@ -64,7 +64,7 @@ Define C-ABI type information and provide conversion and casting
Export fixed-size source time known types and non-fixed compile time known types
mod.rs implememts type-casting for all CTypes

<details><summary><a href="./src/c/types/mod.rs"><strong>Mod <code>ctype_helper</code>:</strong></a> c type helper</summary>
<details><summary><a href="./src/c/types/mod.rs"><strong>Mod <code>ctype_helper</code>:</strong></a> CTypeInfo helper</summary>

- **Function `get_conv`:**
get `FfiConvert` from ctype userdata, used for struct and array conversion
Expand Down
11 changes: 10 additions & 1 deletion tests/ffi/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<!-- markdownlint-disable MD036 -->
<!-- markdownlint-disable MD033 -->

# `tests/ffi`

Expand All @@ -24,6 +25,12 @@ gcc for library compiling (for external-\*)
- [x] [read_boundary](./read_boundary.luau)
- [x] [write_boundary](./write_boundary.luau)

**Types**

- [x] [arr](./types/arr.luau)
- [x] [ptr](./types/ptr.luau)
- [x] [struct](./types/struct.luau)

**Pretty Print**

- [x] [arr](./pretty_print/arr.luau)
Expand All @@ -39,7 +46,7 @@ gcc for library compiling (for external-\*)

> Note: LuaJit's os.clock function returns process CPU time (used) which much smaller then Luau's os.clock output. In this benchmark, luau uses 'time.h' instead of os.clock. See [utility/proc_clock](./utility/proc_clock/init.luau)
### [benchmark/external_call](./benchmark/external_call/init.luau)
<details><summary><h3><a href="./benchmark/external_call/init.luau">benchmark/external_call</a></h3></summary>

**Target external c function**

Expand Down Expand Up @@ -102,3 +109,5 @@ Command: `deno run --unstable-ffi --allow-ffi ./tests/ffi/benchmark/external_cal
> MEM: 12250MiB 5600 MT/s
> KERNEL: 10.0.22631 (Windows 11 x86_64)
> HOST: QEMU Standard PC (Q35 + ICH9, 2009)
</details>

0 comments on commit 461ab26

Please sign in to comment.