Skip to content

hash: lazy-alloc the table in Curl_hash_add() - #8132

Merged
bagder merged 1 commit into
masterfrom
bagder/hash-lazyalloc
Dec 11, 2021
Merged

bagder merged 1 commit into
masterfrom
bagder/hash-lazyalloc

Conversation

@bagder

@bagder bagder commented Dec 10, 2021

Copy link
Copy Markdown
Member

This makes Curl_hash_init() infallible which saves error paths.

It also reduces the number of mallocs needed for basic use cases. My test runs doing curl -v localhost/512M -o /dev/null goes from 94 mallocs to 91. With a maximum 132510 bytes down to 132158 (= 352 bytes less).

@bagder bagder added the tidy-up label Dec 10, 2021
This makes Curl_hash_init() infallible which saves error paths.

Closes #8132
@bagder
bagder force-pushed the bagder/hash-lazyalloc branch from acd3638 to 254f7bd Compare December 10, 2021 22:17
@bagder bagder closed this in 254f7bd Dec 11, 2021
@bagder
bagder merged commit 254f7bd into master Dec 11, 2021
@bagder
bagder deleted the bagder/hash-lazyalloc branch December 11, 2021 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

1 participant