Specify whether generated code uses the operator
new, during model
object registration, to instantiate objects for referenced models configured with a C++
Category: Code Generation > Interface
Generates code that uses dynamic memory allocation to instantiate objects for
referenced models configured with a C++ class interface. Specifically, during
instantiation of an object for the top model in a model reference hierarchy, the
generated code uses
new to instantiate objects for referenced
Selecting this option frees a parent model from having to maintain information about referenced models beyond its direct children.
If you select this option, be aware that a
exception might be thrown, per the C++ standard, if an out-of-memory error occurs
during the use of
new. You must provide code to catch and
bad_alloc exception in case an out-of-memory error
occurs for a
new call during construction of a top model
If Use dynamic memory allocation for model block instantiation is selected and the base model contains a Model block, the build process might generate copy constructor and assignment operator functions in the private section of the model class. The purpose of the functions is to prevent pointer members within the model class from being copied by other code. For more information, see Model Class Copy Constructor and Assignment Operator.
Does not generate code that uses
new to instantiate referenced
Clearing this option means that a parent model maintains information about its referenced models, including its direct and indirect children.
This parameter appears only for ERT-based targets with Language
C++ and Code interface packaging
This parameter requires an Embedded Coder® license when generating code.
|Type: character vector|