• Giuseppe Ottaviano's avatar
    Optimize getline(istream&, fbstring&) implementation · 116f13d8
    Giuseppe Ottaviano authored
    Summary:
    Current `getline` implementation in `fbstring` always allocates, even if the passed string is already large enough. Furthermore, the growing strategy relies on outdated assumptions about the allocator.
    This implementation reuses the existing allocation as much as possible, then uses exponential growth.
    
    Reviewed By: luciang, philippv
    
    Differential Revision: D2871976
    
    fb-gh-sync-id: 8db9512030be3f4953efa8f008747827504c032c
    116f13d8
FBStringTestBenchmarks.cpp.h 7.76 KB