unsafe fn to_ocaml_value(&self) -> usize {
        if !self.is_serialized {
            caml_alloc_initialized_string(self.data.as_ptr(), self.data.len())
        } else if !self.is_compressed {
            caml_input_value_from_block(self.data.as_ptr(), self.data.len())
        } else {
            // TODO(hverr): Make thus more Rust-idiomatic
            let data = malloc(self.uncompressed_size as libc::size_t);
            let uncompressed_size = liblz4::LZ4_decompress_safe(
                self.data.as_ptr() as *const i8,
                data as *mut i8,
                self.data.len().try_into().unwrap(),
                self.uncompressed_size,
            );
            assert!(self.uncompressed_size == uncompressed_size);

            let result = caml_input_value_from_block(data, uncompressed_size as libc::size_t);
            free(data);
            result
        }
    }
/// Convert the heap value into an OCaml object.
///
/// Safety: this allocates in the OCaml heap, and thus enters the runtime.
/// It may deallocate each and every object you haven't registered as a
/// root.
Convert the heap value into an OCaml object.
Safety: this allocates in the OCaml heap, and thus enters the runtime.
It may deallocate each and every object you haven't registered as a
root.
Convert the heap value into an OCaml object . Safety : this allocates in the OCaml heap and thus enters the runtime . It may deallocate each and every object you haven ' t registered as a root .
unsafe fn to_ocaml_value(&self) -> usize {
        if !self.is_serialized {
            caml_alloc_initialized_string(self.data.as_ptr(), self.data.len())
        } else if !self.is_compressed {
            caml_input_value_from_block(self.data.as_ptr(), self.data.len())
        } else {
            // TODO(hverr): Make thus more Rust-idiomatic
            let data = malloc(self.uncompressed_size as libc::size_t);
            let uncompressed_size = liblz4::LZ4_decompress_safe(
                self.data.as_ptr() as *const i8,
                data as *mut i8,
                self.data.len().try_into().unwrap(),
                self.uncompressed_size,
            );
            assert!(self.uncompressed_size == uncompressed_size);
            let result = caml_input_value_from_block(data, uncompressed_size as libc::size_t);
            free(data);
            result
        }
    }
unsafe fn to_ocaml_value ( & self ) -> usize { if ! self . is_serialized { caml_alloc_initialized_string ( self . data . as_ptr ( ) , self . data . len ( ) ) } else if ! self . is_compressed { caml_input_value_from_block ( self . data . as_ptr ( ) , self . data . len ( ) ) } else { // TODO(hverr): Make thus more Rust-idiomatic let data = malloc ( self . uncompressed_size as libc :: size_t ) ; let uncompressed_size = liblz4 :: LZ4_decompress_safe ( self . data . as_ptr ( ) as * const i8 , data as * mut i8 , self . data . len ( ) . try_into ( ) . unwrap ( ) , self . uncompressed_size , ) ; assert ! ( self uncompressed_size uncompressed_size ) ; let result = caml_input_value_from_block ( data , uncompressed_size as libc :: size_t ) ; free ( data ) ; result } }
Convert the heap value into an OCaml object.
Convert the heap value into an OCaml object .
&self
&self