Make dll less biggger is not a point to use dynamic memory allocation. Dynamic memory allocation allows to save memory at runtime (ie. RAM). Currently yapb2 uses old method for storing language translations, ie. there are predefined arrays of chars that uses constant array size (512), whatever the size of the string stored in this array.
Currently yapb2 uses something like that:
PHP Code:
char szTextStr[512];
char szCpy[] = "this is string";
strcpy (szTextStr, szCpy);
So the source string has length = 14, and allocated size = 512, so we waste 498 bytes of memory.
And the original yapb uses something like that:
PHP Code:
char *szTextStr;
char szCpy[] = "this is string";
szTextStr = strdup (szCpy);
In this way we waste nothing