This commit is contained in:
David Holmes 2016-01-27 05:59:31 +01:00
commit 4ca382aeee

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2016, 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
@ -169,7 +169,9 @@ template<class E> class GrowableArray : public GenericGrowableArray {
: GenericGrowableArray(initial_size, 0, C_heap, F) {
_data = (E*)raw_allocate(sizeof(E));
// Needed for Visual Studio 2012 and older
#ifdef _MSC_VER
#pragma warning(suppress: 4345)
#endif
for (int i = 0; i < _max; i++) ::new ((void*)&_data[i]) E();
}
@ -422,7 +424,9 @@ template<class E> void GrowableArray<E>::grow(int j) {
int i = 0;
for ( ; i < _len; i++) ::new ((void*)&newData[i]) E(_data[i]);
// Needed for Visual Studio 2012 and older
#ifdef _MSC_VER
#pragma warning(suppress: 4345)
#endif
for ( ; i < _max; i++) ::new ((void*)&newData[i]) E();
for (i = 0; i < old_max; i++) _data[i].~E();
if (on_C_heap() && _data != NULL) {