~linaro-toolchain-dev/cortex-strings/trunk

« back to all changes in this revision

Viewing changes to benchmarks/multi/harness.c

  • Committer: Will Newton
  • Date: 2013-06-17 10:25:57 UTC
  • Revision ID: will.newton@linaro.org-20130617102557-a24rlufxp2u99fby
Disallow 0 byte alignment as it is not meaningful. Also make sure we
have enough space for alignment in the buffers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
261
261
      usage(argv[0]);
262
262
    }
263
263
 
264
 
  if (alignment > 256 || alignment < 0)
 
264
  if (alignment > 256 || alignment < 1)
265
265
    {
266
 
      printf("Alignment should be in the range [0, 256].\n");
 
266
      printf("Alignment should be in the range [1, 256].\n");
267
267
      usage(argv[0]);
268
268
    }
269
269
 
270
270
  if (alignment == 256)
271
271
    alignment = 0;
272
272
 
273
 
  if (count + alignment > MIN_BUFFER_SIZE)
 
273
  if (count + alignment + 256 > MIN_BUFFER_SIZE)
274
274
    {
275
 
      buffer_size = count + alignment;
 
275
      buffer_size = count + alignment + 256;
276
276
    }
277
277
 
278
278
  /* Buffers to read and write from */