add support for ref counts to memory allocator.

mark and sweep, stop the world garbage collector
(intermediate step in the way to ref counting).
can run pretty with an explicit gc after each file.

R=r
DELTA=502  (346 added, 143 deleted, 13 changed)
OCL=20630
CL=20635
This commit is contained in:
Russ Cox 2008-12-05 15:24:18 -08:00
parent 73120ee81d
commit 3f8aa662e9
12 changed files with 341 additions and 139 deletions

View file

@ -1,19 +0,0 @@
// Copyright 2009 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"
// Stubs for stack management.
// In a separate file so they can be overridden during testing of gc.
void*
stackalloc(uint32 n)
{
return mal(n);
}
void
stackfree(void*)
{
}