discuss-gnuradio
[Top][All Lists]
Advanced

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

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


From: Don Ward
Subject: Re: [Discuss-gnuradio] Re: [Commit-gnuradio] r10410 -gnuradio/trunk/gnuradio-core/src/lib/missing
Date: Wed, 11 Feb 2009 08:26:44 -0500


Michael Dickens wrote:


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.

Agreed, but as far as I can tell, Windows does not have an aligned memory allocation function that works with free() so this solution is not available.

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.

How about a test to automatically disable components that require posix_memalign during configuration?

Thanks,

-- Don W.





reply via email to

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