mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 11:34:38 +02:00
8074319: barrier_set_cast defined via friend injection
Changed the in-class definition to a friend declaration and move the definition to namespace scope Reviewed-by: jwilhelm, simonis
This commit is contained in:
parent
25c5065b89
commit
0401cdb946
1 changed files with 7 additions and 5 deletions
|
@ -68,11 +68,7 @@ private:
|
|||
// Downcast argument to a derived barrier set type.
|
||||
// The cast is checked in a debug build.
|
||||
// T must have a specialization for BarrierSet::GetName<T>.
|
||||
template<typename T>
|
||||
friend T* barrier_set_cast(BarrierSet* bs) {
|
||||
assert(bs->is_a(BarrierSet::GetName<T>::value), "wrong type of barrier set");
|
||||
return static_cast<T*>(bs);
|
||||
}
|
||||
template<typename T> friend T* barrier_set_cast(BarrierSet* bs);
|
||||
|
||||
public:
|
||||
// Note: This is not presently the Name corresponding to the
|
||||
|
@ -216,4 +212,10 @@ public:
|
|||
virtual void print_on(outputStream* st) const = 0;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
inline T* barrier_set_cast(BarrierSet* bs) {
|
||||
assert(bs->is_a(BarrierSet::GetName<T>::value), "wrong type of barrier set");
|
||||
return static_cast<T*>(bs);
|
||||
}
|
||||
|
||||
#endif // SHARE_VM_MEMORY_BARRIERSET_HPP
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue