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

version» Context lines:

pike.git/src/modules/_Stdio/buffer.cmod:17:   #include "cyclic.h"   #include "backend.h"   #include "fd_control.h"   #include "file_machine.h"   #include "file.h"   #include "whitespace.h"   #include "pike_types.h"   #include "pike_threadlib.h"   #include "buffer.h"   #include "module_support.h" + #include "bitvector.h"      /* Includes <gmp.h> */   #include "bignum.h"      #ifdef HAVE_ARPA_INET_H   #include <arpa/inet.h>   #endif /* HAVE_ARPA_INET_H */      #define DEFAULT_CMOD_STORAGE static   DECLARATIONS
pike.git/src/modules/_Stdio/buffer.cmod:271:    {    memmove( io->buffer, io_read_pointer(io), io_len(io) );    io->num_move++;    io->len -= io->offset;    io->offset = 0;    }    }       if( UNLIKELY(io->len + bytes > io->allocated) )    { -  size_t new_len = io->allocated; +  size_t new_len;    -  do -  new_len = ((new_len+32)*2)-32; -  while( new_len < io->len + bytes ); + #if SIZEOF_CHARP == 8 +  new_len = round_up64(io->len+bytes); + #else +  new_len = round_up32(io->len+bytes); + #endif +  if( !new_len ) +  Pike_error(msg_out_of_mem_2, io->len+bytes);       io->buffer = xrealloc( io->buffer, new_len );    io->num_malloc++;    io->allocated = new_len;    }    return io->buffer+io->len;    }       static unsigned char *io_add_space( Buffer *io, size_t bytes, int force )    {