[Mono-devel-list] Zero Length Arrays

Ben Maurer bmaurer at users.sourceforge.net
Sun Jan 11 13:46:44 EST 2004


On Sun, 2004-01-11 at 12:59, A Rafael D Teixeira wrote:
> >From: Ben Maurer <bmaurer at users.sourceforge.net>
> >
> >So, today, I realized that there is a VERY simple solution. In
> >mono_array_new, if it finds that it will be creating a zero length
> >array, it should used a cached zero length array.
> 
> But how will we deal with commonly used typed arrays? Will we have to cache 
> a per-type zero-length array, or is it possible to reuse a object-typed 
> zero-length array?

One must be created per type. But we could lazy alloc.

-- Ben




More information about the Mono-devel-list mailing list