• Erik Verbruggen's avatar
    C++: pre-allocate the output buffer. · 2d500117
    Erik Verbruggen authored
    This prevents a whole lot of re-allocations when the output byte array
    needs to grow. It also prevents some heap fragmentation for big files.
    
    Because the preprocessed output is short lived (it will be parsed
    immediately after, and then discarded), it is not squeezed to the
    minimal size. This would result in another allocation.
    
    Change-Id: I4974be5144f88cdfc4ddc9d8330200725aa90803
    Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
    Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
    2d500117
pp-engine.cpp 69.9 KB