MCPcopy Create free account
hub / github.com/csound/csound / csoundCreateCircularBuffer

Function csoundCreateCircularBuffer

InOut/circularbuffer.c:34–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32} circular_buffer;
33
34void *csoundCreateCircularBuffer(CSOUND *csound, int numelem, int elemsize){
35 circular_buffer *p;
36 if ((p = (circular_buffer *)
37 csound->Malloc(csound, sizeof(circular_buffer))) == NULL) {
38 return NULL;
39 }
40 p->numelem = numelem;
41 p->wp = p->rp = 0;
42 p->elemsize = elemsize;
43
44 if ((p->buffer = (char *) csound->Malloc(csound, numelem*elemsize)) == NULL) {
45 return NULL;
46 }
47 memset(p->buffer, 0, numelem*elemsize);
48 return (void *)p;
49}
50
51int checkspace(circular_buffer *p, int writeCheck){
52 int wp = p->wp, rp = p->rp, numelem = p->numelem;

Callers 8

openSLInitOutParamsFunction · 0.85
openSLInitInParamsFunction · 0.85
test_read_writeFunction · 0.85
test_peekFunction · 0.85
test_wrapFunction · 0.85
csoundDebuggerInitFunction · 0.85

Calls

no outgoing calls

Tested by 4

test_read_writeFunction · 0.68
test_peekFunction · 0.68
test_wrapFunction · 0.68