mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-15 08:34:30 +02:00
8289633: Forbid raw C-heap allocation functions in hotspot and fix findings
Reviewed-by: kbarrett, dholmes
This commit is contained in:
parent
df063f7db1
commit
688712f75c
20 changed files with 78 additions and 43 deletions
|
@ -22,6 +22,7 @@
|
|||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "runtime/os.hpp" // malloc
|
||||
#include "utilities/align.hpp"
|
||||
#include "utilities/bitMap.inline.hpp"
|
||||
#include "utilities/copy.hpp"
|
||||
|
@ -45,11 +46,11 @@ private:
|
|||
public:
|
||||
BitMapMemory(idx_t bits) :
|
||||
_words(BitMap::calc_size_in_words(bits)),
|
||||
_memory(static_cast<bm_word_t*>(malloc(_words * sizeof(bm_word_t))))
|
||||
_memory(static_cast<bm_word_t*>(os::malloc(_words * sizeof(bm_word_t), mtTest)))
|
||||
{ }
|
||||
|
||||
~BitMapMemory() {
|
||||
free(_memory);
|
||||
os::free(_memory);
|
||||
}
|
||||
|
||||
BitMapView make_view(idx_t bits, bm_word_t value) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue