# Synopsis

PDX_MSGT mda_AllocateAppData2(long option, size_t size, int model, MDA_APP_DATA **ad_ptr)

# Purpose

Allocate application data in specified model

# Description

Storage to contain application information of the specified size will be allocated. The data may then be accessed with the functions mda_ReadAppData and mda_WriteAppData. The function mda_FreeAppData should be called when the application data is no longer needed. This function may be called at any time (regardless of how many entities are currently in the model). The allocated application data is defined for the specified model (i.e. calls to mda_Read/WriteAppData must be made for entities which are defined in the same model when the application data was allocated).

# Input

## option

### MDA_ZERO_DATA

Causes the allocated area to be initialized to 0. Default if not specified is to not initialize the data area.

### MDA_NULLPTR_DATA

Causes the allocated area to be initialized to MDA_NULL_PTR. The size argument must be sizeof(MDA_PTR) if this option is specified.

## size

Size of the data to be stored with each entity

## model

Model Number

# Output

## ad_ptr

The application data pointer used to refer to the storage allocated in this function.

# Return

MDA error code