[v2] Pass allocator to context and subcontext eval and add new allocators#452
Conversation
eaed9a9 to
1c4e8c1
Compare
1c4e8c1 to
f50f59c
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## anilm3/v2 #452 +/- ##
=============================================
- Coverage 84.94% 84.84% -0.10%
=============================================
Files 189 190 +1
Lines 9715 9787 +72
Branches 4234 4262 +28
=============================================
+ Hits 8252 8304 +52
- Misses 607 613 +6
- Partials 856 870 +14
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Benchmarks clangBenchmark execution time: 2025-09-18 18:59:58 Comparing candidate commit 95f32cf in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 1 metrics, 0 unstable metrics. |
Benchmarks gccBenchmark execution time: 2025-09-18 18:59:54 Comparing candidate commit 95f32cf in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 1 metrics, 0 unstable metrics. |
Artifact Size Comparison 📦
|
Benchmarks clang-pgoBenchmark execution time: 2025-09-18 12:51:03 Comparing candidate commit db21366 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 1 metrics, 0 unstable metrics. |
e926c7f to
e1adffc
Compare
d58f31b to
2bcc91b
Compare
f6f45ef to
6752038
Compare
88cd85b to
f45b7ff
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep it up! About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback". |
a0af9ef to
11d6e68
Compare
11d6e68 to
6c4db5c
Compare
4e5340a to
9dfa4af
Compare
b45b10a to
db21366
Compare
522f2d3 to
c528eb5
Compare
There was a problem hiding this comment.
Codex Review: Here are some suggestions.
Reply with @codex fix comments to fix any unresolved comments.
About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".
c528eb5 to
5de1ecc
Compare
b6610eb to
95f32cf
Compare
* Object view: read only abstraction to ddwaf_object (#341) * [v2] Remove mingw builds (#381) * Writable objects: owned and borrowed object and object limits removal (#378, #382) * [v2] Refactor and improve object types (#387) * [v2] Update unit tests to use new abstractions (#389) * [v2] Update `raw_configuration` type to use `object_view` (#390) * [v2] Remove remaining uses of ddwaf_object in `src` and `tests/unit` (#391) * [v2] JWT Decoding Processor (#401) * [v2] First iteration of object layout changes (#394) * Split context data insertion from evaluation (#407) * [v2] Second iteration of object layout changes (#408) * [v2] Add new fingerprint and object view tests (#414) * Reenable attribute collector unit test (#415) * [v2] Container view types (#413) * Exclude assertions from coverage (#416) * [v2] Use allocators internally instead of malloc/free and stop generating zero-terminated strings (#418) * Add memory resource to owned and borrowed objects (#428) * [v2] Propagate allocators from context (#420) * [v2] Update interface and expose allocators (#427) * Refactor evaluation stages out of the context (#442) * Subcontext: replace ephemerals with a new scope with user-defined lifetime derived from the context (#443) * Validator: Add support for testing subcontexts and attributes (#451) * [v2] Pass allocator to context and subcontext eval and add new allocators (#452) * Update logger to avoid dependencies on ddwaf.h (#453) * [v2] Return DDWAF_MATCH when there are events, attributes or actions (#455) * [v2] Cleanup: remove exclusion namespace and some redundant references (#456)
This PR adds the following:
libcxx-compat. The latter is a wrapper for custom allocation/deallocation functions, this can be used to create other types of allocators, e.g. counting allocators.ddwaf_context_evalandddwaf_subcontext_evalso that the memory provided can be automatically reclaimed using the correct allocator. Additionally,nullptrcan be provided to prevent memory from being reclaimed altogether.Excluding any testing and fixes, this PR concludes the changes required for allocator support. The next PRs will include the following changes:
DDWAF_MATCHdue to its confusing and outdated semantics.ddwaf.hinside C++ code (excludinginterface.cpp).