参考文章:http://blog.csdn.net/linyt/article/details/53355355 本文参考linux系统中 kfifo缓冲区实现.由于没有涉及到锁,在多线程环境下,只适用于 单生产者 + 单消费者 模型. fifo_buffer.h fifo_buffer.cpp 测 Read More
posted @ 2016-12-04 21:25 你好阿汤哥 Views(4150) Comments(0) Diggs(0) Edit
#include #include // 判断整数是否为2幂 /* if (a & (a - 1)) { // not } else { // yes } */ uint32_t roundup_pow_of_two(const uint32_t x) { if (x == 0){ return 0; } if (x == 1){ return 2; } ... Read More
posted @ 2016-12-04 17:47 你好阿汤哥 Views(992) Comments(0) Diggs(0) Edit