emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: scratch/hash-table-perf 2d28042f56a 19/35: Use non-Lisp allocation f


From: Dmitry Gutov
Subject: Re: scratch/hash-table-perf 2d28042f56a 19/35: Use non-Lisp allocation for internal hash-table vectors
Date: Thu, 4 Jan 2024 19:32:59 +0200
User-agent: Mozilla Thunderbird

On 04/01/2024 17:56, Mattias EngdegÄrd wrote:
+/* Like xmalloc, but makes allocation count toward the total consing.
+   Return NULL for a zero-sized allocation.  */
+void *
+hash_table_alloc_bytes (ptrdiff_t nbytes)
+{
+  if (nbytes == 0)
+    return NULL;
+  tally_consing (nbytes);
+  return xmalloc (nbytes);
+}

Sorry if it's a stupid question, but if the operation doesn't add any Lisp "garbage", why increase the consing counter? That is likely triggers more GCs earlier which otherwise might not run, and if there are no slots to GC, it seems like they would run in vain.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]