-
Notifications
You must be signed in to change notification settings - Fork 652
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
Add support for compiling and running NIO on Raspberry Pi 32-bit #383
Changes from 6 commits
905826c
145ecf5
095e668
80e1f1b
124e532
65537e5
7a94933
864a9f6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -379,7 +379,12 @@ public class HTTPDecoder<HTTPMessageT>: ByteToMessageDecoder, AnyHTTPDecoder { | |
|
||
public func decoderRemoved(ctx: ChannelHandlerContext) { | ||
// Remove the stored reference to ChannelHandlerContext | ||
parser.data = UnsafeMutableRawPointer(bitPattern: 0x0000deadbeef0000) | ||
#if arch(arm) // 32-bit | ||
let veryDeadBeef : UInt = 0xdeadbeef | ||
parser.data = UnsafeMutableRawPointer(bitPattern: veryDeadBeef) | ||
#else | ||
parser.data = UnsafeMutableRawPointer(bitPattern: 0x0000deadbeef0000) | ||
#endif | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jw Do we need this change? I think we only wanted this pointer value to be easy to spot in debuggers and core dumps: does it need to have the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we can just use a 32 bit value There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That still needs the UInt32 cast though, because parser.data seems to be Int32. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @helje5 isn’t parser.data a pointer? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right it is. I guess the problem is the Swift type overloading again. It will treat 0xdeadbeef as an There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, but can't we just compress this into one line? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @helje5 I'm happy with this except for this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It should, but you have to remember that we are talking Swift here! ;->
Same issue: UInt essentially has a |
||
|
||
// Set the callbacks to nil as we dont need these anymore | ||
settings.on_body = nil | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can just kill this assertion. We now have much better tests (allocation counters) which will blow up if this assertion would fail
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume there is no chance to make this work better on 32-bit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@helje5 the existential buffer size is 3 words. On 32 bit that means 12 bytes. Given that byte buffer needs one pointer, we’re left with 8 bytes for reader index, writer index, slice begin and end. I don’t think it’s feasible. So unfortunately for 32bit we’ll need to be larger than the builtin storage of an existential. But we still have the byte buffer special case in NIOAny so not all too bad...