Автоматизация и управление в технических системах
Электронный научный журнал
Архив выпусков

Автоматизация и управление в технических системах: научно-методический сборник трудов кафедры Автоматизированные системы управления Московского автомобильно-дорожного государственного технического университета (МАДИ)


Технические науки
CONTROLLED STACK IN C LANGUAGE PROGRAMS
Samokhvalov A.B. 1

1. State Technical University – MADI

Abstract:

The problem of programming code reliability regarding exception safety and early procedure and frame exit in C language is considered. The way of managed stack implementation in C language and its testing results are presented. In order to provide correct, flexible programming code, reliable resource management and high-level logic procuring the software development should be based on the principle of symmetry. In C++ language the principle of symmetry is guaranteed by determinated destructor while in C language it is attained by the using of managed stack idiom (pattern). Due to managed stack the programs in C language become robust to early exit from procedures and frames, including by the cause of exceptions. The object-oriented approach and dynamic type information are used in proposed implementation. The testing results show the possibility to attain high performance of the programs in C with the usage of managed stack. The research would be interesting for program code development and refactoring not only in C language but also for other programming languages.

Keywords: C, C++, programming language, managed stack, resources, symmetry, exceptions, idiom, pattern

Сайт работает на RAE Editorial System
Яндекс.Метрика