Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file cstubs_analysis.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120(*
* Copyright (c) 2014 Jeremy Yallop.
*
* This file is distributed under the terms of the MIT License.
* See the file LICENSE for details.
*)(* Analysis for stub generation *)openCtypes_staticletis_float_primitive:typea.atyp->bool=letopenCtypes_primitive_typesinfunction|PrimitiveFloat->true|PrimitiveDouble->true|_->falseletrecfloat:typea.afn->bool=function|Returnst->is_float_primitivet|Function(f,t)->is_float_primitivef&&floatt(* A value of type 'a noalloc says that reading a value of type 'a
will not cause an OCaml allocation in C code. *)type_noalloc=Noalloc_unit:unitnoalloc|Noalloc_int:intnoalloc|Noalloc_uint8_t:Unsigned.uint8noalloc|Noalloc_uint16_t:Unsigned.uint16noalloc|Noalloc_char:charnoalloc|Noalloc_bool:boolnoalloc|Noalloc_view:('a,'b)view*'bnoalloc->'anoalloc(* A value of type 'a alloc says that reading a value of type 'a
may cause an OCaml allocation in C code. *)type_alloc=|Alloc_sint:Signed.sintalloc|Alloc_long:Signed.longalloc|Alloc_llong:Signed.llongalloc|Alloc_uint:Unsigned.uintalloc|Alloc_uchar:Unsigned.ucharalloc|Alloc_ushort:Unsigned.ushortalloc|Alloc_ulong:Unsigned.ulongalloc|Alloc_ullong:Unsigned.ullongalloc|Alloc_size_t:Unsigned.size_talloc|Alloc_int32_t:int32alloc|Alloc_int64_t:int64alloc|Alloc_uint32_t:Unsigned.uint32alloc|Alloc_uint64_t:Unsigned.uint64alloc|Alloc_nativeint:nativeintalloc|Alloc_float:floatalloc|Alloc_ldouble:LDouble.talloc|Alloc_complex:Complex.talloc|Alloc_complexld:ComplexL.talloc|Alloc_pointer:(_,_)pointeralloc|Alloc_funptr:_static_funptralloc|Alloc_structured:(_,_)structuredalloc|Alloc_array:_carrayalloc|Alloc_bigarray:(_,'a,_)Ctypes_bigarray.t->'aalloc|Alloc_view:('a,'b)view*'balloc->'aalloctype'aallocation=[`Noallocof'anoalloc|`Allocof'aalloc]letprimitive_allocation:typea.aCtypes_primitive_types.prim->aallocation=letopenCtypes_primitive_typesinfunction|Char->`NoallocNoalloc_char|Bool->`NoallocNoalloc_bool|Schar->`NoallocNoalloc_int|Short->`NoallocNoalloc_int|Int->`NoallocNoalloc_int|Int8_t->`NoallocNoalloc_int|Int16_t->`NoallocNoalloc_int|Uint8_t->`NoallocNoalloc_uint8_t|Uint16_t->`NoallocNoalloc_uint16_t|Camlint->`NoallocNoalloc_int|Long->`AllocAlloc_long|Llong->`AllocAlloc_llong|Ushort->`AllocAlloc_ushort|Uchar->`AllocAlloc_uchar|Sint->`AllocAlloc_sint|Uint->`AllocAlloc_uint|Ulong->`AllocAlloc_ulong|Ullong->`AllocAlloc_ullong|Size_t->`AllocAlloc_size_t|Int32_t->`AllocAlloc_int32_t|Int64_t->`AllocAlloc_int64_t|Uint32_t->`AllocAlloc_uint32_t|Uint64_t->`AllocAlloc_uint64_t|Nativeint->`AllocAlloc_nativeint|Float->`AllocAlloc_float|Double->`AllocAlloc_float|LDouble->`AllocAlloc_ldouble|Complex32->`AllocAlloc_complex|Complex64->`AllocAlloc_complex|Complexld->`AllocAlloc_complexldletrecallocation:typea.atyp->aallocation=function|Void->`NoallocNoalloc_unit|Primitivep->primitive_allocationp|Pointer_->`AllocAlloc_pointer|Funptr_->`AllocAlloc_funptr|Struct_->`AllocAlloc_structured|Union_->`AllocAlloc_structured|Abstract_->`AllocAlloc_structured|Viewv->beginmatchallocationv.tywith|`Alloca->`Alloc(Alloc_view(v,a))|`Noallocna->`Noalloc(Noalloc_view(v,na))end|Qualified(_,ty)->allocationty|Array_->`AllocAlloc_array|Bigarrayba->`Alloc(Alloc_bigarrayba)|OCaml_->`AllocAlloc_pointerletrecmay_allocate:typea.afn->bool=function|Returnst->beginmatchallocationtwith|`Noalloc_->false|`Alloc_->trueend|Function(_,t)->may_allocatet