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

Philip Pratt-Szeliga phil.pratt.szeliga at gmail.com
Sun Oct 11 00:13:32 EST 2009


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


More information about the cbe-oss-dev mailing list