Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pp/third_party/deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ def _third_party_deps_impl(_ctx):
Label("//third_party/patches/lz4:0003-fix_offsetof_calculation.patch"),
Label("//third_party/patches/lz4:0004-svacer_fixes.patch"),
],
sha256 = "658ba6191fa44c92280d4aa2c271b0f4fbc0e34d249578dd05e50e76d0e5efcc",
strip_prefix = "lz4-1.9.2",
url = "https://github.com/lz4/lz4/archive/v1.9.2.tar.gz",
sha256 = "537512904744b35e232912055ccf8ec66d768639ff3abe5788d90d792ec5f48b",
strip_prefix = "lz4-1.10.0",
url = "https://github.com/lz4/lz4/archive/v1.10.0.tar.gz",
)

http_archive(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
--- lib/lz4frame.h
+++ lib/lz4frame_patched.h
@@ -74,7 +74,7 @@ extern "C" {
#elif defined(LZ4_DLL_IMPORT) && (LZ4_DLL_IMPORT==1)
# define LZ4FLIB_API __declspec(dllimport)
#elif defined(__GNUC__) && (__GNUC__ >= 4)
-# define LZ4FLIB_API __attribute__ ((__visibility__ ("default")))
+# define LZ4FLIB_API
#else
# define LZ4FLIB_API
#endif
@@ -71,7 +71,7 @@ extern "C" {
*/
#ifndef LZ4FLIB_VISIBILITY
# if defined(__GNUC__) && (__GNUC__ >= 4)
-# define LZ4FLIB_VISIBILITY __attribute__ ((visibility ("default")))
+# define LZ4FLIB_VISIBILITY
# else
# define LZ4FLIB_VISIBILITY
# endif
19 changes: 9 additions & 10 deletions pp/third_party/patches/lz4/0002-add_allocated_memory.patch
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
--- lib/lz4frame.h
+++ lib/lz4frame.h
@@ -467,7 +467,7 @@ LZ4FLIB_API size_t LZ4F_decompress(LZ4F_dctx* dctx,
@@ -512,6 +512,7 @@ LZ4FLIB_API size_t LZ4F_decompress(LZ4F_dctx* dctx,
* and start a new one using same context resources. */
LZ4FLIB_API void LZ4F_resetDecompressionContext(LZ4F_dctx* dctx); /* always successful */

-

+size_t LZ4F_allocated_memory(LZ4F_dctx* dctx);

#if defined (__cplusplus)
}
/**********************************
* Dictionary compression API

--- lib/lz4frame.c
+++ lib/lz4frame.c
@@ -1097,6 +1097,11 @@ void LZ4F_resetDecompressionContext(LZ4F_dctx* dctx)
dctx->dictSize = 0;
@@ -1334,6 +1334,11 @@ void LZ4F_resetDecompressionContext(LZ4F_dctx* dctx)
dctx->frameRemainingSize = 0;
}

+size_t LZ4F_allocated_memory(LZ4F_dctx* dctx)
+{
+ return sizeof(*dctx) + dctx->tmpInSize + dctx->tmpOutSize;
+}
+

/*! LZ4F_decodeHeader() :
* input : `src` points at the **beginning of the frame**
12 changes: 6 additions & 6 deletions pp/third_party/patches/lz4/0003-fix_offsetof_calculation.patch
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
--- lib/lz4hc.c
+++ lib/lz4hc_patched.c
@@ -886,8 +886,8 @@ int LZ4_sizeofStateHC(void) { return (int)sizeof(LZ4_streamHC_t); }
* while actually aligning LZ4_streamHC_t on 4 bytes. */
@@ -1488,8 +1488,8 @@ int LZ4_sizeofStateHC(void) { return (int)sizeof(LZ4_streamHC_t); }
static size_t LZ4_streamHC_t_alignment(void)
{
- struct { char c; LZ4_streamHC_t t; } t_a;
- return sizeof(t_a) - sizeof(t_a.t);
#if LZ4_ALIGN_TEST
- typedef struct { char c; LZ4_streamHC_t t; } t_a;
- return sizeof(t_a) - sizeof(LZ4_streamHC_t);
+ struct alignment_check_struct { char c; LZ4_streamHC_t t; };
+ return offsetof(struct alignment_check_struct, t);
}
#else
return 1; /* effectively disabled */
#endif

Loading