diff options
author | Yann Collet <Cyan4973@users.noreply.github.com> | 2020-07-16 16:44:40 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-16 16:44:40 (GMT) |
commit | 48f9ecfb3436877b014d22280d36e7644f867140 (patch) | |
tree | 1b81bb333b54438a887e315f2aa22cacc8f8465e | |
parent | 8ef649f3a8f9d2cd8223c2cf8478206e303d0a3a (diff) | |
parent | 7a75b045bde89e77e3573f91821d0314251aac1d (diff) | |
download | lz4-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.c | 4 | ||||
-rw-r--r-- | lib/lz4hc.c | 4 |
2 files changed, 4 insertions, 4 deletions
@@ -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 |