/[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.50 by camm, Sat Nov 12 18:33:42 2005 UTC revision 1.51 by camm, Sun Nov 27 17:55:41 2005 UTC
# Line 38  DEFVAR("*AFTER-GBC-HOOK*",sSAafter_gbc_h Line 38  DEFVAR("*AFTER-GBC-HOOK*",sSAafter_gbc_h
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    
 static void call_after_gbc_hook(int t);  
41    
42  #ifdef DEBUG_SBRK  #ifdef DEBUG_SBRK
43  int debug;  int debug;
# Line 96  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;
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;
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 230  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  static void  void
235  call_after_gbc_hook(t)  call_after_gbc_hook(t)
236  { if (sSAafter_gbc_hookA && sSAafter_gbc_hookA->s.s_dbind!= Cnil)  { pending_agbch_call=0;
237      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      }      }
# Line 379  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);
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 463  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);
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 660  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);
668          return(p);          return(p);
669  }  }
670    
# Line 1182  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);
1191    RETURN1(Ct);    RETURN1(Ct);
1192    
1193  }  }
# Line 1228  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);
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 1283  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);
1294    RETURN1(Ct);    RETURN1(Ct);
1295    
1296  }  }

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

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