The user_marshal attribute


   typedef  [user_marshal( user_type)]   transmissible_type;

This attribute is a type attribute used in the ACF file and is somewhat similar in syntax and semantic to the represent_as attribute. Each user-specific type has a corresponding transmissible type that defines the wire representation. Similar to represent_as, in the generated files, each usage of the trasmissible_type name is substituted by the user_type name.

The user can define his specific type quite freely, (simple types, pointer types and composite types may be used) although some restrictions apply. The main one is that the type object needs to have well defined (fixed) memory size. If the changeable size needs to be accommodated, the type should have a pointer field as opposed to a conformant array; or it can be a pointer to the interesting type. General restrictions apply as usual. Specific restrictions related to embedding affect the way types can be specified. For more information see the "User type vs. wire type" section.

The [user_marshal] attribute cannot be used with [allocate()] attribute (directly or indirectly) as the engine doesn't control the memory allocation for the type. Also the wire type cannot be an interface pointer (these may be marshaled directly) or a full pointer (we cannot take care of the aliasing).

Additional points regarding user_marshal: