"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "stress-malloc.c" between
stress-ng-0.12.09.tar.xz and stress-ng-0.12.10.tar.xz

About: stress-ng will stress test a computer system in various selectable ways. It was designed to exercise various physical subsystems of a computer as well as the various operating system kernel interfaces.

stress-malloc.c  (stress-ng-0.12.09.tar.xz):stress-malloc.c  (stress-ng-0.12.10.tar.xz)
skipping to change at line 158 skipping to change at line 158
static void *stress_malloc_loop(void *ptr) static void *stress_malloc_loop(void *ptr)
{ {
const stress_malloc_args_t *malloc_args = (stress_malloc_args_t *)ptr; const stress_malloc_args_t *malloc_args = (stress_malloc_args_t *)ptr;
const stress_args_t *args = malloc_args->args; const stress_args_t *args = malloc_args->args;
uint64_t *counters = malloc_args->counters; uint64_t *counters = malloc_args->counters;
uint64_t *counter = &counters[malloc_args->instance]; uint64_t *counter = &counters[malloc_args->instance];
void **addr; void **addr;
static void *nowt = NULL; static void *nowt = NULL;
size_t j; size_t j;
addr = (void **)calloc(malloc_max, sizeof(void *)); addr = (void **)calloc(malloc_max, sizeof(*addr));
if (!addr) { if (!addr) {
pr_dbg("%s: cannot allocate address buffer: %d (%s)\n", pr_dbg("%s: cannot allocate address buffer: %d (%s)\n",
args->name, errno, strerror(errno)); args->name, errno, strerror(errno));
return &nowt; return &nowt;
} }
for (;;) { for (;;) {
const unsigned int rnd = stress_mwc32(); const unsigned int rnd = stress_mwc32();
const unsigned int i = rnd % malloc_max; const unsigned int i = rnd % malloc_max;
const unsigned int action = (rnd >> 12) & 1; const unsigned int action = (rnd >> 12) & 1;
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)