Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
68a597dd
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看板
提交
68a597dd
编写于
7月 08, 2013
作者:
H
hseigel
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
0362f5f8
5622f783
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
11 addition
and
3 deletion
+11
-3
src/share/vm/memory/allocation.cpp
src/share/vm/memory/allocation.cpp
+8
-1
src/share/vm/memory/allocation.hpp
src/share/vm/memory/allocation.hpp
+2
-1
src/share/vm/runtime/handles.hpp
src/share/vm/runtime/handles.hpp
+1
-1
未找到文件。
src/share/vm/memory/allocation.cpp
浏览文件 @
68a597dd
...
@@ -236,10 +236,11 @@ class ChunkPool: public CHeapObj<mtInternal> {
...
@@ -236,10 +236,11 @@ class ChunkPool: public CHeapObj<mtInternal> {
size_t
_num_used
;
// number of chunks currently checked out
size_t
_num_used
;
// number of chunks currently checked out
const
size_t
_size
;
// size of each chunk (must be uniform)
const
size_t
_size
;
// size of each chunk (must be uniform)
// Our
three
static pools
// Our
four
static pools
static
ChunkPool
*
_large_pool
;
static
ChunkPool
*
_large_pool
;
static
ChunkPool
*
_medium_pool
;
static
ChunkPool
*
_medium_pool
;
static
ChunkPool
*
_small_pool
;
static
ChunkPool
*
_small_pool
;
static
ChunkPool
*
_tiny_pool
;
// return first element or null
// return first element or null
void
*
get_first
()
{
void
*
get_first
()
{
...
@@ -319,15 +320,18 @@ class ChunkPool: public CHeapObj<mtInternal> {
...
@@ -319,15 +320,18 @@ class ChunkPool: public CHeapObj<mtInternal> {
static
ChunkPool
*
large_pool
()
{
assert
(
_large_pool
!=
NULL
,
"must be initialized"
);
return
_large_pool
;
}
static
ChunkPool
*
large_pool
()
{
assert
(
_large_pool
!=
NULL
,
"must be initialized"
);
return
_large_pool
;
}
static
ChunkPool
*
medium_pool
()
{
assert
(
_medium_pool
!=
NULL
,
"must be initialized"
);
return
_medium_pool
;
}
static
ChunkPool
*
medium_pool
()
{
assert
(
_medium_pool
!=
NULL
,
"must be initialized"
);
return
_medium_pool
;
}
static
ChunkPool
*
small_pool
()
{
assert
(
_small_pool
!=
NULL
,
"must be initialized"
);
return
_small_pool
;
}
static
ChunkPool
*
small_pool
()
{
assert
(
_small_pool
!=
NULL
,
"must be initialized"
);
return
_small_pool
;
}
static
ChunkPool
*
tiny_pool
()
{
assert
(
_tiny_pool
!=
NULL
,
"must be initialized"
);
return
_tiny_pool
;
}
static
void
initialize
()
{
static
void
initialize
()
{
_large_pool
=
new
ChunkPool
(
Chunk
::
size
+
Chunk
::
aligned_overhead_size
());
_large_pool
=
new
ChunkPool
(
Chunk
::
size
+
Chunk
::
aligned_overhead_size
());
_medium_pool
=
new
ChunkPool
(
Chunk
::
medium_size
+
Chunk
::
aligned_overhead_size
());
_medium_pool
=
new
ChunkPool
(
Chunk
::
medium_size
+
Chunk
::
aligned_overhead_size
());
_small_pool
=
new
ChunkPool
(
Chunk
::
init_size
+
Chunk
::
aligned_overhead_size
());
_small_pool
=
new
ChunkPool
(
Chunk
::
init_size
+
Chunk
::
aligned_overhead_size
());
_tiny_pool
=
new
ChunkPool
(
Chunk
::
tiny_size
+
Chunk
::
aligned_overhead_size
());
}
}
static
void
clean
()
{
static
void
clean
()
{
enum
{
BlocksToKeep
=
5
};
enum
{
BlocksToKeep
=
5
};
_tiny_pool
->
free_all_but
(
BlocksToKeep
);
_small_pool
->
free_all_but
(
BlocksToKeep
);
_small_pool
->
free_all_but
(
BlocksToKeep
);
_medium_pool
->
free_all_but
(
BlocksToKeep
);
_medium_pool
->
free_all_but
(
BlocksToKeep
);
_large_pool
->
free_all_but
(
BlocksToKeep
);
_large_pool
->
free_all_but
(
BlocksToKeep
);
...
@@ -337,6 +341,7 @@ class ChunkPool: public CHeapObj<mtInternal> {
...
@@ -337,6 +341,7 @@ class ChunkPool: public CHeapObj<mtInternal> {
ChunkPool
*
ChunkPool
::
_large_pool
=
NULL
;
ChunkPool
*
ChunkPool
::
_large_pool
=
NULL
;
ChunkPool
*
ChunkPool
::
_medium_pool
=
NULL
;
ChunkPool
*
ChunkPool
::
_medium_pool
=
NULL
;
ChunkPool
*
ChunkPool
::
_small_pool
=
NULL
;
ChunkPool
*
ChunkPool
::
_small_pool
=
NULL
;
ChunkPool
*
ChunkPool
::
_tiny_pool
=
NULL
;
void
chunkpool_init
()
{
void
chunkpool_init
()
{
ChunkPool
::
initialize
();
ChunkPool
::
initialize
();
...
@@ -376,6 +381,7 @@ void* Chunk::operator new (size_t requested_size, AllocFailType alloc_failmode,
...
@@ -376,6 +381,7 @@ void* Chunk::operator new (size_t requested_size, AllocFailType alloc_failmode,
case
Chunk
::
size
:
return
ChunkPool
::
large_pool
()
->
allocate
(
bytes
,
alloc_failmode
);
case
Chunk
::
size
:
return
ChunkPool
::
large_pool
()
->
allocate
(
bytes
,
alloc_failmode
);
case
Chunk
::
medium_size
:
return
ChunkPool
::
medium_pool
()
->
allocate
(
bytes
,
alloc_failmode
);
case
Chunk
::
medium_size
:
return
ChunkPool
::
medium_pool
()
->
allocate
(
bytes
,
alloc_failmode
);
case
Chunk
::
init_size
:
return
ChunkPool
::
small_pool
()
->
allocate
(
bytes
,
alloc_failmode
);
case
Chunk
::
init_size
:
return
ChunkPool
::
small_pool
()
->
allocate
(
bytes
,
alloc_failmode
);
case
Chunk
::
tiny_size
:
return
ChunkPool
::
tiny_pool
()
->
allocate
(
bytes
,
alloc_failmode
);
default:
{
default:
{
void
*
p
=
os
::
malloc
(
bytes
,
mtChunk
,
CALLER_PC
);
void
*
p
=
os
::
malloc
(
bytes
,
mtChunk
,
CALLER_PC
);
if
(
p
==
NULL
&&
alloc_failmode
==
AllocFailStrategy
::
EXIT_OOM
)
{
if
(
p
==
NULL
&&
alloc_failmode
==
AllocFailStrategy
::
EXIT_OOM
)
{
...
@@ -392,6 +398,7 @@ void Chunk::operator delete(void* p) {
...
@@ -392,6 +398,7 @@ void Chunk::operator delete(void* p) {
case
Chunk
::
size
:
ChunkPool
::
large_pool
()
->
free
(
c
);
break
;
case
Chunk
::
size
:
ChunkPool
::
large_pool
()
->
free
(
c
);
break
;
case
Chunk
::
medium_size
:
ChunkPool
::
medium_pool
()
->
free
(
c
);
break
;
case
Chunk
::
medium_size
:
ChunkPool
::
medium_pool
()
->
free
(
c
);
break
;
case
Chunk
::
init_size
:
ChunkPool
::
small_pool
()
->
free
(
c
);
break
;
case
Chunk
::
init_size
:
ChunkPool
::
small_pool
()
->
free
(
c
);
break
;
case
Chunk
::
tiny_size
:
ChunkPool
::
tiny_pool
()
->
free
(
c
);
break
;
default:
os
::
free
(
c
,
mtChunk
);
default:
os
::
free
(
c
,
mtChunk
);
}
}
}
}
...
...
src/share/vm/memory/allocation.hpp
浏览文件 @
68a597dd
...
@@ -353,7 +353,8 @@ class Chunk: CHeapObj<mtChunk> {
...
@@ -353,7 +353,8 @@ class Chunk: CHeapObj<mtChunk> {
slack
=
20
,
// suspected sizeof(Chunk) + internal malloc headers
slack
=
20
,
// suspected sizeof(Chunk) + internal malloc headers
#endif
#endif
init_size
=
1
*
K
-
slack
,
// Size of first chunk
tiny_size
=
256
-
slack
,
// Size of first chunk (tiny)
init_size
=
1
*
K
-
slack
,
// Size of first chunk (normal aka small)
medium_size
=
10
*
K
-
slack
,
// Size of medium-sized chunk
medium_size
=
10
*
K
-
slack
,
// Size of medium-sized chunk
size
=
32
*
K
-
slack
,
// Default size of an Arena chunk (following the first)
size
=
32
*
K
-
slack
,
// Default size of an Arena chunk (following the first)
non_pool_size
=
init_size
+
32
// An initial size which is not one of above
non_pool_size
=
init_size
+
32
// An initial size which is not one of above
...
...
src/share/vm/runtime/handles.hpp
浏览文件 @
68a597dd
...
@@ -227,7 +227,7 @@ class HandleArea: public Arena {
...
@@ -227,7 +227,7 @@ class HandleArea: public Arena {
HandleArea
*
_prev
;
// link to outer (older) area
HandleArea
*
_prev
;
// link to outer (older) area
public:
public:
// Constructor
// Constructor
HandleArea
(
HandleArea
*
prev
)
{
HandleArea
(
HandleArea
*
prev
)
:
Arena
(
Chunk
::
tiny_size
)
{
debug_only
(
_handle_mark_nesting
=
0
);
debug_only
(
_handle_mark_nesting
=
0
);
debug_only
(
_no_handle_mark_nesting
=
0
);
debug_only
(
_no_handle_mark_nesting
=
0
);
_prev
=
prev
;
_prev
=
prev
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录