src/internal/utils/kitringbuffer.c
Kit_RingBuffer* Kit_CreateRingBuffer(unsigned int size) {
    Kit_RingBuffer *rb = calloc(1, sizeof(Kit_RingBuffer));
    if(rb == NULL) return NULL;
    rb->size = size;
    rb->data = malloc(size);
    if(rb->data == NULL) {
        free(rb);
        return NULL;
    }
    return rb;
}
/**
  * Creates a new ringbuffer with the given size.
  * @param size Size for the new ringbuffer
  * @return Ringbuffer handle
  */
Creates a new ringbuffer with the given size.
@param size Size for the new ringbuffer
@return Ringbuffer handle
Creates a new ringbuffer with the given size . @param size Size for the new ringbuffer @return Ringbuffer handle
Kit_RingBuffer* Kit_CreateRingBuffer(unsigned int size) {
    Kit_RingBuffer *rb = calloc(1, sizeof(Kit_RingBuffer));
    if(rb == NULL) return NULL;
    rb->size = size;
    rb->data = malloc(size);
    if(rb->data == NULL) {
        free(rb);
        return NULL;
    }
    return rb;
}
Kit_RingBuffer * Kit_CreateRingBuffer ( unsigned int size ) { Kit_RingBuffer * rb = calloc ( 1 , sizeof ( Kit_RingBuffer ) ) ; if ( rb == NULL ) return NULL ; rb -> size = size ; rb -> data = malloc ( size ) ; if ( rb -> data == NULL ) { free ( rb ) ; return NULL ; } return rb ; }
Creates a new ringbuffer with the given size.
Creates a new ringbuffer with the given size .