seL4 / projects_libs

Other
6 stars 20 forks source link

Make ringbuffer more robust or improve usage comments #20

Open axel-h opened 2 years ago

axel-h commented 2 years ago

Follow-up from https://github.com/seL4/projects_libs/pull/18#discussion_r1003527717

The ring buffer does not support 0 as data value, but expects this as an end marker. Thus I wonder if rb_new()should do a r->base[0] = 0 to ensure it starts with an empty buffer. Or do a check that the buffer contains at least one NULL value of pre-filled buffers are also supported. Otherwise rb_poll_byte() would loop forever in the worst case.

kent-mcleod commented 2 years ago

Maybe we consider just removing the library before merging the libsharedringbuffer implementation?