-
-
Notifications
You must be signed in to change notification settings - Fork 424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attempt to add 64 bit support to sdktools #2159
base: master
Are you sure you want to change the base?
Conversation
pinging the sourcemod core devs here so they can say if they are already working on this or that they don't like this solution before I spend any more time on this although I think it is pretty much done. I'm introducing a new sdktools type called SDKType_Pointer which will takes 1 int on 32 bits and 2 int on 64 bits. Since sourcepawn can't return a 64 bit value as far as I know, this is why I introduce a new type instead of just fixing the POD type. When you set it as a return value you need to put the return value as a parameter since it could be 64 bits. Usage example with tf2attributes gamedata:
|
Have you reviewed #705 ? It's nearly 7 years old but should help avoid what's being proposed with high and low bits. |
I didn't review it. How will it help if it is already merged? Is there something specific you want to point out? I don't want to look through 90 files worth of changes. |
hmmm...
Is there something missing? |
pseudoaddress is already being used and supposedly does not work on addresses far away from the code (ie heap) |
so ... do we need to allocate a new pseudoaddress type, based on your findings? Not trying to be cryptic here, but if we don't have to reinvent anything, and patch 16~ years of plugins that's the better solution, no? |
It is not possible to invent another pseudoaddress that will fix the problem. You just can't fit 64 bits into 32 bits. If you just use the full 32 bits as the index to a hash table, you can't do pointer arithmetic on it anymore. No matter what combination of bits you use for the index or the offset, it's going to result in problems. With my changes, you can port plugins to 64 bit and they will work on 32 bits, so it's fully backwards compatible. It just doesn't magically make unchanged plugins work on 64 bits. Dvander himself said here not to wait for him to add 64 bit ints and to use arrays. So that is what I'm doing. If people want to wait until sourcemod fixes Address so it can be 64 bits transparently, they can wait. Or if they don't want their server to be down for a long time, they can use this. I don't think there are many plugins that use sdktools to get addresses. Given that dvander said not to wait, I get the feeling that a stopgap measure like this is needed. |
Can I get a decision on whether this will be approved or not or are we waiting for dvander to add 64 bit ints to sourcepawn? This is 1 of the last 3 things needed for full 64 bit support. |
Not here to comment on the decision. But I'd suggest you fix the diff change on the PR, as it's currently impossible to review what you've added or removed. And you should delete that duplicate change in sdktools, as you already have another PR #2152 adding that. |
I'm not sure what you mean. It looks pretty clean to me. https://github.com/alliedmodders/sourcemod/pull/2159/files Don't click on the force-push I did, because that was just me rebasing the branch to the recently merged changes. I just want to hear a simple yes or no whether this solution is acceptable or we are waiting until dvander to make major changes to sourcepawn can return 64 bit values (even though he said not to). If it isn't, there's no point in doing more work on this like making the commits perfect. I need the fixes I made from the other pull request so my server can run without crashing. |
|
yeah as you found out you didn't have whitespace changes hidden. I am not sure how that happened, but there are quite a few files in the project already with different line ending styles. |
any ETA on merging? as int64 type is not coming to sourcepawn anytime soon and pseudoaddresses are gonna cause more trouble than not with heap, it seems like there's no better solution at the hand |
Apologies for double post but we decided to compile SourceMod branch with this PR merged and run on our servers. So far it works great (tf2attributes, tf2 taunt'em, etc.) although was kinda confusing when to use SDKType_Pointer and when not. But that's more of skill issue on our side |
any plans to merging? |
No description provided.