Re: My thoughts on C# and gaming.

Jon Watte <[email protected]>
Newsgroups gmane.games.devel.sweng
Message-ID <[email protected]>
So, in my question, I'm assuming that the implementation of DisposeThePool()
walks all other pools (roots), looking for references into the pool getting
disposed. I imagine that the stack counts as a root/pool in this case, just
like any other garbage collection case. Given that there is weak pointer
support in the runtime in general, implementing this safety should not be
all that hard (compared to the other problems you have to solve).

What am I missing?

Sincerely,

jw


--
Americans might object: there is no way we would sacrifice our living
standards for the benefit of people in the rest of the world. Nevertheless,
whether we get there willingly or not, we shall soon have lower consumption
rates, because our present rates are unsustainable.



On Thu, Feb 25, 2010 at 12:16 PM, Miguel de Icaza <[email protected]> wrote:

> Hello,
>
> > I don't see why you'd lose the safety. Because it's CLR-derived you
> > don't need a conservative garbage collector. Thus, you can assert (in
> > non-final builds) that no back pointers exist into that pool when you
> > blow it away. Given that pool-blowing-awaying generally should only
> > happen during loading time, that assert shouldn't get in the way much
> > of regular play testing etc.
>
> In this trivial sample:
>
>        var foo = new Foo ();   // Allocate from Pool
>        DisposeThePool ();
>        foo.Dingus = 1;
>
> The lack of safety is that the 3 statement is writing over memory that
> has been released, something that would never happen under the safe
> execution environment.
>
> This shifts the responsibility of the safety from the language/runtime
> to the developer.   It is perfectly fine to do something like this, but
> the results is no longer a type safe environment.
>
> Miguel.
>
> _______________________________________________
> Sweng-Gamedev mailing list
> [email protected]
> http://lists.midnightryder.com/listinfo.cgi/sweng-gamedev-midnightryder.com
>

_______________________________________________
Sweng-Gamedev mailing list
[email protected]
http://lists.midnightryder.com/listinfo.cgi/sweng-gamedev-midnightryder.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.