-
Notifications
You must be signed in to change notification settings - Fork 108
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
Clobbering of MT slots #1439
Clobbering of MT slots #1439
Conversation
… field which contains the source fd of the event
input/input.c
Outdated
@@ -312,7 +317,7 @@ static inline size_t drain_input_queue(lua_State* L, struct input_event* input_q | |||
|
|||
// Iterate over every input event in the queue buffer | |||
for (const struct input_event* event = input_queue; event < input_queue + ev_count; event++) { | |||
set_event_table(L, event); // Pushed a new ev table all filled up at the top of the stack (that's -1) | |||
set_event_table(L, event,fd); // Pushed a new ev table all filled up at the top of the stack (that's -1) |
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.
nit, I think clang-format will take care of it by itself?
input/input.c
Outdated
@@ -406,7 +411,7 @@ static int waitForInput(lua_State* L) | |||
|
|||
if ((size_t) len == queue_available_size) { | |||
// If we're out of buffer space in the queue, drain it *now* | |||
j = drain_input_queue(L, input_queue, ev_count, j); | |||
j = drain_input_queue(L, input_queue, ev_count,inputfds[i], j); |
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.
same nit
input/input.c
Outdated
@@ -150,6 +150,7 @@ static int openInputDevice(lua_State* L) | |||
|
|||
// We're done w/ inputdevice, pop it | |||
lua_settop(L, 0); | |||
lua_pushnumber(L,inputfds[fd_idx]); |
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.
Double nit
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.
lgtm besides the formatting nits (spaces for indentation, space after comma), but as I said, clang-format. ^_^
ugh sorry, stupid of me. Ok, those should be updated |
I'm gonna go with "Not good enough" for now, sorry. (This is just a quick veto to merging this as-is, until I have more than a shower's worth of time to think about it). In decreasing order of importance:
|
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 did it wrong, see above ;p.
(This is just to generate a big red cross to avoid drive-by merges).
Ok, points taken. I will close this for the moment on my end. |
I thought that was implied by this PR btw. |
I think my lack of clarity didn't aid this PR. I was thinking that the fd would just be passed between the C and the lua so that frontend can deal with it as it sees appropriate. Not that the This confusion aside however I totally take that the lack of changes on the lua side makes this a bit futile at this point and adds a not insignificant amount to the size of the tables being sent back to lua. So I am happy for this to sit quietly until I have made some changes on the front that either make this PR worthwhile, or change the PR to reduce overhead and satisfy you guys and myself that it isn't going to cause some pernicious issues in the gesture detecting. |
As per discussion on #1437.
I have made changes to return an fd on device open and to pass the fd that generated the event as part of the lua table returned.
Having made these changes I think it probably is unnecessary to pass the fd with EVERY event as ultimately the main loop in waitForInput only returns a table of event tables for one device at a time, so could have waitForInput return a triple instead. hypothetically.
This change is