Why does creating a cyclic record cause the Target Language Compiler to crash upon exiting while using the Real-Time Workshop 4.1 (R12,1PV1)?

3 views (last 30 days)
A cyclic record is one which ends up pointing to itself. They only can be constructed manually, as in the following:
%createrecord x { } %%create an empty record x
%createrecord y { } %%create an empty record y
%addtorecord x field y %%add a field to x which points to y
%addtorecord y field x %%add a field to y which points to x
At this point, a cyclic record exists, i.e. x.field.field == x. With this code in place, the TLC crashes when it exits.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
Cyclic records are problematic because they cause memory leaks in the Target Language Compiler (TLC). The -dr command line option enables the Target Language Compiler to detect at run time when cyclic records are created and to produce a diagnostic message.
Note, since this feature significantly slows TLC performance, it is "off" by default.

More Answers (0)

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!