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 13:30:53 +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 23:31:12 -0400, Stefan Monnier <address@hidden> said:

>> + 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;
>> + }

> Can the result be freed by passing it to `free'?
> That's a very important part of the spec.

Yes.  The function `memalign', which is also implemented in gmalloc.c,
records the original return value of `malloc' in the linear list
starting from `_aligned_blocks', and `free' looks through it first.

                                     YAMAMOTO Mitsuharu
                                address@hidden




reply via email to

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