Skip to content
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

Generic Memory Pools Fix #7504

Merged
merged 1 commit into from
May 6, 2024

Conversation

ejohnstown
Copy link
Contributor

Description

  1. Add some expository comments describing the purpose of:
    • WOLFMEM_MAX_BUCKETS
    • WOLFMEM_DEF_BUCKETS
    • WOLFMEM_BUCKETS
    • WOLFMEM_DIST
  2. Switch the API test for LoadStaticMemory() to named constants.
  3. Delete redundant test case. Add a new test case.
  4. In the wolfCrypt test for the memory constants, check the sizes of the WOLFMEM_BUCKETS and WOLFMEM_DIST lists against WOLFMEM_DEF_BUCKETS which should be their length. Check that WOLFMEM_DEF_BUCKETS is not greater than WOLFMEM_MAX_BUCKETS.
  5. Default for WOLFMEM_MAX_BUCKETS should be WOLFMEM_DEF_BUCKETS, set it to what is specified. Add a warning if MAX is less than DEF.
  6. Separate the definition of the constant LARGEST_MEM_BUCKET so it is dependent on config and not if WOLFMEM_BUCKETS isn't set.

Fixes ZD17924

Testing

Added a test case to cover the size differences.

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

1. Add some expository comments describing the purpose of:
   * WOLFMEM_MAX_BUCKETS
   * WOLFMEM_DEF_BUCKETS
   * WOLFMEM_BUCKETS
   * WOLFMEM_DIST
2. Switch the API test for LoadStaticMemory() to named constants.
3. Delete redundant test case. Add a new test case.
4. In the wolfCrypt test for the memory constants, check the sizes of
   the WOLFMEM_BUCKETS and WOLFMEM_DIST lists against
   WOLFMEM_DEF_BUCKETS which should be their length. Check that
   WOLFMEM_DEF_BUCKETS is not greater than WOLFMEM_MAX_BUCKETS.
5. Default for WOLFMEM_MAX_BUCKETS should be WOLFMEM_DEF_BUCKETS, set it
   to what is specified. Add a warning if MAX is less than DEF.
6. Separate the definition of the constant LARGEST_MEM_BUCKET so it is
   dependent on config and not if WOLFMEM_BUCKETS isn't set.
@ptsiewie
Copy link
Contributor

ptsiewie commented May 6, 2024

I can confirm that this resolves the issue that I was having.

@JacobBarthelmeh JacobBarthelmeh merged commit 7bc73d3 into wolfSSL:master May 6, 2024
114 checks passed
@ejohnstown ejohnstown deleted the generic-pool-fix branch May 8, 2024 04:37
jefferyq2 pushed a commit to jefferyq2/wolfssl that referenced this pull request Jun 9, 2024
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.

5 participants