mod hybrid;
#[cfg(feature = "track_threads")]
mod hybrid_threads;
mod regular;
use crate::FlexRcInner;
pub use hybrid::*;
pub use regular::*;
pub trait Algorithm<META, META2> {
fn create() -> Self;
fn is_unique(&self) -> bool;
fn clone(&self);
fn drop(&self) -> bool;
fn try_into_other<T: ?Sized>(
&self,
inner: *mut FlexRcInner<META, META2, T>,
) -> Result<*mut FlexRcInner<META2, META, T>, *mut FlexRcInner<META, META2, T>>;
fn try_to_other<T: ?Sized>(
&self,
inner: *mut FlexRcInner<META, META2, T>,
) -> Result<*mut FlexRcInner<META2, META, T>, *mut FlexRcInner<META, META2, T>>;
}
#[cfg(feature = "std")]
#[inline]
fn abort() {
std::process::abort()
}
#[cfg(not(feature = "std"))]
#[inline]
fn abort() {
panic!("Reference count overflow");
}