From 3b01c2ca8e1d832ef2d73af8d08cc7fdbeb63fc7 Mon Sep 17 00:00:00 2001 From: Pip Cet Date: Tue, 17 Mar 2026 10:50:36 +0000 Subject: [PATCH] [MPS] Allocate shelved bidi caches ambiguously * src/bidi.c (bidi_shelve_cache) [MPS]: Use 'igc_xzalloc_ambig'. (bidi_unshelve_cache) [MPS]: Use 'igc_xfree'. --- src/bidi.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/bidi.c b/src/bidi.c index f4bca186177..a266007b379 100644 --- a/src/bidi.c +++ b/src/bidi.c @@ -246,6 +246,7 @@ along with GNU Emacs. If not, see . */ #include "dispextern.h" #include "region-cache.h" #include "sysstdio.h" +#include "igc.h" static bool bidi_initialized = 0; @@ -996,7 +997,11 @@ bidi_shelve_cache (void) alloc = (bidi_shelve_header_size + bidi_cache_idx * sizeof (struct bidi_it)); +#ifdef HAVE_MPS + databuf = igc_xzalloc_ambig (alloc); +#else databuf = xmalloc (alloc); +#endif bidi_cache_total_alloc += alloc; memcpy (databuf, &bidi_cache_idx, sizeof (bidi_cache_idx)); @@ -1095,7 +1100,11 @@ bidi_unshelve_cache (void *databuf, bool just_free) + bidi_cache_idx * sizeof (struct bidi_it)); } +#ifdef HAVE_MPS + igc_xfree (p); +#else xfree (p); +#endif } }