Merge pull request #863 from Devernua/reducing_stack_usage_in_t_alignment

Reducing stack usage in _t_alignment checks
This commit is contained in:
Yann Collet 2020-07-16 09:44:40 -07:00 committed by GitHub
commit 48f9ecfb34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -1349,8 +1349,8 @@ LZ4_stream_t* LZ4_createStream(void)
while actually aligning LZ4_stream_t on 4 bytes. */ while actually aligning LZ4_stream_t on 4 bytes. */
static size_t LZ4_stream_t_alignment(void) static size_t LZ4_stream_t_alignment(void)
{ {
struct { char c; LZ4_stream_t t; } t_a; typedef struct { char c; LZ4_stream_t t; } t_a;
return sizeof(t_a) - sizeof(t_a.t); return sizeof(t_a) - sizeof(LZ4_stream_t);
} }
#endif #endif

View File

@ -886,8 +886,8 @@ int LZ4_sizeofStateHC(void) { return (int)sizeof(LZ4_streamHC_t); }
* while actually aligning LZ4_streamHC_t on 4 bytes. */ * while actually aligning LZ4_streamHC_t on 4 bytes. */
static size_t LZ4_streamHC_t_alignment(void) static size_t LZ4_streamHC_t_alignment(void)
{ {
struct { char c; LZ4_streamHC_t t; } t_a; typedef struct { char c; LZ4_streamHC_t t; } t_a;
return sizeof(t_a) - sizeof(t_a.t); return sizeof(t_a) - sizeof(LZ4_streamHC_t);
} }
#endif #endif