benchtests: Avoid truncation in random memcpy/memset benchmarks

Use uint16_t rather than uint8_t for the size arrays.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
This commit is contained in:
Wilco Dijkstra 2025-08-12 11:14:24 +00:00
parent bc5cf78543
commit 122847e4a2
2 changed files with 2 additions and 2 deletions

View File

@ -34,7 +34,7 @@ typedef struct { uint8_t align; uint16_t freq; } align_data_t;
#define SIZE_NUM 65536
#define SIZE_MASK (SIZE_NUM-1)
static uint8_t size_arr[SIZE_NUM];
static uint16_t size_arr[SIZE_NUM];
/* Frequency data for memcpy of less than 4096 bytes based on SPEC2017. */
static freq_data_t size_freq[] =

View File

@ -39,7 +39,7 @@ typedef struct { uint8_t align; uint16_t freq; } align_data_t;
#define SIZE_NUM 65536
#define SIZE_MASK (SIZE_NUM-1)
static uint8_t len_arr[SIZE_NUM];
static uint16_t len_arr[SIZE_NUM];
/* Frequency data for memset sizes up to 4096 bytes based on SPEC2017. */
static freq_data_t memset_len_freq[] =