Skip to content

Commit 3a76276

Browse files
committed
The CI doesn't support multhread zstd
1 parent e7069e7 commit 3a76276

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

c_src/zstd_nif.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -222,23 +222,23 @@ static ERL_NIF_TERM zstd_nif_flush_compression_stream(ErlNifEnv* env, int argc,
222222
size_t offset = 0;
223223
ZSTD_outBuffer outbuf;
224224
do {
225-
/* output buffer */
226-
outbuf.pos = 0;
227-
outbuf.dst = bin.data + offset;
228-
outbuf.size = bin.size - offset;
229-
230-
/* ends the stream */
231-
size_t const remaining = ZSTD_endStream(*pzcs, &outbuf);
232-
if (ZSTD_isError(remaining))
233-
{
234-
enif_release_binary(&bin);
235-
return enif_make_tuple2(env, zstd_atom_error, enif_make_string(env, ZSTD_getErrorName(remaining), ERL_NIF_LATIN1));
236-
}
237-
finished = remaining == 0;
238-
if(!finished) {
239-
offset += ZSTD_CStreamOutSize();
240-
enif_realloc_binary(&bin, bin.size + ZSTD_CStreamOutSize());
241-
}
225+
/* output buffer */
226+
outbuf.pos = 0;
227+
outbuf.dst = bin.data + offset;
228+
outbuf.size = bin.size - offset;
229+
230+
/* ends the stream */
231+
size_t const remaining = ZSTD_endStream(*pzcs, &outbuf);
232+
if (ZSTD_isError(remaining))
233+
{
234+
enif_release_binary(&bin);
235+
return enif_make_tuple2(env, zstd_atom_error, enif_make_string(env, ZSTD_getErrorName(remaining), ERL_NIF_LATIN1));
236+
}
237+
finished = remaining == 0;
238+
if(!finished) {
239+
offset += ZSTD_CStreamOutSize();
240+
enif_realloc_binary(&bin, bin.size + ZSTD_CStreamOutSize());
241+
}
242242
} while (!finished);
243243

244244
/* transfer to binary object */

test/zstd_tests.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
-define(COMPRESSION_LEVEL, 5).
44
-define(WINDOW_LOG, 23).
55
-define(ENABLE_LONG_DISTANCE_MATCHING, 1).
6-
-define(NUM_WORKERS, 8).
6+
-define(NUM_WORKERS, 0).
77

88
-include_lib("eunit/include/eunit.hrl").
99

0 commit comments

Comments
 (0)