new SimpleCollator (CultureInfo.InvariantCulture);
readonly TextInfo textInfo; // for ToLower().
- readonly bool frenchSort;
- unsafe readonly byte* cjkCatTable;
- unsafe readonly byte* cjkLv1Table;
readonly CodePointIndexer cjkIndexer;
- unsafe readonly byte* cjkLv2Table;
- readonly CodePointIndexer cjkLv2Indexer;
- readonly int lcid;
readonly Contraction [] contractions;
readonly Level2Map [] level2Maps;
-
// This flag marks characters as "unsafe", where the character
// could be used as part of a contraction (whose length > 1).
readonly byte [] unsafeFlags;
+ unsafe readonly byte* cjkCatTable;
+ unsafe readonly byte* cjkLv1Table;
+ unsafe readonly byte* cjkLv2Table;
+ readonly CodePointIndexer cjkLv2Indexer;
+ readonly int lcid;
+ readonly bool frenchSort;
+
+
const int UnsafeFlagLength = 0x300 / 8;
// readonly byte [] contractionFlags = new byte [16];
#endregion
readonly string source;
- readonly CompareOptions options;
readonly byte [] key;
+ readonly CompareOptions options;
readonly int lcid;
// for legacy unmanaged one
{
// l4s = small kana sensitivity, l4t = mark type,
// l4k = katakana flag, l4w = kana width sensitivity
- int l1, l2, l3, l4s, l4t, l4k, l4w, l5;
byte [] l1b, l2b, l3b, l4sb, l4tb, l4kb, l4wb, l5b;
// int level5LastPos;
string source;
+ int l1, l2, l3, l4s, l4t, l4k, l4w, l5;
+ int lcid;
+ CompareOptions options;
bool processLevel2;
bool frenchSort;
bool frenchSorted;
- int lcid;
- CompareOptions options;
public SortKeyBuffer (int lcid)
{
TKey [] keySlots;
TValue [] valueSlots;
+ //Leave those 2 fields here to improve heap layout.
+ IEqualityComparer<TKey> hcp;
+ SerializationInfo serialization_info;
+
// The number of slots in "linkSlots" and "keySlots"/"valueSlots" that
// are in use (i.e. filled with data) or have been used and marked as
// "empty" later on.
// resizing the hash table and the slots arrays.
int threshold;
- IEqualityComparer<TKey> hcp;
- SerializationInfo serialization_info;
-
// The number of changes made to this dictionary. Used by enumerators
// to detect changes and invalidate themselves.
int generation;
private sealed class ArrayListEnumerator
: IEnumerator, ICloneable
{
+ private object m_Current;
+ private ArrayList m_List;
private int m_Pos;
private int m_Index;
private int m_Count;
- private object m_Current;
- private ArrayList m_List;
private int m_ExpectedStateChanges;
public ArrayListEnumerator(ArrayList list)
sealed class SimpleEnumerator : IEnumerator, ICloneable
{
ArrayList list;
+ object currentElement;
int index;
int version;
- object currentElement;
static object endFlag = new object ();
public SimpleEnumerator (ArrayList list)
#region Fields
private const int DefaultInitialCapacity = 4;
-
- /// <summary>
- /// Number of items in the list.
- /// </summary>
- private int _size;
/// <summary>
/// Array to store the items.
/// </summary>
private object[] _items;
-
+
+ /// <summary>
+ /// Number of items in the list.
+ /// </summary>
+ private int _size;
+
/// <summary>
/// Total number of state changes.
/// </summary>
const int CHAIN_MARKER = ~Int32.MaxValue;
- private int inUse;
- private int modificationCount;
- private float loadFactor;
private Slot [] table;
// Hashcodes of the corresponding entries in the slot table. Kept separate to
// help the GC
private int [] hashes;
-
- private int threshold;
-
private HashKeys hashKeys;
private HashValues hashValues;
-
private IHashCodeProvider hcpRef;
private IComparer comparerRef;
private SerializationInfo serializationInfo;
-
private IEqualityComparer equalityComparer;
+ private int inUse;
+ private int modificationCount;
+ private float loadFactor;
+ private int threshold;
+
private static readonly int [] primeTbl = {
11,
19,
private sealed class Enumerator : IDictionaryEnumerator, IEnumerator {
private Hashtable host;
+ private Object currentKey;
+ private Object currentValue;
+
private int stamp;
private int pos;
private int size;
private EnumeratorMode mode;
- private Object currentKey;
- private Object currentValue;
-
private readonly static string xstr = "Hashtable.Enumerator: snapshot out of sync.";
public Enumerator (Hashtable host, EnumeratorMode mode) {
private enum EnumeratorMode : int { KEY_MODE = 0, VALUE_MODE, ENTRY_MODE }
- private int inUse;
- private int modificationCount;
private Slot[] table;
private IComparer comparer;
+ private int inUse;
+ private int modificationCount;
private int defaultCapacity;
//
private sealed class Enumerator : ICloneable, IDictionaryEnumerator, IEnumerator {
private SortedList host;
+ private object currentKey;
+ private object currentValue;
+
private int stamp;
private int pos;
private int size;
private EnumeratorMode mode;
- private object currentKey;
- private object currentValue;
-
bool invalid = false;
private readonly static string xstr = "SortedList.Enumerator: snapshot out of sync.";
protected Stream OutStream;
private Encoding m_encoding;
private byte [] buffer;
+ byte [] stringBuffer;
+ int maxCharsPerRound;
private bool disposed = false;
protected BinaryWriter() : this (Stream.Null, Encoding.UTF8UnmarkedUnsafe) {
OutStream.Write(BitConverterLE.GetBytes(value), 0, 4);
}
-
- byte [] stringBuffer;
- int maxCharsPerRound;
public virtual void Write(string value) {
static byte[] buf_recycle;
static readonly object buf_recycle_lock = new object ();
+ private byte [] buf; // the buffer
+ private string name = "[Unknown]"; // name of file.
+
+ SafeFileHandle safeHandle; // set only when using one of the
+ // constructors taking SafeFileHandle
+
+ private long append_startpos;
+ IntPtr handle; // handle to underlying file
+
private FileAccess access;
private bool owner;
private bool async;
private bool canseek;
- private long append_startpos;
private bool anonymous;
+ private bool buf_dirty; // true if buffer has been written to
- private byte [] buf; // the buffer
private int buf_size; // capacity in bytes
private int buf_length; // number of valid bytes in buffer
private int buf_offset; // position of next byte
- private bool buf_dirty; // true if buffer has been written to
private long buf_start; // location of buffer in file
- private string name = "[Unknown]"; // name of file.
-
- IntPtr handle; // handle to underlying file
- SafeFileHandle safeHandle; // set only when using one of the
- // constructors taking SafeFileHandle
}
}
char [] decoded_buffer;
static char[] decoded_buffer_recycle;
+ Encoding encoding;
+ Decoder decoder;
+ StringBuilder line_builder;
+ Stream base_stream;
+
//
// Decoded bytes in decoded_buffer.
//
int do_checks;
- Encoding encoding;
- Decoder decoder;
-
- Stream base_stream;
bool mayBlock;
- StringBuilder line_builder;
private class NullStreamReader : StreamReader {
public override int Peek ()
\r
private Stream internalStream;\r
\r
- private bool iflush;\r
- \r
private const int DefaultBufferSize = 1024;\r
private const int DefaultFileBufferSize = 4096;\r
private const int MinimumBufferSize = 256;\r
\r
private byte[] byte_buf;\r
- private int byte_pos;\r
private char[] decode_buf;\r
+ private int byte_pos;\r
private int decode_pos;\r
\r
+ private bool iflush;\r
private bool DisposedAlready;\r
private bool preamble_done;\r
\r
#if !ECMA_COMPAT
- internal string body_name;
- internal string encoding_name;
- internal string header_name;
internal bool is_mail_news_display;
internal bool is_mail_news_save;
internal bool is_browser_save = false;
internal bool is_browser_display = false;
+ internal string body_name;
+ internal string encoding_name;
+ internal string header_name;
internal string web_name;
// Get the mail body name for this encoding.
private int seq_num = 1;
private int state;
private int readers;
+ private int writer_lock_owner;
private LockQueue writer_queue;
private Hashtable reader_locks;
- private int writer_lock_owner;
public ReaderWriterLock()
{
{
WaitHandle _waitObject;
WaitOrTimerCallback _callback;
- TimeSpan _timeout;
object _state;
- bool _executeOnlyOnce;
WaitHandle _finalEvent;
ManualResetEvent _cancelEvent;
+ TimeSpan _timeout;
int _callsInProcess;
+ bool _executeOnlyOnce;
bool _unregistered;
internal RegisteredWaitHandle (WaitHandle waitObject, WaitOrTimerCallback callback, object state, TimeSpan timeout, bool executeOnlyOnce)
StoreBounded
}
+ private ApplicationIdentity _appid;
+
// FIXME:
#pragma warning disable 649
private ContextForm _form;
#pragma warning restore 649
- private ApplicationIdentity _appid;
private bool _disposed;
private ActivationContext (ApplicationIdentity identity)
public class Lazy<T>
{
T value;
- bool inited;
- LazyThreadSafetyMode mode;
Func<T> factory;
object monitor;
Exception exception;
+ LazyThreadSafetyMode mode;
+ bool inited;
public Lazy ()
: this (LazyThreadSafetyMode.ExecutionAndPublication)
private NumberFormatInfo _nfi;
+ //part of the private stringbuffer
+ private char[] _cbuf;
+
private bool _NaN;
private bool _infinity;
private bool _isCustomFormat;
#region Inner String Buffer
- private char[] _cbuf;
+ //_cbuf moved to before other fields to improve layout
private int _ind;
private void ResetCharBuf (int size)