Skip to content

use heap hints where possible in benchmark#10121

Open
JacobBarthelmeh wants to merge 4 commits intowolfSSL:masterfrom
JacobBarthelmeh:bench
Open

use heap hints where possible in benchmark#10121
JacobBarthelmeh wants to merge 4 commits intowolfSSL:masterfrom
JacobBarthelmeh:bench

Conversation

@JacobBarthelmeh
Copy link
Copy Markdown
Contributor

No description provided.

@JacobBarthelmeh JacobBarthelmeh self-assigned this Apr 1, 2026
Copilot AI review requested due to automatic review settings April 1, 2026 21:17
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the wolfCrypt benchmark to pass heap hints into allocation/init APIs so benchmark objects can be allocated from the configured heap.

Changes:

  • Pass HEAP_HINT into XMALLOC/XFREE for benchmark stats tracking.
  • Pass HEAP_HINT into several *_Init functions used by benchmark routines.
  • Switch Falcon initialization to wc_falcon_init_ex(...) to allow heap-hint/device-id aware init.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread wolfcrypt/benchmark/benchmark.c Outdated
Comment thread wolfcrypt/benchmark/benchmark.c
Comment thread wolfcrypt/benchmark/benchmark.c
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 15, 2026

MemBrowse Memory Report

gcc-arm-cortex-m4

  • FLASH: .rodata.CSWTCH.1 +24 B, .rodata.str1.1 +151 B, .rodata.wolfSSL_ERR_reason_error_string.str1.1 +29 B, .text +256 B (+0.2%, 195,735 B / 262,144 B, total: 75% used)

gcc-arm-cortex-m4-baremetal

  • FLASH: .text +128 B (+0.2%, 63,667 B / 262,144 B, total: 24% used)

gcc-arm-cortex-m4-min-ecc

  • FLASH: .text +64 B (+0.1%, 59,189 B / 262,144 B, total: 23% used)

gcc-arm-cortex-m4-tls12

  • FLASH: .text +192 B (+0.2%, 119,610 B / 262,144 B, total: 46% used)

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 9 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread wolfcrypt/benchmark/benchmark.c Outdated
Comment thread wolfcrypt/benchmark/benchmark.c Outdated
Comment thread wolfcrypt/src/wc_xmss.c
Comment thread wolfcrypt/benchmark/benchmark.c Outdated
Comment thread wolfcrypt/src/wc_xmss_impl.c
Comment thread wolfcrypt/benchmark/benchmark.c Outdated
Comment thread wolfcrypt/benchmark/benchmark.c Outdated
Comment thread wolfcrypt/benchmark/benchmark.c Outdated
Comment thread wolfcrypt/benchmark/benchmark.c Outdated
@JacobBarthelmeh
Copy link
Copy Markdown
Contributor Author

JacobBarthelmeh commented Apr 17, 2026

Retest this please Jenkins, history unavailable.

Copy link
Copy Markdown

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenrir Automated Review — PR #10121

Scan targets checked: wolfcrypt-bugs, wolfcrypt-src
Findings: 2
1 finding(s) posted as inline comments (see file-level comments below)

Info (1)

Stale docstring still says heap is Unused

File: wolfcrypt/src/wc_xmss.c:808
Function: wc_XmssKey_Init
Category: Dead/unreachable code

Doxygen comment for wc_XmssKey_Init still declares @param [in] heap Unused., but the function now stores key->heap = heap;. The (void) heap; was removed in this PR but the docstring was not updated.

* @param [in] heap   Unused.
 * @param [in] devId  Unused.

Recommendation: Update the docstring to describe heap as the dynamic memory hint used by subsequent allocations.


This review was generated automatically by Fenrir. Findings are non-blocking.

Comment thread wolfcrypt/src/wc_xmss.c
@@ -124,9 +124,10 @@ static void wc_xmss_digest_free(XmssState* state)
* @return Other negative when digest algorithm initialization failed.
*/
static WC_INLINE int wc_xmss_state_init(XmssState* state,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚪ [Info] Missing heap parameter in wc_xmss_state_init docstring · Dead/unreachable code

wc_xmss_state_init gained a void* heap parameter but the doxygen comment above (lines 118-125) was not updated to add @param [in] heap.

Fix: Add @param [in] heap Dynamic memory hint. to the docstring.

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.

4 participants