diff options
Diffstat (limited to 'OpenSim/Framework/CnmMemoryCache.cs')
-rw-r--r-- | OpenSim/Framework/CnmMemoryCache.cs | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/OpenSim/Framework/CnmMemoryCache.cs b/OpenSim/Framework/CnmMemoryCache.cs index db91801..92af331 100644 --- a/OpenSim/Framework/CnmMemoryCache.cs +++ b/OpenSim/Framework/CnmMemoryCache.cs | |||
@@ -70,7 +70,7 @@ namespace OpenSim.Framework | |||
70 | 70 | ||
71 | /// <summary> | 71 | /// <summary> |
72 | /// How many operations between time checks. | 72 | /// How many operations between time checks. |
73 | /// </summary> | 73 | /// </summary> |
74 | private const int DefaultOperationsBetweenTimeChecks = 40; | 74 | private const int DefaultOperationsBetweenTimeChecks = 40; |
75 | 75 | ||
76 | /// <summary> | 76 | /// <summary> |
@@ -168,7 +168,7 @@ namespace OpenSim.Framework | |||
168 | private int m_version; | 168 | private int m_version; |
169 | 169 | ||
170 | /// <summary> | 170 | /// <summary> |
171 | /// Initializes a new instance of the <see cref="CnmMemoryCache{TKey,TValue}"/> class. | 171 | /// Initializes a new instance of the <see cref="CnmMemoryCache{TKey,TValue}"/> class. |
172 | /// </summary> | 172 | /// </summary> |
173 | public CnmMemoryCache() | 173 | public CnmMemoryCache() |
174 | : this(DefaultMaxSize) | 174 | : this(DefaultMaxSize) |
@@ -277,7 +277,7 @@ namespace OpenSim.Framework | |||
277 | /// </param> | 277 | /// </param> |
278 | protected virtual void AddToNewGeneration(int bucketIndex, TKey key, TValue value, long size) | 278 | protected virtual void AddToNewGeneration(int bucketIndex, TKey key, TValue value, long size) |
279 | { | 279 | { |
280 | // Add to newest generation | 280 | // Add to newest generation |
281 | if (!m_newGeneration.Set(bucketIndex, key, value, size)) | 281 | if (!m_newGeneration.Set(bucketIndex, key, value, size)) |
282 | { | 282 | { |
283 | // Failed to add new generation | 283 | // Failed to add new generation |
@@ -311,7 +311,7 @@ namespace OpenSim.Framework | |||
311 | /// Bucket index is remainder when element key's hash value is divided by bucket count. | 311 | /// Bucket index is remainder when element key's hash value is divided by bucket count. |
312 | /// </para> | 312 | /// </para> |
313 | /// <para> | 313 | /// <para> |
314 | /// For example: key's hash is 72, bucket count is 5, element's bucket index is 72 % 5 = 2. | 314 | /// For example: key's hash is 72, bucket count is 5, element's bucket index is 72 % 5 = 2. |
315 | /// </para> | 315 | /// </para> |
316 | /// </remarks> | 316 | /// </remarks> |
317 | protected virtual int GetBucketIndex(TKey key) | 317 | protected virtual int GetBucketIndex(TKey key) |
@@ -367,7 +367,7 @@ namespace OpenSim.Framework | |||
367 | /// </summary> | 367 | /// </summary> |
368 | private void RecycleGenerations() | 368 | private void RecycleGenerations() |
369 | { | 369 | { |
370 | // Rotate old generation to new generation, new generation to old generation | 370 | // Rotate old generation to new generation, new generation to old generation |
371 | IGeneration temp = m_newGeneration; | 371 | IGeneration temp = m_newGeneration; |
372 | m_newGeneration = m_oldGeneration; | 372 | m_newGeneration = m_oldGeneration; |
373 | m_newGeneration.Clear(); | 373 | m_newGeneration.Clear(); |
@@ -522,7 +522,7 @@ namespace OpenSim.Framework | |||
522 | /// <summary> | 522 | /// <summary> |
523 | /// Index of first element's in element chain. | 523 | /// Index of first element's in element chain. |
524 | /// </summary> | 524 | /// </summary> |
525 | /// <value> | 525 | /// <value> |
526 | /// -1 if there is no element in bucket; otherwise first element's index in the element chain. | 526 | /// -1 if there is no element in bucket; otherwise first element's index in the element chain. |
527 | /// </value> | 527 | /// </value> |
528 | /// <remarks> | 528 | /// <remarks> |
@@ -692,7 +692,7 @@ namespace OpenSim.Framework | |||
692 | /// </summary> | 692 | /// </summary> |
693 | /// <value> | 693 | /// <value> |
694 | /// 0 if element is free; otherwise larger than 0. | 694 | /// 0 if element is free; otherwise larger than 0. |
695 | /// </value> | 695 | /// </value> |
696 | public long Size; | 696 | public long Size; |
697 | 697 | ||
698 | /// <summary> | 698 | /// <summary> |
@@ -771,7 +771,7 @@ namespace OpenSim.Framework | |||
771 | /// </returns> | 771 | /// </returns> |
772 | /// <exception cref="InvalidOperationException"> | 772 | /// <exception cref="InvalidOperationException"> |
773 | /// The enumerator has reach end of collection or <see cref="MoveNext"/> is not called. | 773 | /// The enumerator has reach end of collection or <see cref="MoveNext"/> is not called. |
774 | /// </exception> | 774 | /// </exception> |
775 | public KeyValuePair<TKey, TValue> Current | 775 | public KeyValuePair<TKey, TValue> Current |
776 | { | 776 | { |
777 | get | 777 | get |
@@ -1405,10 +1405,10 @@ namespace OpenSim.Framework | |||
1405 | /// When adding an new element to <see cref="ICnmCache{TKey,TValue}"/> that is limiting total size of elements, | 1405 | /// When adding an new element to <see cref="ICnmCache{TKey,TValue}"/> that is limiting total size of elements, |
1406 | /// <see cref="ICnmCache{TKey,TValue}"/> will remove less recently used elements until it can fit an new element. | 1406 | /// <see cref="ICnmCache{TKey,TValue}"/> will remove less recently used elements until it can fit an new element. |
1407 | /// </para> | 1407 | /// </para> |
1408 | /// </remarks> | 1408 | /// </remarks> |
1409 | /// <seealso cref="ICnmCache{TKey,TValue}.MaxElementSize"/> | 1409 | /// <seealso cref="ICnmCache{TKey,TValue}.MaxElementSize"/> |
1410 | /// <seealso cref="ICnmCache{TKey,TValue}.Size"/> | 1410 | /// <seealso cref="ICnmCache{TKey,TValue}.Size"/> |
1411 | /// <seealso cref="ICnmCache{TKey,TValue}.MaxSize"/> | 1411 | /// <seealso cref="ICnmCache{TKey,TValue}.MaxSize"/> |
1412 | /// <seealso cref="ICnmCache{TKey,TValue}.IsCountLimited"/> | 1412 | /// <seealso cref="ICnmCache{TKey,TValue}.IsCountLimited"/> |
1413 | /// <seealso cref="ICnmCache{TKey,TValue}.IsTimeLimited"/> | 1413 | /// <seealso cref="ICnmCache{TKey,TValue}.IsTimeLimited"/> |
1414 | public bool IsSizeLimited | 1414 | public bool IsSizeLimited |
@@ -1438,7 +1438,7 @@ namespace OpenSim.Framework | |||
1438 | } | 1438 | } |
1439 | 1439 | ||
1440 | /// <summary> | 1440 | /// <summary> |
1441 | /// Gets a value indicating whether elements stored to <see cref="ICnmCache{TKey,TValue}"/> have limited inactivity time. | 1441 | /// Gets a value indicating whether elements stored to <see cref="ICnmCache{TKey,TValue}"/> have limited inactivity time. |
1442 | /// </summary> | 1442 | /// </summary> |
1443 | /// <value> | 1443 | /// <value> |
1444 | /// <see langword="true"/> if the <see cref="ICnmCache{TKey,TValue}"/> has a fixed total size of elements; | 1444 | /// <see langword="true"/> if the <see cref="ICnmCache{TKey,TValue}"/> has a fixed total size of elements; |
@@ -1449,7 +1449,7 @@ namespace OpenSim.Framework | |||
1449 | /// or <see cref="ICnmCache{TKey,TValue}.TryGetValue"/> methods in <see cref="ICnmCache{TKey,TValue}.ExpirationTime"/> , then element is automatically removed from | 1449 | /// or <see cref="ICnmCache{TKey,TValue}.TryGetValue"/> methods in <see cref="ICnmCache{TKey,TValue}.ExpirationTime"/> , then element is automatically removed from |
1450 | /// the cache. Depending on implementation of the <see cref="ICnmCache{TKey,TValue}"/>, some of the elements may | 1450 | /// the cache. Depending on implementation of the <see cref="ICnmCache{TKey,TValue}"/>, some of the elements may |
1451 | /// stay longer in cache. | 1451 | /// stay longer in cache. |
1452 | /// </remarks> | 1452 | /// </remarks> |
1453 | /// <seealso cref="ICnmCache{TKey,TValue}.ExpirationTime"/> | 1453 | /// <seealso cref="ICnmCache{TKey,TValue}.ExpirationTime"/> |
1454 | /// <seealso cref="ICnmCache{TKey,TValue}.PurgeExpired"/> | 1454 | /// <seealso cref="ICnmCache{TKey,TValue}.PurgeExpired"/> |
1455 | /// <seealso cref="ICnmCache{TKey,TValue}.IsCountLimited"/> | 1455 | /// <seealso cref="ICnmCache{TKey,TValue}.IsCountLimited"/> |
@@ -1503,7 +1503,7 @@ namespace OpenSim.Framework | |||
1503 | /// <seealso cref="ICnmCache{TKey,TValue}.Set"/> | 1503 | /// <seealso cref="ICnmCache{TKey,TValue}.Set"/> |
1504 | /// <seealso cref="ICnmCache{TKey,TValue}.IsSizeLimited"/> | 1504 | /// <seealso cref="ICnmCache{TKey,TValue}.IsSizeLimited"/> |
1505 | /// <seealso cref="ICnmCache{TKey,TValue}.Size"/> | 1505 | /// <seealso cref="ICnmCache{TKey,TValue}.Size"/> |
1506 | /// <seealso cref="ICnmCache{TKey,TValue}.MaxSize"/> | 1506 | /// <seealso cref="ICnmCache{TKey,TValue}.MaxSize"/> |
1507 | public long MaxElementSize | 1507 | public long MaxElementSize |
1508 | { | 1508 | { |
1509 | get { return m_maxElementSize; } | 1509 | get { return m_maxElementSize; } |
@@ -1517,7 +1517,7 @@ namespace OpenSim.Framework | |||
1517 | /// <value> | 1517 | /// <value> |
1518 | /// Maximal allowed total size for elements stored to <see cref="ICnmCache{TKey,TValue}"/>. | 1518 | /// Maximal allowed total size for elements stored to <see cref="ICnmCache{TKey,TValue}"/>. |
1519 | /// </value> | 1519 | /// </value> |
1520 | /// <remarks> | 1520 | /// <remarks> |
1521 | /// <para> | 1521 | /// <para> |
1522 | /// Normally size is total bytes used by elements in the cache. But it can be any other suitable unit of measure. | 1522 | /// Normally size is total bytes used by elements in the cache. But it can be any other suitable unit of measure. |
1523 | /// </para> | 1523 | /// </para> |
@@ -1562,10 +1562,10 @@ namespace OpenSim.Framework | |||
1562 | /// When adding an new element to <see cref="ICnmCache{TKey,TValue}"/> that is limiting total size of elements, | 1562 | /// When adding an new element to <see cref="ICnmCache{TKey,TValue}"/> that is limiting total size of elements, |
1563 | /// <see cref="ICnmCache{TKey,TValue}"/> will remove less recently used elements until it can fit an new element. | 1563 | /// <see cref="ICnmCache{TKey,TValue}"/> will remove less recently used elements until it can fit an new element. |
1564 | /// </para> | 1564 | /// </para> |
1565 | /// </remarks> | 1565 | /// </remarks> |
1566 | /// <seealso cref="ICnmCache{TKey,TValue}.MaxElementSize"/> | 1566 | /// <seealso cref="ICnmCache{TKey,TValue}.MaxElementSize"/> |
1567 | /// <seealso cref="ICnmCache{TKey,TValue}.IsSizeLimited"/> | 1567 | /// <seealso cref="ICnmCache{TKey,TValue}.IsSizeLimited"/> |
1568 | /// <seealso cref="ICnmCache{TKey,TValue}.MaxSize"/> | 1568 | /// <seealso cref="ICnmCache{TKey,TValue}.MaxSize"/> |
1569 | /// <seealso cref="ICnmCache{TKey,TValue}.IsCountLimited"/> | 1569 | /// <seealso cref="ICnmCache{TKey,TValue}.IsCountLimited"/> |
1570 | /// <seealso cref="ICnmCache{TKey,TValue}.ExpirationTime"/> | 1570 | /// <seealso cref="ICnmCache{TKey,TValue}.ExpirationTime"/> |
1571 | public long Size | 1571 | public long Size |
@@ -1576,9 +1576,9 @@ namespace OpenSim.Framework | |||
1576 | /// <summary> | 1576 | /// <summary> |
1577 | /// Gets an object that can be used to synchronize access to the <see cref="ICnmCache{TKey,TValue}"/>. | 1577 | /// Gets an object that can be used to synchronize access to the <see cref="ICnmCache{TKey,TValue}"/>. |
1578 | /// </summary> | 1578 | /// </summary> |
1579 | /// <value> | 1579 | /// <value> |
1580 | /// An object that can be used to synchronize access to the <see cref="ICnmCache{TKey,TValue}"/>. | 1580 | /// An object that can be used to synchronize access to the <see cref="ICnmCache{TKey,TValue}"/>. |
1581 | /// </value> | 1581 | /// </value> |
1582 | /// <remarks> | 1582 | /// <remarks> |
1583 | /// <para> | 1583 | /// <para> |
1584 | /// To get synchronized (thread safe) access to <see cref="ICnmCache{TKey,TValue}"/>, use <see cref="CnmSynchronizedCache{TKey,TValue}"/> | 1584 | /// To get synchronized (thread safe) access to <see cref="ICnmCache{TKey,TValue}"/>, use <see cref="CnmSynchronizedCache{TKey,TValue}"/> |
@@ -1630,7 +1630,7 @@ namespace OpenSim.Framework | |||
1630 | /// </para> | 1630 | /// </para> |
1631 | /// <para> | 1631 | /// <para> |
1632 | /// Depending on <see cref="ICnmCache{TKey,TValue}"/> implementation, some of expired elements | 1632 | /// Depending on <see cref="ICnmCache{TKey,TValue}"/> implementation, some of expired elements |
1633 | /// may stay longer than <see cref="ICnmCache{TKey,TValue}.ExpirationTime"/> in the cache. | 1633 | /// may stay longer than <see cref="ICnmCache{TKey,TValue}.ExpirationTime"/> in the cache. |
1634 | /// </para> | 1634 | /// </para> |
1635 | /// </remarks> | 1635 | /// </remarks> |
1636 | /// <seealso cref="ICnmCache{TKey,TValue}.IsTimeLimited"/> | 1636 | /// <seealso cref="ICnmCache{TKey,TValue}.IsTimeLimited"/> |
@@ -1810,7 +1810,7 @@ namespace OpenSim.Framework | |||
1810 | /// </summary> | 1810 | /// </summary> |
1811 | /// <returns> | 1811 | /// <returns> |
1812 | /// <see langword="true"/>if the <see cref="ICnmCache{TKey,TValue}"/> contains an element with | 1812 | /// <see langword="true"/>if the <see cref="ICnmCache{TKey,TValue}"/> contains an element with |
1813 | /// the specified key; otherwise, <see langword="false"/>. | 1813 | /// the specified key; otherwise, <see langword="false"/>. |
1814 | /// </returns> | 1814 | /// </returns> |
1815 | /// <param name="key"> | 1815 | /// <param name="key"> |
1816 | /// The key whose <paramref name="value"/> to get. | 1816 | /// The key whose <paramref name="value"/> to get. |