pike.git / src / array.c

version» Context lines:

pike.git/src/array.c:16:   #include "pike_types.h"   #include "fsort.h"   #include "builtin_functions.h"   #include "pike_memory.h"   #include "gc.h"   #include "main.h"   #include "cyclic.h"   #include "multiset.h"   #include "mapping.h"   #include "bignum.h" + #include "pike_search.h"      /** The empty array. */   PMOD_EXPORT struct array empty_array=   {    PIKE_CONSTANT_MEMOBJ_INIT(1, PIKE_T_ARRAY), /* Never free */    0, /* Size = 0 */    0, /* malloced Size = 0 */    0, /* no types */    0, /* no flags */    &weak_empty_array, /* Next */
pike.git/src/array.c:1411:    return ~a->size;    }       return low_lookup(a,s,switch_svalue_cmpfun);   }         /**    * Reorganize an array in the order specified by 'order'.    */ - PMOD_EXPORT struct array *order_array(struct array *v, INT32 *order) + PMOD_EXPORT struct array *order_array(struct array *v, const INT32 *order)   {    reorder((char *)ITEM(v),v->size,sizeof(struct svalue),order);    return v;   }         /**    * Copy and reorganize an array.    */ - PMOD_EXPORT struct array *reorder_and_copy_array(struct array *v, INT32 *order) + PMOD_EXPORT struct array *reorder_and_copy_array(const struct array *v, const INT32 *order)   {    INT32 e;    struct array *ret;    ret=allocate_array_no_init(v->size, 0);    ret->type_field = v->type_field;       for(e=0;e<v->size;e++)    assign_svalue_no_free(ITEM(ret)+e, ITEM(v)+order[e]);       return ret;
pike.git/src/array.c:2788:    if (a->flags & ARRAY_WEAK_FLAG) {    gc_check_weak_svalues(ITEM(a), a->size);    gc_checked_as_weak(a);    }    else    gc_check_svalues(ITEM(a), a->size);    }    } GC_LEAVE;   }    - void gc_mark_array_as_referenced(struct array *a) + PMOD_EXPORT void gc_mark_array_as_referenced(struct array *a)   {    if(gc_mark(a, T_ARRAY))    GC_ENTER (a, T_ARRAY) {    if (a == gc_mark_array_pos)    gc_mark_array_pos = a->next;    if (a == gc_internal_array)    gc_internal_array = a->next;    else {    DOUBLEUNLINK (first_array, a);    DOUBLELINK (first_array, a); /* Linked in first. */
pike.git/src/array.c:2833:    a->type_field = t;    else    a->type_field |= t;    }    gc_assert_checked_as_nonweak(a);    }    }    } GC_LEAVE;   }    - void real_gc_cycle_check_array(struct array *a, int weak) + PMOD_EXPORT void real_gc_cycle_check_array(struct array *a, int weak)   {    GC_CYCLE_ENTER(a, T_ARRAY, weak) {   #ifdef PIKE_DEBUG    if (!gc_destruct_everything &&    (a == &empty_array || a == &weak_empty_array))    Pike_fatal("Trying to gc cycle check some *_empty_array.\n");   #endif       if (a->type_field & BIT_COMPLEX)    {