Displaying 3 results from an estimated 3 matches for "base_int_ptr".
2018 Mar 19
4
RFC: Devirtualization v2
...b = new(a) B; auto av = (uintptr_t)a; auto
bv = (uintptr_t)b; if (av == bv) b->foo();}int to ptrHere because
we are creating a fat pointer from integer, we need to use launder:void
foo(Base *base) { uintptr_t base_int = (uintptr_t)base; /* base_int =
ptrtoint (strip base) */ Base *base_int_ptr = (Base*)base_int; /*
base_int_ptr = inttoptr base_int = inttoptr (ptrtoint (strip base)) = strip
base */ base_int_ptr->vfun(); ... Derived *derived = std::launder(base);
uintptr_t derived_int = (uintptr_t)derived; /* derived_int = ptrtoint
(strip derived) */ /* Note: base_int == derived_...
2018 Mar 28
0
[cfe-dev] RFC: Devirtualization v2
...if (av == bv)
> b->foo();
> }
>
>
> int to ptr
> Here because we are creating a fat pointer from integer, we need to use launder:
>
> void foo(Base *base) {
> uintptr_t base_int = (uintptr_t)base;
> /* base_int = ptrtoint (strip base) */
> Base *base_int_ptr = (Base*)base_int;
> /* base_int_ptr = inttoptr base_int = inttoptr (ptrtoint (strip base)) = strip base */
> base_int_ptr->vfun();
> ...
> Derived *derived = std::launder(base);
> uintptr_t derived_int = (uintptr_t)derived;
> /* derived_int = ptrtoint (strip derive...
2018 Mar 29
2
[cfe-dev] RFC: Devirtualization v2
...av = (uintptr_t)a; auto
> bv = (uintptr_t)b; if (av == bv) b->foo();}int to ptrHere because
> we are creating a fat pointer from integer, we need to use launder:void
> foo(Base *base) { uintptr_t base_int = (uintptr_t)base; /* base_int =
> ptrtoint (strip base) */ Base *base_int_ptr = (Base*)base_int; /*
> base_int_ptr = inttoptr base_int = inttoptr (ptrtoint (strip base)) = strip
> base */ base_int_ptr->vfun(); ... Derived *derived = std::launder(base);
> uintptr_t derived_int = (uintptr_t)derived; /* derived_int = ptrtoint
> (strip derived) */ /* Note:...