Changeset 10159


Ignore:
Timestamp:
Feb 11, 2010, 12:53:50 AM (12 years ago)
Author:
charles
Message:

(trunk libt) when generating json/benc strings, preallocate some space in the evbuffer to avoid excess realloc()s

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/bencode.c

    r10091 r10159  
    15811581{
    15821582    evbuffer_drain( buf, EVBUFFER_LENGTH( buf ) );
     1583    evbuffer_expand( buf, 4096 ); /* alloc a little memory to start off with */
    15831584
    15841585    switch( mode )
Note: See TracChangeset for help on using the changeset viewer.