[Mono-devel-list] The first (attempt to checkin) managed collation patch

Paolo Molaro lupus at ximian.com
Mon Jul 25 05:41:55 EDT 2005


On 07/24/05 Miguel de Icaza wrote:
> > > It can be done in two ways: embed the files in the mono binary like we do
> > > with the char tables or load the files from where mscorlib was loaded.
> > > Both are trivial to implement.
> > 
> > For now I took the latter approach. That means however we need some
> > love on the build system.
> 
> I personally like the idea of having this data on the dll files
> themselves more, you can embed the resources with -resource and then get
> the same IntPtr without adding a new icall like this:
> 
> int size;
> Module module;
> IntPtr data = GetManifestResourceInternal (name, out size, out module);
> 
> We reuse the existing framework, do not require build system love and do
> not have to introduce a new icall.

All of that is fine, except that you get incorrect data, since we have arrays
of shorts or ints, so we either give incorrect results on bigendian systems
or we introduce code to byteswap at runtime, needlessly slowing down the code.

The code should do what we already do for the char data: embed the arrays
in mono so the endianess is correct and there are no build systems changes.
Using managed resources for this is a net loss. Using and mmapping external files
instead of embedding them has the same (well, less) build system complexity
of embedding the correct endian files as managed resources.

lupus

-- 
-----------------------------------------------------------------
lupus at debian.org                                     debian/rules
lupus at ximian.com                             Monkeys do it better



More information about the Mono-devel-list mailing list