[K/N] Handle permanent objects in new MM MemorySharedRefs ^KT-56233
Do not create a foreign ref to the permanent objects. There's no need to do it, and, moreover, this ref would have leaked.
This commit is contained in:
committed by
Space Team
parent
1f1b26f2a5
commit
8a8aeed998
@@ -46,6 +46,7 @@ static_assert(std::is_trivially_destructible_v<KRefSharedHolder>, "KRefSharedHol
|
||||
|
||||
class BackRefFromAssociatedObject {
|
||||
public:
|
||||
void initForPermanentObject(ObjHeader* obj);
|
||||
void initAndAddRef(ObjHeader* obj);
|
||||
|
||||
// Error if refCount is zero and it's called from the wrong worker with non-frozen obj_.
|
||||
@@ -65,6 +66,8 @@ class BackRefFromAssociatedObject {
|
||||
template <ErrorPolicy errorPolicy>
|
||||
ObjHeader* ref() const;
|
||||
|
||||
ObjHeader* refPermanent() const;
|
||||
|
||||
private:
|
||||
ObjHeader* obj_; // May be null before [initAndAddRef] or after [detach].
|
||||
ForeignRefContext context_;
|
||||
|
||||
Reference in New Issue
Block a user