Use dynamic memory allocation for model block instantiation
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
newto instantiate objects for referenced models.
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
bad_allocexception 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 process the
bad_allocexception in case an out-of-memory error occurs for a
newcall during construction of a top model object.
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.
Does not generate code that uses
newto instantiate referenced model objects.
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 set to
C++and Code interface packaging set to
This parameter requires an Embedded Coder® license when generating code.
|Type: character vector|