OMG! I found it! Can you see it?
void flx_collector_t::scan_object(void *p)
{
Word_t reachable = (parity & 1UL) ^ 1UL;
if(debug)
fprintf(stderr,"Scan object %p, reachable bit value =
%d\n",p,(int)reachable);
Word_t cand = (Word_t)p;
Word_t fp=cand;
Word_t *w = (Word_t*)JudyLLast(j_shape,&fp,&je);
if(w==(Word_t*)PPJERR)judyerror("scan_object");
if(w == NULL) return; // no lower object
/*
if(debug)
{
fprintf(stderr,"Found candidate object %p, &shape=%p, shape(1)
%p\n",(void*)fp,(void*)w,(void*)(*w));
fprintf(stderr," .. type=%s!\n",((gc_shape_t*)(*w & ~1UL))->cname);
}
*/
if( (*w & 1UL) == reachable) return; // already handled
gc_shape_t *shape = (gc_shape_t*)(*w & ~1UL);
unsigned long n = get_count((void*)fp) * shape->count * shape->amt;
if(cand >= (Word_t)(void*)((unsigned char*)(void*)fp+n)) return; // not
interior
if(debug)
fprintf(stderr,"MARKING object %p, shape %p,
type=%s\n",(void*)fp,shape,shape->cname);
*w = (*w & ~1uL) | reachable;
unsigned long n_used = get_used((void*)fp) * shape->count;
std::size_t n_offsets = shape->n_offsets;
std::size_t *offsets = shape->offsets;
if(shape->flags & gc_flags_conservative)
{
// end of object, rounded down to size of a void*
void **end = (void**)(
(unsigned char*)(void*)fp +
n_used * n / sizeof(void*) * sizeof(void*)
);
for ( void **i = (void**)p; i != end; i = i+1)
{
//if(debug)
// fprintf(stderr, "Check if *%p=%p is a pointer\n",i,*(void**)i);
scan_object(*i);
}
}
else
{
for(unsigned long j=0; j<n_used; ++j)
{
for(unsigned int i=0; i<n_offsets; ++i)
{
void **pq = (void**)(void*)((unsigned char*)p + offsets[i]);
void *q = *pq;
if(q)scan_object(q);
}
p=(void*)((unsigned char*)p+shape->amt);
}
}
}
No? This routine is scanning objects for pointers and chasing them down,
scanning them
for pointers too ...
It's right there, on the second last line of actual code.
RECURSION. Down a list of millions of elements .. that's sure to blow the stack.
LOL!
--
john skaller
[email protected]
------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Felix-language mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/felix-language