Skip to content

Commit ebe318f

Browse files
committed
Add AnyPtr::is_null
1 parent 7374e08 commit ebe318f

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

libcc2rs/src/rc.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,6 +1115,10 @@ impl AnyPtr {
11151115
}
11161116
self.ptr.as_bytes().reinterpret_cast::<T>()
11171117
}
1118+
1119+
pub fn is_null(&self) -> bool {
1120+
self.ptr.is_null()
1121+
}
11181122
}
11191123

11201124
impl PartialEq for AnyPtr {

tests/unit/malloc_realloc_free.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// panic: refcount
21
#include <assert.h>
32
#include <stdlib.h>
43

0 commit comments

Comments
 (0)