Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
010c5ffe
D
dragonwell8_hotspot
项目概览
openanolis
/
dragonwell8_hotspot
通知
2
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_hotspot
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
010c5ffe
编写于
4月 27, 2011
作者:
Z
zgu
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
dac7ba64
2c79479b
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
20 addition
and
7 deletion
+20
-7
src/share/vm/memory/allocation.cpp
src/share/vm/memory/allocation.cpp
+8
-0
src/share/vm/memory/allocation.hpp
src/share/vm/memory/allocation.hpp
+3
-0
src/share/vm/utilities/elfFile.cpp
src/share/vm/utilities/elfFile.cpp
+5
-4
src/share/vm/utilities/elfStringTable.cpp
src/share/vm/utilities/elfStringTable.cpp
+4
-3
未找到文件。
src/share/vm/memory/allocation.cpp
浏览文件 @
010c5ffe
...
...
@@ -44,6 +44,14 @@ void* CHeapObj::operator new(size_t size){
return
(
void
*
)
AllocateHeap
(
size
,
"CHeapObj-new"
);
}
void
*
CHeapObj
::
operator
new
(
size_t
size
,
const
std
::
nothrow_t
&
nothrow_constant
)
{
char
*
p
=
(
char
*
)
os
::
malloc
(
size
);
#ifdef ASSERT
if
(
PrintMallocFree
)
trace_heap_malloc
(
size
,
"CHeapObj-new"
,
p
);
#endif
return
p
;
}
void
CHeapObj
::
operator
delete
(
void
*
p
){
FreeHeap
(
p
);
}
...
...
src/share/vm/memory/allocation.hpp
浏览文件 @
010c5ffe
...
...
@@ -34,6 +34,8 @@
#include "opto/c2_globals.hpp"
#endif
#include <new>
#define ARENA_ALIGN_M1 (((size_t)(ARENA_AMALLOC_ALIGNMENT)) - 1)
#define ARENA_ALIGN_MASK (~((size_t)ARENA_ALIGN_M1))
#define ARENA_ALIGN(x) ((((size_t)(x)) + ARENA_ALIGN_M1) & ARENA_ALIGN_MASK)
...
...
@@ -99,6 +101,7 @@ class AllocatedObj {
class
CHeapObj
ALLOCATION_SUPER_CLASS_SPEC
{
public:
void
*
operator
new
(
size_t
size
);
void
*
operator
new
(
size_t
size
,
const
std
::
nothrow_t
&
nothrow_constant
);
void
operator
delete
(
void
*
p
);
void
*
new_array
(
size_t
size
);
};
...
...
src/share/vm/utilities/elfFile.cpp
浏览文件 @
010c5ffe
...
...
@@ -29,6 +29,7 @@
#include <string.h>
#include <stdio.h>
#include <limits.h>
#include <new>
#include "memory/allocation.inline.hpp"
#include "utilities/decoder.hpp"
...
...
@@ -46,7 +47,7 @@ ElfFile::ElfFile(const char* filepath) {
m_status
=
Decoder
::
no_error
;
int
len
=
strlen
(
filepath
)
+
1
;
m_filepath
=
NEW_C_HEAP_ARRAY
(
char
,
len
);
m_filepath
=
(
const
char
*
)
os
::
malloc
(
len
*
sizeof
(
char
)
);
if
(
m_filepath
!=
NULL
)
{
strcpy
((
char
*
)
m_filepath
,
filepath
);
m_file
=
fopen
(
filepath
,
"r"
);
...
...
@@ -74,7 +75,7 @@ ElfFile::~ElfFile() {
}
if
(
m_filepath
!=
NULL
)
{
FREE_C_HEAP_ARRAY
(
char
,
m_filepath
);
os
::
free
((
void
*
)
m_filepath
);
}
if
(
m_next
!=
NULL
)
{
...
...
@@ -120,14 +121,14 @@ bool ElfFile::load_tables() {
}
// string table
if
(
shdr
.
sh_type
==
SHT_STRTAB
)
{
ElfStringTable
*
table
=
new
ElfStringTable
(
m_file
,
shdr
,
index
);
ElfStringTable
*
table
=
new
(
std
::
nothrow
)
ElfStringTable
(
m_file
,
shdr
,
index
);
if
(
table
==
NULL
)
{
m_status
=
Decoder
::
out_of_memory
;
return
false
;
}
add_string_table
(
table
);
}
else
if
(
shdr
.
sh_type
==
SHT_SYMTAB
||
shdr
.
sh_type
==
SHT_DYNSYM
)
{
ElfSymbolTable
*
table
=
new
ElfSymbolTable
(
m_file
,
shdr
);
ElfSymbolTable
*
table
=
new
(
std
::
nothrow
)
ElfSymbolTable
(
m_file
,
shdr
);
if
(
table
==
NULL
)
{
m_status
=
Decoder
::
out_of_memory
;
return
false
;
...
...
src/share/vm/utilities/elfStringTable.cpp
浏览文件 @
010c5ffe
...
...
@@ -27,6 +27,7 @@
#ifndef _WINDOWS
#include "memory/allocation.inline.hpp"
#include "runtime/os.hpp"
#include "utilities/elfStringTable.hpp"
// We will try to load whole string table into memory if we can.
...
...
@@ -41,14 +42,14 @@ ElfStringTable::ElfStringTable(FILE* file, Elf_Shdr shdr, int index) {
// try to load the string table
long
cur_offset
=
ftell
(
file
);
m_table
=
(
char
*
)
NEW_C_HEAP_ARRAY
(
char
,
shdr
.
sh_size
);
m_table
=
(
char
*
)
os
::
malloc
(
sizeof
(
char
)
*
shdr
.
sh_size
);
if
(
m_table
!=
NULL
)
{
// if there is an error, mark the error
if
(
fseek
(
file
,
shdr
.
sh_offset
,
SEEK_SET
)
||
fread
((
void
*
)
m_table
,
shdr
.
sh_size
,
1
,
file
)
!=
1
||
fseek
(
file
,
cur_offset
,
SEEK_SET
))
{
m_status
=
Decoder
::
file_invalid
;
FREE_C_HEAP_ARRAY
(
char
,
m_table
);
os
::
free
((
void
*
)
m_table
);
m_table
=
NULL
;
}
}
else
{
...
...
@@ -58,7 +59,7 @@ ElfStringTable::ElfStringTable(FILE* file, Elf_Shdr shdr, int index) {
ElfStringTable
::~
ElfStringTable
()
{
if
(
m_table
!=
NULL
)
{
FREE_C_HEAP_ARRAY
(
char
,
m_table
);
os
::
free
((
void
*
)
m_table
);
}
if
(
m_next
!=
NULL
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录