2. Memory organization#

_images/Shape1.gif

JEVEUX dynamically allocates each memory area intended to accommodate the values associated with the object or the collection of objects. A check of the accumulated space is carried out during each new allocation, and an unloading mechanism can possibly be implemented to free up memory spaces associated with objects that the developer has declared as no longer being used.

On 64-bit platforms, memory area allocation is done dynamically using the HPALLOC system routine. This area is seen in the software through the integer array (INTEGER *8 ISZON) of length LISZON and a start address JISZON. It is stored in the common/IZONJE /. In the rest of the document, the term « word » will be used to designate the addressing unit. On a 64-bit platform, the word is 8 bytes long and corresponds to a length of type INTEGER*8.

The zone is managed word by word in unit of type INTEGER (addressing unit), the value segments associated with the JEVEUX objects are surrounded by 8 words containing, in this order, the following information:

  1. the address following the last word constituting the value segment and the 8 identifiers;

  2. the value of an offset used to align type segments that are longer than the addressing unit. On a 64-bit platform, this value is always zero for value segments associated with INTEGER and REAL *8 objects. It is sometimes worth 8 (bytes) for value segments associated with objects of type COMPLEX*16: in fact, it happens that the start of the value segment (position 5) cannot coincide with a position in the reference table ZK16, it is then necessary to move one word (8 bytes). It’s even more common with the CHARACTER type when it’s worth 16, 32, or 80!

  3. the integer identifier associated with simple objects or collections;

  4. the status of the value segment that can take the value X or U (coded on an integer);

  5. the state of the value segment which can take the value X, A or D (coded on an integer);

  6. the integer identifier associated with the collectibles;

  7. the code for the class associated with object JEVEUX;

  8. the address of the first word preceding the value segment and the 8 identifiers.

Managing the memory area with type INTEGER does not make it possible to align correctly with types longer than this addressing unit. Although the order EQUIVALENCE present in the software makes it possible to align the initial address of the various reference variables (tables) ZI, ZI4, ZR, ZC, ZL, ZK8, ZK16, ZK24, ZK32 and ZK80, the positioning of a value segment associated with a value segment associated with an object of type ZK32 is unlikely to be aligned with a « multiple » of 4 from table ISZON on a 64-bit platform, hence the need to manage an offset among the descriptors.

The values making it possible to code the status and the state of the value segment are obtained so that the representation does not correspond to any type used within the value segment in order to detect any overwrites of these descriptors. This role is assigned to routine JJLIRS, which is called mainly during requests to store the value segment. The emission of an error message of the type « ECRASEMENT AMONT POSSIBLE… » indicates that the identifier (3) or the status (4) have been overwritten, the emission of an error message of the type « ECRASEMENT AVAL POSSIBLE… » indicates that the state (5) or the class (7) has been overwritten.

On a 64-bit platform, the values used have the following octal representation:

0100000000000000000000

for X,

0300000000000000000000

for A,

0200000000000000000000

for U,

0400000000000000000000

for D.

Use of value segments

The status/status pair allows you to know the use of a segment of values in memory:

  • XX indicates that the value segment is free, this position can be used directly,

  • UA indicates that the value segment is used for reading (its disk image will not be updated after release),

  • UD indicates that the value segment is used for writing (its disk image will be updated after release),

  • XD indicates that the value segment has been released, but that its contents should be unloaded to disk,

  • XA indicates that the value segment has been released, this position can be used directly.