[Mono-devel-list] String constants and localization

Andreas Nahr ClassDevelopment at A-SoftTech.com
Mon Jul 14 14:42:01 EDT 2003


Hi,

in your other post you wrote something about just doing things and not doing
them in a perfectly designed way. The whole discussion in this tread is
anyways just about saving the last 10% of memory so it would raise memory
usage from about 30% of the would-be-needed level (for the suggested
solution) to about 20%

Rest is in text


> Hello,
>
> > I'm not sure what you are meaning with this. But if you mean that you
cannot
> > remove the enumeration after compiling because somebody might use
> > enum.ToString() then you are right.
> > However there is no case in which anybody should use ToString on that
enum
> > anywhere.
> > The enum in this case basically serves as an auto-(re)indexing int field
>
> Yes, but this is not something the compiler knows.
>
> Because you can always do:
>
> object a = MyEnum.Value;
>
> And later call ToString ()

Sorry, but I seem to have not made myself clear. What I want to do is just
remove the code manually after compiling (You should compile the support
into an external Assembly to make it simple removing it. No changes to
compiler, no support, no nothing.
If then somebody tries the things you descibe here above or below.
Then he'll get a runtime exception (probably a typeload exception or
something like that)
So at that point if anybody uses this it's his own fault.

> Even worse: you can do dynamic invocations;  Even worse: the private
> types and the private data *have to be* [1] compiled in, even if they are
> not exposed to the world (think: debugger).
>
> [1] Well, they dont *have to*, but not doing it means creating a
> parallel universe of metadata just to support this.
>
> So the compiler would have to audit all the code before it can know
> whether it can remove the enumeration from the output file.  And given
> MCS current design, this might not be possible (we create the
> enumerations *before* we generate code)
>
> MIguel
>
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
>




More information about the Mono-devel-list mailing list