<commit_before>// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//

// Allocate 120MB of live large objects (2MB at a time) on n threads,
// where n is the number of processors on the machine.
//This test must be run with server GC.

using System;
using System.Threading;

internal class MyThread
{
    private int _index;
    private int _allocPerThreadMB;

    public MyThread(int i, int allocPerThreadMB)
    {
        _index = i;
        _allocPerThreadMB = allocPerThreadMB;
    }

    public void DoWork()
    {
        byte[][] largeArray = new byte[_allocPerThreadMB / 2][];
        for (int i = 0; i < _allocPerThreadMB / 2; i++)
        {
            largeArray[i] = new byte[2 * 1024 * 1024];  // 2 MB
            largeArray[i][i + 100] = Convert.ToByte(i);
        }
        int sum = 0;
        for (int i = 0; i < _allocPerThreadMB / 2; i++)
            sum += Convert.ToInt32(largeArray[i][i + 100]);
        Console.WriteLine("Thread {0}: finished", _index);
    }<commit_msg>Fix OverflowException in b115557.cs GC test on systems with fewer than four processors/cores<commit_after>// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//

// Allocate 120MB of live large objects (2MB at a time) on n threads,
// where n is the number of processors on the machine.
//This test must be run with server GC.

using System;
using System.Threading;

internal class MyThread
{
    private int _index;
    private int _allocPerThreadMB;

    public MyThread(int i, int allocPerThreadMB)
    {
        _index = i;
        _allocPerThreadMB = allocPerThreadMB;
    }

    public void DoWork()
    {
        byte[][] largeArray = new byte[_allocPerThreadMB / 2][];
        for (int i = 0; i < _allocPerThreadMB / 2; i++)
        {
            largeArray[i] = new byte[2 * 1024 * 1024];  // 2 MB
            largeArray[i][i + 100] = Convert.ToByte(Math.Min(i, byte.MaxValue));
        }
        int sum = 0;
        for (int i = 0; i < _allocPerThreadMB / 2; i++)
            sum += Convert.ToInt32(largeArray[i][i + 100]);
        Console.WriteLine("Thread {0}: finished", _index);
    }
{'fraction_non_alphanumeric': 0.10128102481985589, 'fraction_numerical': 0.025620496397117692, 'mean_word_length': 2.539660056657224, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2475531', 'n_tokens_mistral': 784, 'n_tokens_neox': 723, 'n_words': 285}