aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 0e68817629c..9589ae05e95 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -82,6 +82,8 @@ extern POINTER_TYPE *sbrk ();
82 82
83extern size_t _bytes_used; 83extern size_t _bytes_used;
84extern size_t __malloc_extra_blocks; 84extern size_t __malloc_extra_blocks;
85extern void *_malloc_internal (size_t);
86extern void _free_internal (void *);
85 87
86#endif /* not DOUG_LEA_MALLOC */ 88#endif /* not DOUG_LEA_MALLOC */
87 89
@@ -314,7 +316,6 @@ static Lisp_Object Vdead;
314#ifdef GC_MALLOC_CHECK 316#ifdef GC_MALLOC_CHECK
315 317
316enum mem_type allocated_mem_type; 318enum mem_type allocated_mem_type;
317static int dont_register_blocks;
318 319
319#endif /* GC_MALLOC_CHECK */ 320#endif /* GC_MALLOC_CHECK */
320 321
@@ -391,8 +392,13 @@ static int live_misc_p (struct mem_node *, void *);
391static void mark_maybe_object (Lisp_Object); 392static void mark_maybe_object (Lisp_Object);
392static void mark_memory (void *, void *); 393static void mark_memory (void *, void *);
393static void mem_init (void); 394static void mem_init (void);
395#if (defined GC_MALLOC_CHECK \
396 ? !defined SYSTEM_MALLOC && !defined SYNC_INPUT \
397 : GC_MARK_STACK)
398# define NEED_MEM_INSERT
394static struct mem_node *mem_insert (void *, void *, enum mem_type); 399static struct mem_node *mem_insert (void *, void *, enum mem_type);
395static void mem_insert_fixup (struct mem_node *); 400static void mem_insert_fixup (struct mem_node *);
401#endif
396static void mem_rotate_left (struct mem_node *); 402static void mem_rotate_left (struct mem_node *);
397static void mem_rotate_right (struct mem_node *); 403static void mem_rotate_right (struct mem_node *);
398static void mem_delete (struct mem_node *); 404static void mem_delete (struct mem_node *);
@@ -1223,6 +1229,10 @@ static void (*old_free_hook) (void*, const void*);
1223# define BYTES_USED _bytes_used 1229# define BYTES_USED _bytes_used
1224#endif 1230#endif
1225 1231
1232#ifdef GC_MALLOC_CHECK
1233static int dont_register_blocks;
1234#endif
1235
1226static size_t bytes_used_when_reconsidered; 1236static size_t bytes_used_when_reconsidered;
1227 1237
1228/* Value of _bytes_used, when spare_memory was freed. */ 1238/* Value of _bytes_used, when spare_memory was freed. */
@@ -3571,6 +3581,8 @@ mem_find (void *start)
3571} 3581}
3572 3582
3573 3583
3584#ifdef NEED_MEM_INSERT
3585
3574/* Insert a new node into the tree for a block of memory with start 3586/* Insert a new node into the tree for a block of memory with start
3575 address START, end address END, and type TYPE. Value is a 3587 address START, end address END, and type TYPE. Value is a
3576 pointer to the node that was inserted. */ 3588 pointer to the node that was inserted. */
@@ -3718,6 +3730,8 @@ mem_insert_fixup (struct mem_node *x)
3718 mem_root->color = MEM_BLACK; 3730 mem_root->color = MEM_BLACK;
3719} 3731}
3720 3732
3733#endif /* NEED_MEM_INSERT */
3734
3721 3735
3722/* (x) (y) 3736/* (x) (y)
3723 / \ / \ 3737 / \ / \