Skip to content

Remove redundant call to SetFree for objects bigger than 4GB - #119930

Closed
Alikhalesi wants to merge 2 commits into
dotnet:mainfrom
Alikhalesi:issue-119424
Closed

Remove redundant call to SetFree for objects bigger than 4GB#119930
Alikhalesi wants to merge 2 commits into
dotnet:mainfrom
Alikhalesi:issue-119424

Conversation

@Alikhalesi

Copy link
Copy Markdown

Fix #119424

@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Sep 20, 2025
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/gc
See info in area-owners.md if you want to be subscribed.

@Alikhalesi

Copy link
Copy Markdown
Author

@Alikhalesi please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@dotnet-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@dotnet-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@dotnet-policy-service agree company="Microsoft"

Contributor License Agreement

@dotnet-policy-service agree

Comment thread src/coreclr/gc/gc.cpp Outdated

#ifdef HOST_64BIT
#ifndef HOST_64BIT
((CObjectHeader*)x)->SetFree(size);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
((CObjectHeader*)x)->SetFree(size);
((CObjectHeader*)x)->SetFree(size);

Indentation is off (applies to the rest of the code as well)

Comment thread src/coreclr/gc/gc.cpp Outdated
size_t current_size = UINT32_MAX - get_alignment_constant (FALSE)
- Align (min_obj_size, get_alignment_constant (FALSE));

*(((PTR_PTR)tmp)-1) = 0;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is it really necessary to clear these interim syncblocks? Can we keep "Also clear the syncblock" before #ifndef HOST_64BIT and delete it here?

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Draft Pull Request was automatically closed for 30 days of inactivity. Please let us know if you'd like to reopen it.

@github-actions github-actions Bot locked and limited conversation to collaborators Nov 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-GC-coreclr community-contribution Indicates that the PR has been added by a community member

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Inefficient or invalid free object creation in gc_heap::make_unused_array for large sizes on HOST_64BIT

3 participants