mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8192061: Clean up allocation.inline.hpp includes
Reviewed-by: eosterlund, coleenp
This commit is contained in:
parent
177b24b7d7
commit
58dd5210ec
61 changed files with 409 additions and 256 deletions
|
@ -26,9 +26,9 @@
|
|||
#define SHARE_VM_UTILITIES_GROWABLEARRAY_HPP
|
||||
|
||||
#include "memory/allocation.hpp"
|
||||
#include "memory/allocation.inline.hpp"
|
||||
#include "utilities/debug.hpp"
|
||||
#include "utilities/globalDefinitions.hpp"
|
||||
#include "utilities/ostream.hpp"
|
||||
|
||||
// A growable array.
|
||||
|
||||
|
@ -144,6 +144,8 @@ class GenericGrowableArray : public ResourceObj {
|
|||
assert(on_stack(), "fast ResourceObj path only");
|
||||
return (void*)resource_allocate_bytes(thread, elementSize * _max);
|
||||
}
|
||||
|
||||
void free_C_heap(void* elements);
|
||||
};
|
||||
|
||||
template<class E> class GrowableArrayIterator;
|
||||
|
@ -451,7 +453,7 @@ template<class E> void GrowableArray<E>::grow(int j) {
|
|||
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) {
|
||||
FreeHeap(_data);
|
||||
free_C_heap(_data);
|
||||
}
|
||||
_data = newData;
|
||||
}
|
||||
|
@ -475,7 +477,7 @@ template<class E> void GrowableArray<E>::clear_and_deallocate() {
|
|||
clear();
|
||||
if (_data != NULL) {
|
||||
for (int i = 0; i < _max; i++) _data[i].~E();
|
||||
FreeHeap(_data);
|
||||
free_C_heap(_data);
|
||||
_data = NULL;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue