Logo Search packages:      
Sourcecode: samba-doc-ja version File versions

void* talloc ( TALLOC_CTX t,
size_t  size 
)

Allocate a bit of memory from the specified pool

Definition at line 158 of file talloc.c.

References talloc_chunk::next, talloc_chunk::ptr, and talloc_chunk::size.

Referenced by cli_lsa_enum_privilege(), cli_lsa_enum_privsaccount(), cli_lsa_enum_sids(), cli_lsa_enum_trust_dom(), cli_lsa_lookup_names(), cli_lsa_lookup_sids(), talloc_memdup(), talloc_realloc(), and talloc_zero().

{
      void *p;
      struct talloc_chunk *tc;

      if (!t || size == 0) return NULL;

      p = (void *)malloc(size);
      if (p) {
            tc = (struct talloc_chunk *)malloc(sizeof(*tc));
            if (tc) {
                  tc->ptr = p;
                  tc->size = size;
                  tc->next = t->list;
                  t->list = tc;
                  t->total_alloc_size += size;
            }
            else {
                  SAFE_FREE(p);
            }
      }
      return p;
}


Generated by  Doxygen 1.6.0   Back to index