Changeset 13154


Ignore:
Timestamp:
Jan 10, 2012, 7:18:18 PM (10 years ago)
Author:
jordan
Message:

(trunk libT) #4700 "compilation fails on FreeBSD because it can't find alloca.h" -- fixed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/peer-msgs.c

    r12921 r13154  
    1616#include <stdlib.h>
    1717#include <string.h>
    18 
    19 #include <alloca.h>
    2018
    2119#include <event2/buffer.h>
     
    17491747        int n;
    17501748        const int numwant = msgs->desiredRequestCount - msgs->peer->pendingReqsToPeer;
    1751         tr_block_index_t * blocks = alloca( sizeof( tr_block_index_t ) * numwant );
     1749        tr_block_index_t * blocks = tr_new( tr_block_index_t, numwant );
    17521750
    17531751        tr_peerMgrGetNextRequests( msgs->torrent, msgs->peer, numwant, blocks, &n, false );
     
    17591757            protocolSendRequest( msgs, &req );
    17601758        }
     1759
     1760        tr_free( blocks );
    17611761    }
    17621762}
Note: See TracChangeset for help on using the changeset viewer.