EvilInteractive / happy-engine

Automatically exported from code.google.com/p/happy-engine
GNU Lesser General Public License v3.0
2 stars 1 forks source link

Scratch buffer #14

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Now for every call to sprintf or a temporary buffer copy we need to make a new 
buffer. Sometimes this is possible on stack but other times it needs to be 
dynamic allocated. If we made a per thread scratch buffer of a reasonably big 
size, we could use this one as temp buffer. Then there is no more need for all 
those different temporary buffers. 

The scope of this buffer is very small, if you call a method in between the 
copy and read there is a chance the buffer is already overridden.

Nevertheless it could improve performance (dynamic memory allocation is heavy)  
and counter memory fragmentation

Original issue reported on code.google.com by bastian.damman on 17 Jun 2012 at 4:47