/[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.43 by mjthomas, Thu Oct 14 07:19:43 2004 UTC revision 1.44 by camm, Sun Jan 16 02:30:00 2005 UTC
# Line 823  init_tm(enum type t, char *name, int els Line 823  init_tm(enum type t, char *name, int els
823        
824  }  }
825    
826    /* FIXME this is a work-around for the special MacOSX memory
827       initialization sequence, which sets heap_end, traditionally
828       initialized in gcl_init_alloc.  Mac and windows have non-std
829       sbrk-emulating memory subsystems, and their internals need to be
830       homogenized and integrated into the traditional unix sequence for
831       simplicity.  set_maxpage is overloaded, and the positioning of its
832       call is too fragile.  20050115 CM*/
833    static int gcl_alloc_initialized;
834    
835  void  void
836  set_maxpage(void) {  set_maxpage(void) {
837    
# Line 831  set_maxpage(void) { Line 840  set_maxpage(void) {
840  #ifdef SGC  #ifdef SGC
841    page_multiple=getpagesize()/PAGESIZE;    page_multiple=getpagesize()/PAGESIZE;
842    if (page_multiple==0) error("PAGESIZE must be factor of getpagesize()");    if (page_multiple==0) error("PAGESIZE must be factor of getpagesize()");
843    if (heap_end) {    if (gcl_alloc_initialized) {
844      extern long maxpage;      extern long maxpage;
845      maxpage=page(heap_end);      maxpage=page(heap_end);
846      memory_protect(sgc_enabled ? 1 : 0);      memory_protect(sgc_enabled ? 1 : 0);
# Line 852  void Line 861  void
861  gcl_init_alloc(void) {  gcl_init_alloc(void) {
862    
863    long i;    long i;
   static int initialized;  
864  #ifdef GCL_GPROF  #ifdef GCL_GPROF
865     extern void *GCL_GPROF_START;     extern void *GCL_GPROF_START;
866     unsigned textpage=2*((void *)&etext-(void *)&GCL_GPROF_START)/PAGESIZE;     unsigned textpage=2*((void *)&etext-(void *)&GCL_GPROF_START)/PAGESIZE;
867  #endif  #endif
868        
869    if (initialized) return;    if (gcl_alloc_initialized) return;
   initialized=1;  
870        
871        
872  #ifdef BSD  #ifdef BSD
# Line 983  gcl_init_alloc(void) { Line 990  gcl_init_alloc(void) {
990    if (maxcbpage<textpage)    if (maxcbpage<textpage)
991       maxcbpage=textpage;       maxcbpage=textpage;
992  #endif  #endif
993      gcl_alloc_initialized=1;
994        
995  }  }
996    

Legend:
Removed from v.1.43  
changed lines
  Added in v.1.44

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