Mercurial > emacs
comparison src/alloc.c @ 109100:2bc9a0c04c87
Remove __P and P_ from .c and .m files and definition of P_
* lisp.h:
* atimer.h: Remove define for P_.
* alloc.c: Remove __P and P_ from .c and .m files.
* atimer.c:
* buffer.c:
* callint.c:
* category.c:
* charset.c:
* chartab.c:
* cm.c:
* coding.c:
* composite.c:
* data.c:
* dired.c:
* dispnew.c:
* doc.c:
* editfns.c:
* emacs.c:
* eval.c:
* fileio.c:
* filelock.c:
* fns.c:
* font.c:
* fontset.c:
* frame.c:
* ftfont.c:
* ftxfont.c:
* gmalloc.c:
* gtkutil.c:
* image.c:
* indent.c:
* intervals.c:
* keyboard.c:
* keymap.c:
* lread.c:
* marker.c:
* menu.c:
* minibuf.c:
* print.c:
* process.c:
* scroll.c:
* search.c:
* sound.c:
* strftime.c:
* syntax.c:
* sysdep.c:
* term.c:
* terminal.c:
* textprop.c:
* unexalpha.c:
* w32console.c:
* w32fns.c:
* w32font.c:
* w32menu.c:
* w32term.c:
* w32uniscribe.c:
* window.c:
* xdisp.c:
* xfaces.c:
* xfns.c:
* xfont.c:
* xftfont.c:
* xmenu.c:
* xselect.c:
* xterm.c: Likewise.
* ebrowse.c: Remove P_ and __P.
* etags.c:
* movemail.c:
* pop.c:
* update-game-score.c: Likewise.
| author | Jan D <jan.h.d@swipnet.se> |
|---|---|
| date | Fri, 02 Jul 2010 14:19:53 +0200 |
| parents | 734073f5d073 |
| children | aec1143e8d85 |
comparison
equal
deleted
inserted
replaced
| 109099:e16f43875a48 | 109100:2bc9a0c04c87 |
|---|---|
| 327 Lisp_Object Vpost_gc_hook, Qpost_gc_hook; | 327 Lisp_Object Vpost_gc_hook, Qpost_gc_hook; |
| 328 | 328 |
| 329 Lisp_Object Vgc_elapsed; /* accumulated elapsed time in GC */ | 329 Lisp_Object Vgc_elapsed; /* accumulated elapsed time in GC */ |
| 330 EMACS_INT gcs_done; /* accumulated GCs */ | 330 EMACS_INT gcs_done; /* accumulated GCs */ |
| 331 | 331 |
| 332 static void mark_buffer P_ ((Lisp_Object)); | 332 static void mark_buffer (Lisp_Object); |
| 333 static void mark_terminals P_ ((void)); | 333 static void mark_terminals (void); |
| 334 extern void mark_kboards P_ ((void)); | 334 extern void mark_kboards (void); |
| 335 extern void mark_ttys P_ ((void)); | 335 extern void mark_ttys (void); |
| 336 extern void mark_backtrace P_ ((void)); | 336 extern void mark_backtrace (void); |
| 337 static void gc_sweep P_ ((void)); | 337 static void gc_sweep (void); |
| 338 static void mark_glyph_matrix P_ ((struct glyph_matrix *)); | 338 static void mark_glyph_matrix (struct glyph_matrix *); |
| 339 static void mark_face_cache P_ ((struct face_cache *)); | 339 static void mark_face_cache (struct face_cache *); |
| 340 | 340 |
| 341 #ifdef HAVE_WINDOW_SYSTEM | 341 #ifdef HAVE_WINDOW_SYSTEM |
| 342 extern void mark_fringe_data P_ ((void)); | 342 extern void mark_fringe_data (void); |
| 343 #endif /* HAVE_WINDOW_SYSTEM */ | 343 #endif /* HAVE_WINDOW_SYSTEM */ |
| 344 | 344 |
| 345 static struct Lisp_String *allocate_string P_ ((void)); | 345 static struct Lisp_String *allocate_string (void); |
| 346 static void compact_small_strings P_ ((void)); | 346 static void compact_small_strings (void); |
| 347 static void free_large_strings P_ ((void)); | 347 static void free_large_strings (void); |
| 348 static void sweep_strings P_ ((void)); | 348 static void sweep_strings (void); |
| 349 | 349 |
| 350 extern int message_enable_multibyte; | 350 extern int message_enable_multibyte; |
| 351 | 351 |
| 352 /* When scanning the C stack for live Lisp objects, Emacs keeps track | 352 /* When scanning the C stack for live Lisp objects, Emacs keeps track |
| 353 of what memory allocated via lisp_malloc is intended for what | 353 of what memory allocated via lisp_malloc is intended for what |
| 367 use of the distinction, so it only caused source-code complexity | 367 use of the distinction, so it only caused source-code complexity |
| 368 and runtime slowdown. Minor but pointless. */ | 368 and runtime slowdown. Minor but pointless. */ |
| 369 MEM_TYPE_VECTORLIKE | 369 MEM_TYPE_VECTORLIKE |
| 370 }; | 370 }; |
| 371 | 371 |
| 372 static POINTER_TYPE *lisp_align_malloc P_ ((size_t, enum mem_type)); | 372 static POINTER_TYPE *lisp_align_malloc (size_t, enum mem_type); |
| 373 static POINTER_TYPE *lisp_malloc P_ ((size_t, enum mem_type)); | 373 static POINTER_TYPE *lisp_malloc (size_t, enum mem_type); |
| 374 void refill_memory_reserve (); | 374 void refill_memory_reserve (); |
| 375 | 375 |
| 376 | 376 |
| 377 #if GC_MARK_STACK || defined GC_MALLOC_CHECK | 377 #if GC_MARK_STACK || defined GC_MALLOC_CHECK |
| 378 | 378 |
| 450 /* Sentinel node of the tree. */ | 450 /* Sentinel node of the tree. */ |
| 451 | 451 |
| 452 static struct mem_node mem_z; | 452 static struct mem_node mem_z; |
| 453 #define MEM_NIL &mem_z | 453 #define MEM_NIL &mem_z |
| 454 | 454 |
| 455 static POINTER_TYPE *lisp_malloc P_ ((size_t, enum mem_type)); | 455 static POINTER_TYPE *lisp_malloc (size_t, enum mem_type); |
| 456 static struct Lisp_Vector *allocate_vectorlike P_ ((EMACS_INT)); | 456 static struct Lisp_Vector *allocate_vectorlike (EMACS_INT); |
| 457 static void lisp_free P_ ((POINTER_TYPE *)); | 457 static void lisp_free (POINTER_TYPE *); |
| 458 static void mark_stack P_ ((void)); | 458 static void mark_stack (void); |
| 459 static int live_vector_p P_ ((struct mem_node *, void *)); | 459 static int live_vector_p (struct mem_node *, void *); |
| 460 static int live_buffer_p P_ ((struct mem_node *, void *)); | 460 static int live_buffer_p (struct mem_node *, void *); |
| 461 static int live_string_p P_ ((struct mem_node *, void *)); | 461 static int live_string_p (struct mem_node *, void *); |
| 462 static int live_cons_p P_ ((struct mem_node *, void *)); | 462 static int live_cons_p (struct mem_node *, void *); |
| 463 static int live_symbol_p P_ ((struct mem_node *, void *)); | 463 static int live_symbol_p (struct mem_node *, void *); |
| 464 static int live_float_p P_ ((struct mem_node *, void *)); | 464 static int live_float_p (struct mem_node *, void *); |
| 465 static int live_misc_p P_ ((struct mem_node *, void *)); | 465 static int live_misc_p (struct mem_node *, void *); |
| 466 static void mark_maybe_object P_ ((Lisp_Object)); | 466 static void mark_maybe_object (Lisp_Object); |
| 467 static void mark_memory P_ ((void *, void *, int)); | 467 static void mark_memory (void *, void *, int); |
| 468 static void mem_init P_ ((void)); | 468 static void mem_init (void); |
| 469 static struct mem_node *mem_insert P_ ((void *, void *, enum mem_type)); | 469 static struct mem_node *mem_insert (void *, void *, enum mem_type); |
| 470 static void mem_insert_fixup P_ ((struct mem_node *)); | 470 static void mem_insert_fixup (struct mem_node *); |
| 471 static void mem_rotate_left P_ ((struct mem_node *)); | 471 static void mem_rotate_left (struct mem_node *); |
| 472 static void mem_rotate_right P_ ((struct mem_node *)); | 472 static void mem_rotate_right (struct mem_node *); |
| 473 static void mem_delete P_ ((struct mem_node *)); | 473 static void mem_delete (struct mem_node *); |
| 474 static void mem_delete_fixup P_ ((struct mem_node *)); | 474 static void mem_delete_fixup (struct mem_node *); |
| 475 static INLINE struct mem_node *mem_find P_ ((void *)); | 475 static INLINE struct mem_node *mem_find (void *); |
| 476 | 476 |
| 477 | 477 |
| 478 #if GC_MARK_STACK == GC_MARK_STACK_CHECK_GCPROS | 478 #if GC_MARK_STACK == GC_MARK_STACK_CHECK_GCPROS |
| 479 static void check_gcpros P_ ((void)); | 479 static void check_gcpros (void); |
| 480 #endif | 480 #endif |
| 481 | 481 |
| 482 #endif /* GC_MARK_STACK || GC_MALLOC_CHECK */ | 482 #endif /* GC_MARK_STACK || GC_MALLOC_CHECK */ |
| 483 | 483 |
| 484 /* Recording what needs to be marked for gc. */ | 484 /* Recording what needs to be marked for gc. */ |
| 493 | 493 |
| 494 /* Index of next unused slot in staticvec. */ | 494 /* Index of next unused slot in staticvec. */ |
| 495 | 495 |
| 496 static int staticidx = 0; | 496 static int staticidx = 0; |
| 497 | 497 |
| 498 static POINTER_TYPE *pure_alloc P_ ((size_t, int)); | 498 static POINTER_TYPE *pure_alloc (size_t, int); |
| 499 | 499 |
| 500 | 500 |
| 501 /* Value is SZ rounded up to the next multiple of ALIGNMENT. | 501 /* Value is SZ rounded up to the next multiple of ALIGNMENT. |
| 502 ALIGNMENT must be a power of 2. */ | 502 ALIGNMENT must be a power of 2. */ |
| 503 | 503 |
| 1162 #ifndef SYNC_INPUT | 1162 #ifndef SYNC_INPUT |
| 1163 /* When using SYNC_INPUT, we don't call malloc from a signal handler, so | 1163 /* When using SYNC_INPUT, we don't call malloc from a signal handler, so |
| 1164 there's no need to block input around malloc. */ | 1164 there's no need to block input around malloc. */ |
| 1165 | 1165 |
| 1166 #ifndef DOUG_LEA_MALLOC | 1166 #ifndef DOUG_LEA_MALLOC |
| 1167 extern void * (*__malloc_hook) P_ ((size_t, const void *)); | 1167 extern void * (*__malloc_hook) (size_t, const void *); |
| 1168 extern void * (*__realloc_hook) P_ ((void *, size_t, const void *)); | 1168 extern void * (*__realloc_hook) (void *, size_t, const void *); |
| 1169 extern void (*__free_hook) P_ ((void *, const void *)); | 1169 extern void (*__free_hook) (void *, const void *); |
| 1170 /* Else declared in malloc.h, perhaps with an extra arg. */ | 1170 /* Else declared in malloc.h, perhaps with an extra arg. */ |
| 1171 #endif /* DOUG_LEA_MALLOC */ | 1171 #endif /* DOUG_LEA_MALLOC */ |
| 1172 static void * (*old_malloc_hook) P_ ((size_t, const void *)); | 1172 static void * (*old_malloc_hook) (size_t, const void *); |
| 1173 static void * (*old_realloc_hook) P_ ((void *, size_t, const void*)); | 1173 static void * (*old_realloc_hook) (void *, size_t, const void*); |
| 1174 static void (*old_free_hook) P_ ((void*, const void*)); | 1174 static void (*old_free_hook) (void*, const void*); |
| 1175 | 1175 |
| 1176 /* This function is used as the hook for free to call. */ | 1176 /* This function is used as the hook for free to call. */ |
| 1177 | 1177 |
| 1178 static void | 1178 static void |
| 1179 emacs_blocked_free (ptr, ptr2) | 1179 emacs_blocked_free (ptr, ptr2) |
| 1765 | 1765 |
| 1766 #ifdef GC_CHECK_STRING_BYTES | 1766 #ifdef GC_CHECK_STRING_BYTES |
| 1767 | 1767 |
| 1768 static int check_string_bytes_count; | 1768 static int check_string_bytes_count; |
| 1769 | 1769 |
| 1770 static void check_string_bytes P_ ((int)); | 1770 static void check_string_bytes (int); |
| 1771 static void check_sblock P_ ((struct sblock *)); | 1771 static void check_sblock (struct sblock *); |
| 1772 | 1772 |
| 1773 #define CHECK_STRING_BYTES(S) STRING_BYTES (S) | 1773 #define CHECK_STRING_BYTES(S) STRING_BYTES (S) |
| 1774 | 1774 |
| 1775 | 1775 |
| 1776 /* Like GC_STRING_BYTES, but with debugging check. */ | 1776 /* Like GC_STRING_BYTES, but with debugging check. */ |
