--- old/src/hotspot/share/utilities/macros.hpp 2019-12-01 18:05:06.558815040 -0500 +++ new/src/hotspot/share/utilities/macros.hpp 2019-12-01 18:05:06.306801537 -0500 @@ -46,6 +46,19 @@ #define PASTE_TOKENS_AUX(x, y) PASTE_TOKENS_AUX2(x, y) #define PASTE_TOKENS_AUX2(x, y) x ## y +// Declare the named class to be noncopyable. This macro must be used in +// a private part of the class's definition, followed by a semi-colon. +// Doing so provides private declarations for the class's copy constructor +// and assignment operator. Because these operations are private, most +// potential callers will fail to compile because they are inaccessible. +// The operations intentionally lack a definition, to provoke link-time +// failures for calls from contexts where they are accessible, e.g. from +// within the class or from a friend of the class. +// Note: The lack of definitions is still not completely bullet-proof, as +// an apparent call might be optimized away by copy elision. +// For C++11 the declarations should be changed to deleted definitions. +#define NONCOPYABLE(C) C(C const&); C& operator=(C const&) /* next token must be ; */ + // -DINCLUDE_=0 | 1 can be specified on the command line to include // or exclude functionality.