Open YashasSamaga opened 6 years ago
I've tried something: https://github.com/YashasSamaga/pawn/commit/594095a710b3b8967561f93b8f5be171fc96ca73
Commit description:
Syntax:
#pragma nodestruct symbol1 #pragma nodestruct sym2, sym3, sym4
Notes: This is a beta commit.
TODOs:
- error if symbols which cannot be destroyed are marked
nodestruct
I am not sure what to do if a user tries to mark a global symbol or a symbol which doesn't have a destructor as nodestruct
. A warning indicating that the pragma was ignored?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This should prevent the destructor from being called. While there is a workaround for this by using
_:
as tag and manually settingTag:
wherever needed, the neatness of the code won't be maintained.The above dirty option is not possible for arguments as they would affect the function signature. An alternative would be to to set the values to invalid numbers add a check in the destructor code to ignore such cases. But this again is dirty.
The pragma directive will make it explicit and avoids the use of hacks. Moreover, this is vital to prevent destructors being called on arguments of complex assignment operator overloads.