Premium
A heap‐based implementation of the programming language Pascal
Author(s) -
Marlin C. D.
Publication year - 1979
Publication title -
software: practice and experience
Language(s) - English
Resource type - Journals
SCImago Journal Rank - 0.437
H-Index - 70
eISSN - 1097-024X
pISSN - 0038-0644
DOI - 10.1002/spe.4380090205
Subject(s) - pascal (unit) , heap (data structure) , computer science , programming language
The implementation of Pascal known as Pascal ‘P’ was modified so that activation records for blocks (procedures and functions) were no longer allocated on a stack, but were instead allocated on a heap. This was done partly to test the feasibility of using Pascal ‘P’ for experimenting with extensions to Pascal, and partly to assess the efficiency of implementing Pascal procedures and functions in this way. The necessary changes to Pascal ‘P’ are described; where alternative strategies were possible, these are outlined and the reasons for the final choice given. The heap management algorithms used are presented and, in particular, their behaviour when managing the activation records of Pascal programs which do not involve dynamic variables is explained. Quantitative comparisons are made between Pascal ‘P’ and the version with heap‐allocated activation records, to assess their relative efficiencies; these comparisons indicate that the modified system uses more storage, but it gives rise to only slightly longer execution times. Alternative heap management algorithms are discussed. Finally, some advantages of heap‐allocated activation records are presented.