Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Replace ReusableTextReader with shared ArrayPool#43365

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
danmoseley merged 1 commit intodotnet:masterfromam11:feature/cleanup/purge-reusabletextreader
Oct 14, 2020
Merged

Replace ReusableTextReader with shared ArrayPool#43365

danmoseley merged 1 commit intodotnet:masterfromam11:feature/cleanup/purge-reusabletextreader
Oct 14, 2020

Conversation

@am11
Copy link
Member

ReusableTextReader is only used internally on Linux and it allocates buffers in the ctor. Instantiating it in a static context makes the CoreLib linker unfriendly. This change replaces the usage of RTR withArrayPool<T>, and deletes the class.

Fixes#43337

@am11
Copy link
MemberAuthor

cc@jkotas, @danmosemsft

}
finally
{
ArrayPool<byte>.Shared.Return(bytes);
Copy link
Member

Choose a reason for hiding this comment

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

@jkotas I have seen in some cases we don't bother to return in exceptional cases. Yet, I could imagine for some OS reason, we are always failing to read this file, and we are called often, so we drain the array pool. I guess it depends on the context?

Copy link
Member

Choose a reason for hiding this comment

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

Yep, it depends on the context. I think the try/finally is appropriate here.

@danmoseley
Copy link
Member

failure is#43200

@danmoseleydanmoseley merged commit041826b intodotnet:masterOct 14, 2020
@danmoseley
Copy link
Member

thanks@am11

@dotnetdotnet deleted a comment fromjkotasOct 14, 2020
@am11am11 deleted the feature/cleanup/purge-reusabletextreader branchOctober 14, 2020 10:54
@ghostghost locked asresolvedand limited conversation to collaboratorsDec 7, 2020
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@stephentoubstephentoubstephentoub left review comments

@jkotasjkotasjkotas approved these changes

@danmoseleydanmoseleydanmoseley approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Avoid unconditional eager initialization of ReusableTextReader in System.Environment

4 participants

@am11@danmoseley@stephentoub@jkotas

[8]ページ先頭

©2009-2025 Movatter.jp