Ignore:
Timestamp:
Dec 30, 2008, 8:32:00 PM (12 years ago)
Author:
charles
Message:

(trunk libT) have a pool of reusable evbuffers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/bencode.c

    r7524 r7549  
    10441044    char *            ret;
    10451045    struct WalkFuncs  walkFuncs;
    1046     struct evbuffer * out = evbuffer_new( );
     1046    struct evbuffer * out = tr_getBuffer( );
    10471047
    10481048    walkFuncs.intFunc = saveIntFunc;
     
    10561056        *len = EVBUFFER_LENGTH( out );
    10571057    ret = tr_strndup( EVBUFFER_DATA( out ), EVBUFFER_LENGTH( out ) );
    1058     evbuffer_free( out );
     1058
     1059    tr_releaseBuffer( out );
    10591060    return ret;
    10601061}
     
    13181319    struct jsonWalk  data;
    13191320
    1320     data.out = evbuffer_new( );
     1321    data.out = tr_getBuffer( );
    13211322    data.parents = NULL;
    13221323
     
    13341335        *len = EVBUFFER_LENGTH( data.out );
    13351336    ret = tr_strndup( EVBUFFER_DATA( data.out ), EVBUFFER_LENGTH( data.out ) );
    1336     evbuffer_free( data.out );
     1337
     1338    tr_releaseBuffer( data.out );
    13371339    return ret;
    13381340}
Note: See TracChangeset for help on using the changeset viewer.