dax_zip_create_contig - create a codec from contiguous symbols
cc [ flag... ] file... -ldax [ library...] #include <dax.h> dax_status_t dax_zip_create_contig(dax_context_t *ctx, void *buf, size_t length, dax_zip_t **codec);
This function is an alternative to the dax_zip_create() function. But in this function, the nsyms, widths, and syms are passed in a contiguous block of length bytes starting at buf. The returned codec uses buf by reference. buf must align on a 16 byte boundary.
The buf block has the following format:
|
Definitions of nsyms, widths, and syms are available in the dax_zip_create(3DAX) man page. The size of widths is ceil(nsyms/2) bytes. length must not exceed 4098 bytes for libdax version 1, or 8192 bytes for libdax version 2.
The value of length must be equal to 2 + ceil(nsyms/2) + sum(widths). The library only checks this condition if the DAX_DEBUG_EXTRA debug option is set. If the condition is violated and not checked, the results are undefined.
On successful return, the caller must not modify or free buf so long as the returned codec is used in the DAX operations. If this condition is violated, the results are undefined.
Operation completed successfully
Invalid argument
Memory resources unavailable
The calling thread did not create ctx
See attributes(7) for descriptions of the following attributes:
|
For best performance, align buf to the value of the zip_align_best property as defined in the dax_get_props(3DAX) man page.
dax_zip_create(3DAX), dax_zip_free(3DAX), dax_set_debug(3DAX)
libdax version 2 passes buf directly to DAX, avoiding the overhead of converting the codec to a different internal format. libdax version 1 always converts buf to a different format.