Logo Search packages:      
Sourcecode: samba4 version File versions  Download package

typedef void TALLOC_CTX

Define a talloc parent type.

As talloc is a hierarchial memory allocator, every talloc chunk is a potential parent to other talloc chunks. So defining a separate type for a talloc chunk is not strictly necessary. TALLOC_CTX is defined nevertheless, as it provides an indicator for function arguments. You will frequently write code like

      struct foo *foo_create(TALLOC_CTX *mem_ctx)
              struct foo *result;
              result = talloc(mem_ctx, struct foo);
              if (result == NULL) return NULL;
                      ... initialize foo ...
              return result;

In this type of allocating functions it is handy to have a general TALLOC_CTX type to indicate which parent to put allocated structures on.

Definition at line 70 of file talloc.h.

Generated by  Doxygen 1.6.0   Back to index