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

void* icalmemory_tmp_buffer ( size_t  size  ) 

Create a new temporary buffer on the ring. Libical owns these and will deallocate them.

Definition at line 179 of file icalmemory.c.

References icalmemory_add_tmp_buffer().

Referenced by icalmemory_tmp_copy().

{
    char *buf;

    if (size < MIN_BUFFER_SIZE){
      size = MIN_BUFFER_SIZE;
    }
    
    buf = (void*)malloc(size);

    if( buf == 0){
      icalerror_set_errno(ICAL_NEWFAILED_ERROR);
      return 0;
    }

    memset(buf,0,size); 

    icalmemory_add_tmp_buffer(buf);

    return buf;
}


Generated by  Doxygen 1.6.0   Back to index