-
Notifications
You must be signed in to change notification settings - Fork 28
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
Implement Process.pid
& Process.ppid
#43
Conversation
} | ||
|
||
void processPpid(WrenVM* vm) { | ||
wrenEnsureSlots(vm, 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.
@ruby0x1 Are there any default # of slots I can assume or does EnsureSlots need to ALWAYS be called? I'm pretty sure I don't see it used everywhere.
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.
best to call it each time
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.
Is that because we like the explicitness? It seems in most cases if you just said "there is always a minimum of 2" you'd remove the need for this boilerplate 99% of the time?
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 be sure this will be at least as the number of arguments slots. More than that is not guaranteed.
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.
Yeah, I'm just asking why, if that is an intentional design decision vs always say having 2 slots which would cover a huge % of use cases.
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.
To not require an unnecessary allocation. wrenEnsureSlots()
is very fast if a grow is not needed.
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 looks good to me.
Implement static methods
pid
&ppid
for theProcess
class.