pike.git / src / builtin.cmod

version» Context lines:

pike.git/src/builtin.cmod:2911:    *! .. call add several times in code ...    *!    *! string result = b->get(); // also clears the buffer    *! @endcode    */   PIKECLASS Buffer   {    CVAR struct string_builder str;    CVAR int initial;    +  PIKEFUN int _size_object() +  { +  if( THIS->str.s ) +  RETURN THIS->str.malloced; +  RETURN 0; +  } +     void f_Buffer_get_copy( INT32 args );    void f_Buffer_get( INT32 args );    void f_Buffer_add( INT32 args );       /*! @decl void create(int initial_size)    *!    *! Initializes a new buffer.    *!    *! If no @[initial_size] is specified, 256 is used. If you    *! know approximately how big the buffer will be, you can optimize
pike.git/src/builtin.cmod:3377:    *! applied. The Replace object is used internally by the Pike    *! optimizer and need not be used manually.    */   PIKECLASS multi_string_replace   {    CVAR struct replace_many_context ctx;    /* NOTE: from and to are only kept for _encode()'s use. */    PIKEVAR array from flags ID_PROTECTED;    PIKEVAR array to flags ID_PROTECTED;    +  PIKEFUN int _size_object() +  { +  int res = 0, i; +  if( THIS->ctx.v ) +  { +  for( i=0; i<THIS->ctx.num; i++ ) +  res += sizeof(struct replace_many_tupel) + +  rec_size_svalue(THIS->ctx.v[i].ind,NULL) + +  rec_size_svalue(THIS->ctx.v[i].val,NULL); +  } +  +  RETURN res; +  } +     /*! @decl void create(array(string)|mapping(string:string)|void from, @    *! array(string)|string|void to)    */    PIKEFUN void create(array(string)|mapping(string:string)|void from_arg,    array(string)|string|void to_arg)    {    if (THIS->from) {    free_array(THIS->from);    THIS->from = NULL;    }
pike.git/src/builtin.cmod:4992:    * o Detach segment (requires new iterator implementation)    * o Iterator copy    * o _equal() for iterators and lists.    * o _values(), _search(), cast()    * o _sizeof()?, _indices()??    * o Support for reverse(), filter() and map().    * o Initialization from array.    * o Support for Pike.count_memory.    */    +  +  PIKEFUN int _size_object() +  { +  int q = THIS->num_elems; +  int res = q * sizeof(struct pike_list_node); +  struct mapping *m = NULL; +  struct pike_list_node *n = THIS->head; +  while( q-- ) +  { +  res += rec_size_svalue( &n->val, &m ); +  n = n->next; +  } +  if( m ) free_mapping( m ); +  RETURN res; +  } +     INIT    {    THIS->tail = NULL;    THIS->head = TAIL_SENTINEL(THIS);    THIS->tail_pred = HEAD_SENTINEL(THIS);    THIS->head_sentinel_refs = THIS->tail_sentinel_refs = 2;    THIS->num_elems = 0;    }       EXIT