Changeset 10277


Ignore:
Timestamp:
Feb 23, 2010, 7:29:21 AM (12 years ago)
Author:
charles
Message:

(trunk libT) use tr_valloc() in a couple of places where we allocate largish, short-term buffers

Location:
trunk/libtransmission
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/makemeta.c

    r10239 r10277  
    209209        return ret;
    210210
    211     buf = tr_new( uint8_t, b->pieceSize );
     211    buf = tr_valloc( b->pieceSize );
    212212    b->pieceIndex = 0;
    213213    totalRemain = b->totalSize;
  • trunk/libtransmission/utils.c

    r10275 r10277  
    14291429    out = tr_open_file_for_writing( newpath );
    14301430    buflen = stat( newpath, &st ) ? 4096 : st.st_blksize;
    1431     buf = tr_new( char, buflen );
     1431    buf = tr_valloc( buflen );
    14321432    while( bytesLeft > 0 )
    14331433    {
Note: See TracChangeset for help on using the changeset viewer.