Skip to content

Commit dcca4dd

Browse files
authored
Merge pull request #20459 from dmitripivkine/master
Clean up GC_Finalizable*Buffer classes code
2 parents 8d417d6 + a056906 commit dcca4dd

File tree

3 files changed

+26
-26
lines changed

3 files changed

+26
-26
lines changed

runtime/gc_base/FinalizableClassLoaderBuffer.hpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class GC_FinalizableClassLoaderBuffer
3838
private:
3939
J9ClassLoader *_head; /**< the head of the linked list of J9ClassLoader */
4040
J9ClassLoader *_tail; /**< the tail of the linked list of J9ClassLoader */
41-
UDATA _count; /**< the number of buffered J9ClassLoader */
41+
uintptr_t _count; /**< the number of buffered J9ClassLoader */
4242
MM_GCExtensions * const _extensions; /**< a cached pointer to the extensions structure */
4343
protected:
4444
public:
@@ -51,7 +51,7 @@ class GC_FinalizableClassLoaderBuffer
5151
* @param env[in] the current thread
5252
* @param object[in] the object to add
5353
*/
54-
void add(MM_EnvironmentBase* env, J9ClassLoader *loader)
54+
void add(MM_EnvironmentBase *env, J9ClassLoader *loader)
5555
{
5656
if (NULL == _head) {
5757
Assert_MM_true(NULL == _tail);
@@ -69,7 +69,7 @@ class GC_FinalizableClassLoaderBuffer
6969
}
7070
}
7171

72-
void flush(MM_EnvironmentBase* env)
72+
void flush(MM_EnvironmentBase *env)
7373
{
7474
if (NULL != _head) {
7575
Assert_MM_true(NULL != _tail);
@@ -88,9 +88,9 @@ class GC_FinalizableClassLoaderBuffer
8888
*/
8989
GC_FinalizableClassLoaderBuffer(MM_GCExtensions *extensions) :
9090
_head(NULL)
91-
,_tail(NULL)
92-
,_count(0)
93-
,_extensions(extensions)
91+
, _tail(NULL)
92+
, _count(0)
93+
, _extensions(extensions)
9494
{}
9595
};
9696
#endif /* FINALIZABLECLASSLOADERBUFFER_HPP_ */

runtime/gc_base/FinalizableObjectBuffer.hpp

+14-14
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,17 @@ class GC_FinalizableObjectBuffer
3939
private:
4040
j9object_t _systemHead; /**< the head of the linked list of finalizable objects loaded by the system class loader */
4141
j9object_t _systemTail; /**< the tail of the linked list of unfinalized objects loaded by the system class loader */
42-
UDATA _systemObjectCount; /**< the number of buffered objects loaded by the system class loader */
42+
uintptr_t _systemObjectCount; /**< the number of buffered objects loaded by the system class loader */
4343
j9object_t _defaultHead; /**< the head of the linked list of unfinalized objects not loaded by the system class loader */
4444
j9object_t _defaultTail; /**< the tail of the linked list of unfinalized objects not loaded by the system class loader */
45-
UDATA _defaultObjectCount; /**< the number of buffered objects not loaded by the system class loader */
45+
uintptr_t _defaultObjectCount; /**< the number of buffered objects not loaded by the system class loader */
4646
MM_GCExtensions * const _extensions; /**< a cached pointer to the extensions structure */
47-
J9ClassLoader* const _systemClassLoader;
47+
J9ClassLoader * const _systemClassLoader;
4848
protected:
4949
public:
5050

5151
private:
52-
void addSystemObject(MM_EnvironmentBase* env, j9object_t object) {
52+
void addSystemObject(MM_EnvironmentBase *env, j9object_t object) {
5353
if (NULL == _systemHead) {
5454
Assert_MM_true(NULL == _systemTail);
5555
Assert_MM_true(0 == _systemObjectCount);
@@ -66,7 +66,7 @@ class GC_FinalizableObjectBuffer
6666
}
6767
}
6868

69-
void addDefaultObject(MM_EnvironmentBase* env, j9object_t object) {
69+
void addDefaultObject(MM_EnvironmentBase *env, j9object_t object) {
7070
if (NULL == _defaultHead) {
7171
_extensions->accessBarrier->setFinalizeLink(object, NULL);
7272
_defaultHead = object;
@@ -85,7 +85,7 @@ class GC_FinalizableObjectBuffer
8585
* @param env[in] the current thread
8686
* @param object[in] the object to add
8787
*/
88-
virtual void add(MM_EnvironmentBase* env, j9object_t object)
88+
virtual void add(MM_EnvironmentBase *env, j9object_t object)
8989
{
9090
if (_systemClassLoader == (J9OBJECT_CLAZZ((J9VMThread *)env->getOmrVMThread()->_language_vmthread, object)->classLoader)) {
9191
addSystemObject(env, object);
@@ -94,7 +94,7 @@ class GC_FinalizableObjectBuffer
9494
}
9595
}
9696

97-
void flush(MM_EnvironmentBase* env)
97+
void flush(MM_EnvironmentBase *env)
9898
{
9999
GC_FinalizeListManager *finalizeListManager = _extensions->finalizeListManager;
100100
if (NULL != _systemHead) {
@@ -117,13 +117,13 @@ class GC_FinalizableObjectBuffer
117117
*/
118118
GC_FinalizableObjectBuffer(MM_GCExtensions *extensions) :
119119
_systemHead(NULL)
120-
,_systemTail(NULL)
121-
,_systemObjectCount(0)
122-
,_defaultHead(NULL)
123-
,_defaultTail(NULL)
124-
,_defaultObjectCount(0)
125-
,_extensions(extensions)
126-
,_systemClassLoader(((J9JavaVM *)extensions->getOmrVM()->_language_vm)->systemClassLoader)
120+
, _systemTail(NULL)
121+
, _systemObjectCount(0)
122+
, _defaultHead(NULL)
123+
, _defaultTail(NULL)
124+
, _defaultObjectCount(0)
125+
, _extensions(extensions)
126+
, _systemClassLoader(((J9JavaVM *)extensions->getOmrVM()->_language_vm)->systemClassLoader)
127127
{}
128128
};
129129
#endif /* FINALIZABLEOBJECTBUFFER_HPP_ */

runtime/gc_base/FinalizableReferenceBuffer.hpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class GC_FinalizableReferenceBuffer
3939
private:
4040
j9object_t _head; /**< the head of the linked list of reference objects */
4141
j9object_t _tail; /**< the tail of the linked list of reference objects */
42-
UDATA _count; /**< the number of buffered objects */
42+
uintptr_t _count; /**< the number of buffered objects */
4343
MM_GCExtensions * const _extensions; /**< a cached pointer to the extensions structure */
4444
protected:
4545
public:
@@ -52,7 +52,7 @@ class GC_FinalizableReferenceBuffer
5252
* @param env[in] the current thread
5353
* @param object[in] the object to add
5454
*/
55-
void add(MM_EnvironmentBase* env, j9object_t object)
55+
void add(MM_EnvironmentBase *env, j9object_t object)
5656
{
5757
if (NULL == _head) {
5858
Assert_MM_true(NULL == _tail);
@@ -70,7 +70,7 @@ class GC_FinalizableReferenceBuffer
7070
}
7171
}
7272

73-
void flush(MM_EnvironmentBase* env)
73+
void flush(MM_EnvironmentBase *env)
7474
{
7575
if (NULL != _head) {
7676
Assert_MM_true(NULL != _tail);
@@ -89,9 +89,9 @@ class GC_FinalizableReferenceBuffer
8989
*/
9090
GC_FinalizableReferenceBuffer(MM_GCExtensions *extensions) :
9191
_head(NULL)
92-
,_tail(NULL)
93-
,_count(0)
94-
,_extensions(extensions)
92+
, _tail(NULL)
93+
, _count(0)
94+
, _extensions(extensions)
9595
{}
9696
};
9797
#endif /* FINALIZABLEREFERENCEBUFFER_HPP_ */

0 commit comments

Comments
 (0)