aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/malloc.h
AgeCommit message (Collapse)Author
2014-11-11[dev.cc] runtime: convert memory allocator and garbage collector to GoRuss Cox
The conversion was done with an automated tool and then modified only as necessary to make it compile and run. [This CL is part of the removal of C code from package runtime. See golang.org/s/dev.cc for an overview.] LGTM=r R=r CC=austin, dvyukov, golang-codereviews, iant, khr https://golang.org/cl/167540043
2014-10-28runtime: add PauseEnd array to MemStats and GCStatsJens Frederich
Fixes #8787. LGTM=rsc R=rsc, dvyukov CC=golang-codereviews https://golang.org/cl/153670043
2014-10-03cmd/cc, runtime: disallow structs without tagsRuss Cox
Structs without tags have no unique name to use in the Go definitions generated from the C types. This caused issue 8812, fixed by CL 149260043. Avoid future problems by requiring struct tags. Update runtime as needed. (There is no other C code in the tree.) LGTM=bradfitz, iant R=golang-codereviews, bradfitz, dave, iant CC=golang-codereviews, khr, r https://golang.org/cl/150360043
2014-09-24cmd/cc, cmd/ld, runtime: disallow conservative data/bss objectsRuss Cox
In linker, refuse to write conservative (array of pointers) as the garbage collection type for any variable in the data/bss GC program. In the linker, attach the Go type to an already-read C declaration during dedup. This gives us Go types for C globals for free as long as the cmd/dist-generated Go code contains the declaration. (Most runtime C declarations have a corresponding Go declaration. Both are bss declarations and so the linker dedups them.) In cmd/dist, add a few more C files to the auto-Go-declaration list in order to get Go type information for the C declarations into the linker. In C compiler, mark all non-pointer-containing global declarations and all string data as NOPTR. This allows them to exist in C files without any corresponding Go declaration. Count C function pointers as "non-pointer-containing", since we have no heap-allocated C functions. In runtime, add NOPTR to the remaining pointer-containing declarations, none of which refer to Go heap objects. In runtime, also move os.Args and syscall.envs data into runtime-owned variables. Otherwise, in programs that do not import os or syscall, the runtime variables named os.Args and syscall.envs will be missing type information. I believe that this CL eliminates the final source of conservative GC scanning in non-SWIG Go programs, and therefore... Fixes #909. LGTM=iant R=iant CC=golang-codereviews https://golang.org/cl/149770043
2014-09-17runtime: account for tiny allocs, for testing.AllocsPerRunRuss Cox
Fixes #8734. LGTM=r, bradfitz, dvyukov R=bradfitz, r, dvyukov CC=golang-codereviews, iant, khr https://golang.org/cl/143150043
2014-09-16runtime: remove uses of ScanConservativelyRuss Cox
Along with CLs 139610043 and 141490043, this removes all conservative scanning during garbage collection, except _cgo_allocate, which is SWIG-only. LGTM=rlh, khr R=golang-codereviews, dvyukov, rlh, khr CC=golang-codereviews, iant https://golang.org/cl/144860043
2014-09-16runtime: remove untyped allocation of ParForRuss Cox
Now it's two allocations. I don't see much downside to that, since the two pieces were in different cache lines anyway. Rename 'conservative' to 'cgo_conservative_type' and make clear that _cgo_allocate is the only allowed user. This depends on CL 141490043, which removes the other use of conservative (in defer). LGTM=dvyukov, iant R=khr, dvyukov, iant CC=golang-codereviews, rlh https://golang.org/cl/139610043
2014-09-12runtime: tell the truth about BitVector typeRuss Cox
Dmitriy changed all the execution to interpret the BitVector as an array of bytes. Update the declaration and generation of the bitmaps to match, to avoid problems on big-endian machines. LGTM=khr R=khr CC=dvyukov, golang-codereviews https://golang.org/cl/140570044
2014-09-12runtime: look up arg stackmap for makeFuncStub/methodValueStub during tracebackRuss Cox
makeFuncStub and methodValueStub are used by reflect as generic function implementations. Each call might have different arguments. Extract those arguments from the closure data instead of assuming it is the same each time. Because the argument map is now being extracted from the function itself, we don't need the special cases in reflect.Call anymore, so delete those. Fixes an occasional crash seen when stack copying does not update makeFuncStub's arguments correctly. Will also help make it safe to require stack maps in the garbage collector. Derived from CL 142000044 by khr. LGTM=khr R=khr CC=golang-codereviews https://golang.org/cl/143890044
2014-09-08build: move package sources from src/pkg to srcRuss Cox
Preparation was in CL 134570043. This CL contains only the effect of 'hg mv src/pkg/* src'. For more about the move, see golang.org/s/go14nopkg.
2009-06-06move src/runtime -> src/lib/runtime;Russ Cox
only automatic g4 mv here. R=r OCL=30002 CL=30007
2009-03-30more 386 runtime - can run tiny c programs.Russ Cox
R=r DELTA=1926 (1727 added, 168 deleted, 31 changed) OCL=26876 CL=26878
2009-03-24split heapmap, which is specific to 64-bit pointer addresses,Russ Cox
out of malloc proper. TBR=r OCL=26689 CL=26689
2009-03-20embarassing bug in allocator:Russ Cox
was applying wrong waste check, resulting in many more size classes than necessary. R=r DELTA=2 (0 added, 0 deleted, 2 changed) OCL=26602 CL=26605
2009-01-28Use explicit allspan list instead ofRuss Cox
trying to find all the places where spans might be recorded. Free can cascade into complicated span manipulations that move them from list to list; the old code had the possibility of accidentally processing a span twice or jumping to a different list, causing an infinite loop. R=r DELTA=70 (28 added, 25 deleted, 17 changed) OCL=23704 CL=23710
2009-01-26gc #0. mark and sweep collector.Russ Cox
R=r,gri DELTA=472 (423 added, 2 deleted, 47 changed) OCL=23522 CL=23541
2009-01-14Add cgo2c program to translate mixed Go/C code into C. ThisIan Lance Taylor
lets us use a single source file for both 6c and gcc, handling the incompatible handling of return values. R=rsc DELTA=649 (613 added, 35 deleted, 1 changed) OCL=22682 CL=22730
2009-01-13Tweak code to make it easier to compile with gcc.Ian Lance Taylor
+ Use macros to name symbols with non-ASCII characters. + Make some variables unsigned, because they are compared against unsigned values. + Fix a few void* pointers to be MLink*. R=rsc DELTA=94 (44 added, 3 deleted, 47 changed) OCL=22303 CL=22638
2009-01-08Remove duplicate typedef declarations.Ian Lance Taylor
R=rsc DELTA=7 (0 added, 7 deleted, 0 changed) OCL=22267 CL=22281
2008-12-19malloc bug fixes.Russ Cox
use malloc by default. free stacks. R=r DELTA=424 (333 added, 29 deleted, 62 changed) OCL=21553 CL=21584
2008-12-18malloc in runtime (not used by default)Russ Cox
R=r DELTA=1551 (1550 added, 0 deleted, 1 changed) OCL=21404 CL=21538