adl_memRelease question

Hi all,

I am trying to release an array, but when i perform the adl_memRelease, I get RTK exception 155.

ascii rsp[100];

…code, etc

adl_memRelease(rsp);

Can I only release non-array variables? Those don’t come up with any errors when released, but arrays seem to.

Please help me to understand this…

You can only release dynamically-allocated memory; you cannot release variables!

It’s obvious when I think about it!

Thanks

Hiya,

Try something like this instead of using stack arrays:

void myFunction()
{
    u8 *myArray;

    myArray = adm_memGet(sizeof(u8) * 100);

    // use array in code

    adl_memRelease(myArray);

    return;
}

This will assign the memory from the heap, rather than the stack (which is relatively small as you have defined the size in your main file somewhere).

ciao, Dave

Thanks for that, Dave