comparison libmudflap/testsuite/libmudflap.c/fail40-frag.c @ 55:77e2b8dfacca gcc-4.4.5

update it from 4.4.3 to 4.5.0
author ryoma <e075725@ie.u-ryukyu.ac.jp>
date Fri, 12 Feb 2010 23:39:51 +0900
parents a06113de4d67
children
comparison
equal deleted inserted replaced
52:c156f1bd5cd9 55:77e2b8dfacca
12 int main () 12 int main ()
13 { 13 {
14 #ifndef MAP_ANONYMOUS 14 #ifndef MAP_ANONYMOUS
15 #define MAP_ANONYMOUS MAP_ANON 15 #define MAP_ANONYMOUS MAP_ANON
16 #endif 16 #endif
17 #ifndef MAP_FAILED
18 #define MAP_FAILED ((void *)-1)
19 #endif
17 #ifdef HAVE_MMAP 20 #ifdef HAVE_MMAP
18 volatile unsigned char *p; 21 volatile unsigned char *p;
19 unsigned num = getpagesize (); 22 unsigned num = getpagesize ();
20 unsigned i; 23 unsigned i;
21 int rc; 24 int rc;
22 25
23 /* Get a bit of usable address space. We really want an 2**N+1-sized object, 26 /* Get a bit of usable address space. We really want an 2**N+1-sized object,
24 so the low/high addresses wrap when hashed into the lookup cache. So we 27 so the low/high addresses wrap when hashed into the lookup cache. So we
25 will manually unregister the entire mmap, then re-register a slice. */ 28 will manually unregister the entire mmap, then re-register a slice. */
26 p = mmap (NULL, num, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, 0, 0); 29 p = mmap (NULL, num, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
27 if (p == NULL) 30 if (p == MAP_FAILED)
28 return 1; 31 return 1;
29 /* Now unregister it, as if munmap was called. But don't actually munmap, so 32 /* Now unregister it, as if munmap was called. But don't actually munmap, so
30 we can write into the memory. */ 33 we can write into the memory. */
31 __mf_unregister ((void *) p, num, __MF_TYPE_HEAP_I); 34 __mf_unregister ((void *) p, num, __MF_TYPE_HEAP_I);
32 35