Skip to content

Commit

Permalink
memorystress:Fix some warnings and make the index randomized.
Browse files Browse the repository at this point in the history
Signed-off-by: chenrun1 <[email protected]>
  • Loading branch information
crafcat7 authored and xiaoxiang781216 committed Aug 3, 2023
1 parent 4a78ded commit 5645b82
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion system/memstress/memorystress_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
****************************************************************************/

#include <nuttx/config.h>
#include <stdlib.h>
#include <debug.h>
#include <stdio.h>
#include <stddef.h>
Expand Down Expand Up @@ -224,7 +225,7 @@ static bool memorystress_iter(FAR struct memorystress_context_s *context)
bool debug = context->debug;
size_t index;

index = randnum(context->config->nodelen, &seed);
index = rand() % (context->config->nodelen - 1);
node = &(context->node_array[index]);
func = (FAR struct memorystress_func_s *)context->config->func;

Expand Down

0 comments on commit 5645b82

Please sign in to comment.