runtime: rewrite malloc in Go.

This change introduces gomallocgc, a Go clone of mallocgc.
Only a few uses have been moved over, so there are still
lots of uses from C. Many of these C uses will be moved
over to Go (e.g. in slice.goc), but probably not all.
What should remain of C's mallocgc is an open question.

LGTM=rsc, dvyukov
R=rsc, khr, dave, bradfitz, dvyukov
CC=golang-codereviews
https://codereview.appspot.com/108840046

--HG--
rename : src/pkg/runtime/malloc.goc => src/pkg/runtime/malloc.c
runtime: fix freebsd build.  Assignment is int32* on 32 bit
machines and int64* on 64 bit machines.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://codereview.appspot.com/117330044
runtime: fix assembler macro definitions to be consistent in use of center-dot
The DISPATCH and CALLFN macro definitions depend on an inconsistency
between the internal cpp mini-implementation and the language proper in
whether center-dot is an identifier character. The macro depends on it not
being an identifier character, but the resulting code depends on it being one.

Remove the dependence on the inconsistency by placing the center-dot into
the macro invocation rather that the body.

No semantic change. This is just renaming macro arguments.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://codereview.appspot.com/119320043
runtime: fix stack memory test

Stand-alone this test is fine.  Run together with
others, however, the stack used can actually go
negative because other tests are freeing stack
during its execution.

This behavior is new with the new stack allocator.
The old allocator never returned (min-sized) stacks.

This test is fairly poor - it needs to run in
isolation to be accurate.  Maybe we should delete it.

LGTM=r
R=r
CC=golang-codereviews
https://codereview.appspot.com/119330044
runtime: fix cmallocgc's C prototype

LGTM=khr
R=khr
CC=golang-codereviews
https://codereview.appspot.com/121910043

Committer: Keith Randall <khr@golang.org>
runtime: cast to uintptr to match %p formatter.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://codereview.appspot.com/121920043
image/jpeg: rename some internal variables.

LGTM=dsymonds
R=dsymonds
CC=golang-codereviews
https://codereview.appspot.com/120980043
runtime: get rid of free
Several reasons:
1. Significantly simplifies runtime.
2. This code proved to be buggy.
3. Free is incompatible with bump-the-pointer allocation.
4. We want to write runtime in Go, Go does not have free.
5. Too much code to free env strings on startup.

LGTM=khr
R=golang-codereviews, josharian, tracey.brendan, khr
CC=bradfitz, golang-codereviews, r, rlh, rsc
https://codereview.appspot.com/116390043
runtime: use right mask to extract type kind

Cleanup from recent malloc changes.

LGTM=dvyukov
R=dvyukov
CC=golang-codereviews
https://codereview.appspot.com/120960043
cmd/gc: fix example flag in comment

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://codereview.appspot.com/118480044
runtime: convert slice operations to Go.

LGTM=bradfitz, dvyukov
R=golang-codereviews, bradfitz, dvyukov
CC=golang-codereviews
https://codereview.appspot.com/120190044

--HG--
rename : src/pkg/runtime/slice.goc => src/pkg/runtime/slice.go
runtime: fix 32 bit build.

int(maxMem) is negative on 32 bits.  Need to use
unsigned arithmetic.

TBR=bradfitz
CC=golang-codereviews
https://codereview.appspot.com/121000045
runtime: move built-in print routines to go.

Fixes issue 8297

LGTM=bradfitz
R=golang-codereviews, bradfitz, khr, dave, dvyukov
CC=golang-codereviews
https://codereview.appspot.com/119240043
strconv: remove needless cast

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://codereview.appspot.com/119340043
runtime: convert hash functions to Go calling convention.

Create proper closures so hash functions can be called
directly from Go.  Rearrange calling convention so return
value is directly accessible.

LGTM=dvyukov
R=golang-codereviews, dvyukov, dave, khr
CC=golang-codereviews
https://codereview.appspot.com/119360043
runtime: missed a file in alg checkin

TBR=dvyukov
CC=golang-codereviews
https://codereview.appspot.com/122740044
runtime: implement monotonic clocks on windows

Update issue 6007.

LGTM=minux, dvyukov
R=golang-codereviews, dvyukov, patrick, aram.h, minux
CC=golang-codereviews
https://codereview.appspot.com/108700045