1
0
mirror of https://github.com/golang/go synced 2024-10-04 09:21:21 -06:00
Commit Graph

772 Commits

Author SHA1 Message Date
Russ Cox
bf67afc84e print field names on struct members.
also don't concatenate strings next
to each other in the struct,
like p.doprint does.

expose additional print flags to formatters

R=r
DELTA=128  (111 added, 11 deleted, 6 changed)
OCL=20991
CL=21018
2008-12-11 16:53:33 -08:00
Ken Thompson
c7ab332744 restrict declarations of type map/chan/string
(they must be pointers)

R=r
OCL=21009
CL=21009
2008-12-11 16:09:45 -08:00
Russ Cox
73653841af reject struct to interface conversion for now
R=ken
OCL=21007
CL=21007
2008-12-11 15:56:13 -08:00
Rob Pike
9ba97ca308 add uintptr to reflect and print
R=rsc
DELTA=70  (35 added, 4 deleted, 31 changed)
OCL=20993
CL=20998
2008-12-11 14:41:12 -08:00
Rob Pike
546f269c3b if the typestring gives a field name of "?", drop it.
R=rsc
DELTA=11  (7 added, 0 deleted, 4 changed)
OCL=20988
CL=20988
2008-12-11 13:24:04 -08:00
Rob Pike
ac09eb4f49 handle the nil interface better in reflect and print
R=rsc
DELTA=25  (19 added, 0 deleted, 6 changed)
OCL=20985
CL=20985
2008-12-11 12:59:49 -08:00
Russ Cox
793a6effcf add JSON library
R=r
DELTA=1127  (1127 added, 0 deleted, 0 changed)
OCL=20975
CL=20983
2008-12-11 12:25:58 -08:00
Russ Cox
fa945d5bf8 fix race with fresh perforce checkouts
R=r
DELTA=15  (9 added, 0 deleted, 6 changed)
OCL=20977
CL=20981
2008-12-11 11:58:45 -08:00
Russ Cox
cb64ec5bb6 only generate non-trivial signatures in the
file in which they occur.  avoids duplicate
trampoline generation across multiple files.

R=ken
OCL=20976
CL=20980
2008-12-11 11:54:33 -08:00
Russ Cox
a9e890d5cf looks like i broke the build
TBR=r
OCL=20963
CL=20963
2008-12-10 21:20:48 -08:00
Russ Cox
b927ad8835 DNS messages
R=r
DELTA=685  (683 added, 0 deleted, 2 changed)
OCL=20926
CL=20951
2008-12-10 17:17:59 -08:00
Ken Thompson
a4459c5520 bug
R=r
OCL=20940
CL=20940
2008-12-10 16:23:29 -08:00
Russ Cox
d0e30cdaa9 assorted cleanup and fixes
R=r
DELTA=209  (109 added, 79 deleted, 21 changed)
OCL=20930
CL=20934
2008-12-10 15:55:59 -08:00
Rob Pike
a238087aa2 StringBytes help routine, common functionality put into package io for sharing.
R=rsc
DELTA=10  (10 added, 0 deleted, 0 changed)
OCL=20928
CL=20931
2008-12-10 15:46:45 -08:00
Ken Thompson
5f1a3be9dd bug120
R=r
OCL=20921
CL=20921
2008-12-10 14:17:24 -08:00
Ken Thompson
e956429166 string hash function faults w empty string
fixes maps[""]

R=r
OCL=20909
CL=20911
2008-12-10 13:28:46 -08:00
Ken Thompson
7dd62cb3bc 2 minor bugs
R=r
OCL=20906
CL=20906
2008-12-10 12:38:16 -08:00
Ken Thompson
57bd0da375 bug126
R=r
OCL=20879
CL=20879
2008-12-09 18:31:31 -08:00
Ken Thompson
8bce3b5658 bug127
R=r
OCL=20874
CL=20874
2008-12-09 17:52:41 -08:00
Rob Pike
436fcc68e0 fix historical editing glitch
R=rsc
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=20871
CL=20873
2008-12-09 17:43:11 -08:00
Rob Pike
f5cfadde47 implement two TODOs in reflect:
- delete vestigial SetString method
- make type map use interface instead of *interface

R=rsc
DELTA=31  (0 added, 7 deleted, 24 changed)
OCL=20861
CL=20863
2008-12-09 16:33:02 -08:00
Russ Cox
3935610e35 chans and maps of interfaces
R=r
DELTA=746  (729 added, 1 deleted, 16 changed)
OCL=20858
CL=20858
2008-12-09 16:16:07 -08:00
Rob Pike
50d0695ccf use unsafe.pointer in reflection objects
R=rsc
DELTA=326  (4 added, 259 deleted, 63 changed)
OCL=20853
CL=20856
2008-12-09 15:41:21 -08:00
Robert Griesemer
6cbdeb3f88 - fixed bug with unicode text formatting: the number of bytes
per rune cannot be computed correctly if we have only parts
  of a rune - delay computation
- added html filtering mode: html tags and entities are ignored
  for width computations
- expanded tests:
  - extra tests for html text
  - extra tests that write text in various portions

R=r
DELTA=227  (126 added, 20 deleted, 81 changed)
OCL=20833
CL=20835
2008-12-09 13:03:15 -08:00
Ken Thompson
92a1190c6c robs bug converting unsafe.pointer
R=r
OCL=20834
CL=20834
2008-12-09 13:00:50 -08:00
Russ Cox
0d9c1abb58 replace assembly casts with unsafe.pointer
R=r
DELTA=178  (18 added, 101 deleted, 59 changed)
OCL=20822
CL=20826
2008-12-09 10:57:55 -08:00
Russ Cox
f58567d6e2 more impossible time errors
R=r
DELTA=4  (0 added, 0 deleted, 4 changed)
OCL=20788
CL=20818
2008-12-09 10:27:30 -08:00
Ken Thompson
bf6164719a conversion to/from
any pointer or uintptr
and unsafe.pointer

R=r
OCL=20795
CL=20795
2008-12-08 20:50:17 -08:00
Ken Thompson
1d4daa2d39 foundation for import unsafe
R=r
OCL=20794
CL=20794
2008-12-08 19:46:39 -08:00
Russ Cox
6478df1c41 avoid skew in time.Tick; remove errors from time.Seconds, time.Nanoseconds
R=r
DELTA=46  (21 added, 10 deleted, 15 changed)
OCL=20785
CL=20787
2008-12-08 17:45:50 -08:00
Russ Cox
be629138ab use Note sched.stopped correctly
R=r
DELTA=6  (5 added, 0 deleted, 1 changed)
OCL=20777
CL=20779
2008-12-08 17:14:08 -08:00
Russ Cox
4d6bccb0f1 pick up symbol for JMP main(SB)
but not JMP main (label).

R=ken
OCL=20724
CL=20724
2008-12-08 11:33:04 -08:00
Ken Thompson
b79272d9a2 allowed syntax for range
a range m (implies :=)
a,b range m (implies :=)
a:b range m (implies :=)

a := range m
a,b := range m
a:b := range m

a = range m
a,b = range m
a:b = range m

R=r
OCL=20676
CL=20676
2008-12-06 13:40:30 -08:00
Ken Thompson
26b357ca5b range statement
R=r
OCL=20667
CL=20667
2008-12-05 18:24:05 -08:00
Russ Cox
3f8aa662e9 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
2008-12-05 15:24:18 -08:00
Rob Pike
73120ee81d use sync.Mutex instead of a channel for locking
R=rsc
DELTA=12  (3 added, 1 deleted, 8 changed)
OCL=20631
CL=20634
2008-12-05 15:18:07 -08:00
Robert Griesemer
8aeb8647c5 - handle UTF-8 text in tabwriter
R=r
DELTA=84  (27 added, 3 deleted, 54 changed)
OCL=20539
CL=20584
2008-12-05 09:22:13 -08:00
Russ Cox
0d1cbaf225 strings.utflen -> utf8.RuneCount, RuneCountInString
R=r
DELTA=94  (52 added, 33 deleted, 9 changed)
OCL=20547
CL=20552
2008-12-04 21:00:34 -08:00
Ken Thompson
a0a14b98fa empty switches -- bug128
R=r
OCL=20520
CL=20522
2008-12-04 16:05:40 -08:00
Ken Thompson
c597845e13 const/var/iota declarations as discussed
R=r
OCL=20506
CL=20506
2008-12-04 15:33:40 -08:00
Russ Cox
afa6424078 don't warn anymore about missing imports
(happens legitimately in c and assembly objects).

R=r
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=20497
CL=20499
2008-12-04 14:59:38 -08:00
Russ Cox
cfb9425460 emit dynamically linked 6.out on darwin instead of static,
unless given -d flag.

the resulting binary doesn't *use* any dynamic libraries,
it just has a reference to the dynamic linker and an
empty list of needed symbols and libraries.

this is enough to make 6.out binaries that can be run
under dtrace / dtruss.

R=r
DELTA=39  (34 added, 0 deleted, 5 changed)
OCL=20476
CL=20482
2008-12-04 13:49:45 -08:00
Ian Lance Taylor
1a19cb8ec0 Make run.bash run all the current tests.
R=r,rsc
DELTA=8  (8 added, 0 deleted, 0 changed)
OCL=20468
CL=20473
2008-12-04 13:14:09 -08:00
Russ Cox
bf3dd3f0ef add mutex.Mutex
R=r
DELTA=349  (348 added, 0 deleted, 1 changed)
OCL=20380
CL=20472
2008-12-04 12:51:36 -08:00
Russ Cox
3e8faa640f fix build - forgot these files
TBR=r
OCL=20448
CL=20448
2008-12-04 10:18:53 -08:00
Russ Cox
79e1db2da1 add stub routines stackalloc() and stackfree().
run oldstack on g0's stack, just like newstack does,
so that oldstack can free the old stack.

R=r
DELTA=53  (44 added, 0 deleted, 9 changed)
OCL=20404
CL=20433
2008-12-04 08:30:54 -08:00
Russ Cox
c7bab46d0f add time.Tick()
R=r
DELTA=130  (115 added, 1 deleted, 14 changed)
OCL=20376
CL=20385
2008-12-03 16:40:00 -08:00
Russ Cox
dfa5893d4f preparation for exec.
* syscall:
	add syscall.RawSyscall, which doesn't use sys.entersyscall/sys.exitsyscall
	add syscall.dup2
	add syscall.BytePtrPtr
	add syscall.Rusage, RusagePtr
	add syscall.F_GETFD, F_SETFD, FD_CLOEXEC

* runtime:
	clean up, correct signal handling.
	can now survive (continue running after) a signal.

R=r
DELTA=394  (286 added, 51 deleted, 57 changed)
OCL=20351
CL=20369
2008-12-03 14:21:28 -08:00
Russ Cox
2b39165f1e clean stack trace code.
format is unchanged but shows all frames
(old loop stopped one frame early).

wreck=; 6.out
cannot convert type *main.S·interface2 to interface main.I·interface2: missing method Foo
throw: interface conversion
SIGSEGV: segmentation violation
Faulting address: 0x0
pc: 0x256d

throw+0x46 /home/rsc/go/src/runtime/runtime.c:68
	throw(0x863a, 0x0)
hashmap+0x188 /home/rsc/go/src/runtime/iface.c:167
	hashmap(0x8760, 0x0, 0x85b0, 0x0, 0x0, ...)
sys·ifaceT2I+0xa8 /home/rsc/go/src/runtime/iface.c:201
	sys·ifaceT2I(0x8760, 0x0, 0x85b0, 0x0, 0x0, ...)
main·main+0x4e /home/rsc/go/src/runtime/rt0_amd64_darwin.s:87
	main·main()
mainstart+0xf /home/rsc/go/src/runtime/rt0_amd64.s:70
	mainstart()
sys·goexit /home/rsc/go/src/runtime/proc.c:110
	sys·goexit()

R=r
DELTA=44  (5 added, 15 deleted, 24 changed)
OCL=20358
CL=20368
2008-12-03 14:20:23 -08:00
Russ Cox
32a1ee85b1 Make strconv.atof("-0") return -0
and update test.

R=iant
DELTA=11  (3 added, 1 deleted, 7 changed)
OCL=20350
CL=20362
2008-12-03 13:29:13 -08:00