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

Fix some typos #3441

Merged
merged 3 commits into from
May 20, 2024
Merged

Fix some typos #3441

merged 3 commits into from
May 20, 2024

Conversation

TianlongLiang
Copy link
Contributor

No description provided.

&& memory->is_memory64));
bh_assert(data_seg->base_offset.init_expr_type
== (memory->is_memory64 ? INIT_EXPR_TYPE_I64_CONST
: INIT_EXPR_TYPE_I32_CONST));
Copy link
Contributor

Choose a reason for hiding this comment

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

INIT_EXPR_TYPE_GET_GLOBAL is removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

deleted by mistake, added it back here

@@ -38,7 +38,7 @@ bh_log(LogLevel log_level, const char *file, int line, const char *fmt, ...)
t = t % (60 * 60);
m = t / 60;
s = t % 60;
mills = (uint32)(usec % 1000);
mills = (uint32)(usec / 1000);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should not change the code? s = t % 60 is used to get the second value, here mills = (uint32)(usec % 1000) is to get the remainder, it should be smaller than 1 second, or 1000 ms.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

At the beginning of the function, we got usec(microsecond=10-6 second), in order to get millisecond(10-3 second), we should divide it by 1000 rather than get the remainder of usec(still microsecond), I observed a non-incremental log time like 00:00:00:792 to 00:00:00:101 so I traced back here

Copy link
Contributor

Choose a reason for hiding this comment

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

But it will keep increasing and be larger than 1000 if using /. I guess I know why, seems we should use mills = (uint32)((usec % 1000000) / 1000) which limits the usec to be in 1 second first.

@wenyongh wenyongh merged commit 30ed97c into bytecodealliance:main May 20, 2024
377 checks passed
@TianlongLiang TianlongLiang deleted the dev/fix_typo branch July 1, 2024 06:26
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.

None yet

2 participants