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

fixes #22883; replace default(typeof( with reset; suppress `Unsaf… #22895

Merged
merged 1 commit into from
Nov 1, 2023

Conversation

ringabout
Copy link
Member

@ringabout ringabout commented Oct 31, 2023

fixes #22883

…eDefault` warnings

avoid issues mentioned by https://forum.nim-lang.org namely, it allocated unnecessary stack objects in the loop

while (1)
{
tyObject_N__8DSNqSGSHBKOhI8CqSgAow T5_;
nimZeroMem((void *)(&T5_), sizeof(tyObject_N__8DSNqSGSHBKOhI8CqSgAow));
eqsink___test4954_u450((&(*t_p0).data.p->data[i].Field1), T5_);
}

It might be more efficient in some cases

follow up #21821

@Araq Araq merged commit 92141e8 into devel Nov 1, 2023
22 checks passed
@Araq Araq deleted the pr_reset_default branch November 1, 2023 06:54
Copy link
Contributor

github-actions bot commented Nov 1, 2023

Thanks for your hard work on this PR!
The lines below are statistics of the Nim compiler built from 92141e8

Hint: mm: orc; opt: speed; options: -d:release
176356 lines; 9.758s; 767.793MiB peakmem

narimiran pushed a commit that referenced this pull request Apr 18, 2024
#22895)

fixes #22883

…eDefault` warnings

avoid issues mentioned by https://forum.nim-lang.org namely, it
allocated unnecessary stack objects in the loop

```c
while (1)
{
tyObject_N__8DSNqSGSHBKOhI8CqSgAow T5_;
nimZeroMem((void *)(&T5_), sizeof(tyObject_N__8DSNqSGSHBKOhI8CqSgAow));
eqsink___test4954_u450((&(*t_p0).data.p->data[i].Field1), T5_);
}
```

It might be more efficient in some cases

follow up #21821

(cherry picked from commit 92141e8)
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.

Table, CountTable, and HashSet warn on UnsafeDefault del/excl requiresInit key type
2 participants