From ba63a174795188148b5f80b499da721c27f49c17 Mon Sep 17 00:00:00 2001 From: Pip Cet Date: Tue, 17 Mar 2020 13:51:31 +0000 Subject: [PATCH] more debugging --- src/alloc.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/alloc.c b/src/alloc.c index 469c4445bb..0016d75689 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -711,6 +711,8 @@ xmalloc (size_t size) if (!val && size) memory_full (size); MALLOC_PROBE (size); + if (val) + memset (val, 0xaa, size); return val; } @@ -1301,7 +1303,10 @@ lmalloc (size_t size) { void *p = malloc (size); if (laligned (p, size)) - return p; + { + memset (p, 0x5a, size); + return p; + } free (p); size_t bigger = size + LISP_ALIGNMENT; if (size < bigger) @@ -3095,6 +3100,7 @@ sweep_vectors (void) #ifndef GC_MALLOC_CHECK mem_delete (mem_find (block->data)); #endif + memset (block, 0x55, VECTOR_BLOCK_BYTES); xfree (block); } else @@ -3140,6 +3146,7 @@ #define VECTOR_ELTS_MAX \ static struct Lisp_Vector * allocate_vectorlike (ptrdiff_t len) { + eassert (!gc_in_progress); eassert (0 < len && len <= VECTOR_ELTS_MAX); ptrdiff_t nbytes = header_size + len * word_size; struct Lisp_Vector *p; @@ -5869,6 +5876,8 @@ garbage_collect (void) if (garbage_collection_inhibited) return; + eassert (!gc_in_progress); + /* Record this function, so it appears on the profiler's backtraces. */ record_in_backtrace (QAutomatic_GC, 0, 0); -- 2.25.1