示例#1
0
        private NativeMultiValueMap(ref NativeMultiValueMap <TKey, TValue> multiValueMap)
        {
            Debug.Assert(multiValueMap.IsValid);

            Allocator allocator   = multiValueMap.GetAllocator() !;
            int       slots       = multiValueMap.Slots;
            int       sizeOfEntry = sizeof(NativeMap <TKey, NativeList <TValue> > .Entry);
            var       buffer      = allocator.Allocate <NativeMap <TKey, NativeList <TValue> > .Entry>(slots);
            var       source      = multiValueMap._map._buffer;

            Unsafe.CopyBlockUnaligned(buffer, source, (uint)(sizeOfEntry * slots));

            for (int i = 0; i < slots; ++i)
            {
                ref var entry = ref buffer[i];
                if (entry.hashCode >= 0)
                {
                    entry.value = entry.value.Clone();
                }
            }
 public NativeMultiValueMapDebugView(NativeMultiValueMap <TKey, TValue> map)
 {
     _map = map._map;
 }