[Cbe-oss-dev] Memalign and free doesn't work

Phil Pratt-Szeliga pcpratts at syr.edu
Mon Oct 12 01:18:06 EST 2009


Well this is causing me to run out of memory.  Isn't this wrong in
standard unix then too?

Phil

On Sun, Oct 11, 2009 at 2:36 AM, W <w.l.fischer at googlemail.com> wrote:
> Hi Phillip,
>
> nearly the same on standard linux:
>
> $ ./a.out
> MemUsage: 0
> MemUsage: 135168
> $ uname -a
> Linux z4 2.6.26-1-686 #1 SMP Fri Mar 13 18:08:45 UTC 2009 i686 GNU/Linux
>
> Willem
>
> On Sat, Oct 10, 2009 at 3:13 PM, Philip Pratt-Szeliga
> <phil.pratt.szeliga at gmail.com> wrote:
>> Hello,
>>
>> I am noticing that memalign and free doesn't work on the ps3.
>>
>> code:
>> =======================
>> #include <malloc.h>
>>
>> static void printMemUsage()
>> {
>>  struct mallinfo mi;
>>  mi = mallinfo();
>>  printf("MemUsage: %d\n", mi.arena);
>> }
>>
>> int main(unsigned long long spe_id, unsigned long long
>> program_data_ea, unsigned long long env)
>> {
>>  printMemUsage();
>>  void * triangles_local_mem = memalign(16, 65535);
>>  free(triangles_local_mem);
>>  printMemUsage();
>>  return 0;
>> }
>> =======================
>>
>> compile:
>> spu-gcc cell_function.c
>>
>> results:
>> #./a.out
>> MemUsage: 0
>> MemUsage: 68848
>> #
>>
>> Am I doing something wrong?
>>
>> -Phil
>> _______________________________________________
>> cbe-oss-dev mailing list
>> cbe-oss-dev at lists.ozlabs.org
>> https://lists.ozlabs.org/listinfo/cbe-oss-dev
>>
>


More information about the cbe-oss-dev mailing list