PreviousNext

The heap Attribute

This attribute specifies that the server stub's copy of a parameter or of all parameters of a specified type is allocated in heap memory, rather than on the stack.

The heap attribute has the following syntax. (See the example at the end of this topic.)

For a type:

typedef [heap] type_name;

For a parameter:

operation_name ([heap] parameter_name);

Any identifier occurring as a parameter name within an operation declaration in the ACF must also be a parameter name within the corresponding operation declaration in the IDL.

The heap attribute is ignored for pipes, context handles, and scalars.

Example Using the heap Attribute

ACF

[auto_handle] interface galaxies

{

typedef [heap] big_array;

}

IDL File

[uuid(e61de280-0d0b-11ca-6145-08002b111685)]

interface galaxies

{

typedef long big_array[1000];

}