author | ohair |
Wed, 06 Apr 2011 22:06:11 -0700 | |
changeset 9035 | 1255eb81cc2f |
parent 7772 | bf119e738928 |
child 13678 | 5c8001201f98 |
permissions | -rw-r--r-- |
2 | 1 |
/* |
9035
1255eb81cc2f
7033660: Update copyright year to 2011 on any files changed in 2011
ohair
parents:
7772
diff
changeset
|
2 |
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. |
2 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
2 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
2 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5506 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
2 | 24 |
*/ |
25 |
||
26 |
#if !defined(_AWT_DEBUG_H) |
|
27 |
#define _AWT_DEBUG_H |
|
28 |
||
29 |
#include "debug_assert.h" |
|
30 |
#include "debug_trace.h" |
|
31 |
||
32 |
#if defined(DEBUG) |
|
33 |
#if defined(new) |
|
34 |
#error new has already been defined! |
|
35 |
#endif |
|
36 |
class AwtDebugSupport { |
|
37 |
public: |
|
38 |
AwtDebugSupport(); |
|
39 |
~AwtDebugSupport(); |
|
40 |
||
41 |
static void AssertCallback(const char * expr, const char * file, |
|
42 |
int line); |
|
43 |
/* This method signals that the VM is exiting cleanly, and thus the |
|
44 |
the debug memory manager should dump a leaks report when the |
|
45 |
VM has finished exiting. This method should not be called for |
|
46 |
termination exits (such as <CTRL>-C) */ |
|
47 |
static void GenerateLeaksReport(); |
|
48 |
}; |
|
49 |
||
50 |
extern void * operator new(size_t size, const char * filename, int linenumber); |
|
7772
bf119e738928
6999766: Changes to correct c/c++ language issues for use of parfait
dav
parents:
5506
diff
changeset
|
51 |
extern void * operator new[](size_t size, const char * filename, int linenumber); |
bf119e738928
6999766: Changes to correct c/c++ language issues for use of parfait
dav
parents:
5506
diff
changeset
|
52 |
|
2 | 53 |
#if _MSC_VER >= 1200 |
54 |
/* VC 6.0 is more strict about enforcing matching placement new & delete */ |
|
55 |
extern void operator delete(void *ptr, const char*, int); |
|
56 |
#endif |
|
7772
bf119e738928
6999766: Changes to correct c/c++ language issues for use of parfait
dav
parents:
5506
diff
changeset
|
57 |
|
bf119e738928
6999766: Changes to correct c/c++ language issues for use of parfait
dav
parents:
5506
diff
changeset
|
58 |
extern void operator delete(void *ptr) throw(); |
2 | 59 |
extern void DumpClipRectangle(const char * file, int line, int argc, const char * fmt, va_list arglist); |
60 |
extern void DumpUpdateRectangle(const char * file, int line, int argc, const char * fmt, va_list arglist); |
|
61 |
||
62 |
#define AWT_DUMP_UPDATE_RECTANGLE(_msg, _hwnd) \ |
|
63 |
_DTrace_Template(DumpUpdateRectangle, 2, "", (_msg), (_hwnd), 0, 0, 0, 0, 0, 0) |
|
64 |
||
65 |
#define AWT_DUMP_CLIP_RECTANGLE(_msg, _hwnd) \ |
|
66 |
_DTrace_Template(DumpClipRectangle, 2, "", (_msg), (_hwnd), 0, 0, 0, 0, 0, 0) |
|
67 |
||
68 |
#define new new(__FILE__, __LINE__) |
|
69 |
||
70 |
#define VERIFY(exp) DASSERT(exp) |
|
71 |
#define UNIMPLEMENTED() DASSERT(FALSE) |
|
72 |
||
73 |
/* Disable inlining. */ |
|
74 |
#define INLINE |
|
75 |
#else |
|
76 |
#define AWT_DUMP_UPDATE_RECTANGLE(_msg, _hwnd) ((void)0) |
|
77 |
#define AWT_DUMP_CLIP_RECTANGLE(_msg, _hwnd) ((void)0) |
|
78 |
||
79 |
#define UNIMPLEMENTED() \ |
|
80 |
SignalError(0, JAVAPKG "NullPointerException","unimplemented"); |
|
81 |
||
82 |
/* |
|
83 |
* VERIFY macro -- assertion where expression is always evaluated |
|
84 |
* (normally used for BOOL functions). |
|
85 |
*/ |
|
86 |
#define VERIFY(exp) ((void)(exp)) |
|
87 |
||
88 |
/* Enable inlining. */ |
|
89 |
#define INLINE inline |
|
90 |
#endif // DEBUG |
|
91 |
||
92 |
#endif // _AWT_DEBUG_H |