Logo Search packages:      
Sourcecode: sofia-sip version File versions  Download package

SU_DLL void* su_home_clone ( su_home_t parent,
isize_t  size 

Clone a su_home_t object.

Clone a secondary home object used to collect multiple memoryf allocations under one handle. The memory is freed either when the cloned home is destroyed or when the parent home is destroyed.

An independent home object is created if NULL is passed as parent argument.

parenta parent object (may be NULL)
sizesize of home object

The memory home object allocated with su_home_clone() can be freed with su_home_unref().

This function returns a pointer to an su_home_t object, or NULL upon an error.

Definition at line 723 of file su_alloc.c.

References su_home_clone(), and su_home_new().

Referenced by auth_status_t::auth_status_new(), nta_leg_tcreate(), sdp_parse(), stun_handle_init(), su_home_clone(), su_strlst_create(), su_vector_create(), tport_alloc_secondary(), and tport_tcreate().

  su_home_t *home;

  assert(size >= sizeof (*home));

  if (size < sizeof (*home))
    return (void)(errno = EINVAL), NULL;
  else if (size > INT_MAX)
    return (void)(errno = ENOMEM), NULL;

  if (parent) {
    su_block_t *sub = MEMLOCK(parent);
    home = sub_alloc(parent, sub, size, (enum sub_zero)2);
  else {
    home = su_home_new(size);

  return home;

Here is the call graph for this function:

Here is the caller graph for this function:

Generated by  Doxygen 1.6.0   Back to index