Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search  

mbig.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Go to the source code of this file.


Functions

int main (int argc, char *argv[])

Function Documentation

int main int    argc,
char *    argv[]
 

\** File : SUMA.c

Author:
: Ziad Saad Date : Thu Dec 27 16:21:01 EST 2001
Purpose :

Input paramters :

Parameters:
param  Usage : SUMA ( )
Returns :
Returns:
Support :
See also:
OpenGL prog. Guide 3rd edition , varray.c from book's sample code
Side effects :

Definition at line 5 of file mbig.c.

References argc, and malloc.

00006 {
00007    int mm,ii ;
00008    char * cc ;
00009 
00010    if( argc < 2 || strcmp(argv[1],"-help")==0 ){
00011       printf("Usage: mbig n\n"
00012              "Will allocate n Megabytes of memory, then quit.\n") ;
00013       exit(0) ;
00014    }
00015 
00016    mm = strtol( argv[1] , NULL , 10 ) ;
00017    if( mm <= 0 ) exit(1) ;
00018 
00019    cc = (char *)malloc( mm*1024*1024 * sizeof(char) ) ;
00020    printf("Malloc-ed %d Megabytes",mm) ; fflush(stdout) ;
00021    for( ii=0 ; ii < mm*1024*1024 ; ii++ ) cc[ii] = (char) (ii%128) ;
00022 
00023    for( ii=0 ; ii < 3 ; ii++ ){
00024       sleep(1) ; printf(".") ; fflush(stdout) ;
00025    }
00026    printf("\n") ; exit(0) ;
00027 }
 

Powered by Plone

This site conforms to the following standards: