• Kirill Smelkov's avatar
    tracing/runtime: Teach g_typedef to extract type definition for non-struct types · 2c2c5cb6
    Kirill Smelkov authored
    With previous sed expression it was failing e.g. on runtime.guintptr,
    giving much more after type definition:
    
    	$ go doc -c -u runtime.muintptr | sed -n -e '/^type /,/^}/p'
    	type muintptr uintptr
    	    muintptr is a *m that is not tracked by the garbage collector.
    
    	    Because we do free Ms, there are some additional constrains on muintptrs:
    
    	    1. Never hold an muintptr locally across a safe point.
    
    	    2. Any muintptr in the heap must be owned by the M itself so it can
    
    	    ensure it is not in use when the last true *m is released.
    
    	func (mp muintptr) ptr() *m
    	func (mp *muintptr) set(m *m)
    
    Fix it since we'll need to extract more single-line types for Go1.11 support.
    
    To verify it works de-stub {g,p,m}uintptr.
    2c2c5cb6
zruntime_g_go1.10.go 5.37 KB