ext/iodine/mustache_parser.h
/* pushes an instruction to the instruction array */
pushes an instruction to the instruction array
pushes an instruction to the instruction array
static inline int mustache__instruction_push(mustache__loader_stack_s *s,
                                             mustache__instruction_s inst) {
  if (s->m->u.read_only.intruction_count >= INT32_MAX)
    goto instructions_too_long;
  if (s->i_capa <= s->m->u.read_only.intruction_count) {
    s->m = realloc(s->m, sizeof(*s->m) + (sizeof(*s->i) * (s->i_capa + 32)));
    MUSTACHE_ASSERT(s->m, "Mustache memory allocation failed");
    s->i_capa += 32;
    s->i = MUSTACH2INSTRUCTIONS(s->m);
  }
  s->i[s->m->u.read_only.intruction_count] = inst;
  ++s->m->u.read_only.intruction_count;
  return 0;
instructions_too_long:
  *s->err = MUSTACHE_ERR_TOO_DEEP;
  return -1;
}
static inline int mustache__instruction_push ( mustache__loader_stack_s * s , mustache__instruction_s inst ) { if ( s -> m -> u . read_only . intruction_count >= INT32_MAX ) goto instructions_too_long ; if ( s -> i_capa <= s -> m -> u . read_only . intruction_count ) { s -> m = realloc ( s -> m , sizeof ( * s -> m ) + ( sizeof ( * s -> i ) * ( s -> i_capa + 32 ) ) ) ; MUSTACHE_ASSERT ( s -> m , " " ) ; s -> i_capa += 32 ; s -> i = MUSTACH2INSTRUCTIONS ( s -> m ) ; } s -> i [ s -> m -> u . read_only . intruction_count ] = inst ; ++ s -> m -> u . read_only . intruction_count ; return 0 ; instructions_too_long : * s -> err = MUSTACHE_ERR_TOO_DEEP ; return -1 ; }
pushes an instruction to the instruction array
pushes an instruction to the instruction array