Skip to content

Commit

Permalink
(#354) Docs: more clarifications
Browse files Browse the repository at this point in the history
  • Loading branch information
ForNeVeR committed Jul 29, 2023
1 parent 7cf15f0 commit b5512a0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/architecture-sets.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ Cesium aims to support the following architecture sets:

**This architecture is machine-independent** and results in producing of an Any CPU-targeting assembly.

Specifically for the **wide** architecture, the types `VoidPtr`, `CPtr<T>` and `FuncPtr<T>` were introduced. They correspond to 64-bit pointers universally, and the **wide** architecture uses it in place of normal pointer types everywhere in the API. For cross-compatibility with any architecture, these types are also used in the Cesium.Runtime library. See [the type system documentation][docs.type-system] for more information.
Specifically for the **wide** architecture, the types `VoidPtr`, `CPtr<T>` and `FuncPtr<TDelegate>` were introduced. They correspond to 64-bit pointers universally, and the **wide** architecture uses it in place of normal pointer types everywhere in the API. For cross-compatibility with any architecture, these types are also used in the Cesium.Runtime library. See [the type system documentation][docs.type-system] for more information.

[docs.type-system]: type-system.md
14 changes: 7 additions & 7 deletions docs/type-system.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ All the pointer types are mapped to the CLI pointers of the corresponding type o

The **wide** architecture set supports mapping to raw pointers as well, but also supports special mapping types that have architecture-independent size and memory alignment, according to the following table.

| C type | CLI Type |
|--------------------------------------------------------|--------------------------|
| `void*` | `Cesium.Runtime.VoidPtr` |
| Function pointer | `Cesium.Runtime.FuncPtr` |
| `T*` (where `T` is not `void` and not a function type) | `Cesium.Runtime.CPtr<T>` |
| C type | CLI Type |
|--------------------------------------------------------|-------------------------------------|
| `void*` | `Cesium.Runtime.VoidPtr` |
| Function pointer | `Cesium.Runtime.FuncPtr<TDelegate>` |
| `T*` (where `T` is not `void` and not a function type) | `Cesium.Runtime.CPtr<T>` |

Note that function and function pointer signatures (i.e. the arguments and the return types) still use raw pointers even in the **wide** architecture set, because this has no effect on memory requirement and alignment, and thus type safety is preferred by default.
Note that function and function pointer signatures (i.e. the arguments and the return types) still use raw pointers even in the **wide** architecture set, because this has no effect on memory requirement and alignment, and thus more type safety is preferred by default.

To be compatible with both **wide** and other architecture sets, the Cesium.Runtime library uses `CPtr` and `FPtr`, where appropriate, in all of its standard APIs.
To be compatible with both **wide** and other architecture sets, the Cesium.Runtime library uses `VoidPtr`, `CPtr<T>` and `FuncPtr<TDelegate>`, where appropriate, in all of its standard APIs.

0 comments on commit b5512a0

Please sign in to comment.