<commit_before>// Copyright 2010 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.

#include "runtime.h"
#include "malloc.h"

// Assume there's an arbitrary amount of memory starting at "end".
// Sizing PC memory is beyond the scope of this demo.

static byte *allocp;

void*
SysAlloc(uintptr ask)
{
	extern byte end[];
	byte *q;
	
	if(allocp == nil) {
		allocp = end;
		allocp += 7 & -(uintptr)allocp;
	}
	ask += 7 & -ask;

	q = allocp;
	allocp += ask;
	·memclr(q, ask);
	return q;
}

void
SysFree(void *v, uintptr n)
{
	// Push pointer back if this is a free
	// of the most recent SysAlloc.
	n += 7 & -n;
	if(allocp == v+n)
		allocp -= n;
}

void
SysUnused(void *v, uintptr n)
{
	USED(v, n);
}

void
SysMemInit(void)
{
}
<commit_msg>runtime: fix tiny build<commit_after>// Copyright 2010 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.

#include "runtime.h"
#include "malloc.h"

// Assume there's an arbitrary amount of memory starting at "end".
// Sizing PC memory is beyond the scope of this demo.

static byte *allocp;

void*
SysAlloc(uintptr ask)
{
	extern byte end[];
	byte *q;
	
	if(allocp == nil) {
		allocp = end;
		allocp += 7 & -(uintptr)allocp;
	}
	ask += 7 & -ask;

	q = allocp;
	allocp += ask;
	·memclr(q, ask);
	return q;
}

void
SysFree(void *v, uintptr n)
{
	// Push pointer back if this is a free
	// of the most recent SysAlloc.
	n += 7 & -n;
	if(allocp == (byte*)v+n)
		allocp -= n;
}

void
SysUnused(void *v, uintptr n)
{
	USED(v, n);
}

void
SysMemInit(void)
{
}

{'fraction_non_alphanumeric': 0.13508667065152422, 'fraction_numerical': 0.008368200836820083, 'mean_word_length': 3.123152709359606, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2236976', 'n_tokens_mistral': 668, 'n_tokens_neox': 629, 'n_words': 233}