1
0
Fork 0
forked from wry/wry

autocommit 2022-02-02 20:01:25 CET

This commit is contained in:
Julian Orth 2022-02-02 20:01:25 +01:00
parent 65a7a55b82
commit 89b8396932
12 changed files with 279 additions and 57 deletions

View file

@ -196,6 +196,29 @@ impl<T> NodeRef<T> {
pub fn append(&self, t: T) -> LinkedNode<T> {
unsafe { append(self.data, t) }
}
pub fn prev(&self) -> NodeRef<T> {
unsafe {
let data = self.data.as_ref();
let other = data.prev.get();
other.as_ref().rc.fetch_add(1);
NodeRef {
data: other,
}
}
}
#[allow(dead_code)]
pub fn next(&self) -> NodeRef<T> {
unsafe {
let data = self.data.as_ref();
let other = data.next.get();
other.as_ref().rc.fetch_add(1);
NodeRef {
data: other,
}
}
}
}
struct NodeData<T> {