Page 1 of 1

StringArray memory management

Posted: Mon Dec 30, 2013 8:26 am
by GJ-68
Hello,

Some functions in my UserLibs (in C) populate a String Array exactly as does 'ExtractRegularExpression'.
I don't use any PB Sting function in this case, it's a TCHAR** mapped to the Address member in the PB_Array structure.
Something like this:

Code: Select all

M_PBFUNCTION(integer) PB_TestFunction(PB_Array *pArray)
{
  integer **ppArrayBase;
  TCHAR **ppSzArray;
  integer iNumItems;
  ...
  ...
  pArray--;
  ppArrayBase = (integer**)pArray->Address;
  SYS_ReAllocateArray(iNumItems, ppArrayBase);
  ppSzArray = (TCHAR**)*ppArrayBase;
  ...
  ...
}
As I manage the memory used for the null terminated strings myself, my question is:
Does PureBasic's string management try to release some memory in this case ?

Thanks.