[Mono-dev] Replacing/Removing I18N

Paolo Molaro lupus at ximian.com
Fri Oct 13 11:15:25 EDT 2006


On 10/13/06 Kornél Pál wrote:
> >I maintain that having the option to store it either embedded in the
> >binary or in data files is better than the proposal to use assembly
> >resources or your proposal of having only external files (which makes
> >it harder to support mkbundle).
> 
> I just was thinking of a data file (or more data files) but that can be 
> independent of the assembly, can be a linked resource or an embedded 
> resource. I think that this is a minor detail because this can be changed in 
> some minutes at any time and does not affect the entire encoding 
> infrastructure. And I agree with you that using resources is a better 
> solution.

You misunderstood: embedding the data as a resource in the assemblies is
not a better solution. The best way is to add an icall:

	static byte* GetEncodingData (int encoding_id);

The runtime can search an internal table for the data, or lookup
the file $prefix/lib/mono/encodings/encoding_id, mmap it and return the
pointer. The result of the icall is stored in a readonly static field.
If you use a resource in the managed assemblies you'll have more
overhead, since it requires creating objects, setting up finalizers etc.

lupus

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



More information about the Mono-devel-list mailing list