Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
c76ac547
Commit
c76ac547
authored
Jun 02, 2018
by
pijyoi
Committed by
Luca Boccassi
Jun 02, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix computation of winsock fd_set size (#3151)
* fix computation of winsock fd_set size
parent
e2a4d770
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
polling_util.hpp
src/polling_util.hpp
+10
-8
No files found.
src/polling_util.hpp
View file @
c76ac547
...
...
@@ -128,30 +128,32 @@ inline size_t valid_pollset_bytes (const fd_set &pollset_)
}
#if defined ZMQ_HAVE_WINDOWS
// struct fd_set {
// u_int fd_count;
// SOCKET fd_array[1];
// };
// NOTE: offsetof(fd_set, fd_array)==sizeof(SOCKET) on both x86 and x64
// due to alignment bytes for the latter.
class
optimized_fd_set_t
{
public
:
explicit
optimized_fd_set_t
(
size_t
nevents_
)
:
_fd_set
(
nevents_
)
{}
explicit
optimized_fd_set_t
(
size_t
nevents_
)
:
_fd_set
(
1
+
nevents_
)
{}
fd_set
*
get
()
{
return
reinterpret_cast
<
fd_set
*>
(
&
_fd_set
[
0
]);
}
private
:
fast_vector_t
<
char
,
sizeof
(
u_int
)
+
ZMQ_POLLITEMS_DFLT
*
sizeof
(
SOCKET
)
>
_fd_set
;
fast_vector_t
<
SOCKET
,
1
+
ZMQ_POLLITEMS_DFLT
>
_fd_set
;
};
class
resizable_optimized_fd_set_t
{
public
:
void
resize
(
size_t
nevents_
)
{
_fd_set
.
resize
(
nevents_
);
}
void
resize
(
size_t
nevents_
)
{
_fd_set
.
resize
(
1
+
nevents_
);
}
fd_set
*
get
()
{
return
reinterpret_cast
<
fd_set
*>
(
&
_fd_set
[
0
]);
}
private
:
resizable_fast_vector_t
<
char
,
sizeof
(
u_int
)
+
ZMQ_POLLITEMS_DFLT
*
sizeof
(
SOCKET
)
>
_fd_set
;
resizable_fast_vector_t
<
SOCKET
,
1
+
ZMQ_POLLITEMS_DFLT
>
_fd_set
;
};
#else
class
optimized_fd_set_t
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment