aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/string.c
AgeCommit message (Collapse)Author
2014-11-11[dev.cc] runtime: convert basic library routines from C to GoRuss Cox
float.c held bit patterns for special float64 values, hiding from the real uses. Rewrite Go code not to refer to those values directly. Convert library routines in runtime.c and string.c. LGTM=r R=r, dave CC=austin, dvyukov, golang-codereviews, iant, khr https://golang.org/cl/170330043
2014-09-11runtime: make gostringnocopy update maxstringKeith Randall
Fixes #8706 LGTM=josharian R=josharian CC=golang-codereviews https://golang.org/cl/143880043
2014-09-08liblink, runtime: diagnose and fix C code running on Go stackRuss Cox
This CL contains compiler+runtime changes that detect C code running on Go (not g0, not gsignal) stacks, and it contains corrections for what it detected. The detection works by changing the C prologue to use a different stack guard word in the G than Go prologue does. On the g0 and gsignal stacks, that stack guard word is set to the usual stack guard value. But on ordinary Go stacks, that stack guard word is set to ^0, which will make any stack split check fail. The C prologue then calls morestackc instead of morestack, and morestackc aborts the program with a message about running C code on a Go stack. This check catches all C code running on the Go stack except NOSPLIT code. The NOSPLIT code is allowed, so the check is complete. Since it is a dynamic check, the code must execute to be caught. But unlike the static checks we've been using in cmd/ld, the dynamic check works with function pointers and other indirect calls. For example it caught sigpanic being pushed onto Go stacks in the signal handlers. Fixes #8667. LGTM=khr, iant R=golang-codereviews, khr, iant CC=golang-codereviews, r https://golang.org/cl/133700043
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-05-27added protection against race conditionKen Thompson
between first and second pass of converting []int to string. R=r OCL=29467 CL=29467
2009-05-27string([]int) conversionKen Thompson
R=r OCL=29466 CL=29466
2009-05-26add NUL when allocating strings, to make useRuss Cox
of getenv by low-level runtime easier. fix 32-bit bug in gc (there are still more). R=ken OCL=29415 CL=29415
2009-05-08move things out of sys into os and runtimeRuss Cox
R=r OCL=28569 CL=28573
2009-05-056g tweaksRuss Cox
* byteastring is no longer used * do not generate ODCL, OAS for globals (wasn't generating any code but might save one or two init functions) * do not call self from Init function R=ken OCL=28309 CL=28309
2009-04-12tweakKen Thompson
R=r OCL=27344 CL=27344
2009-04-12fix string range to have full unicode range (up to 10FFFF).Rob Pike
add test for string range. test has minor failure: after loop the index == len(s); should be len(s)-1 in this case. according to spec, vars are left at position at last iteration. R=ken,rsc DELTA=259 (161 added, 96 deleted, 2 changed) OCL=27343 CL=27343
2009-04-12change replacement rune to its correct value, fffdRob Pike
R=ken OCL=27342 CL=27342
2009-04-10range over stringsKen Thompson
R=r OCL=27332 CL=27332
2009-04-09change representation of stringsKen Thompson
R=r OCL=27293 CL=27293
2009-02-02minor tweaksRuss Cox
R=r DELTA=9 (2 added, 5 deleted, 2 changed) OCL=24107 CL=24152
2009-01-29if take address of local, move to heap.Russ Cox
heuristic to not print bogus strings. fix one error message format. R=ken OCL=23849 CL=23851
2008-12-18convert *[] to [].Russ Cox
R=r OCL=21563 CL=21571
2008-11-23delete stack mark stringsRuss Cox
in favor of using in-memory copy of symbol table. $ ls -l pretty pretty.big -rwxr-xr-x 1 rsc eng 439516 Nov 21 16:43 pretty -rwxr-xr-x 1 rsc eng 580984 Nov 21 16:20 pretty.big $ R=r DELTA=446 (238 added, 178 deleted, 30 changed) OCL=19851 CL=19884
2008-09-22change string([]byte) to pass array, rather than &a[0],Russ Cox
to string convert. if the byte array has length 0, the computation of &a[0] throws an index bounds error. for fixed size arrays, this ends up invoking arrays2d unnecessarily, but it works. R=ken DELTA=304 (44 added, 28 deleted, 232 changed) OCL=15674 CL=15678
2008-09-18proper handling of signals.Russ Cox
do not run init on g0. R=r DELTA=161 (124 added, 23 deleted, 14 changed) OCL=15490 CL=15497
2008-08-05* comment, clean up schedulerRuss Cox
* rewrite lock implementation to be correct (tip: never assume that an algorithm you found in a linux man page is correct.) * delete unneeded void* arg from clone fn * replace Rendez with Note * comment mal better * use 6c -w, fix warnings * mark all assembly functions 7 R=r DELTA=828 (338 added, 221 deleted, 269 changed) OCL=13884 CL=13886
2008-07-07update to Unicode 5Rob Pike
SVN=126184
2008-07-03drop some superfluous file prefixes in runtimeRob Pike
SVN=125956