-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathProcessProvider.cs
More file actions
36 lines (27 loc) · 1.33 KB
/
ProcessProvider.cs
File metadata and controls
36 lines (27 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System.MemoryInteractions;
namespace System.Diagnostics
{
public class ProcessProvider
{
private readonly Process _process;
private readonly Lazy<Allocator> _allocator;
private readonly Lazy<Executor> _executor;
private readonly Lazy<SimpleMemoryManager> _simpleMemoryManager;
private readonly Lazy<MemoryManager> _memoryManager;
private readonly Lazy<PageManager> _pageManager;
public ProcessProvider(Process process)
{
_process = process ?? throw new ArgumentNullException(nameof(process));
_allocator = new Lazy<Allocator>(() => new Allocator(process));
_executor = new Lazy<Executor>(() => new Executor(_process));
_simpleMemoryManager = new Lazy<SimpleMemoryManager>(() => new SimpleMemoryManager(_process));
_memoryManager = new Lazy<MemoryManager>(() => new MemoryManager(_process));
_pageManager = new Lazy<PageManager>(() => new PageManager(_process));
}
public Allocator Allocator => _allocator.Value;
public Executor Executor => _executor.Value;
public PageManager PageManager => _pageManager.Value;
public SimpleMemoryManager SimpleMemoryManager => _simpleMemoryManager.Value;
public MemoryManager MemoryManager => _memoryManager.Value;
}
}