emacs-devel
[Top][All Lists]
Advanced

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

Re: Emacs 22.1 reproducible crash


From: YAMAMOTO Mitsuharu
Subject: Re: Emacs 22.1 reproducible crash
Date: Wed, 08 Aug 2007 11:32:42 +0900
User-agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.6 Emacs/22.1.50 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI)

>>>>> On Tue, 07 Aug 2007 14:03:51 +0200, Jan Djärv <address@hidden> said:

>> Same thing, slightly different backtrace this time.  I have also
>> noticed that this is triggered much easier when using the mouse to
>> open, and close files.

> I think this might be due to the fact that Glib uses posix_memalign,
> but there is no posix_memalign in gmalloc.c.

Then adding its implementation to gmalloc.c simply work?

                                     YAMAMOTO Mitsuharu
                                address@hidden

Index: src/gmalloc.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/gmalloc.c,v
retrieving revision 1.25
diff -c -p -r1.25 gmalloc.c
*** src/gmalloc.c       7 Aug 2007 08:55:43 -0000       1.25
--- src/gmalloc.c       8 Aug 2007 02:31:42 -0000
*************** memalign (alignment, size)
*** 1857,1862 ****
--- 1857,1891 ----
    return result;
  }
  
+ #ifndef ENOMEM
+ #define ENOMEM 12
+ #endif
+ 
+ #ifndef EINVAL
+ #define EINVAL 22
+ #endif
+ 
+ int
+ posix_memalign (memptr, alignment, size)
+      __ptr_t *memptr;
+      __malloc_size_t alignment;
+      __malloc_size_t size;
+ {
+   __ptr_t mem;
+ 
+   if (alignment % sizeof (__ptr_t) != 0
+       || (alignment & (alignment - 1)) != 0)
+     return EINVAL;
+ 
+   mem = memalign (alignment, size);
+   if (mem == NULL)
+     return ENOMEM;
+ 
+   *memptr = mem;
+ 
+   return 0;
+ }
+ 
  #endif /* Not DJGPP v1 */
  /* Allocate memory on a page boundary.
     Copyright (C) 1991, 92, 93, 94, 96 Free Software Foundation, Inc.




reply via email to

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