/[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.51 by camm, Sun Nov 27 17:55:41 2005 UTC revision 1.52 by camm, Tue Nov 29 23:19:39 2005 UTC
# Line 34  Foundation, 675 Mass Ave, Cambridge, MA Line 34  Foundation, 675 Mass Ave, Cambridge, MA
34  static int  static int
35  t_from_type(object);  t_from_type(object);
36    
37  DEFVAR("*AFTER-GBC-HOOK*",sSAafter_gbc_hookA,SI,sLnil,"");  /* DEFVAR("*AFTER-GBC-HOOK*",sSAafter_gbc_hookA,SI,sLnil,""); */
38  DEFVAR("*IGNORE-MAXIMUM-PAGES*",sSAignore_maximum_pagesA,SI,sLt,"");  DEFVAR("*IGNORE-MAXIMUM-PAGES*",sSAignore_maximum_pagesA,SI,sLt,"");
39  #define IGNORE_MAX_PAGES (sSAignore_maximum_pagesA ==0 || sSAignore_maximum_pagesA->s.s_dbind !=sLnil)  #define IGNORE_MAX_PAGES (sSAignore_maximum_pagesA ==0 || sSAignore_maximum_pagesA->s.s_dbind !=sLnil)
40    
# Line 95  void *stack_alloc_start=NULL,*stack_allo Line 95  void *stack_alloc_start=NULL,*stack_allo
95     If not in_signal_handler then try to keep a minimum of     If not in_signal_handler then try to keep a minimum of
96     reserve_pages_for_signal_handler pages on hand in the hole     reserve_pages_for_signal_handler pages on hand in the hole
97   */   */
98  static int pending_agbch_call;  /* static int pending_agbch_call; */
99  char *  char *
100  alloc_page(long n)  alloc_page(long n)
101  {  {
# Line 125  eg to add 20 more do (si::set-hole-size Line 125  eg to add 20 more do (si::set-hole-size
125                          hole_overrun=1;                          hole_overrun=1;
126                          GBC(t_relocatable);                          GBC(t_relocatable);
127                          hole_overrun=0;                          hole_overrun=0;
128                          pending_agbch_call=1;  /*                      pending_agbch_call=1; */
129  #ifdef SGC  #ifdef SGC
130                          if (in_sgc)                          if (in_sgc)
131                            {hole_overrun=1;sgc_start();hole_overrun=0;                            {hole_overrun=1;sgc_start();hole_overrun=0;
# Line 231  type_name(int t) Line 231  type_name(int t)
231  { return make_simple_string(tm_table[(int)t].tm_name+1);}  { return make_simple_string(tm_table[(int)t].tm_name+1);}
232    
233    
234  void  /* void */
235  call_after_gbc_hook(t)  /* call_after_gbc_hook(t) */
236  { pending_agbch_call=0;  /* { pending_agbch_call=0; */
237    if (sSAafter_gbc_hookA && sSAafter_gbc_hookA->s.s_dbind!= Cnil)  /*   if (sSAafter_gbc_hookA && sSAafter_gbc_hookA->s.s_dbind!= Cnil) */
238      { set_up_string_register(tm_table[(int)t].tm_name+1);  /*     { set_up_string_register(tm_table[(int)t].tm_name+1); */
239        ifuncall1(sSAafter_gbc_hookA->s.s_dbind,intern(string_register,system_package));  /*       ifuncall1(sSAafter_gbc_hookA->s.s_dbind,intern(string_register,system_package)); */
240      }  /*     } */
241  }  /* } */
242    
243  /* #define PERCENT_FREE(tm)  ((tm->tm_percent_free ? tm->tm_percent_free : 10)/100.0) */  /* #define PERCENT_FREE(tm)  ((tm->tm_percent_free ? tm->tm_percent_free : 10)/100.0) */
244  #define PERCENT_FREE(tm)  ((tm->tm_percent_free ? tm->tm_percent_free : 30)/100.0)  #define PERCENT_FREE(tm)  ((tm->tm_percent_free ? tm->tm_percent_free : 30)/100.0)
# Line 381  ONCE_MORE: Line 381  ONCE_MORE:
381                  }                  }
382                  p = alloc_page(1);                  p = alloc_page(1);
383                  add_page_to_freelist(p,tm);                  add_page_to_freelist(p,tm);
384                  if (pending_agbch_call) call_after_gbc_hook(t);  /*              if (pending_agbch_call) call_after_gbc_hook(t); */
385                  obj = tm->tm_free;                  obj = tm->tm_free;
386                  if (tm->tm_npage >= tm->tm_maxpage)                  if (tm->tm_npage >= tm->tm_maxpage)
387                          goto CALL_GBC;                          goto CALL_GBC;
# Line 415  CALL_GBC: Line 415  CALL_GBC:
415               tm->tm_adjgbccnt*=(double)j/tm->tm_maxpage;               tm->tm_adjgbccnt*=(double)j/tm->tm_maxpage;
416             }             }
417          }          }
418          call_after_gbc_hook(t);  /*      call_after_gbc_hook(t); */
419          goto ONCE_MORE;          goto ONCE_MORE;
420    
421  EXHAUSTED:  EXHAUSTED:
# Line 430  Use ALLOCATE to expand the space.", Line 430  Use ALLOCATE to expand the space.",
430                  2, vs_top[-2], vs_top[-1], Cnil, Cnil);                  2, vs_top[-2], vs_top[-1], Cnil, Cnil);
431          vs_popp;          vs_popp;
432          vs_popp;          vs_popp;
433          call_after_gbc_hook(t);  /*      call_after_gbc_hook(t); */
434          goto ONCE_MORE;          goto ONCE_MORE;
435  }  }
436    
# Line 466  ONCE_MORE: Line 466  ONCE_MORE:
466                  }                  }
467                  p = alloc_page(1);                  p = alloc_page(1);
468                  add_page_to_freelist(p,tm);                  add_page_to_freelist(p,tm);
469                  if (pending_agbch_call) call_after_gbc_hook(t_cons);  /*              if (pending_agbch_call) call_after_gbc_hook(t_cons); */
470                  obj = tm->tm_free ;                  obj = tm->tm_free ;
471                  if (tm->tm_npage >= tm->tm_maxpage)                  if (tm->tm_npage >= tm->tm_maxpage)
472                          goto CALL_GBC;                          goto CALL_GBC;
# Line 496  CALL_GBC: Line 496  CALL_GBC:
496               tm->tm_adjgbccnt*=(double)j/tm->tm_maxpage;               tm->tm_adjgbccnt*=(double)j/tm->tm_maxpage;
497             }             }
498          }          }
499          call_after_gbc_hook(t_cons);  /*      call_after_gbc_hook(t_cons); */
500          goto ONCE_MORE;          goto ONCE_MORE;
501    
502  EXHAUSTED:  EXHAUSTED:
# Line 509  Use ALLOCATE to expand the space.", Line 509  Use ALLOCATE to expand the space.",
509                  "Continues execution.",                  "Continues execution.",
510                  1, vs_top[-1],Cnil,Cnil,Cnil);                  1, vs_top[-1],Cnil,Cnil,Cnil);
511          vs_popp;          vs_popp;
512          call_after_gbc_hook(t_cons);  /*      call_after_gbc_hook(t_cons); */
513          goto ONCE_MORE;          goto ONCE_MORE;
514  #undef  tm  #undef  tm
515  }  }
# Line 633  ONCE_MORE: Line 633  ONCE_MORE:
633                    }                    }
634                  }                  }
635                  g=j==maxcbpage ? TRUE : FALSE;                  g=j==maxcbpage ? TRUE : FALSE;
636                  call_after_gbc_hook(t_contiguous);  /*              call_after_gbc_hook(t_contiguous); */
637                  goto ONCE_MORE;                  goto ONCE_MORE;
638  EXHAUSTED:  EXHAUSTED:
639                  vs_push(make_fixnum(ncbpage));                  vs_push(make_fixnum(ncbpage));
# Line 643  Use ALLOCATE-CONTIGUOUS-PAGES to expand Line 643  Use ALLOCATE-CONTIGUOUS-PAGES to expand
643                          "Continues execution.", 1, vs_head,Cnil,Cnil,Cnil);                          "Continues execution.", 1, vs_head,Cnil,Cnil,Cnil);
644                  vs_popp;                  vs_popp;
645                  g = FALSE;                  g = FALSE;
646                  call_after_gbc_hook(t_contiguous);  /*              call_after_gbc_hook(t_contiguous); */
647                  goto ONCE_MORE;                  goto ONCE_MORE;
648          }          }
649        }        }
# Line 664  Use ALLOCATE-CONTIGUOUS-PAGES to expand Line 664  Use ALLOCATE-CONTIGUOUS-PAGES to expand
664          }          }
665          ncbpage += m;          ncbpage += m;
666          insert_contblock(p+n, PAGESIZE*m - n);          insert_contblock(p+n, PAGESIZE*m - n);
667          if (pending_agbch_call) call_after_gbc_hook(t_contiguous);  /*      if (pending_agbch_call) call_after_gbc_hook(t_contiguous); */
668          return(p);          return(p);
669  }  }
670    
# Line 809  ONCE_MORE: Line 809  ONCE_MORE:
809              }              }
810            }            }
811            g=i==nrbpage ? TRUE : FALSE;            g=i==nrbpage ? TRUE : FALSE;
812            call_after_gbc_hook(t_relocatable);  /*        call_after_gbc_hook(t_relocatable); */
813            goto ONCE_MORE;            goto ONCE_MORE;
814  EXHAUSTED:                EXHAUSTED:              
815            if (rb_limit > rb_end - 2*RB_GETA)            if (rb_limit > rb_end - 2*RB_GETA)
# Line 822  Use ALLOCATE-RELOCATABLE-PAGES to expand Line 822  Use ALLOCATE-RELOCATABLE-PAGES to expand
822                    "Continues execution.", 1, vs_head,Cnil,Cnil,Cnil);                    "Continues execution.", 1, vs_head,Cnil,Cnil,Cnil);
823            vs_popp;            vs_popp;
824            g = FALSE;            g = FALSE;
825            call_after_gbc_hook(t_relocatable);  /*        call_after_gbc_hook(t_relocatable); */
826            goto ONCE_MORE;            goto ONCE_MORE;
827          }          }
828          p = rb_pointer;          p = rb_pointer;
# Line 1187  DEFUN_NEW("ALLOCATE-CONTIGUOUS-PAGES",ob Line 1187  DEFUN_NEW("ALLOCATE-CONTIGUOUS-PAGES",ob
1187    
1188    ncbpage += m;    ncbpage += m;
1189    insert_contblock(p, PAGESIZE*m);    insert_contblock(p, PAGESIZE*m);
1190    if (pending_agbch_call) call_after_gbc_hook(t_contiguous);  /*   if (pending_agbch_call) call_after_gbc_hook(t_contiguous); */
1191    RETURN1(Ct);    RETURN1(Ct);
1192    
1193  }  }
# Line 1234  DEFUN_NEW("ALLOCATE-RELOCATABLE-PAGES",o Line 1234  DEFUN_NEW("ALLOCATE-RELOCATABLE-PAGES",o
1234    nrbpage = npages;    nrbpage = npages;
1235    rb_limit = rb_end - 2*RB_GETA;    rb_limit = rb_end - 2*RB_GETA;
1236    alloc_page(-(holepage + nrbpage));    alloc_page(-(holepage + nrbpage));
1237    if (pending_agbch_call) call_after_gbc_hook(t_relocatable);  /*   if (pending_agbch_call) call_after_gbc_hook(t_relocatable); */
1238    vs_top = vs_base;    vs_top = vs_base;
1239    vs_push(Ct);    vs_push(Ct);
1240    RETURN1(make_fixnum(npages));    RETURN1(make_fixnum(npages));
# Line 1290  DEFUN_NEW("ALLOCATE",object,fSallocate,S Line 1290  DEFUN_NEW("ALLOCATE",object,fSallocate,S
1290        for (;  tm->tm_npage < tm->tm_maxpage;  pp += PAGESIZE)        for (;  tm->tm_npage < tm->tm_maxpage;  pp += PAGESIZE)
1291          add_page_to_freelist(pp,tm);}          add_page_to_freelist(pp,tm);}
1292        
1293    if (pending_agbch_call) call_after_gbc_hook(t);  /*   if (pending_agbch_call) call_after_gbc_hook(t); */
1294    RETURN1(Ct);    RETURN1(Ct);
1295    
1296  }  }

Legend:
Removed from v.1.51  
changed lines
  Added in v.1.52

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