From: <cli...@li...> - 2008-08-30 19:02:54
|
Send clisp-cvs mailing list submissions to cli...@li... To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/clisp-cvs or, via email, send a message with subject or body 'help' to cli...@li... You can reach the person managing the list at cli...@li... When replying, please edit your Subject line so it is more specific than "Re: Contents of clisp-cvs digest..." CLISP CVS commits for today Today's Topics: 1. clisp/src ChangeLog, 1.6440.4.11, 1.6440.4.12 lispbibl.d, 1.806.2.9, 1.806.2.10 spvw_garcol.d, 1.107.2.2, 1.107.2.3 (Vladimir Tzankov) ---------------------------------------------------------------------- Message: 1 Date: Fri, 29 Aug 2008 23:25:56 +0000 From: Vladimir Tzankov <vt...@us...> Subject: clisp/src ChangeLog, 1.6440.4.11, 1.6440.4.12 lispbibl.d, 1.806.2.9, 1.806.2.10 spvw_garcol.d, 1.107.2.2, 1.107.2.3 To: cli...@li... Message-ID: <E1K...@ma...> Update of /cvsroot/clisp/clisp/src In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv30409/src Modified Files: Tag: threads ChangeLog lispbibl.d spvw_garcol.d Log Message: GC fixes Index: spvw_garcol.d =================================================================== RCS file: /cvsroot/clisp/clisp/src/spvw_garcol.d,v retrieving revision 1.107.2.2 retrieving revision 1.107.2.3 diff -u -d -r1.107.2.2 -r1.107.2.3 --- spvw_garcol.d 26 Aug 2008 13:14:38 -0000 1.107.2.2 +++ spvw_garcol.d 29 Aug 2008 23:25:54 -0000 1.107.2.3 @@ -985,9 +985,6 @@ typedef struct varobj_mem_region { aint start; aint size; -#ifdef SPVW_PURE - uintL heapnr; /* used for hole filling only */ -#endif } varobj_mem_region; /* how to calculate good value for this ??? */ @@ -1083,20 +1080,12 @@ /* if the whole remaining area is small enough - just fill it with nullobjects and move to next regions */ if (cur->size < ACCEPTABLE_VAROBJECT_HEAP_HOLE) { - /* fill with nullobj the hole begore the pinned object. + /* fill with valid object(s) the hole before the pinned object. this should be done in AFTER sweep second phase. - --------------------------------- - var int count=cur->size/sizeof(gcv_object_t); - var gcv_object_t *ptr=(gcv_object_t *)cur->start; - dotimesL(count,count, { *ptr++ = nullobj; } ); - --------------------------------- - So just record what we have to do (if any). */ + So just record what we have to do (if any). */ if (cur->size) { holes[*holes_count].start=cur->start; holes[*holes_count].size=cur->size; - #ifdef SPVW_PURE - holes[*holes_count].heapnr=heapnr; - #endif (*holes_count)++; } cur++; /* advanace to next free buffer */ @@ -1117,7 +1106,7 @@ } /* we have not found big enough place for this object. just pin it at it's current location. */ -#if !defined(HAVE_PINNED_BIT) + #if !defined(HAVE_PINNED_BIT) /* in this case we have insert it in the appropriate place in the list. */ memmove(pin_watch+1,pin_watch, @@ -1127,7 +1116,7 @@ (pin_watch+1)->start=p2+objlen; pin_watch->size=p2-pin_watch->start; next_pinned=p2; -#endif + #endif goto pin; } advance: @@ -1207,10 +1196,14 @@ if (holes[*holes_count].size) { /* is there a hole really? */ holes[*holes_count].start=cur->start; (*holes_count)++; - #ifdef SPVW_PURE - holes[*holes_count].heapnr=heapnr; - #endif } + /* we should mark this object as well. + btw: it should be makred - there is no way to be pinned + and not marked (unless in some extraordinary cases which + should happen). + Still while we are testing - we should + mark it !!!*/ + mark(lastlast->start + lastlast->size); return (lastlast+1)->start; /* return first free address */ } else return cur->start; /* used only if GENERATIONAL_GC || SPVW_PURE */ @@ -1590,6 +1583,8 @@ /* is this varobject? */ #ifndef TYPECODES if (varobjectp(thread->_pinned)) + #else + if (!gcinvariant_object_p(thread->_pinned)) #endif { vs=(aint)TheVarobject(thread->_pinned); @@ -1635,15 +1630,36 @@ #ifdef SPVW_MIXED /* single heap for varobjects - so just reserve simple-8bit-vector */ set_GCself(ptr,Array_type_simple_bit_vector(Atype_8Bit),ptr); - var int len = holes->size - offsetofa(sbvector_,data); + var uintL len = holes->size - offsetofa(sbvector_,data); #ifdef TYPECODES ptr->length = len; #else ptr->tfl = vrecord_tfl(Rectype_Sb8vector,len); #endif - #else - /* depending on the heap type we have to allocate differently*/ - /* VTZ:TODO - implement it.*/ + #else /* SPVW_PURE ==> TYPECODES */ + /* depending on the heap type we have to allocate differently. since + all varobjects have length/type encoded in their header - we will + look at the type of the pinned object (the one after the end of + the hole). We have to "allocate" the same type with length of the + hole.*/ + /*VTZ: TODO: currently only simple vectors are implemented */ + var Varobject ptr=(Varobject)holes->start; + var Varobject pinned=(Varobject)(holes->start+holes->size); + uintL len = holes->size - offsetofa(sbvector_,data); + set_GCself(holes->start,mtypecode(pinned->GCself),holes->start); + /* hmm there will be mess with alignments of VAROBJECT_HEADER ???*/ + switch (typecode_at(holes->start)) { + case_sbvector: len<<=3; break; + case_sb2vector: len<<=2; break; + case_sb4vector: len<<=1; break; + case_sb8vector: break; + case_sb16vector: len>>=1; break; + case_sb32vector: len>>=2; break; + default: + fprintf(stderr,"VTZ: unsupported type of pinned object !!!\n"); + abort(); + } + ((Sbvector)ptr)->length = len; #endif holes++; } Index: lispbibl.d =================================================================== RCS file: /cvsroot/clisp/clisp/src/lispbibl.d,v retrieving revision 1.806.2.9 retrieving revision 1.806.2.10 diff -u -d -r1.806.2.9 -r1.806.2.10 --- lispbibl.d 25 Aug 2008 22:38:50 -0000 1.806.2.9 +++ lispbibl.d 29 Aug 2008 23:25:52 -0000 1.806.2.10 @@ -2240,7 +2240,10 @@ #define NO_ASYNC_INTERRUPTS #endif #if defined(NO_ASYNC_INTERRUPTS) && defined(MULTITHREAD) - #error No multithreading possible with this memory model! +/*#error No multithreading possible with this memory model!*/ +/* VTZ: we do not care about atomic pointer operations. We are not going + to interrupt any thread without it's cooperation. + TODO: For signal handling it's possible to have bad case however*/ #endif /* When changed: extend SPVW, write a interruptp(). */ Index: ChangeLog =================================================================== RCS file: /cvsroot/clisp/clisp/src/ChangeLog,v retrieving revision 1.6440.4.11 retrieving revision 1.6440.4.12 diff -u -d -r1.6440.4.11 -r1.6440.4.12 --- ChangeLog 26 Aug 2008 13:14:36 -0000 1.6440.4.11 +++ ChangeLog 29 Aug 2008 23:25:50 -0000 1.6440.4.12 @@ -1,3 +1,13 @@ +2008-08-30 Vladimir Tzankov <vtz...@gm...> + GC fixes. + + * lispbibl.d: Enabled multithreading when NO_ASYNC_INTERRUPTS. + * spvw_garcol.d: comments cleanup + (gc_sweep1_varobject_page): mark the last pinned object in case + we have not iterated through it. + (fill_varobject_heap_holes): implementation for simple bit + vectors (1/2/4/8/16/32) with SPVW_PURE memory model. + 2008-08-26 Vladimir Tzankov <vtz...@gm...> Fixed TYPECODES build. ------------------------------ ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ ------------------------------ _______________________________________________ clisp-cvs mailing list cli...@li... https://lists.sourceforge.net/lists/listinfo/clisp-cvs End of clisp-cvs Digest, Vol 28, Issue 29 ***************************************** |