8196880: VS2017 Addition of Global Delete Operator with Size Parameter Conflicts with Arena's Chunk Provided One
authorlfoltan
Tue, 20 Feb 2018 07:10:42 -0500
changeset 49023 6b8fb182bb17
parent 49022 83fd70753121
child 49024 953b3fd36b08
8196880: VS2017 Addition of Global Delete Operator with Size Parameter Conflicts with Arena's Chunk Provided One Summary: Add a private ordinary operator delete declaration within class Chunk. Reviewed-by: coleenp, stuefe Contributed-by: kim.barrett@oracle.com, lois.foltan@oracle.com
src/hotspot/share/adlc/arena.hpp
--- a/src/hotspot/share/adlc/arena.hpp	Tue Feb 20 07:00:49 2018 -0500
+++ b/src/hotspot/share/adlc/arena.hpp	Tue Feb 20 07:10:42 2018 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -69,6 +69,11 @@
 //------------------------------Chunk------------------------------------------
 // Linked list of raw memory chunks
 class Chunk: public CHeapObj {
+ private:
+  // This ordinary operator delete is needed even though not used, so the
+  // below two-argument operator delete will be treated as a placement
+  // delete rather than an ordinary sized delete; see C++14 3.7.4.2/p2.
+  void operator delete(void* p);
  public:
   void* operator new(size_t size, size_t length) throw();
   void  operator delete(void* p, size_t length);