Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/runtime/gc_modron_startup/mmparse.h
5986 views
1
2
/*******************************************************************************
3
* Copyright (c) 1991, 2020 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_Modron_Startup
27
*/
28
29
#if !defined(MMPARSE_H_)
30
#define MMPARSE_H_
31
32
class MM_GCExtensions;
33
34
/**
35
* All GC Memory Parameters
36
*/
37
typedef enum {
38
opt_Xmx = 0,
39
opt_Xmca,
40
opt_Xmco,
41
opt_Xmcrs,
42
opt_Xmn,
43
opt_Xmns,
44
opt_Xmnx,
45
opt_Xmo,
46
opt_Xmos,
47
opt_Xmox,
48
opt_Xms,
49
opt_Xmoi,
50
opt_Xmrx,
51
opt_Xmr,
52
opt_Xmdx,
53
opt_Xsoftmx,
54
opt_maxRAMPercent,
55
opt_initialRAMPercent,
56
opt_none
57
} gcMemoryParameters;
58
59
/* When displaying, maximum number of characters required, plus the "-" i.e. -Xmox */
60
#define MAXIMUM_GC_MEMORY_PARAMETER_LENGTH 8 /* -Xsoftmx is longer than the others (length 5) */
61
62
/**
63
* Manipulate GC memory parameters.
64
*
65
* GC memory parameters can either be provided by the user, or calculated based
66
* on a memoryParameter value stored in GCExtensions (Xmdx/Xmx/Xms).
67
* This structure contains the information required to manipulate a non user provided value.
68
* @ingroup GC_Modron_Startup
69
*/
70
struct J9GcMemoryParameter {
71
UDATA MM_GCExtensions::*fieldOffset;
72
gcMemoryParameters optionName;
73
UDATA valueMax;
74
UDATA valueMin;
75
UDATA MM_GCExtensions::*valueBaseOffset;
76
UDATA scaleNumerator;
77
UDATA scaleDenominator;
78
UDATA valueRound;
79
};
80
81
#ifdef __cplusplus
82
extern "C" {
83
#endif
84
85
jint gcParseCommandLineAndInitializeWithValues(J9JavaVM *vm, IDATA *memoryParameters);
86
bool gcParseTGCCommandLine(J9JavaVM *vm);
87
88
jint gcParseXgcArguments(J9JavaVM *vm, char *optArg);
89
jint gcParseXXgcArguments(J9JavaVM *vm, char *optArg);
90
bool scan_udata_helper(J9JavaVM *javaVM, char **cursor, UDATA *value, const char *argName);
91
bool scan_u32_helper(J9JavaVM *javaVM, char **cursor, U_32 *value, const char *argName);
92
bool scan_u64_helper(J9JavaVM *javaVM, char **cursor, U_64 *value, const char *argName);
93
bool scan_udata_memory_size_helper(J9JavaVM *javaVM, char **cursor, uintptr_t *value, const char *argName);
94
bool scan_u64_memory_size_helper(J9JavaVM *javaVM, char **cursor, uint64_t *value, const char *argName);
95
bool scan_hex_helper(J9JavaVM *javaVM, char **cursor, UDATA *value, const char *argName);
96
void gcParseXgcpolicy(MM_GCExtensions *extensions);
97
98
#ifdef __cplusplus
99
} /* extern "C" { */
100
#endif
101
102
#endif /* MMPARSE_H_ */
103
104