Branch: Tag:

2008-06-23

2008-06-23 16:02:25 by Martin Stjernholm <mast@lysator.liu.se>

Expose the object pointer in SearchMojt to allow the caller to make it known
to the gc.

Rev: src/pike_search.c:1.30
Rev: src/pike_search.h:1.10
Rev: src/pike_search_engine.c:1.14

2:   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: pike_search_engine.c,v 1.13 2006/07/05 19:15:35 mast Exp $ + || $Id: pike_search_engine.c,v 1.14 2008/06/23 16:02:25 mast Exp $   */      /*
47:    (SearchMojtFunc1)PxC3(NAME,NSHIFT,1), \    (SearchMojtFunc2)PxC3(NAME,NSHIFT,2), \    (SearchMojtFuncN)PxC3(NAME,NSHIFT,N), \ -  PxC2(NAME,_free), \ +    };      
289:    NameN(init_memsearch)(&tmp,    needle,len,    max_haystacklen); +  tmp.mojt.container = NULL;    return tmp.mojt;    }else{    struct svalue *sval,stmp;
308:    if(o->prog == pike_search_program)    {    s=OB2MSEARCH(sval->u.object); +  assert (sval->u.object == s->mojt.container);    add_ref(sval->u.object);    free_string(hashkey);    return s->mojt;
317:       o=low_clone(pike_search_program);    s=OB2MSEARCH(o); -  s->data.hubbe.o=o; +  s->mojt.container = o; /* Not refcounted self-ref. */    s->s=hashkey;       /* We use 0x7fffffff for max_haystacklen because we do