Trivial fix for defines in mtest01.c.
PATCH 1/1 Trivial fix for defines in mtest01.c.
Hi,
this is a trivial fix.
Signed-off-by Cristian Greco <[email protected]>
--- testcases/kernel/mem/mtest01/mtest01.c | 32 ++++++++++++++++---------------- 1 files changed, 16 insertions(+), 16 deletions(-)
testcases/kernel/mem/mtest01/mtest01.c +16 -16
@@ -44,9 +44,9 @@#include "test.h" -#define FIVE_HUNDRED_KB (unsigned long long)(500*1024*1024) -#define ONE_MEGABYTE (unsigned long long)(1024*1024*1024) -#define THREE_MEGABYTES (unsigned long long)(3*ONE_MEGABYTE) +#define FIVE_HUNDRED_MB (unsigned long long)(500*1024*1024) +#define ONE_GIGABYTE (unsigned long long)(1024*1024*1024) +#define THREE_GIGABYTES (unsigned long long)(3*ONE_GIGABYTE)char *TCID ="mtest01" ;int TST_TOTAL =1 ;
@@ -128,7 +128,7 @@ int main(int argc, char* argv[]) total_free = sstats.freeram + sstats.freeswap;/* Total Free Pre-Test RAM */ pre_mem = sstats.mem_unit * total_free; - max_pids = total_ram / (unsigned long )FIVE_HUNDRED_KB +1 ; + max_pids = total_ram / (unsigned long )FIVE_HUNDRED_MB +1 ;if ((pid_list =malloc (max_pids *sizeof (pid_t))) ==NULL )tst_brkm (TBROK |TERRNO ,NULL ,"malloc failed." );
@@ -171,47 +171,47 @@ int main(int argc, char* argv[]) pid_list[i] = pid;#if defined (_s390_)/* s390's 31bit addressing requires smaller chunks */ -while (pid !=0 && maxbytes >FIVE_HUNDRED_KB ) { +while (pid !=0 && maxbytes >FIVE_HUNDRED_MB ) { i++; - maxbytes -=FIVE_HUNDRED_KB ; + maxbytes -=FIVE_HUNDRED_MB ; pid =fork ();if (pid !=0 ) { pid_cntr++; pid_list[i] = pid; } } -if (maxbytes >FIVE_HUNDRED_KB ) - alloc_bytes =FIVE_HUNDRED_KB ; +if (maxbytes >FIVE_HUNDRED_MB ) + alloc_bytes =FIVE_HUNDRED_MB ;else alloc_bytes = (unsigned long ) maxbytes;#elif __WORDSIZE ==32 -while (pid !=0 && maxbytes >ONE_MEGABYTE ) { +while (pid !=0 && maxbytes >ONE_GIGABYTE ) { i++; - maxbytes -=ONE_MEGABYTE ; + maxbytes -=ONE_GIGABYTE ; pid =fork ();if (pid !=0 ) { pid_cntr++; pid_list[i]=pid; } } -if (maxbytes >ONE_MEGABYTE ) - alloc_bytes =ONE_MEGABYTE ; +if (maxbytes >ONE_GIGABYTE ) + alloc_bytes =ONE_GIGABYTE ;else alloc_bytes = (unsigned long )maxbytes;#elif __WORDSIZE ==64 -while (pid !=0 && maxbytes >THREE_MEGABYTES ) { +while (pid !=0 && maxbytes >THREE_GIGABYTES ) { i++; - maxbytes -=THREE_MEGABYTES ; + maxbytes -=THREE_GIGABYTES ; pid =fork ();if (pid !=0 ) { pid_cntr++; pid_list[i] = pid; } } -if (maxbytes >THREE_MEGABYTES ) - alloc_bytes =THREE_MEGABYTES ; +if (maxbytes >THREE_GIGABYTES ) + alloc_bytes =THREE_GIGABYTES ;else alloc_bytes = maxbytes;#endif
Signature · 19 lines
1.7.2.3 Thanks, -- Cristian Greco GPG key ID: 0xCF4D32E4 ------------------------------------------------------------------------------ Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 3 lines · Cristian Greco
Hi,
this is a trivial fix.
Committed -- thanks!
-Garrett
------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list