Skip to content

Commit 64b3217

Browse files
committed
update doc
1 parent a16cc13 commit 64b3217

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

doc/dev/ffi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ In the case of `@[extern]` all *irrelevant* types are removed first; see next se
3434
3535
### Translating Types from Lean to C
3636
37-
* The integer types `UInt8`, ..., `UInt64`, `USize` are represented by the C types `uint8_t`, ..., `uint64_t`, `size_t`, respectively
37+
* The integer types `UInt8`, ..., `UInt64`, `USize`, `Int8`, ..., `Int64`, `ISize` are represented by
38+
the C types `uint8_t`, ..., `uint64_t`, `size_t`, `int8_t`, ..., `int64_t`, `ptrdiff_t` respectively
3839
* `Char` is represented by `uint32_t`
3940
* `Float` is represented by `double`
4041
* An *enum* inductive type of at least 2 and at most 2^32 constructors, each of which with no parameters, is represented by the first type of `uint8_t`, `uint16_t`, `uint32_t` that is sufficient to represent all constructor indices.
@@ -49,7 +50,6 @@ In the case of `@[extern]` all *irrelevant* types are removed first; see next se
4950
is represented by the representation of that parameter's type.
5051
5152
For example, `{ x : α // p }`, the `Subtype` structure of a value of type `α` and an irrelevant proof, is represented by the representation of `α`.
52-
Similarly, the signed integer types `Int8`, ..., `Int64`, `ISize` are also represented by the unsigned C types `uint8_t`, ..., `uint64_t`, `size_t`, respectively, because they have a trivial structure.
5353
* `Nat` and `Int` are represented by `lean_object *`.
5454
Their runtime values is either a pointer to an opaque bignum object or, if the lowest bit of the "pointer" is 1 (`lean_is_scalar`), an encoded unboxed natural number or integer (`lean_box`/`lean_unbox`).
5555
* A universe `Sort u`, type constructor `... → Sort u`, `Void α` or proposition `p : Prop` is *irrelevant* and is either statically erased (see above) or represented as a `lean_object *` with the runtime value `lean_box(0)`

0 commit comments

Comments
 (0)