<commit_before>// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// +build !plan9,!windows

package main

/*
#cgo CFLAGS: -pthread
#cgo LDFLAGS: -pthread

#include <pthread.h>

void go_callback();

static void *thr(void *arg) {
    go_callback();
    return 0;
}

static void foo() {
    pthread_t th;
    pthread_attr_t attr;
    pthread_attr_init(&attr);
    pthread_attr_setstacksize(&attr, 256 << 10);
    pthread_create(&th, &attr, thr, 0);
    pthread_join(th, 0);
}
*/
import "C"

import (
	"fmt"
	"runtime"
)

func init() {
	register("CgoCallbackGC", CgoCallbackGC)
}

//export go_callback
func go_callback() {
	runtime.GC()
	grow()
	runtime.GC()
}

var cnt int
<commit_msg>runtime: allocate more stack space in CgoCallbackGC test<commit_after>// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// +build !plan9,!windows

package main

/*
#cgo CFLAGS: -pthread
#cgo LDFLAGS: -pthread

#include <pthread.h>

void go_callback();

static void *thr(void *arg) {
    go_callback();
    return 0;
}

static void foo() {
    pthread_t th;
    pthread_attr_t attr;
    pthread_attr_init(&attr);
    // For gccgo use a stack size large enough for all the callbacks,
    // in case we are on a platform that does not support -fsplit-stack.
    pthread_attr_setstacksize(&attr, 512 * 10000);
    pthread_create(&th, &attr, thr, 0);
    pthread_join(th, 0);
}
*/
import "C"

import (
	"fmt"
	"runtime"
)

func init() {
	register("CgoCallbackGC", CgoCallbackGC)
}

//export go_callback
func go_callback() {
	runtime.GC()
	grow()
	runtime.GC()
}

var cnt int

{'fraction_non_alphanumeric': 0.12415349887133183, 'fraction_numerical': 0.01636568848758465, 'mean_word_length': 3.534526854219949, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '4620265', 'n_tokens_mistral': 662, 'n_tokens_neox': 633, 'n_words': 201}