Path: blob/master/runtime/gc_include/ResourceManagedSupport.h
5986 views
1/*******************************************************************************2* Copyright (c) 1991, 2017 IBM Corp. and others3*4* This program and the accompanying materials are made available under5* the terms of the Eclipse Public License 2.0 which accompanies this6* distribution and is available at https://www.eclipse.org/legal/epl-2.0/7* or the Apache License, Version 2.0 which accompanies this distribution and8* is available at https://www.apache.org/licenses/LICENSE-2.0.9*10* This Source Code may also be made available under the following11* Secondary Licenses when the conditions for such availability set12* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU13* General Public License, version 2 with the GNU Classpath14* Exception [1] and GNU General Public License, version 2 with the15* OpenJDK Assembly Exception [2].16*17* [1] https://www.gnu.org/software/classpath/license.html18* [2] http://openjdk.java.net/legal/assembly-exception.html19*20* 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-exception21*******************************************************************************/2223/**24* @file25* @ingroup GC_Include26*/2728#if !defined(RESOURCEMANAGEDSUPPORT_H_)29#define RESOURCEMANAGEDSUPPORT_H_30/* @ddr_namespace: map_to_type=ResourceManagedSupportConstants */31#include "j9.h"32#include "j9cfg.h"3334#ifdef __cplusplus35extern "C" {36#endif /* __cplusplus */3738/**39* @ingroup GC_Include40* @name Return codes for memory space merge operation.41* @{42*/43#define MM_RESMAN_MERGE_OK (UDATA)044#define MM_RESMAN_MERGE_FAILED (UDATA)145/**46* @}47*/4849/**50* @ingroup GC_Include51* @name Return codes for object move operation.52* @{53*/54#define MM_RESMAN_OBJ_MOVE_OK (UDATA)055#define MM_RESMAN_OBJ_MOVE_FAILED (UDATA)156/**57* @}58*/5960/**61* Merge a memory space into another.62* This operation will move all live data from the source memory space into the destination memory space, expanding63* if required. The move is not partial, but an all-or-nothing operation. If the move fails, there may be memory64* consumed in the destination which is "dead", and will be reclaimed on the next garbage collect.65* @return MM_RESMAN_MERGE_OK on success, otherwise fail.66*/67UDATA68mergeMemorySpaces(J9VMThread *vmThread, void *destinationMemorySpace, void *sourceMemorySpace);6970/**71* Move an object to the given memory space.72* This operation will allocate the object pointer in the given memory space, fixing all references to the object73* in the heap to point at the new location. The old object is left intact, but is effectively dead.74* @return MM_RESMAN_OBJ_MOVE_OK on success, otherwise fail.75*/76UDATA77moveObjectToMemorySpace(J9VMThread *vmThread, void *destinationMemorySpace, j9object_t objectPtr);7879/**80* Determine whether an object is in a given memory space.81* @return non-zero if the object is in the memory space, 0 otherwise.82*/83UDATA84isObjectInMemorySpace(J9VMThread *vmThread, void *memorySpace, j9object_t objectPtr);8586/**87* Determine whether a memory space has any external references.88* @return non-zero if there are any references to the space89*/90UDATA91isMemorySpaceReferenced(J9VMThread *vmThread, void *memorySpace);9293#ifdef __cplusplus94} /* extern "C" { */95#endif /* __cplusplus */9697#endif /* RESOURCEMANAGEDSUPPORT_H_ */9899100