[Top][All Lists]

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

Re: [Discuss-gnuradio] Re: [Commit-gnuradio] r10410 -gnuradio/trunk/gnur

From: Michael Dickens
Subject: Re: [Discuss-gnuradio] Re: [Commit-gnuradio] r10410 -gnuradio/trunk/gnuradio-core/src/lib/missing
Date: Tue, 10 Feb 2009 18:27:27 -0500

On Feb 10, 2009, at 11:17 AM, Don Ward wrote:
As far as I can tell, MinGW has no standard aligned-memory allocation functions. Can we use malloc16.c (in gnuradio-core/.../ general) or something like gcell/lib/runtime/gc_aligned_alloc.cc instead?

malloc16.c requires the use of both the specific allocating (malloc16Align () and calloc16Align ()) and freeing (free16Align ()) routines to do what it does, but it would work (even though it might waste a bit of memory when allocating, in order to guarantee both alignment as well as a means for storing the actual allocated pointer value) ... This could be an option for certain issues.

gc_aligned_alloc () uses posix_memalign (), so that's not an option.

A better solution makes use of some built-in memory-alloc-with- alignment function and uses the standard "free ()" to dealloc. That's what the posix_memalign () function is meant to, and currently does, provide.

The best way to do this would be to add on to the posix_memalign.cc file for the specific OS and how it does allocating. Use the AC_CHECK_HEADER macro to check for the correct headers, then AC_CHECK_FUNCS to make sure the functions exist and are callable. Then #ifdef around the appropriate functions after the end of HAVE_VALLOC in posix_memalign.cc for how this OS does it.

As I don't have MinGW installed, I can't be of more use than these general recommendations. Hope they help! - MLD

reply via email to

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