> optional third parameter "minsize" which sets the minimum amount 
of 
> memory reserved for each element.  

Correct

> 
> Is this memory in bytes? bits? kb? 

bytes.
>> "If you specify minsize, all elements will be allocated at least 
this 
> much memory, which will be re-used if any new string is written to 
the 
> element which requires no more memory."
> 
> I don't really follow the 2nd bit of that sentence...  memory is 
re-used 
> if a single element requires no more memory & a new string is 
written to 
> it??  Does that mean the element's value get overwritten?
>

Correct.
With minsize of 8, 
vec[1] ="1234"  ;; 8 bytes allocated, five used (zero byte at end)
vec[1] = "123456"  ;; re-used the same 8 bytes
vec[1] = "1234567890123" ;; now first 8 bytes freed, new 14 bytes 
buffer allocated

Vec plugin will also shrink allocated memory in some circumstances 
if an element with a large allocatoin is re-assigned a much smaller 
string.

The idea is to avoid excessive calls to system memory allocator.  









------------------------ Yahoo! Groups Sponsor --------------------~--> 
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/u8TY5A/tzNLAA/yQLSAA/JV_rlB/TM
--------------------------------------------------------------------~-> 

Attention: PowerPro's Web site has moved: http://www.ppro.org 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/power-pro/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to