Enhanced C#
Loyc library documentation
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
Public fields | List of all members
Loyc.SyncLib.Impl.ListLoader Class Reference

Source file:

Public fields

const int MaxPreallocationBytes = 16 * 1024 * 1024
 The maximum amount of memory that a list loader preallocates for a list (when the data stream says how long it is). A longer list still loads, but its memory grows as items are actually read, so that a corrupt or malicious length prefix cannot cause a huge allocation. Readers that load a list's data in bulk (e.g. byte lists in SyncBinary) use the same limit for the amount of data they request before seeing that the data exists. More...
 

Member Data Documentation

const int Loyc.SyncLib.Impl.ListLoader.MaxPreallocationBytes = 16 * 1024 * 1024

The maximum amount of memory that a list loader preallocates for a list (when the data stream says how long it is). A longer list still loads, but its memory grows as items are actually read, so that a corrupt or malicious length prefix cannot cause a huge allocation. Readers that load a list's data in bulk (e.g. byte lists in SyncBinary) use the same limit for the amount of data they request before seeing that the data exists.