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
Completely random table alloc tweaks in Lua/C modules #1350
Conversation
(usleep is deprecated, and is in fact a wrapper around nanosleep on conforming glibcs).
Not so much for the performance diff (which is likely to be minimal, although we do know that ther'es no metamethod), but for consistency with the previous fields.
LuaJIT types them correctly internally on arm
Will need testing :/.
This reverts commit 2b37298.
I mean, good luck finding a book with > 20 levels of ToC depth, but that could theoretically happen and blow the Lua stack.
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.
Reviewed 7 of 7 files at r1.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @NiLuJe)
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.
Reviewed 2 of 2 files at r2, 1 of 1 files at r3.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @NiLuJe)
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.
Looks alright after a quick skim of cre/xtext. Trusting you on the changes.
I've spent a bit of time doing weird things in the emu without breaking anything so far ;). The wonkiest shit was very much in djvu, though, so I have no specific worries about xtext/cre. |
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.
Looks mainly visual to me besides the djvu thing… which we'll need to test a bit but I can't really say much about it.
We're clearing the stack, so, actually use that fact to simplify this ;). (Because clearing the stack is otherwise entirely pedantic: what's returned is always the uppermost n elements in the stack).
lua_objlen returns a size_t, and lua_tointeger a lua_Integer (usually a ptrdiff_t).
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.
Reviewed 3 of 3 files at r4.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @NiLuJe)
* Bump android-laujit-launcher koreader/android-luajit-launcher#297 * Bump base koreader/koreader-base#1351 koreader/koreader-base#1350 koreader/koreader-base#1349 koreader/koreader-base#1348
Mainly pre-alloc when we can know/estimate the amount of elements, unify usage of *raw* setters for metatable-less tables, and stricter typing (e.g., don't cast integers to double by limiting usage of `pushnumber` to actual floats). Also added some comments for the twistiest bits of logic (djvu, lookin' at ya').
Mainly pre-alloc when we can know/estimate the amount of elements, unify usage of raw setters for metatable-less tables, and stricter typing (e.g., don't cast integers to double by limiting usage of
pushnumber
to actual floats).Also added some comments for the twistiest bits of logic (djvu, lookin' at ya').
This change is