unify ssize_t definition#11384
Conversation
|
Hi, I understand this is a draft PR, but it would be good to have a description with the motivation and context for this change to be submitted. |
|
Hey thanks for this PR! Is the intention to remove |
|
Thanks @mkatanbaf ! I think this is because of #11232 (comment) and this solution looks good (that it moves the introduction of the type to rpc related sources) but I agree it is better to mention this in the PR description |
|
Thanks @manupa-arm for the context! It makes sense to me now :-) Yeah I agree with you that it would be better to keep |
5fb3287 to
9f71eea
Compare
|
Thanks @manupa-arm for the comment. As I explained in the PR description, I believe introducing tvm_ssize_t was not the right approach. I placed the ssize_t definition in a header file under src/support, and hopefully, that would address the redefinition concerns. |
manupak
left a comment
There was a problem hiding this comment.
LGTM! I did not have a strong preference either way but have observed platform-specific redefinition of ssize_t too.
I ll let others have a look as well.
areusch
left a comment
There was a problem hiding this comment.
thanks for the fix @mkatanbaf !
|
regarding overloading |
|
I agree with @areusch that this is an internal header (will not bleed elsewhere) and should be the reasoning to support the change. |
|
@mkatanbaf I ve noted the commit title is too long and commit body is empty. Whilst, we are still in the process of establishing commit message guidelines, I think it would be better to include a commit title and a body. Would you be able to propose these before we merge / or push a commit that has these ? |
8d04293 to
acff804
Compare
acff804 to
7090b72
Compare
|
Thanks @manupa-arm , I updated the commit title and body. |
remove tvm_ssize_t type and unify the definition of ssize_t in Windows build
77c0149 to
f42dd4f
Compare
|
Thanks @mkatanbaf @areusch @junrushao1994 ! This is merged now! |
This PR removes the type tvm_ssize_t introduced in (PR11232) , and unifies the definition of ssize_t.
Initially, there was an issue with the Windows build in (PR10967) , since the ssize_t was not properly defined in rpc_channel_logger.h
our initial solution was to define the ssize_t in that specific file. but we got a redefinition error, since ssize_t was also defined in socket.h. We also tried to include socket.h in rpc_channel_logger.h but we got some errors on hexagon build. (PR11223)
Next attempt, we added another type, tvm_ssize_t, in c_runtime_api.h to resolve the redefinition issue (PR11232) and the plan was to propagate tvm_ssize_t to most of other ssize_t mentions to minimize confusion. The PR got merged, however, there are two issues with this solution. First, the c_runtime_api.h doesn't seem to be the appropriate place for the definition and required header files (here), and ssize_t is widely used in the codebase, so propagating the tvm_ssize_t requires changes all over the codebase.
This brings us to this current solution. It is basically back to our initial solution of defining ssize_t where it is needed (rpc_channel_logger.h ), and resolving the redefinition error by placing the definition in ssize.h file, and including it in both places. I believe this solution makes more sense because it doesn't add an unnecessary and potentially confusing type tvm_ssize_t and keeps the ssize_t definitions consistent.
@areusch, @mehrdadh, @manupa-arm