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

Legend:
Removed from v.1.19.4.1.2.17.2.1.4.1.2.2.4.1  
changed lines
  Added in v.1.19.4.1.2.17.2.1.4.1.2.2.4.2

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