ELC in dev
ELC-lang
载入中...
搜索中...
未找到
elc::defs::memory::gc_n::default_gc_for_type 命名空间参考

函数

void destory_by_gc () noexcept=delete
 
template<class T >
void destory_by_gc (T *)
 
template<class T >
requires use_default_gc_able<T>
void default_gc_method () noexcept
 
template<class T >
requires use_default_gc_success_identifier_able<T>
bool default_gc_success_identifier () noexcept
 

变量

template<class T , class enable_state = ::std::enable_if_t< type_info<T>. template has_attribute_helper< count_able >() >>
size_t count_for_success_identify
 
template<class T >
constexpr bool use_default_gc_able
 
template<class T >
constexpr bool use_default_gc_success_identifier_able = type_info<T>. template has_attribute_helper< count_able >()
 

函数说明

◆ default_gc_method()

template<class T >
requires use_default_gc_able<T>
void elc::defs::memory::gc_n::default_gc_for_type::default_gc_method ( )
inlinenoexcept

在文件 all_defs.cpp26435 行定义.

26435 {
26436 constexpr auto&info=type_info<T>;
26437 //
26438 if constexpr(info.has_attribute(count_able))
26439 count_for_success_identify<T> = the_number_of(info);
26440 //
26441 if constexpr(info.has_attribute(can_map_all)){
26442 if constexpr(info.has_attribute(mark_able_for_gc)&&info.has_attribute(have_root))
26443 roots_of<T>.map_and_mark();
26444 if constexpr(info.has_attribute(can_shrink) || (info.has_attribute(mark_able_for_gc)&&info.has_attribute(have_root)))
26445 map_all<T>(
26446 λ(T*a)noexcept{
26447 if constexpr(info.has_attribute(can_shrink))
26448 a->shrink();
26449 if constexpr(info.has_attribute(mark_able_for_gc)&&info.has_attribute(have_root)){
26450 auto& b=attribute_cast<mark_able_for_gc>(*a);
26451 if(b.was_marked())
26452 b.unmark();
26453 else
26454 destory_by_gc(a);
26455 }
26456 }
26457 );
26458 }
26459 }
#define λ
Definition all_defs.cpp:623
size_t the_number_of(type_info_t< T >) noexcept
函数调用图:
这是这个函数的调用关系图:

◆ default_gc_success_identifier()

bool elc::defs::memory::gc_n::default_gc_for_type::default_gc_success_identifier ( )
inlinenoexcept

在文件 all_defs.cpp26465 行定义.

26465 {
26466 constexpr auto&info=type_info<T>;
26467 if constexpr(info.has_attribute(count_able)){//重复判定,勿删,方便日后扩展
26468 return count_for_success_identify<T> _big_than_ the_number_of(info);
26469 }
26470 }
#define _big_than_
Definition all_defs.cpp:652
函数调用图:
这是这个函数的调用关系图:

◆ destory_by_gc() [1/2]

void elc::defs::memory::gc_n::default_gc_for_type::destory_by_gc ( )
deletenoexcept
这是这个函数的调用关系图:

◆ destory_by_gc() [2/2]

template<class T >
void elc::defs::memory::gc_n::default_gc_for_type::destory_by_gc ( T *  )

在文件 all_defs.cpp26430 行定义.

26430 {
26431 template_error("this function should not be instantiated,please overload the function destory_by_gc in the namespace where this type is defined.");
26432 }
#define template_error(reason)
Definition all_defs.cpp:559
函数调用图:

变量说明

◆ count_for_success_identify

template<class T , class enable_state = ::std::enable_if_t< type_info<T>. template has_attribute_helper< count_able >() >>
size_t elc::defs::memory::gc_n::default_gc_for_type::count_for_success_identify
inline

在文件 all_defs.cpp26410 行定义.

◆ use_default_gc_able

template<class T >
constexpr bool elc::defs::memory::gc_n::default_gc_for_type::use_default_gc_able
constexpr
初始值:
=
(
type_info<T>. template has_attribute_helper< mark_able_for_gc >() &&
type_info<T>. template has_attribute_helper< have_root >()
)&&(
type_info<T>. template has_attribute_helper< can_map_all >()
&&(
type_info<T>. template has_attribute_helper< can_shrink >()
||(
type_info<T>. template has_attribute_helper< mark_able_for_gc >() &&
type_info<T>. template has_attribute_helper< have_root >()
)
)
)

在文件 all_defs.cpp26413 行定义.

◆ use_default_gc_success_identifier_able

template<class T >
constexpr bool elc::defs::memory::gc_n::default_gc_for_type::use_default_gc_success_identifier_able = type_info<T>. template has_attribute_helper< count_able >()
constexpr

在文件 all_defs.cpp26462 行定义.