Module ffi

Module ffi 

Source
Expand description

FFI safety utilities

Provides safe wrappers for unsafe FFI operations including:

  • Pointer validation
  • Tracked allocations with safe deallocation
  • SAFETY documentation patterns

Structs§

TrackedAllocation
A tracked allocation that stores its layout for safe deallocation.

Constants§

MAX_FFI_BUFFER_SIZE
Maximum buffer size for FFI operations (256 MB)

Functions§

slice_from_ptr
Safely creates a slice from a raw pointer after validation.
slice_from_ptr_mut
Safely creates a mutable slice from a raw pointer after validation.
validate_ptr
Validates a raw pointer before use in unsafe code.
validate_ptr_mut
Validates a mutable raw pointer before use.

Type Aliases§

FfiError
Error type for FFI operations