summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Collet <Cyan4973@users.noreply.github.com>2020-07-16 16:44:40 (GMT)
committerGitHub <noreply@github.com>2020-07-16 16:44:40 (GMT)
commit48f9ecfb3436877b014d22280d36e7644f867140 (patch)
tree1b81bb333b54438a887e315f2aa22cacc8f8465e
parent8ef649f3a8f9d2cd8223c2cf8478206e303d0a3a (diff)
parent7a75b045bde89e77e3573f91821d0314251aac1d (diff)
downloadlz4-48f9ecfb3436877b014d22280d36e7644f867140.zip
lz4-48f9ecfb3436877b014d22280d36e7644f867140.tar.gz
lz4-48f9ecfb3436877b014d22280d36e7644f867140.tar.bz2
Merge pull request #863 from Devernua/reducing_stack_usage_in_t_alignment
Reducing stack usage in _t_alignment checks
-rw-r--r--lib/lz4.c4
-rw-r--r--lib/lz4hc.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/lz4.c b/lib/lz4.c
index 2f7880a..fa125a1 100644
--- a/lib/lz4.c
+++ b/lib/lz4.c
@@ -1349,8 +1349,8 @@ LZ4_stream_t* LZ4_createStream(void)
while actually aligning LZ4_stream_t on 4 bytes. */
static size_t LZ4_stream_t_alignment(void)
{
- struct { char c; LZ4_stream_t t; } t_a;
- return sizeof(t_a) - sizeof(t_a.t);
+ typedef struct { char c; LZ4_stream_t t; } t_a;
+ return sizeof(t_a) - sizeof(LZ4_stream_t);
}
#endif
diff --git a/lib/lz4hc.c b/lib/lz4hc.c
index b75514f..687f87e 100644
--- a/lib/lz4hc.c
+++ b/lib/lz4hc.c
@@ -886,8 +886,8 @@ int LZ4_sizeofStateHC(void) { return (int)sizeof(LZ4_streamHC_t); }
* while actually aligning LZ4_streamHC_t on 4 bytes. */
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);
+ typedef struct { char c; LZ4_streamHC_t t; } t_a;
+ return sizeof(t_a) - sizeof(LZ4_streamHC_t);
}
#endif