[9] RFR(L): 8037816 : Fix for 8036122 breaks build with Xcode5/clang

John Rose john.r.rose at oracle.com
Fri Apr 18 00:03:21 UTC 2014


On Apr 17, 2014, at 4:31 PM, David Chase <david.r.chase at oracle.com> wrote:

>> Can we please not use a macro for this?  Use an inline method instead.
> 
> Will do.  What does a top-level inline method look like?
> Would this do?
> 
> static inline intptr_t p2i(void * p) { return (intptr_t) p; }

There are similar functions in globalDefinitions.hpp; see castable_address and pointer_delta.  You should use them as a model.  This is what you could get to:

inline intptr_t  p2i(const void* x) { return (intptr_t) x; }

I am not enough of a C Wizard to know whether you can just repurpose castable_address, or whether it should really be "void* x" or "const void* x".

You can put the definition either near castable_address and friends, or near the other defs that pertain to format hackery.

— John


More information about the hotspot-dev mailing list