Skip to content

Add HUF_writeCTable_wksp() function#2523

Merged
terrelln merged 1 commit intofacebook:devfrom
terrelln:huf-stack-reduction
Mar 5, 2021
Merged

Add HUF_writeCTable_wksp() function#2523
terrelln merged 1 commit intofacebook:devfrom
terrelln:huf-stack-reduction

Conversation

@terrelln
Copy link
Contributor

@terrelln terrelln commented Mar 5, 2021

This saves ~700 bytes of stack space in HUF_writeCTable() by adding a workspace variant and using it in the HUF_compress_internal().

unsigned count[HUF_SYMBOLVALUE_MAX + 1];
HUF_CElt CTable[HUF_SYMBOLVALUE_MAX + 1];
HUF_buildCTable_wksp_tables buildCTable_wksp;
union {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unfortunately, nameless union is not a C90 feature.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bummer, I'll name it then

@terrelln terrelln force-pushed the huf-stack-reduction branch from 13e2dda to 5df2a21 Compare March 5, 2021 18:25
This saves ~700 bytes of stack space in HUF_writeCTable.
@terrelln terrelln merged commit b5fd348 into facebook:dev Mar 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants