FAQ

Each field on the dump after the function name represents a word.
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 be
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_
Yep! I was speaking from memory, I haven't touched that code in a long time
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 golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts

Previous

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 5 of 5 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedMar 10, '14 at 5:49a
activeMar 11, '14 at 6:20p
posts5
users4
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase