Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
fc190687
提交
fc190687
2月 10, 2012
创建
作者:
Nickolai Zeldovich
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rcu_freed base class. need to convert all RCU users to new interface
before we can use it, which also requires convering all namespace users to templatized namespace..
上级
c84b6d9c
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
26 行增加
和
4 行删除
+26
-4
Makefile
Makefile
+1
-1
gc.cc
gc.cc
+7
-0
gc.hh
gc.hh
+12
-0
ns.hh
ns.hh
+6
-3
没有找到文件。
Makefile
浏览文件 @
fc190687
...
...
@@ -26,7 +26,7 @@ COMFLAGS := -fno-pic -static -fno-builtin -fno-strict-aliasing -O2 -Wall \
-DHW_
$(HW)
-include
param.h
-include
compiler.h
COMFLAGS
+=
$(
shell
$(CC)
-fno-stack-protector
-E
-x
c /dev/null
>
/dev/null 2>&1
&&
echo
-fno-stack-protector
)
CFLAGS
:=
$(COMFLAGS)
-std
=
c99
CXXFLAGS
:=
$(COMFLAGS)
-std
=
c++0x
-Wno-sign-compare
-fno-exceptions
CXXFLAGS
:=
$(COMFLAGS)
-std
=
c++0x
-Wno-sign-compare
-fno-exceptions
-fno-rtti
ASFLAGS
=
-m64
-gdwarf-2
-MD
LDFLAGS
+=
-m
elf_x86_64
...
...
gc.cc
浏览文件 @
fc190687
...
...
@@ -336,3 +336,10 @@ initgc(void)
release
(
&
gcp
->
lock
);
}
}
void
del_rcu_freed
(
void
*
arg
)
{
rcu_freed
*
rf
=
(
rcu_freed
*
)
arg
;
delete
rf
;
}
gc.hh
0 → 100644
浏览文件 @
fc190687
#pragma once
class
rcu_freed
{
private
:
u64
_rcu_epoch
;
rcu_freed
*
_rcu_next
;
public
:
virtual
~
rcu_freed
()
{}
};
void
del_rcu_freed
(
void
*
);
ns.hh
浏览文件 @
fc190687
#pragma once
#include "gc.hh"
// name spaces
// XXX maybe use open hash table, no chain, better cache locality
...
...
@@ -16,7 +18,7 @@ class scoped_gc_epoch {
};
template
<
class
K
,
class
V
>
class
xelem
{
class
xelem
:
public
rcu_freed
{
public
:
V
val
;
int
next_lock
;
...
...
@@ -24,6 +26,7 @@ class xelem {
K
key
;
xelem
(
const
K
&
k
,
const
V
&
v
)
:
val
(
v
),
next_lock
(
0
),
next
(
0
),
key
(
k
)
{}
virtual
~
xelem
()
{}
};
template
<
class
K
,
class
V
>
...
...
@@ -73,7 +76,7 @@ class xns {
if
(
!
allowdup
)
{
for
(
auto
x
=
root
;
x
;
x
=
x
->
next
)
{
if
(
x
->
key
==
key
)
{
// XXX delete e
;
gc_delayed
(
e
,
del_rcu_freed
)
;
return
-
1
;
}
}
...
...
@@ -128,7 +131,7 @@ class xns {
}
*
pelock
=
0
;
// XXX delete e
;
gc_delayed
(
e
,
del_rcu_freed
)
;
return
true
;
}
...
...
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论