mirror of
https://github.com/fergalmoran/DnsServer.git
synced 2026-01-07 01:04:02 +00:00
Zone: memory optimization done by using specific capacity for concurrent dictionary.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Technitium DNS Server
|
||||
Copyright (C) 2020 Shreyas Zare (shreyas@technitium.com)
|
||||
Copyright (C) 2021 Shreyas Zare (shreyas@technitium.com)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -32,7 +32,7 @@ namespace DnsServerCore.Dns.Zones
|
||||
#region variables
|
||||
|
||||
protected readonly string _name;
|
||||
protected readonly ConcurrentDictionary<DnsResourceRecordType, IReadOnlyList<DnsResourceRecord>> _entries = new ConcurrentDictionary<DnsResourceRecordType, IReadOnlyList<DnsResourceRecord>>();
|
||||
protected readonly ConcurrentDictionary<DnsResourceRecordType, IReadOnlyList<DnsResourceRecord>> _entries;
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -41,6 +41,13 @@ namespace DnsServerCore.Dns.Zones
|
||||
protected Zone(string name)
|
||||
{
|
||||
_name = name;
|
||||
_entries = new ConcurrentDictionary<DnsResourceRecordType, IReadOnlyList<DnsResourceRecord>>(1, 5);
|
||||
}
|
||||
|
||||
protected Zone(string name, int capacity)
|
||||
{
|
||||
_name = name;
|
||||
_entries = new ConcurrentDictionary<DnsResourceRecordType, IReadOnlyList<DnsResourceRecord>>(1, capacity);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user