Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/runtime/gc_include/ResourceManagedSupport.h
5986 views
1
2
/*******************************************************************************
3
* Copyright (c) 1991, 2017 IBM Corp. and others
4
*
5
* This program and the accompanying materials are made available under
6
* the terms of the Eclipse Public License 2.0 which accompanies this
7
* distribution and is available at https://www.eclipse.org/legal/epl-2.0/
8
* or the Apache License, Version 2.0 which accompanies this distribution and
9
* is available at https://www.apache.org/licenses/LICENSE-2.0.
10
*
11
* This Source Code may also be made available under the following
12
* Secondary Licenses when the conditions for such availability set
13
* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
14
* General Public License, version 2 with the GNU Classpath
15
* Exception [1] and GNU General Public License, version 2 with the
16
* OpenJDK Assembly Exception [2].
17
*
18
* [1] https://www.gnu.org/software/classpath/license.html
19
* [2] http://openjdk.java.net/legal/assembly-exception.html
20
*
21
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
22
*******************************************************************************/
23
24
/**
25
* @file
26
* @ingroup GC_Include
27
*/
28
29
#if !defined(RESOURCEMANAGEDSUPPORT_H_)
30
#define RESOURCEMANAGEDSUPPORT_H_
31
/* @ddr_namespace: map_to_type=ResourceManagedSupportConstants */
32
#include "j9.h"
33
#include "j9cfg.h"
34
35
#ifdef __cplusplus
36
extern "C" {
37
#endif /* __cplusplus */
38
39
/**
40
* @ingroup GC_Include
41
* @name Return codes for memory space merge operation.
42
* @{
43
*/
44
#define MM_RESMAN_MERGE_OK (UDATA)0
45
#define MM_RESMAN_MERGE_FAILED (UDATA)1
46
/**
47
* @}
48
*/
49
50
/**
51
* @ingroup GC_Include
52
* @name Return codes for object move operation.
53
* @{
54
*/
55
#define MM_RESMAN_OBJ_MOVE_OK (UDATA)0
56
#define MM_RESMAN_OBJ_MOVE_FAILED (UDATA)1
57
/**
58
* @}
59
*/
60
61
/**
62
* Merge a memory space into another.
63
* This operation will move all live data from the source memory space into the destination memory space, expanding
64
* if required. The move is not partial, but an all-or-nothing operation. If the move fails, there may be memory
65
* consumed in the destination which is "dead", and will be reclaimed on the next garbage collect.
66
* @return MM_RESMAN_MERGE_OK on success, otherwise fail.
67
*/
68
UDATA
69
mergeMemorySpaces(J9VMThread *vmThread, void *destinationMemorySpace, void *sourceMemorySpace);
70
71
/**
72
* Move an object to the given memory space.
73
* This operation will allocate the object pointer in the given memory space, fixing all references to the object
74
* in the heap to point at the new location. The old object is left intact, but is effectively dead.
75
* @return MM_RESMAN_OBJ_MOVE_OK on success, otherwise fail.
76
*/
77
UDATA
78
moveObjectToMemorySpace(J9VMThread *vmThread, void *destinationMemorySpace, j9object_t objectPtr);
79
80
/**
81
* Determine whether an object is in a given memory space.
82
* @return non-zero if the object is in the memory space, 0 otherwise.
83
*/
84
UDATA
85
isObjectInMemorySpace(J9VMThread *vmThread, void *memorySpace, j9object_t objectPtr);
86
87
/**
88
* Determine whether a memory space has any external references.
89
* @return non-zero if there are any references to the space
90
*/
91
UDATA
92
isMemorySpaceReferenced(J9VMThread *vmThread, void *memorySpace);
93
94
#ifdef __cplusplus
95
} /* extern "C" { */
96
#endif /* __cplusplus */
97
98
#endif /* RESOURCEMANAGEDSUPPORT_H_ */
99
100