Library
Module
Module type
Parameter
Class
Class type
Efficient copies between various types of memory blocks: bytes, bigarrays, addresses and arrays
The types of memory are divided into two classes: safe
, where the bounds can be checked, and unsafe
, where no bounds information is available.
val bigarray :
< ba_repr : 'a
; bigarray : 'b
; carray : 'c
; dims : 'd
; element : 'e >
Ctypes.bigarray_class ->
'd ->
('e, 'a) Stdlib.Bigarray.kind ->
(safe, 'b) spec
A specification for a bigarray type
val pointer : (unsafe, _ Ctypes.ptr) spec
A specification for a Ctypes pointer type
val carray : (safe, _ Ctypes.carray) spec
A specification for a Ctypes array type
val memcpy :
(safe, 's) spec ->
(safe, 'd) spec ->
src:'s ->
dst:'d ->
src_off:int ->
dst_off:int ->
len:int ->
unit
memcpy s d ~src ~dst ~src_off ~dst_off ~len
copies len
bytes from offset src_off
of src
to offset dst_off
of dst
.
val unsafe_memcpy :
(_, 's) spec ->
(_, 'd) spec ->
src:'s ->
dst:'d ->
src_off:int ->
dst_off:int ->
len:int ->
unit
unsafe_memcpy s d ~src ~dst ~src_off ~dst_off ~len
copies len
bytes from offset src_off
of src
to offset dst_off
of dst
.
No attempt is made to check that the specified regions of memory actually fall within src
and dst
.