Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
94d1970b
R
Rust
项目概览
int
/
Rust
11 个月 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
94d1970b
编写于
3月 28, 2018
作者:
S
Simon Sapin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move the alloc::allocator module to core::heap
This is the `Alloc` trait and its dependencies.
上级
1169541e
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
17 addition
and
11 deletion
+17
-11
src/liballoc/heap.rs
src/liballoc/heap.rs
+1
-1
src/liballoc/lib.rs
src/liballoc/lib.rs
+4
-3
src/libcore/heap.rs
src/libcore/heap.rs
+6
-6
src/libcore/lib.rs
src/libcore/lib.rs
+4
-0
src/libstd/heap.rs
src/libstd/heap.rs
+2
-1
未找到文件。
src/liballoc/heap.rs
浏览文件 @
94d1970b
...
...
@@ -19,7 +19,7 @@
use
core
::
mem
::{
self
,
ManuallyDrop
};
use
core
::
usize
;
pub
use
allocator
::
*
;
pub
use
core
::
heap
::
*
;
#[doc(hidden)]
pub
mod
__
core
{
pub
use
core
::
*
;
...
...
src/liballoc/lib.rs
浏览文件 @
94d1970b
...
...
@@ -81,6 +81,7 @@
#![cfg_attr(not(test),
feature(exact_size_is_empty))]
#![cfg_attr(not(test),
feature(generator_trait))]
#![cfg_attr(test,
feature(rand,
test))]
#![feature(allocator_api)]
#![feature(allow_internal_unstable)]
#![feature(ascii_ctype)]
#![feature(box_into_raw_non_null)]
...
...
@@ -145,9 +146,9 @@
#[macro_use]
mod
macros
;
// Allocator trait and helper struct definitions
pub
mod
allocator
;
#[rustc_deprecated(since
=
"1.27.0"
,
reason
=
"use the heap module in core, alloc, or std instead"
)]
#[unstable(feature
=
"allocator_api"
,
issue
=
"32838"
)]
pub
use
core
::
heap
as
allocator
;
// Heaps provided for low-level allocation strategies
...
...
src/lib
alloc/allocator
.rs
→
src/lib
core/heap
.rs
浏览文件 @
94d1970b
...
...
@@ -15,11 +15,11 @@
tracing garbage collector"
,
issue
=
"32838"
)]
use
c
ore
::
c
mp
;
use
core
::
fmt
;
use
core
::
mem
;
use
core
::
usize
;
use
core
::
ptr
::{
self
,
NonNull
};
use
cmp
;
use
fmt
;
use
mem
;
use
usize
;
use
ptr
::{
self
,
NonNull
};
/// Represents the combination of a starting address and
/// a total capacity of the returned block.
...
...
@@ -568,7 +568,7 @@ pub unsafe trait Alloc {
/// invoked method, and let the client decide whether to invoke
/// this `oom` method in response.
fn
oom
(
&
mut
self
,
_
:
AllocErr
)
->
!
{
unsafe
{
::
core
::
intrinsics
::
abort
()
}
unsafe
{
::
intrinsics
::
abort
()
}
}
// == ALLOCATOR-SPECIFIC QUANTITIES AND LIMITS ==
...
...
src/libcore/lib.rs
浏览文件 @
94d1970b
...
...
@@ -185,6 +185,10 @@
pub
mod
fmt
;
pub
mod
time
;
/* Heap memory allocator trait */
#[allow(missing_docs)]
pub
mod
heap
;
// note: does not need to be public
mod
char_private
;
mod
iter_private
;
...
...
src/libstd/heap.rs
浏览文件 @
94d1970b
...
...
@@ -12,8 +12,9 @@
#![unstable(issue
=
"32838"
,
feature
=
"allocator_api"
)]
pub
use
alloc
::
heap
::
{
Heap
,
Alloc
,
Layout
,
Excess
,
CannotReallocInPlace
,
AllocErr
}
;
pub
use
alloc
::
heap
::
Heap
;
pub
use
alloc_system
::
System
;
pub
use
core
::
heap
::
*
;
#[cfg(not(test))]
#[doc(hidden)]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录