benchmark string fix to save RAM - #514
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reduces RAM usage in the benchmark timing subsystem by changing benchmark operation names from an inline fixed-size buffer to a referenced string pointer.
Changes:
- Replace
whBenchOp.namefixed-sizechar[]storage with aconst char*stored by reference. - Update
wh_Bench_RegisterOpto compare names withstrcmpand store the pointer directly. - Update header comments to document the new name lifetime requirement.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| benchmark/wh_bench_ops.h | Changes operation name storage to const char* and updates API documentation for the new lifetime semantics. |
| benchmark/wh_bench_ops.c | Updates registration logic to use strcmp and store the operation name by reference. |
Suppressed comments (1)
benchmark/wh_bench_ops.h:89
- Since
wh_Bench_RegisterOpnow storesnameby reference, it would help to explicitly state in the API comment thatnamemust be a NUL-terminated C string and is not copied (caller must keep it alive until cleanup).
/* Register a new benchmark operation with a name, returns ID via pointer.
* The name is stored by reference and must stay valid until
* wh_Bench_Cleanup */
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
bigbrett
marked this pull request as ready for review
August 19, 2026 19:56
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #514
Scan targets checked: wolfhsm-core-bugs, wolfhsm-crypto-bugs, wolfhsm-src
Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)
This review was generated automatically by Fenrir. Findings are non-blocking.
AlexLanzano
approved these changes
Aug 20, 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 PR reduces RAM usage in the benchmark timing subsystem by changing benchmark operation names from an inline fixed-size buffer to a referenced string pointer.
Changes: