[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] aligned memory and posix_memalign
From: |
Josh Blum |
Subject: |
Re: [Discuss-gnuradio] aligned memory and posix_memalign |
Date: |
Tue, 08 Mar 2011 16:41:31 -0800 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Lightning/1.0b2 Thunderbird/3.1.8 |
here is my fix attempt:
http://gnuradio.org/cgit/jblum.git/commit/?h=wip/volk/remove_posix_memalign
-josh
On 03/06/2011 09:08 AM, Tom Rondeau wrote:
> On Sun, Mar 6, 2011 at 9:48 AM, Don Ward <address@hidden> wrote:
>
>> A worrisome (to me) issue with the volk library is the use of
>> posix_memalign() in the qa tests. The worry is:
>>
>> * posix_memalign() will never work on Windows with Microsoft's runtime
>> library *
>>
>> That means that code that uses posix_memalign won't work on Windows with
>> MinGW or Microsoft native compilers. (The problem is not that memory
>> alignment is difficult; it is simply that there is no memory-aligned version
>> of malloc() in the Microsoft API that works with free().)
>>
>> At present, posix_memalign is used in GNU Radio in machine-dependent code
>> (gcell, altivec, and arm7) and in the volk qa tests. If we can replace it
>> in volk and avoid its spread, we can continue to use GNU Radio on Windows.
>>
>> One option is to use something like malloc16Align/free16Align (in
>> malloc16.{h,c}) in gnuradio-core. Can we structure the code to make this
>> available in volk, and anywhere else it is needed? We can add a version to
>> do more general alignment if needed. Would it help to wrap aligned buffers
>> in a C++ class to make it easier to catch errors (such as using free() on a
>> malloc16Align() buffer)?
>>
>> Note that simply enhancing our own missing/posix_memalign function using
>> _mingw_aligned_malloc() or Microsofts's _aligned_malloc() won't work because
>> memory allocated with those cannot be released with free().
>>
>> Trying not to cause too much trouble,
>>
>> -- Don W.
>>
>
>
> Thanks for bringing this up. I'll look into it and we'll try to figure out a
> general solution for all platforms involved.
>
> Tom
>
>
>
>
> _______________________________________________
> Discuss-gnuradio mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/discuss-gnuradio