-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filterx allow stack based string wrappers #470
Filterx allow stack based string wrappers #470
Conversation
8f3cac8
to
6f96b60
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened a followup PR with a couple more stack allocated string usecases: #491
Thinking a bit more about concurrency, I don't even see how FilterXObjects can be accessed from multiple threads. I saw the atomic operations and my mind clicked to concurrency mode. Can you help me out about why we have atomic counters here? I think if it is not necessary we either should not use atomic counters at all or we should write the code with the mindset that the refcounters can be changed concurrently, in which case my review comments stand. |
bacdbc1
to
1ea3983
Compare
1ea3983
to
f10f3fc
Compare
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
…ecast Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
…BJECT_REFCOUNT_FROZEN Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Instances of strings that are only used once for a brief period can be allocated on the stack to reduce malloc() calls. This is especially useful when iterating over a lot of FilterXString instances, most of which is imediately dropped away. Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Clarify the races involved and also trigger an abort on use-after-free. Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
f10f3fc
to
6b3afc7
Compare
This PR enables filterx code to create short-lived FilterXString instances on the stack.
Such instances
The PR also contains a number of conversions from allocation based FilterXString instances to these, reducing the
total number of malloc() calls significantly for unset_empties(), parse_csv() and parse_kv()