-
Notifications
You must be signed in to change notification settings - Fork 30
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
SVCD::write [NOT READY] #39
base: master
Are you sure you want to change the base?
Conversation
resolve_table(L, "TIMEOUT"); | ||
int timeout = (int) lua_tonumber(L, -1); | ||
|
||
resolve_table(L, "handlers"); // 7 |
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.
While it is a good abstraction for development, this may add extra overhead to the embedded system since SVCD need to be load/unload every time this function is called, but in reality, it only need to be load once.
Untitled
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 agree with Jack that this adds unnecessary overhead. The point of these C functions is that although they are ugly to write, you spend the time trying to optimise them. Development and prototyping would be done in Lua, in C you should be trying to be as efficient as possible
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.
This is experimental code that we forgot to remove.
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.
Can you please remove it before your final pull request due in 1 hour and 20 minutes?
I am not convinced that this code was tested, how does anon_function get visible in the global scope? Can you detail how this was tested? |
storm.os.invokeLater(timeout_ms*storm.os.MILLISECOND, function() | ||
if SVCD.handlers[ivkid] ~= nil then | ||
SVCD.handlers[ivkid](SVCD.TIMEOUT) | ||
SVCD.handlers[ivkid] = nil | ||
end | ||
end) | ||
storm.net.sendto(SVCD.wcsock, storm.mp.pack({svcid, attrid, ivkid, payload}), targetip, 2526) | ||
end |
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.
Not really sure what is going on with this bit of Lua left over. Do you still require it?
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.
Yea, we still require the invoke later. We were trying to switch it over to C and we got stuck.
|
||
/* SEND TO */ | ||
lua_pushlightfunction(L, libstorm_net_sendto); | ||
// resolve_table(L, "print_sendto"); |
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.
You can remove this line; It was a special debugging statement. Was resolving a lua function SVCD.print_sendto
...
This is the same SCVD write pull request, except with a cleaned commit log. Please comment on either.
#36