Next: , Previous: , Up: overview   [Contents][Index]


1.4 Memory allocation for pathname instances

CCStructs allocates data structures using memory allocators as defined by the package CCMemory, (ccmemory)The generic allocators API.

From the point of view of instance constructors, there are two categories:

embedded

An embedded instance of a struct type is allocated on the stack or embedded into an enclosing data structure. The constructors of such instances do not have to allocate memory for the instance itself; they might allocate memory for the internal representation of the instance.

When the facilities of ccnames.h are used: the constructors for embedded instances have names generated by ccname_init(); (ccstructs)Well known functions for struct types.

standalone

A standalone instance of a struct type is allocated on the heap. The constructors of such instances do have to allocate memory for both the instance itself and the internal representation of the pathname.

When the facilities of ccnames.h are used: the constructors for embedded instances have names generated by ccname_new(); (ccstructs)Well known functions for struct types.


Next: , Previous: , Up: overview   [Contents][Index]

This document describes version 0.3.0-devel.3 of CCStructs.