Merged
Conversation
This feature enhances drvector by introducing a `zero_alloc` configuration and a `drvector_clear()` API. When `zero_alloc` is enabled, the container zero-initializes its internal storage when resizing and clearing the vector. The new `drvector_clear()` function allows users to empty a drvector's contents while retaining its allocated capacity for reuse. It invokes the user-provided free_data_func for all existing entries like `drvector_delete()`, and zeroes out the storage if zero_alloc is set, providing a more efficient alternative to deleting and re-initializing the container. Adds a test in suite/tests/client-interface/drcontainers-test.dll.c. Fixes #7798
Added zero_alloc to release doc.
derekbruening
requested changes
Feb 3, 2026
Contributor
derekbruening
left a comment
There was a problem hiding this comment.
Compatibility needs to be addressed.
zero_alloc feature.
drvector_config_t.
derekbruening
approved these changes
Feb 6, 2026
edeiana
added a commit
that referenced
this pull request
Feb 7, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This feature enhances drvector by introducing a
zero_allocconfigurationand a
drvector_clear()API. Whenzero_allocis enabled, the containerzero-initializes its internal storage when initializing, resizing, or clearing the
vector.
zero_allocis a config parameter inside the newdrvector_config_tstruct and can be passed to the newly introduced
drvector_init_ex().The new
drvector_clear()function allows users to empty a drvector'scontents while retaining its allocated capacity for reuse. It invokes the
user-provided
free_data_func()for all existing entries(like
drvector_delete()), and zeroes out the storage of the vector ifzero_allocis set, providing a more efficient alternative to deletingand re-initializing the container.
Adds documentation about drvector in
ext/drcontainers/drcontainers.dox.Adds a test in
suite/tests/client-interface/drcontainers-test.dll.c.Adds
drvector_config_t(which containszero_alloc),drvector_init_ex(), anddrvector_clear()APIs to release doc.Version bumped to 11.91 since this PR contains compatibility-breaking
changes.
Fixes #7798