Skip to content

Commit 36acd5f

Browse files
committed
refactor(cndrv): Blob 移动到 memory,缩小范围
Signed-off-by: YdrMaster <ydrml@hotmail.com>
1 parent fc35abc commit 36acd5f

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

cndrv/src/lib.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![doc = include_str!("../README.md")]
1+
#![doc = include_str!("../README.md")]
22
#![cfg(detected_neuware)]
33
#![deny(warnings)]
44

@@ -82,11 +82,6 @@ pub use notifier::{Notifier, NotifierSpore};
8282
pub use queue::{Queue, QueueSpore};
8383
pub use version::{driver_version, library_version, Version};
8484

85-
struct Blob<P> {
86-
ptr: P,
87-
len: usize,
88-
}
89-
9085
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
9186
#[repr(transparent)]
9287
pub struct MemSize(pub usize);

cndrv/src/memory.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::{bindings::CNaddr, Blob, CurrentCtx, Queue};
1+
use crate::{bindings::CNaddr, CurrentCtx, Queue};
22
use context_spore::{impl_spore, AsRaw};
33
use std::{
44
alloc::Layout,
@@ -63,6 +63,11 @@ impl Queue<'_> {
6363
}
6464
}
6565

66+
struct Blob<P> {
67+
ptr: P,
68+
len: usize,
69+
}
70+
6671
impl_spore!(DevMem and DevMemSpore by (CurrentCtx, Blob<CNaddr>));
6772

6873
impl CurrentCtx {

0 commit comments

Comments
 (0)