forked from chakra-core/ChakraCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExpirableObject.h
More file actions
35 lines (28 loc) · 1.19 KB
/
Copy pathExpirableObject.h
File metadata and controls
35 lines (28 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
class ThreadContext;
class ExpirableObject: public FinalizableObject
{
public:
ExpirableObject(ThreadContext* threadContext);
virtual void Finalize(bool isShutdown);
virtual void Dispose(bool isShutdown) override;
virtual void Mark(Recycler *recycler) override { AssertMsg(false, "Mark called on object that isn't TrackableObject"); }
// Called when an expirable object gets expired
virtual void Expire() = 0;
virtual void EnterExpirableCollectMode();
bool IsObjectUsed();
void SetIsObjectUsed();
bool SupportsExpiration()
{
return (GetRegistrationHandle() != nullptr);
}
// Used by ThreadContext
void * GetRegistrationHandle();
void SetRegistrationHandle(void * registrationHandle);
void ClearRegistrationHandle();
private:
Field(intptr_t) registrationHandle;
};