Skip to content

Commit

Permalink
Merge pull request #2845 from krzycz/test-vmem_ma
Browse files Browse the repository at this point in the history
test: fix alloc sizes in vmem_mix_allocations
  • Loading branch information
krzycz authored Apr 11, 2018
2 parents dbb0826 + 6e1cf60 commit b9f1438
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/test/vmem_mix_allocations/vmem_mix_allocations.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2014-2017, Intel Corporation
* Copyright 2014-2018, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -38,9 +38,9 @@

#include "unittest.h"

#define COUNT 21
#define COUNT 24
#define POOL_SIZE VMEM_MIN_POOL
#define MAX_SIZE (4 << COUNT)
#define MAX_SIZE (1 << (COUNT - 1)) /* 8MB */

int
main(int argc, char *argv[])
Expand All @@ -49,7 +49,7 @@ main(int argc, char *argv[])
void *mem_pool = NULL;
VMEM *vmp;
size_t obj_size;
int *ptr[COUNT];
int *ptr[COUNT + 1];
int i = 0;
size_t sum_alloc = 0;

Expand All @@ -75,7 +75,7 @@ main(int argc, char *argv[])
}

obj_size = MAX_SIZE;
/* test with multiple size of allocations from 4MB to 2B */
/* test with multiple size of allocations from 8MB to 1B */
for (i = 0; i < COUNT; ++i, obj_size /= 2) {
ptr[i] = vmem_malloc(vmp, obj_size);

Expand Down

0 comments on commit b9f1438

Please sign in to comment.