[Cbe-oss-dev] memalign weirdness in newlib
Patrick Mansfield
patmans at us.ibm.com
Fri Jan 4 04:25:49 EST 2008
On Thu, Jan 03, 2008 at 06:16:41PM +0100, Goffredo Marocchi wrote:
> I was referring to the functions located in libmisc.h (provided with
> the CELL SDK).
>
> http://www.cag.csail.mit.edu/ps3/cellminiref.shtml
>
> ""Dynamic allocation
>
> malloc on the SPEs allocates memory that is 8-byte aligned. To
> allocate memory with larger alignments (on both the SPU and PPU), use
> malloc_align:
>
> void *malloc_align(size_t size, unsigned int n)
>
> which allocates memory that is 2n-byte aligned (free this memory using
> free_align). To use malloc_align/free_align, you must #include
> <libmisc.h> and link with libmisc (add -lmisc to the IMPORTS variable
> in your SPU program makefile).""
>
> It would be helpful to know if those functions suffer of the same
> problem as memalign and free do when used in conjunction.
Those should work fine, since they just call malloc() and free().
-- Patrick Mansfield
More information about the cbe-oss-dev
mailing list