Mistake in capabilities tutorial
lainy opened this issue · comments
Lain commented
Not sure if this is the correct place to post this.
Lines 162-163 of capabilities.md, which are lines 4-5 of the main.c file:
size_t initial_cnode_object_size = BIT(info->initThreadCNodeSizeBits);
printf("Initial CNode is %zu bytes in size\n", initial_cnode_object_size);
However, BIT(n)
is 1ul<<n
, so this is not in fact reporting the CNode size is bytes.
If I understand correctly, BIT(info->initThreadCNodeSizeBits)
would be the number of CSlots
the CNode
can hold, so the printf
should perhaps read:
printf("Initial CNode is %zu slots in size\n", initial_cnode_object_size);
Of course this is inconsequential to what the tutorial is teaching, but it seemed worth pointing out.
Curtis Millar commented
That does seem to be correct. If you want to make a quick PR to fix, we should be able to merge it fairly quickly.