Function varint_simd::decode_unsafe

source ·
pub unsafe fn decode_unsafe<T: VarIntTarget>(bytes: *const u8) -> (T, usize)
Expand description

Decodes a single varint from the input pointer. Returns a tuple containing the decoded number and the number of bytes read.

Safety

There must be at least 16 bytes of allocated memory after the beginning of the pointer. Otherwise, there may be undefined behavior. Any data after the end of the varint are ignored. A truncated value will be returned if the varint represents a number too large for the target type.

You may prefer to use this unsafe interface if you know what you are doing and need a little extra performance.