alliance-support '02
Enhancements to Alliance 4.5.0 mbk_sys.c


Art (pinaar@austin.rr.com)
Sat, 2 Feb 2002 21:59:03 -0600

Hi! Please review and submit the context diff below. I did not make any "ocrRouter.c", other then debugging printf's which I removed. Thanks & Regards, Art --- context diff's --- *** /usr/local/source/alliance/sources/mbk/mbk_sys.c Thu Jan 24 15:46:00 2002 --- /cygdrive/f/u/pinaar/ws/alliance/sources/mbk/mbk_sys.c Sun Feb 3 03:39:30 2002 *************** *** 31,36 **** --- 31,37 ---- #ident "$Id: mbk_sys.c,v 1.26 2002/01/24 15:45:59 czo Exp $" #include <stdio.h> + #include <stdlib.h> /* Declare getnenv() */ #include <unistd.h> #include <malloc.h> #include <sys/types.h> *************** *** 53,72 **** autoackchld_list *HEAD_AUTOACKCHLD_FREE=NULL; int STAT_AUTOACKCHLD; ! long mbkalloc_stat = 0; /* statistics on maximun allocated memory */ void *mbkalloc(nbytes) unsigned int nbytes; { void *pt; - mbkalloc_stat += nbytes; if (!(pt = malloc(nbytes))) { (void)fflush(stdout); (void)fprintf(stderr,"*** mbk error ***\n"); (void)fprintf(stderr,"fatal mbkalloc error : not enough memory\n"); EXIT(1); } return pt; } --- 54,76 ---- autoackchld_list *HEAD_AUTOACKCHLD_FREE=NULL; int STAT_AUTOACKCHLD; ! unsigned long mbkalloc_stat = 0; /* statistics on maximun allocated memory */ void *mbkalloc(nbytes) unsigned int nbytes; { void *pt; if (!(pt = malloc(nbytes))) { (void)fflush(stdout); (void)fprintf(stderr,"*** mbk error ***\n"); (void)fprintf(stderr,"fatal mbkalloc error : not enough memory\n"); + (void)fprintf(stderr, + "info: %d KB requested. %ld KB allocated\n", + nbytes/1024,mbkalloc_stat/1024); EXIT(1); } + mbkalloc_stat += nbytes; return pt; } *************** *** 75,87 **** unsigned int nbytes; { - mbkalloc_stat += nbytes; if (!(pt = realloc(pt, nbytes))) { (void)fflush(stdout); (void)fprintf(stderr,"*** mbk error ***\n"); (void)fprintf(stderr,"fatal mbkrealloc error : not enough memory\n"); EXIT(1); } return pt; } --- 79,94 ---- unsigned int nbytes; { if (!(pt = realloc(pt, nbytes))) { (void)fflush(stdout); (void)fprintf(stderr,"*** mbk error ***\n"); (void)fprintf(stderr,"fatal mbkrealloc error : not enough memory\n"); + (void)fprintf(stderr, + "info: %d KB requested. %ld KB allocated\n", + nbytes/1024,mbkalloc_stat/1024); EXIT(1); } + mbkalloc_stat += nbytes; return pt; }

 



Alliance Web Site © 1997, 2002 ASIM/LIP6/UPMC, page maintained by Czo [Olivier Sirol] , last updated on 04 February 2002.