You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: wolfSSL/src/chapter04.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -807,7 +807,7 @@ When you're done using static memory allocation, you should call `void wc_Unload
807
807
808
808
#### Advanced Static Buffer Size Calculation
809
809
810
-
The function `int wolfSSL_StaticBufferSz_ex(unsigned int listSz, const word32 *sizeList, const word32 *distList, byte* buffer, word32 sz, int flag)` allows you to calculate the required buffer size for static memory allocation with custom bucket sizes and distributions. This is useful when you want to optimize memory usage for your specific application needs.
810
+
The function `int wolfSSL_StaticBufferSz_ex(unsigned int listSz, const word32 *sizeList, const word32 *distList, byte* buffer, word32 sz, int flag)` is a pre-allocation planning tool that calculates how much of a given buffer can be effectively used for static memory allocation, based on the provided bucket sizes and distribution. It returns the usable portion of the buffer that fits complete buckets, excluding any unusable leftover space. This is useful for sizing and tuning static memory pools to maximize utilization and reduce overall memory usage.
811
811
812
812
Parameters:
813
813
- `listSz`: Number of bucket sizes in the list
@@ -829,7 +829,7 @@ The static-buffer-allocation option provided by wolfSSL manages the specified bu
829
829
830
830
#### Macros for General Use Buffers
831
831
832
-
Each bucket varies in size depending on the number of memory blocks it contains and their size.
832
+
Each bucket varies in size depending on the number of memory blocks it contains and their size.
833
833
834
834
The memory block size and number of blocks for each area to be used are defined in /wolfssl/wolfcrypt/memory.h with the following macros:
835
835
@@ -839,7 +839,7 @@ The memory block size and number of blocks for each area to be used are defined
839
839
#define WOLFSSL_STATIC_ALIGN 16 /* alignment 16 bytes by default*/
840
840
#define WOLFMEM_MAX_BUCKETS 9 /* number of buckets */
841
841
#define WOLFMEM_IO_SZ 16992 /* buffer size for I/O */
842
-
#define LARGEST_MEM_BUCKET 16128 /* the max block size */
842
+
#define LARGEST_MEM_BUCKET 16128 /* the max block size */
0 commit comments