ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/p.c
Revision: 1.6
Committed: Fri Mar 21 18:48:45 2003 UTC (21 years, 1 month ago) by greg
Content type: text/plain
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +0 -0 lines
State: FILE REMOVED
Log Message:
Final updates for official 3.5 release

File Contents

# Content
1 #include <stdlib.h>
2 #include <stdio.h>
3 #include <malloc.h>
4
5 main( int argc, char *argv[])
6 {
7 int s,mb,q,a;
8 unsigned char *mem,b;
9
10 if( argc != 2 ) {
11 fprintf(stderr,"usage: p MB\n");
12 return(1);
13 }
14 s= 1024*1024* (mb=atoi(argv[1]));
15 if (!(mem=malloc(s))) {
16 printf("failed\n");
17 exit(1);
18 }
19 for (;;) {
20 for (q=0;q<mb;++q) {
21 a=q*1024*1024+ 1+(int)(1024*1024.0*rand()/(RAND_MAX+1.0)) ;
22 b=255*rand()/(RAND_MAX+1.0);
23 mem[a] = b;
24 if( mem[a] != b )
25 fprintf(stderr,"hopla %x\n", a);
26 }
27 }
28
29 return(0);
30
31 }