You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
854 B

  1. namespace Newtonsoft.Json
  2. {
  3. /// <summary>
  4. /// Provides an interface for using pooled arrays.
  5. /// </summary>
  6. /// <typeparam name="T">The array type content.</typeparam>
  7. internal interface IArrayPool<T>
  8. {
  9. /// <summary>
  10. /// Rent an array from the pool. This array must be returned when it is no longer needed.
  11. /// </summary>
  12. /// <param name="minimumLength">The minimum required length of the array. The returned array may be longer.</param>
  13. /// <returns>The rented array from the pool. This array must be returned when it is no longer needed.</returns>
  14. T[] Rent(int minimumLength);
  15. /// <summary>
  16. /// Return an array to the pool.
  17. /// </summary>
  18. /// <param name="array">The array that is being returned.</param>
  19. void Return(T[] array);
  20. }
  21. }