MCPcopy Create free account
hub / github.com/Santroller/Santroller / ring_buffer_get_num_bytes_unsafe

Function ring_buffer_get_num_bytes_unsafe

lib/ring_buffer/ring_buffer.c:98–109  ·  view source on GitHub ↗

TODO: are these functions really necessary?

Source from the content-addressed store, hash-verified

96
97// TODO: are these functions really necessary?
98RING_BUFFER_SIZE_TYPE ring_buffer_get_num_bytes_unsafe(ring_buffer_t *ring_buf)
99{
100 assert(ring_buf);
101#if RING_BUFFER_MULTICORE_SUPPORT
102 spin_lock_unsafe_blocking(ring_buf->crit.spin_lock);
103#endif
104 RING_BUFFER_SIZE_TYPE num_bytes = ring_buf->num_buffered;
105#if RING_BUFFER_MULTICORE_SUPPORT
106 spin_unlock_unsafe(ring_buf->crit.spin_lock);
107#endif
108 return num_bytes;
109}
110
111RING_BUFFER_SIZE_TYPE ring_buffer_get_num_bytes(ring_buffer_t *ring_buf)
112{

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected