[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFE] function to read a file descriptor
From: |
Ralf Wildenhues |
Subject: |
Re: [RFE] function to read a file descriptor |
Date: |
Tue, 19 Aug 2008 22:18:33 +0200 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
Hello Debarshi,
* Debarshi Ray wrote on Tue, Aug 19, 2008 at 05:29:28AM CEST:
> > *buffer = realloc (*buffer, *size);
>
> Oops, I meant to use xrealloc there.
FWIW, your current algorithm of adding BUFSIZ to size causes nonlinear
amount of work done in realloc, for reading large files. You might
want to increase memory by a constant factor or BUFSIZ, whichever is
larger (e.g., just like read-file does), and thus less often than you
recv.
Cheers,
Ralf
- [RFE] function to read a file descriptor, Debarshi Ray, 2008/08/18
- Re: [RFE] function to read a file descriptor, Bruno Haible, 2008/08/18
- Re: [RFE] function to read a file descriptor, Debarshi Ray, 2008/08/18
- Re: [RFE] function to read a file descriptor,
Ralf Wildenhues <=
- Re: [RFE] function to read a file descriptor, Debarshi Ray, 2008/08/19
- Re: [RFE] function to read a file descriptor, Ralf Wildenhues, 2008/08/20
- Re: [RFE] function to read a file descriptor, Debarshi Ray, 2008/08/20
- Re: [RFE] function to read a file descriptor, Bruno Haible, 2008/08/20
- Re: [RFE] function to read a file descriptor, Debarshi Ray, 2008/08/21
- Re: [RFE] function to read a file descriptor, Bruno Haible, 2008/08/21
- Re: [RFE] function to read a file descriptor, Ralf Wildenhues, 2008/08/21