Skip to content

Conversation

@bazsi
Copy link
Member

@bazsi bazsi commented Jan 3, 2026

This PR prepares for the use of "borrowed" string slices in FilterXString, avoiding a number of data copying taking place with the current implementation.

The patches are scattered but in general simple. The PR also adds a DEBUG component that let's us find cases where
the new assumption is broken.

@bazsi bazsi force-pushed the filterx-strings-can-be-unterminated branch from ae260c4 to fecfd2a Compare January 7, 2026 08:06
@OverOrion OverOrion self-requested a review January 23, 2026 15:30
bazsi added 17 commits January 30, 2026 09:06
Also reduce polling frequency as checking if a process exited every 1msec
is heating up my CPU.

Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
…ed string

Simply using strncmp() does not work, as the length needs to be checked too.

Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
This is the same as g_str_hash() but with an explicit length argument.

Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
This compares two, potentially not NUL terminated strings.

Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
To match how callers intend to use the extracted fields, add a few more
variants of filterx_string_get_value_ref()

Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
…lterXString

Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
We will crash in the next line if the length pointer is NULL anyway.

Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
…ling functions

Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Handle cases where FilterXString instances are not NUL terminated.

Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
By using the new accessor functions, using non-NUL terminated strings
became easier. This patch only contains the trivial changes.

Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
…rn length

Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
To work with strings that are not NUL terminated.

Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
This just calls filterx_object_extract_string_ref(), which we already use
in the code otherwise.

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>
@bazsi bazsi force-pushed the filterx-strings-can-be-unterminated branch from fecfd2a to 239f03a Compare January 30, 2026 08:07
bazsi added 6 commits January 30, 2026 09:50
…bjectList

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>
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
…in DEBUG mode

This is to test if users of FilterXString properly handle the
`length` member or rely on the NUL terminator.

In production builds, this is not done, so in cases where we
do the NUL character, we don't need to use bounce buffers.

Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
@bazsi bazsi force-pushed the filterx-strings-can-be-unterminated branch from 239f03a to ce18e06 Compare January 30, 2026 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant