mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-03 10:05:29 +00:00
r15815 "Allow 8k and 32k page sizes" added an extra line in memalign_test.c. This changed the line numbers in the output compared to the .exp file. Just put everything on one (long) line to match expectations again. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15818
28 lines
710 B
C
28 lines
710 B
C
|
|
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
#include <unistd.h>
|
|
#include <assert.h>
|
|
|
|
int main ( void )
|
|
{
|
|
void* a[10];
|
|
int i;
|
|
unsigned long pszB = sysconf(_SC_PAGE_SIZE);
|
|
assert(sizeof(long) == sizeof(void*));
|
|
assert(pszB == 4096 || pszB == 8192 || pszB == 16384 || pszB == 32768 || pszB == 65536); /* All on one line to match linenumbers in the .exp file. */
|
|
|
|
for (i = 0; i < 10; i++) {
|
|
a[i] = valloc(11111 * (i+1));
|
|
/* check valloc really is returning page-aligned memory */
|
|
assert( (((unsigned long)(a[i])) % pszB) == 0 );
|
|
// printf("I acquire %p\n", a[i]);
|
|
}
|
|
for (i = 0; i < 10; i++) {
|
|
// printf("I release %p\n", a[i]);
|
|
free(a[i]);
|
|
}
|
|
free(a[9]);
|
|
return 0;
|
|
}
|