<commit_before>/*
Copyright (c) 2013 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.

Author: <NAME>
*/
#include <pthread.h>
#include <memory.h>
#include <iostream>
#include "util/exception.h"

#define LEAN_MIN_STACK_SPACE 128*1024  // 128 Kb

namespace lean {
static void throw_get_stack_size_failed() {
    throw exception("failed to retrieve thread stack size");
}

#ifdef LEAN_WINDOWS
size_t get_stack_size() {
    return LEAN_WIN_STACK_SIZE;
}
#elif defined (__APPLE__)
size_t get_stack_size() {
    pthread_attr_t attr;
    memset (&attr, 0, sizeof(attr));
    pthread_attr_init(&attr);
    size_t result;
    if (pthread_attr_getstacksize(&attr, &result) != 0) {
        throw_get_stack_size_failed();
    }
    return result;
}
#else
size_t get_stack_size() {
    pthread_attr_t attr;
    memset (&attr, 0, sizeof(attr));
    if (pthread_getattr_np(pthread_self(), &attr) != 0) {
        throw_get_stack_size_failed();
    }<commit_msg>fix(util/stackinfo): compilation warning on mingw and cygwin<commit_after>/*
Copyright (c) 2013 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.

Author: <NAME>
*/
#include <pthread.h>
#include <memory.h>
#include <iostream>
#include "util/exception.h"

#define LEAN_MIN_STACK_SPACE 128*1024  // 128 Kb

namespace lean {
void throw_get_stack_size_failed() {
    throw exception("failed to retrieve thread stack size");
}

#ifdef LEAN_WINDOWS
size_t get_stack_size() {
    return LEAN_WIN_STACK_SIZE;
}
#elif defined (__APPLE__)
size_t get_stack_size() {
    pthread_attr_t attr;
    memset (&attr, 0, sizeof(attr));
    pthread_attr_init(&attr);
    size_t result;
    if (pthread_attr_getstacksize(&attr, &result) != 0) {
        throw_get_stack_size_failed();
    }
    return result;
}
#else
size_t get_stack_size() {
    pthread_attr_t attr;
    memset (&attr, 0, sizeof(attr));
    if (pthread_getattr_np(pthread_self(), &attr) != 0) {
        throw_get_stack_size_failed();
    }
{'fraction_non_alphanumeric': 0.11478599221789883, 'fraction_numerical': 0.019455252918287938, 'mean_word_length': 4.370757180156658, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '2322332', 'n_tokens_mistral': 752, 'n_tokens_neox': 715, 'n_words': 181}