프로젝트
GitHub에서 보기
jnk0le/Ring-Buffer
소개
컴파일 시 메모리를 할당하고 평가할 수 있는 간단한 C++11 링 버퍼 구현입니다.
기타 프로젝트측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- -1
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalRing Buffer
- pure C++11, no OS dependency
- lock and wait free bounded SPSC operation
- no exceptions, RTTI, virtual functions and dynamic memory allocation
- designed for compile time (static) allocation and type evaluation
- no wasted slots (in powers of 2 granularity)
- underrun and overrun checks in insert/remove functions
- highly efficient on most microcontroller architectures (nearly equal performance as in 'wasted-slot' implemetation)
notes
- index_t of size less than architecture reg size (size_t) might not be most efficient (known gcc bug)
- Only lamda expressions or functor callbacks can be inlined into
buffWrite/buffReadfunctions - 8 bit architectures are not supported in master branch at the moment. Broken code is likely to be generated
- relaxed atomic stores on RISC-V gcc port may be inefficient
- the DEC Alpha ultra-weak memory model is not supported
example
jnk0le::Ringbuffer<const char*, 256> message;
int main()
{
//...
while(1)
{
const char* tmp = nullptr;
while(!message.remove(tmp));
printf("%s fired\n", tmp);
//...
}
}
extern "C" void SysTick_Handler(void)
{
message.insert("SysTick_Handler");
}
관련 프로젝트 살펴보기
불러오는 중…