Data descriptor


In computing, a data descriptor is a structure containing information that describes data.
Data descriptors may be used in compilers, as a software structure at run time in languages like Ada or PL/I, or as a hardware structure in some computers such as Burroughs large systems.
Data descriptors are typically used at run-time to pass argument information to called subroutines. HP OpenVMS and Multics have system-wide language-independent standards for argument descriptors. Descriptors are also used to hold information about data that is only fully known at run-time, such as a dynamically allocated array.

Examples

The following descriptor is used by IBM Enterprise PL/I to describe a character string:

+--------+--------+--------+--------+
| desc | string | | flags |
| type | type | | |
+--------+--------+--------+--------+
| maximum string length |
| |
+--------+--------+--------+--------+
byte 0 1 2 3

Here is the source of an array descriptor from Multics. The definitions include a structure for the base array information and a structure for each dimension..

dcl 1 array based aligned,
2 node_type bit unaligned,
2 reserved bit unaligned,
2 number_of_dimensions fixed unaligned,
2 own_number_of_dimensions fixed unaligned,
2 element_boundary fixed unaligned,
2 size_units fixed unaligned,
2 offset_units fixed unaligned,
2 interleaved bit unaligned,
2 c_element_size fixed,
2 c_element_size_bits fixed,
2 c_virtual_origin fixed,
2 element_size ptr unaligned,
2 element_size_bits ptr unaligned,
2 virtual_origin ptr unaligned,
2 symtab_virtual_origin ptr unaligned,
2 symtab_element_size ptr unaligned,
2 bounds ptr unaligned,
2 element_descriptor ptr unaligned;
dcl 1 bound based aligned,
2 node_type bit,
2 c_lower fixed,
2 c_upper fixed,
2 c_multiplier fixed,
2 c_desc_multiplier fixed,
2 lower ptr unaligned,
2 upper ptr unaligned,
2 multiplier ptr unaligned,
2 desc_multiplier ptr unaligned,
2 symtab_lower ptr unaligned,
2 symtab_upper ptr unaligned,
2 symtab_multiplier ptr unaligned,
2 next ptr unaligned;