Re: (Semi) precise GC [was: Re: Std Phobos 2 and logging library?]

2009-04-15 Thread Leandro Lucarella
Fawzi Mohamed, el 15 de abril a las 14:57 me escribiste: > >Well, if it turns out to be a win, I'm sure we could put it into LDC. > >DMD would be up to Walter. > > and tango will also for sure welcome a new gc implementation. Well, right now I'm working on a minimal, naive, fully documented GC im

Re: (Semi) precise GC [was: Re: Std Phobos 2 and logging library?]

2009-04-15 Thread Fawzi Mohamed
On 2009-04-13 20:33:53 +0200, Frits van Bommel said: Leandro Lucarella wrote: Frits van Bommel, el 13 de abril a las 19:36 me escribiste: Leandro Lucarella wrote: Frits van Bommel, el 13 de abril a las 13:30 me escribiste: Or you can pin anything that's referenced from the stack, and move

Re: (Semi) precise GC [was: Re: Std Phobos 2 and logging library?]

2009-04-14 Thread Robert Jacques
On Tue, 14 Apr 2009 11:34:05 -0400, Frits van Bommel wrote: Robert Jacques wrote: On Tue, 14 Apr 2009 09:27:09 -0400, Frits van Bommel wrote: Robert Jacques wrote: On Tue, 14 Apr 2009 06:04:01 -0400, Frits van Bommel wrote: Using D2 structs with a moving GC would need some extra bookkeep

Re: (Semi) precise GC [was: Re: Std Phobos 2 and logging library?]

2009-04-14 Thread Frits van Bommel
Robert Jacques wrote: On Tue, 14 Apr 2009 09:27:09 -0400, Frits van Bommel wrote: Robert Jacques wrote: On Tue, 14 Apr 2009 06:04:01 -0400, Frits van Bommel wrote: Using D2 structs with a moving GC would need some extra bookkeeping data anyway, to work out things like their postblit call. P

Re: (Semi) precise GC [was: Re: Std Phobos 2 and logging library?]

2009-04-14 Thread Robert Jacques
On Tue, 14 Apr 2009 09:27:09 -0400, Frits van Bommel wrote: Robert Jacques wrote: On Tue, 14 Apr 2009 06:04:01 -0400, Frits van Bommel wrote: Robert Jacques wrote: it instead. (You'd have to create a fake ClassInfo for structs and arrays.) Then the GC only has to track the start of each o

Re: (Semi) precise GC [was: Re: Std Phobos 2 and logging library?]

2009-04-14 Thread Frits van Bommel
Robert Jacques wrote: On Tue, 14 Apr 2009 06:04:01 -0400, Frits van Bommel wrote: Robert Jacques wrote: it instead. (You'd have to create a fake ClassInfo for structs and arrays.) Then the GC only has to track the start of each object (i.e. the beginning of a block in the current GC). The adv

Re: (Semi) precise GC [was: Re: Std Phobos 2 and logging library?]

2009-04-14 Thread Robert Jacques
On Tue, 14 Apr 2009 06:04:01 -0400, Frits van Bommel wrote: Robert Jacques wrote: On Mon, 13 Apr 2009 14:54:57 -0400, Frits van Bommel wrote: [snip] An alternative to this is to encode the information in ClassInfo and use It's already there. That's where TypeInfo for classes gets it fr

Re: (Semi) precise GC [was: Re: Std Phobos 2 and logging library?]

2009-04-14 Thread Frits van Bommel
Robert Jacques wrote: On Mon, 13 Apr 2009 14:54:57 -0400, Frits van Bommel wrote: [snip] An alternative to this is to encode the information in ClassInfo and use It's already there. That's where TypeInfo for classes gets it from :). it instead. (You'd have to create a fake ClassInfo for s

Re: (Semi) precise GC [was: Re: Std Phobos 2 and logging library?]

2009-04-13 Thread Robert Jacques
On Mon, 13 Apr 2009 14:54:57 -0400, Frits van Bommel wrote: Sean Kelly wrote: Leandro Lucarella wrote: But right now gc_malloc() doesn't take any TypeInfo argument. I can't see where I can get the TypeInfo in the first place =/ The call would have to be modified. Right now the best you

Re: (Semi) precise GC [was: Re: Std Phobos 2 and logging library?]

2009-04-13 Thread Leandro Lucarella
Frits van Bommel, el 13 de abril a las 20:33 me escribiste: > >But right now gc_malloc() doesn't take any TypeInfo argument. I can't see > >where I can get the TypeInfo in the first place =/ > > Ah, you're right. But if you'll look at your nearest lifetime.d[1] > you'll see that all the allocation

Re: (Semi) precise GC [was: Re: Std Phobos 2 and logging library?]

2009-04-13 Thread Frits van Bommel
Sean Kelly wrote: Leandro Lucarella wrote: But right now gc_malloc() doesn't take any TypeInfo argument. I can't see where I can get the TypeInfo in the first place =/ The call would have to be modified. Right now the best you can do is pass BlkAttr.NO_SCAN. And storing a pointer per block

Re: (Semi) precise GC [was: Re: Std Phobos 2 and logging library?]

2009-04-13 Thread Frits van Bommel
Leandro Lucarella wrote: Frits van Bommel, el 13 de abril a las 19:36 me escribiste: Leandro Lucarella wrote: Frits van Bommel, el 13 de abril a las 13:30 me escribiste: Or you can pin anything that's referenced from the stack, and move anything that is only referenced from the heap. That's m

Re: (Semi) precise GC [was: Re: Std Phobos 2 and logging library?]

2009-04-13 Thread Sean Kelly
Leandro Lucarella wrote: Frits van Bommel, el 13 de abril a las 19:36 me escribiste: Leandro Lucarella wrote: Frits van Bommel, el 13 de abril a las 13:30 me escribiste: Or you can pin anything that's referenced from the stack, and move anything that is only referenced from the heap. That's m

Re: (Semi) precise GC [was: Re: Std Phobos 2 and logging library?]

2009-04-13 Thread Leandro Lucarella
Frits van Bommel, el 13 de abril a las 19:36 me escribiste: > Leandro Lucarella wrote: > >Frits van Bommel, el 13 de abril a las 13:30 me escribiste: > Or you can pin anything that's referenced from the stack, and move > anything that is only referenced from the heap. > >>>That's more likel

Re: (Semi) precise GC [was: Re: Std Phobos 2 and logging library?]

2009-04-13 Thread Frits van Bommel
Leandro Lucarella wrote: Frits van Bommel, el 13 de abril a las 13:30 me escribiste: Or you can pin anything that's referenced from the stack, and move anything that is only referenced from the heap. That's more likely to happen, but it requires a compiler change too (provide type information o

(Semi) precise GC [was: Re: Std Phobos 2 and logging library?]

2009-04-13 Thread Leandro Lucarella
Frits van Bommel, el 13 de abril a las 13:30 me escribiste: > >>Or you can pin anything that's referenced from the stack, and move > >>anything that is only referenced from the heap. > >That's more likely to happen, but it requires a compiler change too > >(provide type information on allocation).