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

version» Context lines:

pike.git/src/modules/_Stdio/buffer.h:1:   struct _Buffer   {    unsigned char *buffer;       size_t offset; /* reading */    size_t len, allocated; /* writing */       struct object *this;    struct program *error_mode; +  struct _Buffer *child;       union {    struct pike_string *str; /* PIKE_T_STRING */    struct object *obj; /* PIKE_T_OBJECT */ -  struct _Buffer *parent; /* PIKE_T_MIXED */ +  struct _Buffer *parent; /* PIKE_T_RING */    } source;    INT32 sourcetype; /* type for the source union */ -  INT32 locked, locked_move; +  INT32 locked_move;    float max_waste;       struct svalue output;      #ifdef PIKE_DEBUG    INT32 num_malloc, num_move; /* debug mainly, for testsuite*/   #endif   };      struct rewind_to {
pike.git/src/modules/_Stdio/buffer.h:49:      PIKE_UNUSED_ATTRIBUTE   static unsigned char *io_read_pointer(Buffer *io)   {    return io->buffer + io->offset;   }      PIKE_UNUSED_ATTRIBUTE   static unsigned char *io_add_space( Buffer *io, size_t bytes, int force )   { -  if (LIKELY(!io->locked)) { +  if (LIKELY(!io->child)) {    if (UNLIKELY(io->len == io->offset) && LIKELY(!io->locked_move))    io->offset = io->len = 0;    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 );   }      PIKE_UNUSED_ATTRIBUTE