pike.git / src / modules / _Stdio / file.c

version» Context lines:

pike.git/src/modules/_Stdio/file.c:667:    int all,    int *err)   {    ONERROR ebuf;    ptrdiff_t bytes_read, i;    INT32 try_read;    bytes_read=0;    *err=0;       if(r <= DIRECT_BUFSIZE || -  (all && (r<<1) > r && (((r-1)|r)+1)!=(r<<1))) /* r<<1 != power of two */ +  (all && !INT32_MUL_OVERFLOW(r, 2) && (((r<<1)-1)&(r<<1)))) /* r<<1 != power of two */    {    struct pike_string *str;       i=r;       str=begin_shared_string(r);       SET_ONERROR(ebuf, do_free_unlinked_pike_string, str);       do{
pike.git/src/modules/_Stdio/file.c:756:    *    * The slowdowns most likely are because of memory validation    * done by the kernel for buffer space which is later unused    * (short read) /srb    */    dynamic_buffer b;       b.s.str=0;    initialize_buf(&b);    SET_ONERROR(ebuf, free_dynamic_buffer, &b); -  i = all && (r<<1)>r ? DIRECT_BUFSIZE : READ_BUFFER; +  i = all && !INT32_MUL_OVERFLOW(r, 2) ? DIRECT_BUFSIZE : READ_BUFFER;    do{    int e;    char *buf;       try_read = i;       buf = low_make_buf_space(try_read, &b);       THREADS_ALLOW();    i = fd_read(fd, buf, try_read);