Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Finalizer.Instance.Collect() and Runtime.TryCollectingGarbage(...) ar…
…e now callable from Python
  • Loading branch information
lostmsu committed Jul 14, 2022
commit 59b1c51daad161fc5f85452102188b75cc7284e3
1 change: 1 addition & 0 deletions src/runtime/Finalizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ internal IncorrectRefCountException(IntPtr ptr)

#endregion

[ForbidPythonThreads]
public void Collect() => this.DisposeAll();

internal void ThrottledCollect()
Expand Down
1 change: 1 addition & 0 deletions src/runtime/Runtime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ static bool TryCollectingGarbage(int runs, bool forceBreakLoops)
/// </summary>
/// <param name="runs">Total number of GC loops to run</param>
/// <returns><c>true</c> if a steady state was reached upon the requested number of tries (e.g. on the last try no objects were collected).</returns>
[ForbidPythonThreads]
public static bool TryCollectingGarbage(int runs)
=> TryCollectingGarbage(runs, forceBreakLoops: false);

Expand Down