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

version» Context lines:

pike.git/src/modules/_Stdio/buffer.cmod:298:    {    Buffer *cp = io, *lc;    while (UNLIKELY((lc = cp->child) != io && lc)) {    cp = lc;    cp->source.parent = newbuffer;    locks++;    }    }    oldobj = io->this;    oldobj->refs -= locks; /* Swap refs too */ +  assert(oldobj->refs > 0);    newobj->refs += locks - 1; /* Compensate for initial copy */ -  +  assert(newobj->refs > 0);    ptmp = newbuffer->buffer; /* Swap buffers */    newbuffer->buffer = io->buffer;    io->buffer = ptmp;    newbuffer->child = io->child;    io->child = 0;    io->offset = newbuffer->offset;    io->len = newbuffer->len;    io->allocated = newbuffer->allocated;    } else {    io->buffer = xrealloc( io->buffer, io->allocated + growth );