VMT structure
Original Reporter info from Mantis: FPCCore
-
Reporter name: FPC core team
Original Reporter info from Mantis: FPCCore
- Reporter name: FPC core team
Description:
Compiler question - internal object structures?
Do free Pascal support the (original?) OOP internal structure where:
a) VMT field is not stored in the object record, but with the address of the object, and addr(x), where x is an object, does return 8 byte double pointer with first to object memory ram area, next pointer to object const. area. (exploded rom)
b) The idea above is to not store VMT field in any object record, and make arrys compact. (No VMT fields or other hidden fields used. It is a part of ext. object address to constants instead.)
c) Using compactor in code to save place in VMT / constant and code areas.
d) Aviable to not store only pointers in VMT (using as constant area, all data types may be stored, virtuals are only a seperate task)
e) E.g. define consants in objects as x:byte=25, and they stored in the VMT structure (now for constants too of any kind of structure, pointers, as well as e.g. bytes)
f) The constant type, X:byte=25 is inhirited as virtuals are, and const X=25 works as normal non-virtual procedure in all cases. (Only access from actual structure.)
g) Is it possible to select between the old standard as above, or the old boorland/ansi c?
h) The structure above is a standard structure, where all non constants are saved as normal, but constants are saved in read only memory original.
i) Normal, as when using constants, run time update is possible for some compilers, changing the constants for any structure of the used type.
(A constant x:byte=26 may be changed to x:=39 in code as example, changing the constant area, an for all type using the class. Other compilers will not allow constant override at runtime.
In case if the structure above is not implemented at the moment, why not, and when will it be?
Know that some compilers old compilers only like 32 bit pointer. Maybee that may be troubles to goto 64 bit structures?
Does the Free Pascal compress konstant area now?
Additional information:
Reporter: Guest
EMail: data_sheet at yahoo dot com
Mantis conversion info:
- Mantis ID: 3276
- OS: All
- Version: ?
- Fixed in version: N/A