/[gcl]/gcl/o/alloc.c
ViewVC logotype

Diff of /gcl/o/alloc.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by camm, Sun Dec 16 07:31:05 2001 UTC revision 1.2.2.1 by camm, Thu Jan 24 18:46:02 2002 UTC
# Line 1057  static char *baby_malloc(n) Line 1057  static char *baby_malloc(n)
1057  }  }
1058  #endif  #endif
1059    
1060    /* configure size, static init ? */
1061    static char bfd_buf[/*  4392 */5000];
1062    static char *bfd_buf_p=bfd_buf;
1063    
1064    static void *
1065    bfd_malloc(int n) {
1066    
1067      char *c;
1068    
1069      c=bfd_buf_p;
1070      n+=7;
1071      n>>=3;
1072      n<<=3;
1073      if (c+n>bfd_buf+sizeof(bfd_buf)) {
1074        fprintf(stderr,"Not enough space in bfd_buf %d %d\n",n,sizeof(bfd_buf)-(bfd_buf_p-bfd_buf));
1075        exit(1);
1076      }
1077      bfd_buf_p+=n;
1078      return (void *)c;
1079    
1080    }
1081    
1082  char *  char *
1083  malloc(size)  malloc(size)
1084  int size;  int size;
1085  {  {
1086          object x;          extern int in_bfd_init;
1087            object x;
1088            
1089            if (in_bfd_init)
1090              return bfd_malloc(size);
1091    
1092  #ifdef BABY_MALLOC_SIZE  #ifdef BABY_MALLOC_SIZE
1093          if (GBC_enable == 0) return baby_malloc(size);          if (GBC_enable == 0) return baby_malloc(size);

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.2.2.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26