<commit_before>#include "../sccs.h"

#ifdef WIN32

#include <psapi.h>

u64
maxrss(void)
{
	PROCESS_MEMORY_COUNTERS cnt;

	if (GetProcessMemoryInfo(GetCurrentProcess(), &cnt, sizeof(cnt))) {
		return (cnt.PeakWorkingSetSize);
	}
	return (0);
}

#else

#include <sys/resource.h>

u64
maxrss(void)
{
	struct rusage ru;

	if (!getrusage(RUSAGE_SELF, &ru)) return (1024 * ru.ru_maxrss);
	return (0);
}

#endif
<commit_msg>Adjust for the fact that MacOS X and Solaris report maxrss in different units.<commit_after>#include "../sccs.h"

#ifdef WIN32

#include <psapi.h>

u64
maxrss(void)
{
	PROCESS_MEMORY_COUNTERS cnt;

	if (GetProcessMemoryInfo(GetCurrentProcess(), &cnt, sizeof(cnt))) {
		return (cnt.PeakWorkingSetSize);
	}
	return (0);
}

#else

#include <sys/resource.h>

u64
maxrss(void)
{
	struct rusage	ru;
#if defined(sun)
	int		factor = getpagesize();
#elif defined(__APPLE__)
	int	factor = 1;
#else
	int	factor = 1024;
#endif

	if (getrusage(RUSAGE_SELF, &ru)) return (0);

	return (ru.ru_maxrss * factor);
}

#endif

{'fraction_non_alphanumeric': 0.1466275659824047, 'fraction_numerical': 0.024437927663734114, 'mean_word_length': 4.818181818181818, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '2931315', 'n_tokens_mistral': 447, 'n_tokens_neox': 425, 'n_words': 98}