PR# 11792 An attribute was added to INTERNAL
Problem Report Summary
Submitter: randyjohn
Category: EiffelBase
Priority: Medium
Date: 2007/01/08
Class: Bug
Severity: Serious
Number: 11792
Release: 6.0.6.5740
Confidential: No
Status: Closed
Responsible:
Environment: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; AXAR_Corp_Device; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727)
Synopsis: An attribute was added to INTERNAL
Description
The class INTERNAL now has an attribute. This was introduced in one of the later versions of 5.7 (I'm not exactly sure which one). This class should NEVER have attributes. It breaks storables, enlarges objects (I might have millions of objects that inherit from INTERNAL) and breaks the unwritten agreement that INTERNAL was a useful set of utility routines, not attributes. Secondly, it seems to me that the attribute (which is 'INTERNAL_HELPER:is_pre_ecma_mapping_disabled') should really be a once function. It is used to control the interpretation of another once function, 'pre_ecma_type_mapping'. Randy
To Reproduce
Problem Report Interactions
Talking with Mark, we decided to add a new class ECMA_INTERNAL. That is to say INTERNAL does not have attributes and to remove the mapping one has to create an instance of ECMA_INTERNAL.
We can easily fix the storable part by adding the inheritance to MISMATCH_CORRECTOR. For the added size, if you inherit from INTERNAL most of the time, then I would say that in more than 50% (possibly even more) of the time, it does not change the size of the objects because of our padding to 8 bytes.
It breaks storables AND it adds memory. No, when a class inherits from INTERNAL it does not change the added size from 8 to 16. The added size should be 0! Randy
But really the question is: is this because storable fails or because it adds to much memory? Note that instead of storing 8-bytes you are now storing 16-bytes with the addition of the attribute.
Regardless of how you solve the problem, we feel that it should be solved. To give you some idea of how important we feel that this is, Zoran is already removing the attribute from our code. Randy
There is a danger in implementing it as a once and I believe this is why it is an attribute. The issue is that if someone wants INTERNAL to have pre_ecma_mapping and the other one no, they always need to disable or enable that setting before using a feature of INTERNAL. I'm not sure what is best. I think having a once object of INTERNAL might be better because at least you can have 2, one with pre_ecma_mapping and the other without and you can easily choose which one to use depending on your context. What is indeed missing is the ability to recover old storables that might have an instance of INTERNAL. If it was the case, would the added attribute matter?