View Issue Details
|ID||Category||Date Submitted||Last Update|
|0001420||bugs||2007-01-12 04:35||2007-01-12 04:35|
|Fixed in Version|
|Summary||0001420: pbd/ringbuffer.h is incorrect for some 64 bit arches: sizeof(gint) != sizeof(size_t)|
|Description||presently the ringbuffe*.h includes are incorrect for some 64 bit architectures.|
secondly write_ptr and read_ptr are actually indexes.
thirdly, few places in this code actually need or can use a size_t size, so you could gain benefits by cutting the sizes down to ints... also....
In looking over the range of the ringbuffers in use, I didn't see any that were greater than 2^16, so the atomic operations could be cut down to a struct of two shorts unioned with int and made completely atomic (with either 16 bit atomic ops or a 32 bit atomic compare and exchange operation)
(or, moved to different cache lines entirely to reduce cache invalidations on smp arches)...
(there are also 64 bit atomic operations available on most arches. See the linux kernel source for complete information in the various atomic header files)
|Tags||No tags attached.|