new_wrapped_full


Description:

[ CCode ( has_construct_function = false , simple_generics = true ) ]
public static Buffer new_wrapped_full<T> (MemoryFlags flags, uint8[] data, size_t offset, size_t size, owned T user_data)

Allocates a new buffer that wraps the given memory.

data must point to maxsize of memory, the wrapped buffer will have the region from offset and data.length visible.

When the buffer is destroyed, notify will be called with user_data.

The prefix/padding must be filled with 0 if flags contains ZERO_PREFIXED and ZERO_PADDED respectively.

Parameters:

flags

MemoryFlags

data

data to wrap

offset

offset in data

user_data

user_data

maxsize

allocated size of data

notify

called with user_data when the memory is freed

size

size of valid data

Returns:

a new Buffer