zlib-streams 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/Makefile +4 -4
  2. package/README.md +1 -1
  3. package/build/debug/src/inffast9.d +9 -0
  4. package/build/debug/src/inffast9.o +0 -0
  5. package/build/debug/src/inflate9.d +12 -0
  6. package/build/debug/src/inflate9.o +0 -0
  7. package/build/debug/src/zlib/adler32.d +5 -0
  8. package/build/debug/src/zlib/adler32.o +0 -0
  9. package/build/debug/src/zlib/contrib/infback9/infback9.d +13 -0
  10. package/build/debug/src/zlib/contrib/infback9/infback9.o +0 -0
  11. package/build/debug/src/zlib/contrib/infback9/inftree9.d +7 -0
  12. package/build/debug/src/zlib/contrib/infback9/inftree9.o +0 -0
  13. package/build/debug/src/zlib/crc32.d +6 -0
  14. package/build/debug/src/zlib/crc32.o +0 -0
  15. package/build/debug/src/zlib/infback.d +10 -0
  16. package/build/debug/src/zlib/infback.o +0 -0
  17. package/build/debug/src/zlib/inffast.d +9 -0
  18. package/build/debug/src/zlib/inffast.o +0 -0
  19. package/build/debug/src/zlib/inflate.d +10 -0
  20. package/build/debug/src/zlib/inflate.o +0 -0
  21. package/build/debug/src/zlib/inftrees.d +6 -0
  22. package/build/debug/src/zlib/inftrees.o +0 -0
  23. package/build/debug/src/zlib/trees.d +7 -0
  24. package/build/debug/src/zlib/trees.o +0 -0
  25. package/build/debug/src/zlib/zutil.d +6 -0
  26. package/build/debug/src/zlib/zutil.o +0 -0
  27. package/build/src/inffast9.d +9 -0
  28. package/build/src/inffast9.o +0 -0
  29. package/build/src/inflate9.d +12 -0
  30. package/build/src/inflate9.o +0 -0
  31. package/build/src/zlib/adler32.d +5 -0
  32. package/build/src/zlib/adler32.o +0 -0
  33. package/build/src/zlib/contrib/infback9/infback9.d +13 -0
  34. package/build/src/zlib/contrib/infback9/infback9.o +0 -0
  35. package/build/src/zlib/contrib/infback9/inftree9.d +7 -0
  36. package/build/src/zlib/contrib/infback9/inftree9.o +0 -0
  37. package/build/src/zlib/crc32.d +6 -0
  38. package/build/src/zlib/crc32.o +0 -0
  39. package/build/src/zlib/infback.d +10 -0
  40. package/build/src/zlib/infback.o +0 -0
  41. package/build/src/zlib/inffast.d +9 -0
  42. package/build/src/zlib/inffast.o +0 -0
  43. package/build/src/zlib/inflate.d +10 -0
  44. package/build/src/zlib/inflate.o +0 -0
  45. package/build/src/zlib/inftrees.d +6 -0
  46. package/build/src/zlib/inftrees.o +0 -0
  47. package/build/src/zlib/trees.d +7 -0
  48. package/build/src/zlib/trees.o +0 -0
  49. package/build/src/zlib/zutil.d +6 -0
  50. package/build/src/zlib/zutil.o +0 -0
  51. package/dist/zlib-streams.wasm +0 -0
  52. package/package.json +1 -1
  53. package/src/inffast9.c +312 -0
  54. package/src/inffast9.h +11 -0
  55. package/src/inflate9.c +167 -34
  56. package/src/wasm/allocator.c +12 -0
  57. package/src/wasm/allocator.h +4 -0
  58. package/src/wasm/deflate_stream_wasm.c +3 -2
  59. package/src/wasm/inflate9_stream_wasm.c +3 -2
  60. package/src/wasm/inflate_stream_wasm.c +4 -3
  61. package/tmp/all_runs/payload_decompress_nowindow_debug__100k_lines.deflate64.log +34 -0
  62. package/tmp/all_runs/payload_decompress_nowindow_debug__100k_lines.deflate64.out +100000 -0
  63. package/tmp/all_runs/payload_decompress_nowindow_debug__10k_lines.deflate64.log +2 -0
  64. package/tmp/all_runs/payload_decompress_nowindow_debug__10k_lines.deflate64.out +10000 -0
  65. package/tmp/all_runs/payload_decompress_nowindow_debug__payload_63k.deflate64.log +1 -0
  66. package/tmp/all_runs/payload_decompress_nowindow_debug__payload_63k.deflate64.out +0 -0
  67. package/tmp/all_runs/payload_decompress_nowindow_debug__payload_64k.deflate64.log +1 -0
  68. package/tmp/all_runs/payload_decompress_nowindow_debug__payload_64k.deflate64.out +0 -0
  69. package/tmp/all_runs/payload_decompress_nowindow_debug__payload_65k.deflate64.log +2 -0
  70. package/tmp/all_runs/payload_decompress_nowindow_debug__payload_65k.deflate64.out +0 -0
  71. package/tmp/all_runs/payload_decompress_nowindow_debug__rand_block_gap.deflate64.log +1 -0
  72. package/tmp/all_runs/payload_decompress_nowindow_debug__rand_block_gap.deflate64.out +0 -0
  73. package/tmp/all_runs/payload_decompress_nowindow_debug__repeat_63k.deflate64.log +1 -0
  74. package/tmp/all_runs/payload_decompress_nowindow_debug__repeat_63k.deflate64.out +0 -0
  75. package/tmp/all_runs/payload_decompress_nowindow_debug__repeat_64k.deflate64.log +1 -0
  76. package/tmp/all_runs/payload_decompress_nowindow_debug__repeat_64k.deflate64.out +0 -0
  77. package/tmp/all_runs/payload_decompress_nowindow_debug__repeat_65k.deflate64.log +2 -0
  78. package/tmp/all_runs/payload_decompress_nowindow_debug__repeat_65k.deflate64.out +0 -0
  79. package/tmp/all_runs/payload_decompress_nowindow_debug__zeros_100k.deflate64.log +2 -0
  80. package/tmp/all_runs/payload_decompress_nowindow_debug__zeros_100k.deflate64.out +0 -0
  81. package/tmp/all_runs/payload_decompress_ref_debug__100k_lines.deflate64.log +1 -0
  82. package/tmp/all_runs/payload_decompress_ref_debug__100k_lines.deflate64.out +100000 -0
  83. package/tmp/all_runs/payload_decompress_ref_debug__10k_lines.deflate64.log +1 -0
  84. package/tmp/all_runs/payload_decompress_ref_debug__10k_lines.deflate64.out +10000 -0
  85. package/tmp/all_runs/payload_decompress_ref_debug__payload_63k.deflate64.log +1 -0
  86. package/tmp/all_runs/payload_decompress_ref_debug__payload_63k.deflate64.out +0 -0
  87. package/tmp/all_runs/payload_decompress_ref_debug__payload_64k.deflate64.log +1 -0
  88. package/tmp/all_runs/payload_decompress_ref_debug__payload_64k.deflate64.out +0 -0
  89. package/tmp/all_runs/payload_decompress_ref_debug__payload_65k.deflate64.log +1 -0
  90. package/tmp/all_runs/payload_decompress_ref_debug__payload_65k.deflate64.out +0 -0
  91. package/tmp/all_runs/payload_decompress_ref_debug__rand_block_gap.deflate64.log +1 -0
  92. package/tmp/all_runs/payload_decompress_ref_debug__rand_block_gap.deflate64.out +0 -0
  93. package/tmp/all_runs/payload_decompress_ref_debug__repeat_63k.deflate64.log +1 -0
  94. package/tmp/all_runs/payload_decompress_ref_debug__repeat_63k.deflate64.out +0 -0
  95. package/tmp/all_runs/payload_decompress_ref_debug__repeat_64k.deflate64.log +1 -0
  96. package/tmp/all_runs/payload_decompress_ref_debug__repeat_64k.deflate64.out +0 -0
  97. package/tmp/all_runs/payload_decompress_ref_debug__repeat_65k.deflate64.log +1 -0
  98. package/tmp/all_runs/payload_decompress_ref_debug__repeat_65k.deflate64.out +0 -0
  99. package/tmp/all_runs/payload_decompress_ref_debug__zeros_100k.deflate64.log +1 -0
  100. package/tmp/all_runs/payload_decompress_ref_debug__zeros_100k.deflate64.out +0 -0
  101. package/tmp/all_runs/payload_decompress_test_debug__100k_lines.deflate64.log +34 -0
  102. package/tmp/all_runs/payload_decompress_test_debug__100k_lines.deflate64.out +100000 -0
  103. package/tmp/all_runs/payload_decompress_test_debug__10k_lines.deflate64.log +2 -0
  104. package/tmp/all_runs/payload_decompress_test_debug__10k_lines.deflate64.out +10000 -0
  105. package/tmp/all_runs/payload_decompress_test_debug__payload_63k.deflate64.log +1 -0
  106. package/tmp/all_runs/payload_decompress_test_debug__payload_63k.deflate64.out +0 -0
  107. package/tmp/all_runs/payload_decompress_test_debug__payload_64k.deflate64.log +1 -0
  108. package/tmp/all_runs/payload_decompress_test_debug__payload_64k.deflate64.out +0 -0
  109. package/tmp/all_runs/payload_decompress_test_debug__payload_65k.deflate64.log +2 -0
  110. package/tmp/all_runs/payload_decompress_test_debug__payload_65k.deflate64.out +0 -0
  111. package/tmp/all_runs/payload_decompress_test_debug__rand_block_gap.deflate64.log +1 -0
  112. package/tmp/all_runs/payload_decompress_test_debug__rand_block_gap.deflate64.out +0 -0
  113. package/tmp/all_runs/payload_decompress_test_debug__repeat_63k.deflate64.log +1 -0
  114. package/tmp/all_runs/payload_decompress_test_debug__repeat_63k.deflate64.out +0 -0
  115. package/tmp/all_runs/payload_decompress_test_debug__repeat_64k.deflate64.log +1 -0
  116. package/tmp/all_runs/payload_decompress_test_debug__repeat_64k.deflate64.out +0 -0
  117. package/tmp/all_runs/payload_decompress_test_debug__repeat_65k.deflate64.log +2 -0
  118. package/tmp/all_runs/payload_decompress_test_debug__repeat_65k.deflate64.out +0 -0
  119. package/tmp/all_runs/payload_decompress_test_debug__zeros_100k.deflate64.log +2 -0
  120. package/tmp/all_runs/payload_decompress_test_debug__zeros_100k.deflate64.out +0 -0
@@ -0,0 +1,12 @@
1
+ #include <stdlib.h>
2
+ #include "zlib.h"
3
+
4
+ voidpf my_zalloc(voidpf opaque, unsigned items, unsigned size) {
5
+ (void)opaque;
6
+ return malloc(items * size);
7
+ }
8
+
9
+ void my_zfree(voidpf opaque, voidpf ptr) {
10
+ (void)opaque;
11
+ free(ptr);
12
+ }
@@ -0,0 +1,4 @@
1
+ #include <zconf.h>
2
+
3
+ voidpf my_zalloc(voidpf opaque, unsigned items, unsigned size);
4
+ void my_zfree(voidpf opaque, voidpf ptr);
@@ -2,6 +2,7 @@
2
2
  #include <string.h>
3
3
  #include <stdint.h>
4
4
  #include "zlib.h"
5
+ #include "allocator.h"
5
6
 
6
7
  #ifndef RAW_WBITS
7
8
  #if defined(MAX_WBITS)
@@ -23,8 +24,8 @@ unsigned deflate_new(void) {
23
24
  if (!c)
24
25
  return 0;
25
26
  memset(c, 0, sizeof(*c));
26
- c->strm.zalloc = Z_NULL;
27
- c->strm.zfree = Z_NULL;
27
+ c->strm.zalloc = my_zalloc;
28
+ c->strm.zfree = my_zfree;
28
29
  c->strm.opaque = Z_NULL;
29
30
  c->inbuf = NULL;
30
31
  c->inbuf_sz = 0;
@@ -3,6 +3,7 @@
3
3
  #include <stdint.h>
4
4
  #include "zlib.h"
5
5
  #include "inflate9.h"
6
+ #include "allocator.h"
6
7
  #ifndef DEFLATE64_WBITS
7
8
  #if defined(MAX_WBITS) && (MAX_WBITS >= 16)
8
9
  #define DEFLATE64_WBITS MAX_WBITS
@@ -23,8 +24,8 @@ unsigned inflate9_new(void) {
23
24
  if (!c)
24
25
  return 0;
25
26
  memset(c, 0, sizeof(*c));
26
- c->strm.zalloc = Z_NULL;
27
- c->strm.zfree = Z_NULL;
27
+ c->strm.zalloc = my_zalloc;
28
+ c->strm.zfree = my_zfree;
28
29
  c->strm.opaque = Z_NULL;
29
30
  c->inbuf = NULL;
30
31
  c->inbuf_sz = 0;
@@ -2,6 +2,7 @@
2
2
  #include <string.h>
3
3
  #include <stdint.h>
4
4
  #include "zlib.h"
5
+ #include "allocator.h"
5
6
 
6
7
  #ifndef RAW_WBITS
7
8
  #if defined(MAX_WBITS)
@@ -23,9 +24,9 @@ unsigned inflate_new(void) {
23
24
  if (!c)
24
25
  return 0;
25
26
  memset(c, 0, sizeof(*c));
26
- c->strm.zalloc = Z_NULL;
27
- c->strm.zfree = Z_NULL;
28
- c->strm.opaque = Z_NULL;
27
+ c->strm.zalloc = my_zalloc;
28
+ c->strm.zfree = my_zfree;
29
+ c->strm.opaque = NULL;
29
30
  c->inbuf = NULL;
30
31
  c->inbuf_sz = 0;
31
32
  return (unsigned)(uintptr_t)c;
@@ -0,0 +1,34 @@
1
+ inflate9 nowindow loop ret=0 produced=65536
2
+ inflate9 nowindow loop ret=0 produced=65536
3
+ inflate9 nowindow loop ret=0 produced=65536
4
+ inflate9 nowindow loop ret=0 produced=65536
5
+ inflate9 nowindow loop ret=0 produced=65536
6
+ inflate9 nowindow loop ret=0 produced=65536
7
+ inflate9 nowindow loop ret=0 produced=65536
8
+ inflate9 nowindow loop ret=0 produced=65536
9
+ inflate9 nowindow loop ret=0 produced=65536
10
+ inflate9 nowindow loop ret=0 produced=65536
11
+ inflate9 nowindow loop ret=0 produced=65536
12
+ inflate9 nowindow loop ret=0 produced=65536
13
+ inflate9 nowindow loop ret=0 produced=65536
14
+ inflate9 nowindow loop ret=0 produced=65536
15
+ inflate9 nowindow loop ret=0 produced=65536
16
+ inflate9 nowindow loop ret=0 produced=65536
17
+ inflate9 nowindow loop ret=0 produced=65536
18
+ inflate9 nowindow loop ret=0 produced=65536
19
+ inflate9 nowindow loop ret=0 produced=65536
20
+ inflate9 nowindow loop ret=0 produced=65536
21
+ inflate9 nowindow loop ret=0 produced=65536
22
+ inflate9 nowindow loop ret=0 produced=65536
23
+ inflate9 nowindow loop ret=0 produced=65536
24
+ inflate9 nowindow loop ret=0 produced=65536
25
+ inflate9 nowindow loop ret=0 produced=65536
26
+ inflate9 nowindow loop ret=0 produced=65536
27
+ inflate9 nowindow loop ret=0 produced=65536
28
+ inflate9 nowindow loop ret=0 produced=65536
29
+ inflate9 nowindow loop ret=0 produced=65536
30
+ inflate9 nowindow loop ret=0 produced=65536
31
+ inflate9 nowindow loop ret=0 produced=65536
32
+ inflate9 nowindow loop ret=0 produced=65536
33
+ inflate9 nowindow loop ret=0 produced=65536
34
+ inflate9 nowindow loop ret=1 produced=26202