Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pyodide
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
pyodide
Commits
4adce231
Commit
4adce231
authored
Sep 20, 2018
by
Michael Droettboom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove redundant code
parent
fff45f8b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
14 deletions
+4
-14
emsdk/patches/lz4_c.patch
emsdk/patches/lz4_c.patch
+4
-14
No files found.
emsdk/patches/lz4_c.patch
View file @
4adce231
...
@@ -44,25 +44,15 @@ index 4c3f583b7..5291002a4 100644
...
@@ -44,25 +44,15 @@ index 4c3f583b7..5291002a4 100644
},
},
createNode: function (parent, name, mode, dev, contents, mtime) {
createNode: function (parent, name, mode, dev, contents, mtime) {
var node = FS.createNode(parent, name, mode);
var node = FS.createNode(parent, name, mode);
@@ -112,
8 +106,1
7 @@
mergeInto(LibraryManager.library, {
@@ -112,
6 +106,
7 @@
mergeInto(LibraryManager.library, {
//console.log('LZ4 read ' + [offset, length, position]);
//console.log('LZ4 read ' + [offset, length, position]);
length = Math.min(length, stream.node.size - position);
length = Math.min(length, stream.node.size - position);
if (length <= 0) return 0;
if (length <= 0) return 0;
+
+
var contents = stream.node.contents;
var contents = stream.node.contents;
var compressedData = contents.compressedData;
var compressedData = contents.compressedData;
+ if (compressedData.buf === null) {
+ compressedData.buf = Module['_malloc'](LZ4.CHUNK_SIZE);
+ for (var i = 0; i < compressedData.cachedIndexes.length; i++) {
+ compressedData.cachedIndexes[i] = -1;
+ compressedData.cachedChunks[i] = Module['_malloc'](LZ4.CHUNK_SIZE);
+ assert(compressedData.cachedChunks[i] !== null)
+ }
+ }
var written = 0;
var written = 0;
while (written < length) {
@@ -122,6 +117,8 @@
mergeInto(LibraryManager.library, {
var start = contents.start + position + written; // start index in uncompressed data
@@ -122,6 +125,8 @@
mergeInto(LibraryManager.library, {
var chunkIndex = Math.floor(start / LZ4.CHUNK_SIZE);
var chunkIndex = Math.floor(start / LZ4.CHUNK_SIZE);
var compressedStart = compressedData.offsets[chunkIndex];
var compressedStart = compressedData.offsets[chunkIndex];
var compressedSize = compressedData.sizes[chunkIndex];
var compressedSize = compressedData.sizes[chunkIndex];
...
@@ -71,7 +61,7 @@ index 4c3f583b7..5291002a4 100644
...
@@ -71,7 +61,7 @@ index 4c3f583b7..5291002a4 100644
var currChunk;
var currChunk;
if (compressedData.successes[chunkIndex]) {
if (compressedData.successes[chunkIndex]) {
var found = compressedData.cachedIndexes.indexOf(chunkIndex);
var found = compressedData.cachedIndexes.indexOf(chunkIndex);
@@ -138,18 +1
43
,19 @@
mergeInto(LibraryManager.library, {
@@ -138,18 +1
35
,19 @@
mergeInto(LibraryManager.library, {
Module['decompressedChunks'] = (Module['decompressedChunks'] || 0) + 1;
Module['decompressedChunks'] = (Module['decompressedChunks'] || 0) + 1;
}
}
var compressed = compressedData.data.subarray(compressedStart, compressedStart + compressedSize);
var compressed = compressedData.data.subarray(compressedStart, compressedStart + compressedSize);
...
@@ -99,7 +89,7 @@ index 4c3f583b7..5291002a4 100644
...
@@ -99,7 +89,7 @@ index 4c3f583b7..5291002a4 100644
var currWritten = endInChunk - startInChunk;
var currWritten = endInChunk - startInChunk;
written += currWritten;
written += currWritten;
}
}
@@ -181,4 +1
87
,3 @@
if (LibraryManager.library['$FS__deps']) {
@@ -181,4 +1
79
,3 @@
if (LibraryManager.library['$FS__deps']) {
warn('FS does not seem to be in use (no preloaded files etc.), LZ4 will not do anything');
warn('FS does not seem to be in use (no preloaded files etc.), LZ4 will not do anything');
}
}
#endif
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment