aboutsummaryrefslogtreecommitdiff
path: root/libjava/prims.cc
diff options
context:
space:
mode:
authorAnthony Green <green@gcc.gnu.org>2000-11-26 03:58:56 +0000
committerAnthony Green <green@gcc.gnu.org>2000-11-26 03:58:56 +0000
commit31280fb7c47e6a32289b4dfc47880a9f22a9d9b4 (patch)
tree271c97444f9f312ff7d98c59c17993b4b9218ea3 /libjava/prims.cc
parent1786009e06fdea320bf13b65f130632853c9386a (diff)
downloadgcc-31280fb7c47e6a32289b4dfc47880a9f22a9d9b4.zip
gcc-31280fb7c47e6a32289b4dfc47880a9f22a9d9b4.tar.gz
gcc-31280fb7c47e6a32289b4dfc47880a9f22a9d9b4.tar.bz2
prims.cc (_Jv_NewObjectArray): Undo placement change.
2000-11-25 Anthony Green <green@redhat.com> * prims.cc (_Jv_NewObjectArray): Undo placement change. (_Jv_NewPrimArray): Likewise. * gcj/array.h (__JArray): Undo const change. Removed constructor. (class JArray): Removed constructor. * java/lang/Thread.java (context_class_loader): New private data. (getContextClassLoader): New method. (setContextClassLoader): New method. (Thread): Initialize context_class_loader. * java/net/URLClassLoader.java: Import java.util.Enumeration. (getResource): Rename to findResource. (findResource): New method. Used to be getResource. (getResourceAsStream): Deleted. (jarFileize): Extracted logic from URLClassLoader constructor into this new private method. (addURL): New protected method. (URLClassLoader): Call jarFileize. Use addElement instead of insertElementAt. (findResources): New method. * java/lang/ClassLoader.java: Import java.util.Enumeration. (getResource): Implement correct logic. (findResource): New method. (getResources): New method. (findClass): Create a ClassNotFoundException with the name of the class rather than nothing at all. (defineClass) Only throw ClassFormatError. * java/lang/Class.java (forName): New method. * java/lang/Class.h (forName): New method. * java/lang/natClass.cc (forName): New method. From-SVN: r37751
Diffstat (limited to 'libjava/prims.cc')
-rw-r--r--libjava/prims.cc11
1 files changed, 3 insertions, 8 deletions
diff --git a/libjava/prims.cc b/libjava/prims.cc
index 22fa4b6..b6ac7f8 100644
--- a/libjava/prims.cc
+++ b/libjava/prims.cc
@@ -67,9 +67,6 @@ details. */
#include <ltdl.h>
#endif
-// We use placement new.
-#include <new>
-
// We allocate a single OutOfMemoryError exception which we keep
// around for use if we run out of memory.
static java::lang::OutOfMemoryError *no_memory;
@@ -414,9 +411,8 @@ _Jv_NewObjectArray (jsize count, jclass elementClass, jobject init)
obj = (jobjectArray) _Jv_AllocArray (size, klass);
if (__builtin_expect (! obj, false))
JvThrow (no_memory);
- // Use placement new to initialize length field.
- new (obj) __JArray (count);
- jobject *ptr = elements(obj);
+ obj->length = count;
+ jobject *ptr = elements (obj);
// We know the allocator returns zeroed memory. So don't bother
// zeroing it again.
if (init)
@@ -450,8 +446,7 @@ _Jv_NewPrimArray (jclass eltype, jint count)
__JArray *arr = (__JArray*) _Jv_AllocObj (size + elsize * count, klass);
if (__builtin_expect (! arr, false))
JvThrow (no_memory);
- // Use placement new to initialize length field.
- new (arr) __JArray (count);
+ arr->length = count;
// Note that we assume we are given zeroed memory by the allocator.
return arr;