[Mono-devel-list] culture info patches

Ben Maurer 05mauben at hawken.edu
Tue Mar 16 12:23:01 EST 2004

I am sorry, I should have been more specific.

I realize GCC does that, so no problem there.

However, we do:
+ this->displayname = mono_string_new (domain, ci->displayname);

+ this->englishname = mono_string_new (domain, ci->englishname);

+ this->nativename = mono_string_new (domain, ci->nativename);

That will *NOT* be cached in such a way. A new string will be created
for each one.

-- Ben

>>> Miguel de Icaza <miguel at ximian.com> 03/16/04 11:40 AM >>>

> So in the tables we have stuff like:
> static const CultureInfoEntry culture_entries [] = {
> {0x0009, "English", "English", "English", "eng", "en", -1, -1},
> {0x1009, "English (Canada)", "English (Canada)", "English (Canada)",
> "eng", "en", 0, 0},
> As I understand it, a string like "English" gets created multiple
> when you create the culture info. Maybe you need some interning here.
> This would help in other places too: for example, all the english
> varients use the same names for the days of the week, so you save a
> creation there.

As long as all the strings live on the same file the compiler will do
this for us, so only one copy of "English" ever exists. 

So we do not need to do anything else.

Mono-devel-list mailing list
Mono-devel-list at lists.ximian.com

More information about the Mono-devel-list mailing list