pike.git / src / pike_types.cmod

version» Context lines:

pike.git/src/pike_types.cmod:224:    * ASSIGN variable (int) type    * NAME name (string) type    * ATTRIBUTE name (string) type Added in 7.7.    * FUNCTION type FUNCTION|MANY    * MANY many type return type    * RING type type Reserved.    * TUPLE type type Reserved.    * MAPPING index type value type    * OR type (not OR) type    * AND type type -  * ARRAY - type +  * ARRAY len type type len added in 8.1    * MULTISET type -    * NOT type -    * '0'-'9' - -    * FLOAT - - -  * STRING - ZERO, INT or OR Range added in 7.7 +  * STRING len type ZERO, INT or OR len:8.1, Range:7.7    * TYPE type -    * PROGRAM type -    * MIXED - -    * VOID - -    * ZERO - -    * UNKNOWN - -    * INT min (int) max (int)    * OBJECT implements/is object id(int)    *    * Note that the cdr of a FUNCTION is a valid FUNCTION for the rest of
pike.git/src/pike_types.cmod:311:       /* FIXME: Recursion: Should we use a stack? */    switch(type) {    case T_FUNCTION:    case T_MANY:    case T_TUPLE:    case T_MAPPING:    case T_OR:    case T_AND:    case PIKE_T_RING: +  case T_ARRAY: +  case T_STRING:    /* Free car & cdr */    free_type(car);    t = (struct pike_type *) cdr;    debug_free_type_preamble (t);    goto loop;       case PIKE_T_AUTO:    if (!car)    break;    /* FALLTHRU */
pike.git/src/pike_types.cmod:332:    case T_NOT:    case T_TYPE:    case T_PROGRAM:    /* Free car */    t = (struct pike_type *) car;    debug_free_type_preamble (t);    goto loop;       case T_SCOPE:    case T_ASSIGN: -  case T_ARRAY: -  case T_STRING: +     /* Free cdr */    t = (struct pike_type *) cdr;    debug_free_type_preamble (t);    goto loop;       case PIKE_T_ATTRIBUTE:    case PIKE_T_NAME:    free_string((struct pike_string *)car);    t = (struct pike_type *) cdr;    debug_free_type_preamble (t);
pike.git/src/pike_types.cmod:484:    (t->car == car) && (t->cdr == cdr)) {    /* Free car & cdr as appropriate. */    switch(type) {    case T_FUNCTION:    case T_MANY:    case T_TUPLE:    case T_MAPPING:    case T_OR:    case T_AND:    case PIKE_T_RING: +  case T_ARRAY: +  case T_STRING:    /* Free car & cdr */    free_type((struct pike_type *)debug_malloc_pass(car));    free_type((struct pike_type *)debug_malloc_pass(cdr));    break;       case T_MULTISET:    case T_NOT:    case T_TYPE:    case T_PROGRAM:    /* Free car */    free_type((struct pike_type *)debug_malloc_pass(car));    break;    case PIKE_T_AUTO:    if( car )    free_type((struct pike_type *)debug_malloc_pass(car));    break;       case T_SCOPE:    case T_ASSIGN: -  case T_ARRAY: -  case T_STRING: +     /* Free cdr */    free_type((struct pike_type *)debug_malloc_pass(cdr));    break;       case PIKE_T_ATTRIBUTE:    case PIKE_T_NAME:    free_string((struct pike_string *)debug_malloc_pass(car));    free_type((struct pike_type *)debug_malloc_pass(cdr));    break;   #ifdef PIKE_DEBUG
pike.git/src/pike_types.cmod:589:      #ifdef DEBUG_MALLOC    switch(type) {    case T_FUNCTION:    case T_MANY:    case T_TUPLE:    case T_MAPPING:    case T_OR:    case T_AND:    case PIKE_T_RING: +  case T_ARRAY: +  case T_STRING:    debug_malloc_pass(car);    debug_malloc_pass(cdr);    break;       case T_MULTISET:    case T_NOT:    case T_TYPE:    case T_PROGRAM:    case PIKE_T_AUTO:    debug_malloc_pass(car);    break;       case T_ASSIGN:    t->flags |= PT_FLAG_ASSIGN_0 << PTR_TO_INT(car);    /* FALLTHRU */    case T_SCOPE: -  case T_ARRAY: -  case T_STRING: +     debug_malloc_pass(cdr);    break;       case PIKE_T_ATTRIBUTE:    case PIKE_T_NAME:    debug_malloc_pass(car);    debug_malloc_pass(cdr);    break;       case '0':
pike.git/src/pike_types.cmod:9166:      void gc_mark_type_as_referenced(struct pike_type *t)   {    if (gc_mark(t, PIKE_T_TYPE)) {    GC_ENTER(t, PIKE_T_TYPE) {    switch(t->type) {    case PIKE_T_SCOPE:    case T_ASSIGN:    case PIKE_T_NAME:    case PIKE_T_ATTRIBUTE: -  case PIKE_T_ARRAY: +     if (t->cdr) gc_mark_type_as_referenced(t->cdr);    break;    case PIKE_T_FUNCTION:    case T_MANY:    case PIKE_T_RING:    case PIKE_T_TUPLE:    case PIKE_T_MAPPING:    case T_OR:    case T_AND: -  +  case PIKE_T_ARRAY: +  case PIKE_T_STRING:    if (t->cdr) gc_mark_type_as_referenced(t->cdr);    /* FALLTHROUGH */    case PIKE_T_MULTISET:    case T_NOT:    case PIKE_T_TYPE:    case PIKE_T_PROGRAM:    if (t->car) gc_mark_type_as_referenced(t->car);    break;    }    } GC_LEAVE;
pike.git/src/pike_types.cmod:9261:       GC_ENTER (t, T_TYPE) {    switch (t->type) {    case T_FUNCTION:    case T_MANY:    case T_TUPLE:    case T_MAPPING:    case T_OR:    case T_AND:    case PIKE_T_RING: +  case T_ARRAY: +  case T_STRING:    debug_gc_check (t->car, " as car in a type");    debug_gc_check (t->cdr, " as cdr in a type");    break;    case PIKE_T_ATTRIBUTE:    case PIKE_T_NAME:   #ifdef PIKE_DEBUG    /* this is a string and without PIKE_DEBUG    * they are not touched by the GC */    debug_gc_check (t->car, " as car in a type");   #endif
pike.git/src/pike_types.cmod:9282:    break;    case T_MULTISET:    case T_NOT:    case T_TYPE:    case T_PROGRAM:    case PIKE_T_AUTO:    debug_gc_check (t->car, " as car in a type");    break;    case T_SCOPE:    case T_ASSIGN: -  case T_ARRAY: -  case T_STRING: +     debug_gc_check (t->cdr, " as cdr in a type");    break;   #ifdef PIKE_DEBUG    case '0':    case '1':    case '2':    case '3':    case '4':    case '5':    case '6':