# Synopsis

(macro) PDX_MSGT mda_MallocEntity(long option, DDF_TF tf, void *ent)

# Purpose

Allocate an entity in memory.

# Description

An entity is allocated from the heap. The entity does not exist in the database. All of the mda memory management routines may be used to manipulate memory associated with the entity. Memory associated with the entity can be freed by calling mda_FreeEntity or the entity can be committed to the database by calling mda_CreateEntity. This function allows an application to create memory resident entities without the overhead of actually committing the entity to the database. Note that the ent argument is the address of the pointer to store the allocated memory pointer in. The TF is taken with respect to the DDF of the current model. Use mda_MallocEntity2 to allocate an entity whose TF is defined with respect to another model.

# Input

## option

### MDA_DEFAULT_FIELDS

Initialize fields to default values.

## tf

TF of the entity to be allocated

## ent

Address to store the allocated memory pointer at

# Output

## ent

The allocated entity

# Return

MDA error code