Skip to content

Conversation

@RaphaelIT7
Copy link
Owner

@RaphaelIT7 RaphaelIT7 commented Oct 26, 2025

WIP

The current idea:
Implement a reference counter used for gc instead of using tri-color.
Though this means to basically go through every piece of code that uses TValue or a GC object and check/adjust it as having a reference leak would be chaos.
I may change the entire approach later, as it does seem utterly painful/difficult to do, just gonna try different things and see

ToDo:

  • Properly increment/decrement the reference counter
  • Implement code into the GC for removal of objects that have a counter of 0
  • Improve implementation to reach the point of not relying on the tri-color gc and possibly removing that

Always open for ideas/feedback though remember, this is still wip and in its early stages

@RaphaelIT7 RaphaelIT7 self-assigned this Oct 26, 2025
@RaphaelIT7 RaphaelIT7 added the enhancement New feature or request label Oct 26, 2025
@RaphaelIT7 RaphaelIT7 force-pushed the main branch 4 times, most recently from 3c6136a to d279f42 Compare October 28, 2025 12:13
@Zvbhrf
Copy link

Zvbhrf commented Oct 28, 2025

What improvements new gc brings? Can it fix Vectors and Angles not being cleaned up if you create tons of them?

@RaphaelIT7
Copy link
Owner Author

What improvements new gc brings? Can it fix Vectors and Angles not being cleaned up if you create tons of them?

iirc they are cleaned up, though not instantly or is there an existing memory leak with them?
With the reference counters, it could delete them instantly instead of leaving them for a while.

@RaphaelIT7 RaphaelIT7 force-pushed the main branch 3 times, most recently from 822fda3 to 341d27f Compare October 28, 2025 12:43
@Zvbhrf
Copy link

Zvbhrf commented Oct 28, 2025

is there an existing memory leak with them?

Facepunch/garrysmod-issues#5397

@RaphaelIT7
Copy link
Owner Author

Huh, totally forgot about that

@RaphaelIT7 RaphaelIT7 force-pushed the main branch 15 times, most recently from 6ab921e to b25b5f9 Compare October 29, 2025 19:04
@RaphaelIT7 RaphaelIT7 force-pushed the main branch 25 times, most recently from e20e54f to 3fecb14 Compare November 11, 2025 23:06
@RaphaelIT7 RaphaelIT7 force-pushed the main branch 5 times, most recently from ff61989 to b0f250a Compare November 21, 2025 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants