forked from redpanda-data/seastar
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Currently json2code only supports std::vector as a list type, but this results in unavoidable large allocations for even modest response sizes, e.g., is is not uncommon for sizeof(elem_type) for these vectors to be 100 - 1000 bytes for simple to moderately complex response types, so then a mere ~1200 to ~120 objects in the vector are enough to result in allocations > 128K, a problem for seastar applications which must avoid large allocations (because of fragmentation). To avoid this problem, support chunked_fifo as a second type for lists in json2code. Use the type "chunked_array" instead of "array" to use it and the generated code will use chunked_fifo instead of vector. Also adds tests for the new use case in the json2code test.
- Loading branch information
1 parent
87515f4
commit 542ac71
Showing
5 changed files
with
53 additions
and
12 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
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
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
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
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