Skip to main content
9 votes
Accepted

Cross platform raw input handling in C/C++ for Linux and Windows

Use an existing terminal I/O library Instead of reinventing the wheel and writing all this non-portable, low-level I/O code by hand, consider looking for already existing libraries that take care of ...
G. Sliepen's user avatar
  • 61.7k
7 votes
Accepted

Optimizing Masked Bit Shifts of Gray Code with AND Operation and Parity Count

Latency analysis The "generic" (not specific to any particular microarchitecture) latency analysis you did is not bad. There are some extra quirks though: ...
user555045's user avatar
  • 10.7k
6 votes

Optimizing Masked Bit Shifts of Gray Code with AND Operation and Parity Count

CPUs are much more complex Level 8: ret You are looking at the instructions from the stand-alone functions, but those are never actually ...
G. Sliepen's user avatar
  • 61.7k
4 votes

Small Virtual Machine executing its own byte-code

General Observations The rules in the Code Review Community on Stack Exchange require that only code to be reviewed must be in the post, however, the only way to actually review the code in the ...
pacmaninbw's user avatar
  • 24.8k
3 votes

Optimizing Masked Bit Shifts of Gray Code with AND Operation and Parity Count

This function is faster, but it crashes in the corner case where SHIFT_MASK == 0 because it loses the least significant bit. This issue can be resolved by zero ...
wepajakeg's user avatar
  • 113
3 votes
Accepted

Linear System Solver using Gauss-Jordan Elimination

General Observations Based on how long ago this was asked and how active you have been on the Code Review Community you probably know most of this already. You might want to read up on negative zero, ...
pacmaninbw's user avatar
  • 24.8k

Only top scored, non community-wiki answers of a minimum length are eligible