pike.git / src / modules / Pipe / pipe.c

version» Context lines:

pike.git/src/modules/Pipe/pipe.c:108:   #define MAX_BYTES_IN_BUFFER 65536      /*! @module Pipe    *!    *! Single socket output.    *!    *! Regular file output and (multiple, adding) socket output    *! with no mmap input.    *!    *! Multiple socket output without regular file output illegal. +  *! +  *! @note +  *! It is preferable to use the @[Shuffler] API, it is significantly +  *! more flexible.    */      static struct program *pipe_program, *output_program;      #ifdef THIS   #undef THIS   #endif   #define THIS ((struct pipe *)(Pike_fp->current_storage))   #define THISOBJ (Pike_fp->current_object)   
pike.git/src/modules/Pipe/pipe.c:568: Inside #if defined(HAVE_MMAP) && defined(HAVE_MUNMAP)
   this->pos += this->firstinput->len;    input_finish();    continue;    }    len = this->firstinput->len + this->pos - pos;    if (len > READ_BUFFER_SIZE) len=READ_BUFFER_SIZE;    tmp = begin_shared_string( len );    src = this->firstinput->u.mmap + pos - this->pos;   /* This thread_allow/deny is at the cost of one extra memory copy */    THREADS_ALLOW(); -  MEMCPY(tmp->str, src, len); +  memcpy(tmp->str, src, len);    THREADS_DISALLOW();    return end_shared_string(tmp);    }    else   #endif    if (this->firstinput->type!=I_OBJ)    {    /* FIXME: What about I_BLOCKING_OBJ? */    input_finish(); /* shouldn't be anything else ... maybe a finished object */    }
pike.git/src/modules/Pipe/pipe.c:1250:    free_svalue(& p->output_closed_callback);    free_svalue(& p->id);       SET_SVAL_TYPE(p->done_callback, T_INT);    SET_SVAL_TYPE(p->output_closed_callback, T_INT);    SET_SVAL_TYPE(p->id, T_INT);       /* p->done=0; */   }    - static void init_pipe_struct(struct object *UNUSED(o)) + static void init_pipe_struct(struct object *DMALLOCUSED(o))   {    debug_malloc_touch(o);       THIS->firstbuffer=THIS->lastbuffer=NULL;    THIS->firstinput=THIS->lastinput=NULL;    THIS->firstoutput=NULL;    THIS->bytes_in_buffer=0;    THIS->pos=0;    THIS->sleeping=0;    THIS->done=0;