pike.git / src / program.c

version» Context lines:

pike.git/src/program.c:11453:    free_type(f->current_type);       if(f->current_return_type)    free_type(f->current_return_type);       Pike_compiler->compiler_frame=f->previous;    dmfree((char *)f);   }       - PMOD_EXPORT char *get_inherit_storage(struct object *o, int inherit) + PMOD_EXPORT void *get_inherit_storage(struct object *o, int inherit)   {    if (!o || !o->prog) return NULL;   #ifdef PIKE_DEBUG    if ((inherit < 0) || (inherit >= o->prog->num_inherits))    Pike_fatal("Inherit #%d out of range [0..%d]\n",    inherit, o->prog->num_inherits-1);   #endif    return o->storage + o->prog->inherits[inherit].storage_offset;   }   
pike.git/src/program.c:11481:   PMOD_EXPORT ptrdiff_t low_get_storage(struct program *o, struct program *p)   {    INT32 oid, pid;    ptrdiff_t offset;    unsigned INT32 hval;       if(!o) return -1;    oid=o->id;    pid=p->id;    hval=(unsigned)oid*9248339 + (unsigned)pid; -  hval%=GET_STORAGE_CACHE_SIZE; - #ifdef PIKE_DEBUG -  if(hval>GET_STORAGE_CACHE_SIZE) -  Pike_fatal("hval>GET_STORAGE_CACHE_SIZE\n"); - #endif +  hval&=GET_STORAGE_CACHE_SIZE-1;    if(get_storage_cache[hval].oid == oid &&    get_storage_cache[hval].pid == pid)    {    offset=get_storage_cache[hval].offset;    }else{    INT32 e;    offset=-1;    for(e=0;e<o->num_inherits;e++)    {    if(o->inherits[e].prog==p)
pike.git/src/program.c:11510:    }       get_storage_cache[hval].oid=oid;    get_storage_cache[hval].pid=pid;    get_storage_cache[hval].offset=offset;    }       return offset;   }    - PMOD_EXPORT char *get_storage(struct object *o, struct program *p) + PMOD_EXPORT void *get_storage(struct object *o, struct program *p)   {    ptrdiff_t offset;      #ifdef _REENTRANT    if(d_flag) CHECK_INTERPRETER_LOCK();   #endif       offset= low_get_storage(o->prog, p);    if(offset == -1) return 0;    return o->storage + offset;