emacs-diffs
[Top][All Lists]
Advanced

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

scratch/igc fe6849068fc 3/7: Allow unaligned-size allocations in igc_xza


From: Pip Cet
Subject: scratch/igc fe6849068fc 3/7: Allow unaligned-size allocations in igc_xzalloc_ambig
Date: Sat, 13 Jul 2024 14:58:30 -0400 (EDT)

branch: scratch/igc
commit fe6849068fcce4ff9df4dd4ae04d4687b219147c
Author: Pip Cet <pipcet@protonmail.com>
Commit: Pip Cet <pipcet@protonmail.com>

    Allow unaligned-size allocations in igc_xzalloc_ambig
    
    * src/igc.c (igc_xzalloc_ambig): Increase size argument so it's aligned.
---
 src/igc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/igc.c b/src/igc.c
index e39aa70d1d7..c3e3c55f182 100644
--- a/src/igc.c
+++ b/src/igc.c
@@ -2947,6 +2947,8 @@ igc_xzalloc_ambig (size_t size)
   /* Not sure if xzalloc can ever return NULL here, depending on all the
      config options involved. Also not sure when it returns non-null for
      size 0. It does for me on macOS. */
+  while (size % IGC_ALIGN_DFLT)
+    size++;
   void *p = xzalloc (size);
   if (p == NULL)
     return NULL;



reply via email to

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