This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

access c++ objects / structs in shared memory

hi all

consider the following pseudo code snippet for a GPP side application:

Uint16* DataBufPtr = 0;

// there are various types of structs / classes defined:

typedef struct myObj1{

int a, short b, int c;

} MyObj1;

typedef struct myObj2{

char x, float y[1000];

} MyObj2;

Class A;

// allocate a large buffer (which shall be used "heap-like")

POOL_alloc(0, DataBufPtr, 1MB);

// inside that buffer, place different kind of objects

MyObj1* obj1 = DataBufPtr[1000];

MyObj2* obj1 = DataBufPtr[2000];

A* a = DataBufPtr[3000];

// fill the objects' content

obj1->a = 1; obj1->b = 2; obj1->c = 3;

obj2->x = 'x'; obj2->y = { ... }


Question:

How would the DSP application be able to access such objects? Can you (resp. have to?) do a POOL_writeback(0, obj1, sizeof(MyObj1))? Or does POOL_writeback() only work on a complete POOL buffer? Or can you also write back only parts of an allocated buffer (maybe the parts must be DSP cache aligned)?

The same question applies to POOL_translateAddr: Does it work on any address inside a pool buffer or only on the start address of a buffer?


My general idea:

How would it be possible to make something like a "shared memory heap" where i can place objects (as described above) from the GPP side and then read / write these object from the DSP side too?

 

Any advices are very welcome! Thx.