Skip to content
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

win, unix: extract common fields out of the loop fields. #1067

Closed
wants to merge 10 commits into from

Conversation

txdv
Copy link
Contributor

@txdv txdv commented Sep 23, 2016

only -11 lines though in total.

include/uv.h Outdated
void* check_handles[2];
void* async_handles[2];
/* Timers */
void* idle_handles[2];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this before prepare, it doesn't belong under the Timers title

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, made a mistake

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Em, do you want me to udpate the comment too then? Is it (async/ prepare/ check/ idle) watchers?

include/uv.h Outdated
uv_async_t wq_async;
/* The current time according to the event loop. in msecs. */
uint64_t time;
uint64_t timer_counter;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

put the counter together with the timer stuff

include/uv.h Outdated
void* idle_handles[2];
/* The current time according to the event loop. in msecs. */
uint64_t time;
uint64_t timer_counter;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this to after the timer heap

@saghul
Copy link
Member

saghul commented Sep 23, 2016

Small nit, otherwise LGTM.

@txdv
Copy link
Contributor Author

txdv commented Sep 23, 2016

-30 yeah... squash into one big one?

include/uv.h Outdated
@@ -409,6 +409,37 @@ struct uv_shutdown_s {
} u; \
UV_HANDLE_PRIVATE_FIELDS \

#define UV_TIMER_PRIVATE_FIELDS \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

come to think of it, we no longer need these private markers if we directly put the fields in the strctures directly. though this way may look a bit nicer. can you check if there are private marked fields that should be extracted?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you check if there are private marked fields that should be extracted?

I do not understand this request. Can you elaborate it a bit differently?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On some handles we have some fields directly in their struct definition which are marked as private with a comment. Check if there are repetitions please.

Also, ignore the first part of my message, I think it looks better with the define, for now.

@txdv
Copy link
Contributor Author

txdv commented Sep 26, 2016

I have found some double definitions in

UV_ASYNC_PRIVATE_FIELDS
UV_FS_PRIVATE_FIELDS
UV_FS_EVENT_PRIVATE_FIELDS

as in, there are fields which are in both unix and windows present, buit not all.

UV_FS_PRIVATE_FIELDS has this gem: https://github.com/txdv/libuv/blob/v1.x/include/uv-win.h#L600

Should I pull out the common fields and put them just in the struct definition?

Also, what about that todo? It originated from here 514265e

@txdv
Copy link
Contributor Author

txdv commented Oct 3, 2016

I pulled out common variables of all the other structs.

I noticed that sometimes the callbacks in the structs are called just cb, sometimes they are called shutdown_cb(<action_name>_cb). I think <action_name>_cb is better, should I rename all of them in to match this naming style?

@saghul
Copy link
Member

saghul commented Oct 3, 2016

Let's leave that for another PR. This one is about the common fields, then we can consolidate naming.

@txdv
Copy link
Contributor Author

txdv commented Oct 3, 2016

Ok, so the only one left is UV_FS_PRIVATE_FIELDS.

That one has a super old TODO on windows and no union on unix (I think it is possible to put most of the fields in unions, depending on what operation is being done, to save some space).

I would like @piscisaureus to make a comment on that TODO

@txdv
Copy link
Contributor Author

txdv commented Oct 6, 2016

No comments, nothing?

@saghul
Copy link
Member

saghul commented Oct 6, 2016

Sorry, I have some busy time ahe. I'll come back to this as soon as I can. Thanks for your work!

@txdv
Copy link
Contributor Author

txdv commented Oct 18, 2016

@saghul can you run the integration tests?

@txdv
Copy link
Contributor Author

txdv commented Mar 16, 2017

With #1255 I realized that https://github.com/txdv/libuv/blob/slimmer-fs-struct/include/uv.h#L416-L417 timer and repeat should be public fields, should I put them at the top and comment them like that?

@cjihrig cjihrig added the v2 label Sep 5, 2017
@cjihrig cjihrig removed the v2 label May 26, 2018
@txdv txdv closed this Jun 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants