-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(server): complex array formatter causing gen2 gc
- Loading branch information
Showing
8 changed files
with
226 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,28 @@ | ||
using MessagePack; | ||
using MessagePack; | ||
|
||
namespace Qynit.PulseGen.Server.Models; | ||
|
||
[MessagePackObject] | ||
public sealed record PulseGenResponse( | ||
[property: Key(0)] IList<PooledComplexArray<double>> Waveforms) : IDisposable | ||
public sealed class PulseGenResponse : IDisposable | ||
{ | ||
[Key(0)] | ||
public IList<PooledComplexArray<double>> Waveforms { get; set; } = null!; | ||
|
||
private readonly List<ArcUnsafe<PooledComplexArray<double>>> _disposables = null!; | ||
|
||
public PulseGenResponse() { } | ||
|
||
public PulseGenResponse(List<ArcUnsafe<PooledComplexArray<double>>> waveforms) | ||
{ | ||
_disposables = waveforms; | ||
Waveforms = _disposables.Select(x => x.Target).ToList(); | ||
} | ||
|
||
public void Dispose() | ||
{ | ||
foreach (var waveform in Waveforms) | ||
foreach (var disposable in _disposables) | ||
{ | ||
waveform.Dispose(); | ||
disposable.Dispose(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.