equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
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 |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
318 void operator=(const Array<T>&); |
318 void operator=(const Array<T>&); |
319 |
319 |
320 void* operator new(size_t size, ClassLoaderData* loader_data, int length, bool read_only, TRAPS) { |
320 void* operator new(size_t size, ClassLoaderData* loader_data, int length, bool read_only, TRAPS) { |
321 size_t word_size = Array::size(length); |
321 size_t word_size = Array::size(length); |
322 return (void*) Metaspace::allocate(loader_data, word_size, read_only, |
322 return (void*) Metaspace::allocate(loader_data, word_size, read_only, |
323 Metaspace::NonClassType, CHECK_NULL); |
323 MetaspaceObj::array_type(sizeof(T)), CHECK_NULL); |
324 } |
324 } |
325 |
325 |
326 static size_t byte_sizeof(int length) { return sizeof(Array<T>) + MAX2(length - 1, 0) * sizeof(T); } |
326 static size_t byte_sizeof(int length) { return sizeof(Array<T>) + MAX2(length - 1, 0) * sizeof(T); } |
327 |
327 |
328 explicit Array(int length) : _length(length) { |
328 explicit Array(int length) : _length(length) { |