[contrib][linux] Add wrapper API

Add the kernel wrapper API. This keeps the same API and semantics as the
existing kernel API with name changes to be more kernel style and avoid
symbol collisions with zstd.
This commit is contained in:
Nick Terrell committed 2020-12-02 01:08:08 -08:00
1 parent 6112b82526
commit f58e9a9830
8 files changed
+769 -177

No files matched your search

+4 -4
View File
@@ -31,13 +31,13 @@ static const char kEmptyZstdFrame[] = {
static void test_decompress_unzstd() {
fprintf(stderr, "Testing decompress unzstd... ");
{
size_t const wkspSize = ZSTD_estimateDCtxSize();
size_t const wkspSize = zstd_dctx_workspace_bound();
void* wksp = malloc(wkspSize);
CONTROL(wksp != NULL);
ZSTD_DCtx* dctx = ZSTD_initStaticDCtx(wksp, wkspSize);
ZSTD_DCtx* dctx = zstd_init_dctx(wksp, wkspSize);
CONTROL(dctx != NULL);
size_t const dSize = ZSTD_decompressDCtx(dctx, NULL, 0, kEmptyZstdFrame, sizeof(kEmptyZstdFrame));
CONTROL(!ZSTD_isError(dSize));
size_t const dSize = zstd_decompress_dctx(dctx, NULL, 0, kEmptyZstdFrame, sizeof(kEmptyZstdFrame));
CONTROL(!zstd_is_error(dSize));
CONTROL(dSize == 0);
free(wksp);
}