[Kamailio-Devel] [SR-Dev] static buffers

Daniel-Constantin Mierla miconda at gmail.com
Thu Nov 27 17:27:01 CET 2008


On 11/27/08 17:51, Andrei Pelinescu-Onciul wrote:
> On Nov 27, 2008 at 16:22, Henning Westerholt <henning.westerholt at 1und1.de> wrote:
>   
>> On Thursday 27 November 2008, Daniel-Constantin Mierla wrote:
>>     
>>> There seem to be many places where static buffers are used for building
>>> strings. It is clear they are used just for usage inside some functions,
>>> with no need to keep the value for usage somewhere else.
>>>
>>> Would defining a global static buffer to be used for such cases make
>>> sense? The access to the pointer and size can be given via functions.
>>>
>>> There could be couple of such buffers to be used in the cases one
>>> function need concurrent access to more than one ... opinions? It will
>>> reduce memory space reserved and used...
>>>       
>> Hi Daniel,
>>
>> what about getting rid of this static buffers completely? If we want to go 
>> multi-threaded sometimes,

he, he ... let's look closer in the future ... and from management 
perspective looks easier if they are collected in one place.


>>  we need to lock every access. And i doubt it really 
>> makes a difference from the performance POV nowadays. The only issue i could 
>> think of is eventual memory fragementation..
>>     
>
> We could use buffers on the stack as much as possible (we don't need to
> pkg_malloc all the buffers).
>   
yes, but is it advisable to do it with big buffers ... ?

Cheers,
Daniel

-- 
Daniel-Constantin Mierla
http://www.asipto.com




More information about the Devel mailing list