pike.git / src / modules / _Stdio / buffer.cmod

version» Context lines:

pike.git/src/modules/_Stdio/buffer.cmod:287:    Pike_error(msg_out_of_mem_2, io->allocated+growth );    io->buffer = new_ptr;    io->num_malloc++;    io->allocated += growth;    }    return io->buffer+io->len;    }       static unsigned char *io_add_space( Buffer *io, size_t bytes, int force )    { -  if( io->len == io->offset ) +  if (LIKELY(!io->locked)) { +  if (UNLIKELY(io->len == io->offset) && LIKELY(!io->locked_move))    io->offset = io->len = 0; -  if( !force && io->malloced && !io->locked && io->len+bytes < io->allocated && -  (!bytes || io->len+bytes > io->len)) +  if (LIKELY(!force && io->len+bytes < io->allocated +  && io->len+bytes >= io->len))    return io->buffer+io->len; -  +  }    return io_add_space_do_something( io, bytes, force );    }       /*! @decl protected bool range_error( int howmuch )    *!    *! This function is called when an attempt is made to read out of bounds.    *!    *! The default implementation simply returns @expr{0@} (zero).    *!    *! Override this function to change the behavior.