mirror of
https://github.com/JakeHillion/object-introspection.git
synced 2024-09-19 19:19:05 +01:00
e27f725a85
Previously, we treated weak_ptrs as normal types and we recursed within them, following the internal data pointer and possibly causing crashes. We really shouldn't be following them, so I added a custom type to simply abort processing. If we want to handle them (ie: check if they are valid, and follow them if so), that should be fairly easy with the work there is here so far.
23 lines
460 B
TOML
23 lines
460 B
TOML
[info]
|
|
typeName = "std::weak_ptr"
|
|
numTemplateParams = 1
|
|
ctype = "WEAK_PTR_TYPE"
|
|
header = "memory"
|
|
ns = ["namespace std"]
|
|
replaceTemplateParamIndex = []
|
|
|
|
[codegen]
|
|
decl = """
|
|
template<typename T>
|
|
void getSizeType(const %1%<T> &s_ptr, size_t& returnArg);
|
|
"""
|
|
|
|
# Weak pointers do not have ownership, so let's not follow them (for now)
|
|
func = """
|
|
template<typename T>
|
|
void getSizeType(const %1%<T> &s_ptr, size_t& returnArg)
|
|
{
|
|
SAVE_SIZE(sizeof(%1%<T>));
|
|
}
|
|
"""
|