-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lazily allocate and eagerly free unpacker stack
Applications may have numerous unpacker instances allocated with different configurations, but are very unlikely to have more than one or a handful active concurrently. As such eagerly allocating the 4kiB parsing stack is using more memory than necessary. Additionally, when only a few arena pages are in use, allocating a chunk from a first page is very cheap. The only complexity in this patch is the `Unpacker#each` API that requires not to free the stack on EOF as parsing may be resumed afterwards.
- Loading branch information
Showing
1 changed file
with
35 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters