Each field on the dump after the function name represents a word.
a pointer, though)
For example, func f(x [1024]uint32) will take all 1024*4 bytes of x from
stack.
Take a look at this sample program and its panic, and you will understand:
http://play.golang.org/p/9WUElkfhc_
Depending on the type, you're looking a 1-word types, 2-word types or
3-word types. Note that this is derived from the fact the Go will pass
structs up to 3 words by value, while bigger values will be passed by
reference.
FYI, this is wrong. Go passes everything by value (the values happen to be3-word types. Note that this is derived from the fact the Go will pass
structs up to 3 words by value, while bigger values will be passed by
reference.
a pointer, though)
For example, func f(x [1024]uint32) will take all 1024*4 bytes of x from
stack.
Take a look at this sample program and its panic, and you will understand:
http://play.golang.org/p/9WUElkfhc_
and I got that mixed up with the maximum inlined copy. Funny thing is I've
just remembered it's not 3 anymore, it's now 4.
Anyway, getting back to the topic. The current limit is a magic number in
runtime·gentraceback (around line 218 in traceback_x86.c and 157 in
traceback_arm.c), currently set to 5. It would be nice if this limit was
eliminated and runtime.Stack with a nil first argument returned the
required buffer length to copy the stack. This would be a backwards
compatible change and it would make 3rd party tools which "prettify" the
stack way more useful.
Regards,
Alberto
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.