Actually, the size of the buffer is 63, not 64. One byte is always left free to distinguish empty from full. This is what makes the logic correct.
I was unable to reproduce your report, although it's possible that I misunderstood you. Can you please submit some sample code along with your description of the problem? For example, here is a commit I have just pushed into master which tests basic ring_buffer functionality:
Beginning test.
resetting ring buffer.
ring buffer contents:
rb_push_insert()-ing 63 bytes.
rb_full_count(rb) = 63
ring buffer contents: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63
------------------------------
resetting ring buffer.
ring buffer contents:
rb_push_insert()-ing 64 bytes.
rb_full_count(rb) = 63
ring buffer contents: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64
------------------------------
resetting ring buffer.
ring buffer contents:
rb_safe_insert()-ing 63 bytes.
rb_full_count(rb) = 63
ring buffer contents: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63
------------------------------
resetting ring buffer.
ring buffer contents:
rb_safe_insert()-ing 64 bytes.
rb_full_count(rb) = 63
ring buffer contents: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63
------------------------------
Test finished.
In the future, when discussing problems, can you please report the version of libmaple or the Maple IDE that you are using? If you are using 0.0.9, the ring_buffer implementation had many bugs which have been fixed in subsequent snapshot releases.