Skip to content

Commit 8e8d7aa

Browse files
committed
Inline th refcount functions
1 parent 7ca45fd commit 8e8d7aa

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

custom.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
/// # Safety
55
/// If the reference count is decremented to zero, the object is freed and `objPtr` turns into a null pointer.
66
/// If objPtr is null, UB occurs.
7+
#[inline(always)]
78
pub unsafe fn Tcl_DecrRefCount(objPtr: *mut Tcl_Obj) {
89
let mut obj = unsafe { *objPtr };
910
obj.refCount -= 1;
@@ -19,6 +20,7 @@ pub unsafe fn Tcl_DecrRefCount(objPtr: *mut Tcl_Obj) {
1920
/// # Safety
2021
/// If [`Tcl_DecrRefCount`] is not called and the pointer is dropped, the object will be leaked.
2122
/// If objPtr is null, UB occurs.
23+
#[inline(always)]
2224
pub unsafe fn Tcl_IncrRefCount(objPtr: *mut Tcl_Obj) {
2325
let mut obj = unsafe { *objPtr };
2426
obj.refCount += 1;

0 commit comments

Comments
 (0)