Skip to content

Commit 83d6745

Browse files
committed
8281450: Remove unnecessary operator new and delete from ObjectMonitor
Reviewed-by: dholmes
1 parent f5d8ceb commit 83d6745

File tree

2 files changed

+2
-20
lines changed

2 files changed

+2
-20
lines changed

src/hotspot/share/runtime/objectMonitor.cpp

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1998, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -233,19 +233,6 @@ OopStorage* ObjectMonitor::_oop_storage = NULL;
233233
// * See also http://blogs.sun.com/dave
234234

235235

236-
void* ObjectMonitor::operator new (size_t size) throw() {
237-
return AllocateHeap(size, mtInternal);
238-
}
239-
void* ObjectMonitor::operator new[] (size_t size) throw() {
240-
return operator new (size);
241-
}
242-
void ObjectMonitor::operator delete(void* p) {
243-
FreeHeap(p);
244-
}
245-
void ObjectMonitor::operator delete[] (void *p) {
246-
operator delete(p);
247-
}
248-
249236
// Check that object() and set_object() are called from the right context:
250237
static void check_object_context() {
251238
#ifdef ASSERT

src/hotspot/share/runtime/objectMonitor.hpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1998, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -203,11 +203,6 @@ class ObjectMonitor : public CHeapObj<mtInternal> {
203203

204204
static int Knob_SpinLimit;
205205

206-
void* operator new (size_t size) throw();
207-
void* operator new[] (size_t size) throw();
208-
void operator delete(void* p);
209-
void operator delete[] (void* p);
210-
211206
// TODO-FIXME: the "offset" routines should return a type of off_t instead of int ...
212207
// ByteSize would also be an appropriate type.
213208
static int header_offset_in_bytes() { return offset_of(ObjectMonitor, _header); }

0 commit comments

Comments
 (0)