-
Notifications
You must be signed in to change notification settings - Fork 579
Updates for Cython3 #587
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
Updates for Cython3 #587
Changes from 4 commits
83ae19d
55bab4f
95a147f
ca06a74
c11671c
a73522b
932f546
f63df46
c48173d
7562c1e
fb95d4e
5b03fdd
8793035
d387089
2e57927
b2f6897
232cd3f
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 | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,4 +1,8 @@ | ||||||||||||||||||
DEF __PREALLOCED_BUFS = 4 | ||||||||||||||||||
cdef extern from *: | ||||||||||||||||||
''' | ||||||||||||||||||
enum {__PREALLOCED_BUFS = 4}; | ||||||||||||||||||
''' | ||||||||||||||||||
const bint __PREALLOCED_BUFS | ||||||||||||||||||
Comment on lines
-1
to
+5
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. Am curious whether it would make sense to make this a Cython
Suggested change
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. Yeah, I think this is a good suggestion - it pretty much generates the same C code. 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. Thanks Fantix! 🙏 Submitted a PR: #634 |
||||||||||||||||||
|
||||||||||||||||||
|
||||||||||||||||||
@cython.no_gc_clear | ||||||||||||||||||
|
@@ -279,7 +283,7 @@ cdef class UVStream(UVBaseTransport): | |||||||||||||||||
cdef inline _close_on_read_error(self): | ||||||||||||||||||
self.__read_error_close = 1 | ||||||||||||||||||
|
||||||||||||||||||
cdef bint _is_reading(self): | ||||||||||||||||||
cdef bint _is_reading(self) noexcept: | ||||||||||||||||||
return self.__reading | ||||||||||||||||||
|
||||||||||||||||||
cdef _start_reading(self): | ||||||||||||||||||
|
@@ -578,7 +582,7 @@ cdef class UVStream(UVBaseTransport): | |||||||||||||||||
|
||||||||||||||||||
self._maybe_resume_protocol() | ||||||||||||||||||
|
||||||||||||||||||
cdef size_t _get_write_buffer_size(self): | ||||||||||||||||||
cdef size_t _get_write_buffer_size(self) noexcept: | ||||||||||||||||||
if self._handle is NULL: | ||||||||||||||||||
return 0 | ||||||||||||||||||
return ((<uv.uv_stream_t*>self._handle).write_queue_size + | ||||||||||||||||||
|
@@ -755,7 +759,7 @@ cdef inline bint __uv_stream_on_read_common( | |||||||||||||||||
UVStream sc, | ||||||||||||||||||
Loop loop, | ||||||||||||||||||
ssize_t nread, | ||||||||||||||||||
): | ||||||||||||||||||
) noexcept: | ||||||||||||||||||
if sc._closed: | ||||||||||||||||||
# The stream was closed, there is no reason to | ||||||||||||||||||
# do any work now. | ||||||||||||||||||
|
@@ -818,7 +822,7 @@ cdef inline void __uv_stream_on_read_impl( | |||||||||||||||||
uv.uv_stream_t* stream, | ||||||||||||||||||
ssize_t nread, | ||||||||||||||||||
const uv.uv_buf_t* buf, | ||||||||||||||||||
): | ||||||||||||||||||
) noexcept: | ||||||||||||||||||
cdef: | ||||||||||||||||||
UVStream sc = <UVStream>stream.data | ||||||||||||||||||
Loop loop = sc._loop | ||||||||||||||||||
|
@@ -849,7 +853,7 @@ cdef inline void __uv_stream_on_read_impl( | |||||||||||||||||
cdef inline void __uv_stream_on_write_impl( | ||||||||||||||||||
uv.uv_write_t* req, | ||||||||||||||||||
int status, | ||||||||||||||||||
): | ||||||||||||||||||
) noexcept: | ||||||||||||||||||
cdef: | ||||||||||||||||||
_StreamWriteContext ctx = <_StreamWriteContext> req.data | ||||||||||||||||||
UVStream stream = <UVStream>ctx.stream | ||||||||||||||||||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#ifndef UVLOOP_SYSTEM_H_ | ||
#define UVLOOP_SYSTEM_H_ | ||
#if defined(_WIN32) || defined(MS_WINDOWS) || defined(_MSC_VER) | ||
#include "Winsock2.h" | ||
#include "ws2def.h" | ||
#include "includes/fork_handler.h" | ||
#else | ||
fantix marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
#include "arpa/inet.h" | ||
#include "sys/socket.h" | ||
#include "sys/un.h" | ||
#include "unistd.h" | ||
#include "pthread.h" | ||
#endif | ||
#endif | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.