Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
gcc_programmer
on May 13, 2017
|
parent
|
context
|
favorite
| on:
Writing Performance Sensitive OCaml Code
In the first code snippet, they havr add $2, %rax but the function actually adds 1 to its argument.
thelema314
on May 13, 2017
|
next
[–]
This is correct; OCaml integers are tagged with their LSB being 1 to indicate they're not a pointer. This means that the integer n is stored as 2n+1, and adding 1 requires modifying the stored value by 2.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: