/[emacs]/emacs/gc/alloc.c
ViewVC logotype

Diff of /emacs/gc/alloc.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2.2.1 by fx, Thu Jun 5 18:23:03 2003 UTC revision 1.2.2.2 by fx, Fri Jun 6 09:43:30 2003 UTC
# Line 17  Line 17 
17    
18    
19  # include "private/gc_priv.h"  # include "private/gc_priv.h"
20    #include <malloc.h>
21  # include <stdio.h>  # include <stdio.h>
22  # if !defined(MACOS) && !defined(MSWINCE)  # if !defined(MACOS) && !defined(MSWINCE)
23  #   include <signal.h>  #   include <signal.h>
# Line 135  int GC_n_attempts = 0;         /* Number of att Line 135  int GC_n_attempts = 0;         /* Number of att
135    }    }
136  #endif /* !SMALL_CONFIG */  #endif /* !SMALL_CONFIG */
137    
138    #if 0
139    void* callocx (size_t n, size_t size)
140    {
141      void *val;
142      mallopt (M_MMAP_MAX, 0);
143      val = calloc (n, size);
144      mallopt (M_MMAP_MAX, 100000000);
145      return val;
146    }
147    #endif
148    
149  /* Return the minimum number of words that must be allocated between    */  /* Return the minimum number of words that must be allocated between    */
150  /* collections to amortize the collection cost.                         */  /* collections to amortize the collection cost.                         */
151  static word min_words_allocd()  static word min_words_allocd()
# Line 297  void GC_maybe_gc() Line 308  void GC_maybe_gc()
308  }  }
309    
310    
311    void (*GC_collect_start_callback)GC_PROTO((void)) = NULL;
312    void (*GC_collect_end_callback)GC_PROTO((void)) = NULL;
313    
314  /*  /*
315   * Stop the world garbage collection.  Assumes lock held, signals disabled.   * Stop the world garbage collection.  Assumes lock held, signals disabled.
316   * If stop_func is not GC_never_stop_func, then abort if stop_func returns TRUE.   * If stop_func is not GC_never_stop_func, then abort if stop_func returns TRUE.
# Line 309  GC_stop_func stop_func; Line 323  GC_stop_func stop_func;
323          CLOCK_TYPE start_time, current_time;          CLOCK_TYPE start_time, current_time;
324  #   endif  #   endif
325      if (GC_dont_gc) return FALSE;      if (GC_dont_gc) return FALSE;
326        if (GC_collect_start_callback)
327          GC_collect_start_callback();
328      if (GC_incremental && GC_collection_in_progress()) {      if (GC_incremental && GC_collection_in_progress()) {
329  #   ifdef CONDPRINT  #   ifdef CONDPRINT
330        if (GC_print_stats) {        if (GC_print_stats) {
# Line 371  GC_stop_func stop_func; Line 387  GC_stop_func stop_func;
387                     MS_TIME_DIFF(current_time,start_time));                     MS_TIME_DIFF(current_time,start_time));
388        }        }
389  #   endif  #   endif
390        if (GC_collect_end_callback)
391          GC_collect_end_callback();
392      return(TRUE);      return(TRUE);
393  }  }
394    

Legend:
Removed from v.1.2.2.1  
changed lines
  Added in v.1.2.2.2

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