/[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.3 by camm, Mon Jan 7 16:44:35 2002 UTC revision 1.4 by camm, Sun Feb 3 18:44:08 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);
# Line 1199  char *ptr; Line 1223  char *ptr;
1223  #endif  #endif
1224    
1225    
1226  #ifndef GNU_MALLOC  #ifndef GNUMALLOC
1227  char *  char *
1228  memalign(align,size)  memalign(align,size)
1229       int align,size;       int align,size;

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

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