зеркало из https://github.com/github/ruby.git
Simplify and clarify bitmask calculation
This commit is contained in:
Родитель
08db4bc672
Коммит
129b4936bf
2
shape.c
2
shape.c
|
@ -103,7 +103,7 @@ redblack_value(redblack_node_t * node)
|
||||||
{
|
{
|
||||||
// Color is stored in the bottom bit of the shape pointer
|
// Color is stored in the bottom bit of the shape pointer
|
||||||
// Mask away the bit so we get the actual pointer back
|
// Mask away the bit so we get the actual pointer back
|
||||||
return (rb_shape_t *)((uintptr_t)node->value & (((uintptr_t)-1) - 1));
|
return (rb_shape_t *)((uintptr_t)node->value & ~(uintptr_t)1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_MMAP
|
#ifdef HAVE_MMAP
|
||||||
|
|
Загрузка…
Ссылка в новой задаче