opencoff / portable-lib Goto Github PK
View Code? Open in Web Editor NEWPortable C, C++ code for hash tables, bloom filters, string-search, string utilities, hash functions, arc4random
License: GNU General Public License v2.0
Portable C, C++ code for hash tables, bloom filters, string-search, string utilities, hash functions, arc4random
License: GNU General Public License v2.0
Lines 188 to 199 in 9b47975
Maybe simply asm("nop")
is better:
for (i = 0; i < n; ++i) {
asm("nop");
rte_pause();
}
Both __store_ring()
and __load_ring()
have a same bug.
function __store_ring
:
portable-lib/inc/fast/ringbuf.h
Lines 237 to 277 in 10c3286
Bug: When n=1
, function __store_ring(ring, head, elements, n)
actually writes 4 elements into the ring.
Reason: loop
should = n>>2
not n&0x03
Buggy code is at line 240:
portable-lib/inc/fast/ringbuf.h
Line 240 in 10c3286
Solution:
The correct logic should be:
unsigned loop = n & ((unsigned) ~0x3U);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.