Skip to content

Commit

Permalink
use zstd v1.5.6 (#139)
Browse files Browse the repository at this point in the history
* chore: update wasm

* chore: update CHAGELOG

* fix: change version
  • Loading branch information
bokuweb authored Feb 4, 2025
1 parent d3126ec commit e837bb1
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 25 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 0.0.23 (4. Feb, 2025)

- use zstd v1.5.6

## 0.0.22 (13. Dec, 2024)

- update ArrayBuffer types.

## 0.0.20 (9. Apr, 2023)

- use zstd v1.5.5
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ cd ../../../

docker run --rm -v $(pwd):/src -u $(id -u):$(id -g) emscripten/emsdk:3.1.0 emcc zstd.c -flto -o ./zstd.js -Oz --memory-init-file 0 --post-js export_module.js -s EXPORTED_FUNCTIONS="['_ZSTD_isError', '_ZSTD_getFrameContentSize', '_ZSTD_decompress', '_ZSTD_compress', '_ZSTD_compress_usingDict', '_ZSTD_decompress_usingDict', '_ZSTD_compressBound', '_malloc', '_free', '_ZSTD_createCCtx', '_ZSTD_createDCtx', '_ZSTD_freeCCtx', '_ZSTD_freeDCtx']" -s FILESYSTEM=0 -s ALLOW_MEMORY_GROWTH=1

cp zstd.wasm lib/wasm/zstd.wasm
cp zstd.wasm lib/zstd.wasm

50 changes: 27 additions & 23 deletions lib/zstd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ if (typeof WebAssembly !== 'object') {
var wasmMemory;
var ABORT = false;
function ___assert_fail(condition, filename, line, func) {
abort('Assertion failed: ' + [filename ? filename : 'unknown filename', line, func ? func : 'unknown function']);
// abort('Assertion failed: ' + [filename ? filename : 'unknown filename', line, func ? func : 'unknown function']);
}
function alignUp(x, multiple) {
if (x % multiple > 0) {
Expand Down Expand Up @@ -133,10 +133,10 @@ function init(filePathOrBuf) {
function receiveInstance(instance, module) {
var exports = instance.exports;
Module['asm'] = exports;
wasmMemory = Module['asm']['d'];
wasmMemory = Module['asm']['c'];
updateGlobalBufferAndViews(wasmMemory.buffer);
wasmTable = Module['asm']['s'];
addOnInit(Module['asm']['e']);
wasmTable = Module['asm']['r'];
addOnInit(Module['asm']['d']);
removeRunDependency('wasm-instantiate');
}
addRunDependency('wasm-instantiate');
Expand Down Expand Up @@ -235,48 +235,52 @@ function _emscripten_resize_heap(requestedSize) {
function _setTempRet0(val) {
setTempRet0(val);
}
var asmLibraryArg = { a: ___assert_fail, b: _emscripten_resize_heap, c: _setTempRet0 };

var asmLibraryArg = { a: _emscripten_resize_heap, b: _setTempRet0 };
Module['___wasm_call_ctors'] = function () {
return (Module['___wasm_call_ctors'] = Module['asm']['e']).apply(null, arguments);
};
Module['_malloc'] = function () {
return (Module['_malloc'] = Module['asm']['q']).apply(null, arguments);
};
Module['_free'] = function () {
return (Module['_free'] = Module['asm']['r']).apply(null, arguments);
return (___wasm_call_ctors = Module['___wasm_call_ctors'] = Module['asm']['d']).apply(null, arguments);
};
Module['_ZSTD_isError'] = function () {
return (Module['_ZSTD_isError'] = Module['asm']['f']).apply(null, arguments);
return (_ZSTD_isError = Module['_ZSTD_isError'] = Module['asm']['e']).apply(null, arguments);
};
Module['_ZSTD_compressBound'] = function () {
return (Module['_ZSTD_compressBound'] = Module['asm']['g']).apply(null, arguments);
return (_ZSTD_compressBound = Module['_ZSTD_compressBound'] = Module['asm']['f']).apply(null, arguments);
};
Module['_ZSTD_createCCtx'] = function () {
return (Module['_ZSTD_createCCtx'] = Module['asm']['h']).apply(null, arguments);
return (_ZSTD_createCCtx = Module['_ZSTD_createCCtx'] = Module['asm']['g']).apply(null, arguments);
};
Module['_ZSTD_freeCCtx'] = function () {
return (Module['_ZSTD_freeCCtx'] = Module['asm']['i']).apply(null, arguments);
return (_ZSTD_freeCCtx = Module['_ZSTD_freeCCtx'] = Module['asm']['h']).apply(null, arguments);
};
Module['_ZSTD_compress_usingDict'] = function () {
return (Module['_ZSTD_compress_usingDict'] = Module['asm']['j']).apply(null, arguments);
return (_ZSTD_compress_usingDict = Module['_ZSTD_compress_usingDict'] = Module['asm']['i']).apply(null, arguments);
};
Module['_ZSTD_compress'] = function () {
return (Module['_ZSTD_compress'] = Module['asm']['k']).apply(null, arguments);
return (_ZSTD_compress = Module['_ZSTD_compress'] = Module['asm']['j']).apply(null, arguments);
};
Module['_ZSTD_createDCtx'] = function () {
return (Module['_ZSTD_createDCtx'] = Module['asm']['l']).apply(null, arguments);
return (_ZSTD_createDCtx = Module['_ZSTD_createDCtx'] = Module['asm']['k']).apply(null, arguments);
};
Module['_ZSTD_freeDCtx'] = function () {
return (Module['_ZSTD_freeDCtx'] = Module['asm']['m']).apply(null, arguments);
return (_ZSTD_freeDCtx = Module['_ZSTD_freeDCtx'] = Module['asm']['l']).apply(null, arguments);
};
Module['_ZSTD_getFrameContentSize'] = function () {
return (Module['_ZSTD_getFrameContentSize'] = Module['asm']['n']).apply(null, arguments);
return (_ZSTD_getFrameContentSize = Module['_ZSTD_getFrameContentSize'] = Module['asm']['m']).apply(null, arguments);
};
Module['_ZSTD_decompress_usingDict'] = function () {
return (Module['_ZSTD_decompress_usingDict'] = Module['asm']['o']).apply(null, arguments);
return (_ZSTD_decompress_usingDict = Module['_ZSTD_decompress_usingDict'] = Module['asm']['n']).apply(
null,
arguments,
);
};
Module['_ZSTD_decompress'] = function () {
return (Module['_ZSTD_decompress'] = Module['asm']['p']).apply(null, arguments);
return (_ZSTD_decompress = Module['_ZSTD_decompress'] = Module['asm']['o']).apply(null, arguments);
};
Module['_malloc'] = function () {
return (_malloc = Module['_malloc'] = Module['asm']['p']).apply(null, arguments);
};
Module['_free'] = function () {
return (_free = Module['_free'] = Module['asm']['q']).apply(null, arguments);
};

var calledRun;
Expand Down
Binary file modified lib/zstd.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bokuweb/zstd-wasm",
"version": "0.0.22",
"version": "0.0.23",
"repository": "ssh://[email protected]/bokuweb/zstd-wasm.git",
"author": "<[email protected]>",
"license": "MIT",
Expand Down

0 comments on commit e837bb1

Please sign in to comment.