And the only way its possible to get it is
Code: Select all
int self_pointer = string.format("%p", self).toint(10);
Add native support for pointers as integers please.
Moderator: GZDoom Developers
Code: Select all
int self_pointer = string.format("%p", self).toint(10);
Code: Select all
class six_four_pointer
{
private uint mantissa, radix;
void construct(string s)
{
int substring_len = s.Length()/2;
mantissa = s.Mid(0, substring_len ).toint(16);
radix = s.Mid(substring_len, substring_len ).toint(16);
}
clearscope uint get_pointer(bool main = true) const
{
if(main)
return mantissa;
else
return radix;
}
}
If the answer is '''No, and here is why'' i fail to understand why you then go on the defence for your own implementation which does the same but is likely more expensive in the long run.Apeirogon wrote:'Tested' both integer and string versions and they work approximately with the same speed.
'tested', because if I made more than around 30 "send network event" calls per single tick, Gzdoom crashes WITHOUT very fatal error window.
I done X in Y way
Do X in Z way instead, its faster this way
I compared Y and Z ways, they works approximately with same speed, but I had small testing sample set, due to a bug