View Single Post
Re: First beta release of YaPB 2
Old
  (#11)
jeefo
путинхуйлоебаное
 
jeefo's Avatar
 
Status: Offline
Posts: 453
Join Date: Nov 2005
Location: Saint-Petersburg
Default Re: First beta release of YaPB 2 - 19-05-2006

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 (szTextStrszCpy); 
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
  
Reply With Quote