runtime: convert traceback*.c to Go
The two converted files were nearly identical.
Instead of continuing that duplication, I merged them
into a single traceback.go.
Tested on arm, amd64, amd64p32, and 386.
Is it safe to use the address of the empty struct as a signal to ...
10 years, 6 months ago
(2014-09-02 06:04:54 UTC)
#3
Is it safe to use the address of the empty struct as a signal to the trace
back code? Don't all empty structs share the same address?
On 2 Sep 2014 13:58, <rsc@golang.org> wrote:
> Reviewers: golang-codereviews,
>
> Message:
> Hello golang-codereviews@googlegroups.com (cc: dvyukov, iant, khr, r),
>
> I'd like you to review this change to
> https://code.google.com/p/go/
>
>
> Description:
> runtime: convert traceback*.c to Go
>
> The two converted files were nearly identical.
> Instead of continuing that duplication, I merged them
> into a single traceback.go.
>
> Tested on arm, amd64, amd64p32, and 386.
>
> Please review this at https://codereview.appspot.com/134200044/
>
> Affected files (+677, -46 lines):
> M src/cmd/api/goapi.go
> M src/pkg/runtime/extern.go
> M src/pkg/runtime/heapdump.c
> M src/pkg/runtime/mgc0.c
> M src/pkg/runtime/mprof.go
> A src/pkg/runtime/os_windows_386.go
> A src/pkg/runtime/os_windows_amd64.go
> M src/pkg/runtime/runtime.h
> M src/pkg/runtime/stack.c
> M src/pkg/runtime/stubs.go
> A src/pkg/runtime/traceback.go
> M src/pkg/runtime/traceback_arm.c
> A src/pkg/runtime/traceback_windows.go
> M src/pkg/runtime/traceback_x86.c
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-codereviews" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-codereviews+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
On 2014/09/02 06:04:54, dfc wrote: > Is it safe to use the address of the ...
10 years, 6 months ago
(2014-09-02 18:10:55 UTC)
#5
On 2014/09/02 06:04:54, dfc wrote:
> Is it safe to use the address of the empty struct as a signal to the trace
> back code? Don't all empty structs share the same address?
yes, it is safe. new(struct{}) and &struct{} use the same address.
global variables are global variables.
the struct{} is overridden by the real text symbol.
https://codereview.appspot.com/134200044/diff/160001/src/pkg/runtime/traceback.go File src/pkg/runtime/traceback.go (right): https://codereview.appspot.com/134200044/diff/160001/src/pkg/runtime/traceback.go#newcode330 src/pkg/runtime/traceback.go:330: print(hex(argp[i])) On 2014/09/02 18:49:17, r wrote: > is i ...
10 years, 6 months ago
(2014-09-02 19:07:09 UTC)
#8
*** Submitted as https://code.google.com/p/go/source/detail?r=3a55fc3ede26 *** runtime: convert traceback*.c to Go The two converted files were ...
10 years, 6 months ago
(2014-09-02 19:13:00 UTC)
#9
*** Submitted as https://code.google.com/p/go/source/detail?r=3a55fc3ede26 ***
runtime: convert traceback*.c to Go
The two converted files were nearly identical.
Instead of continuing that duplication, I merged them
into a single traceback.go.
Tested on arm, amd64, amd64p32, and 386.
LGTM=r
R=golang-codereviews, remyoudompheng, dave, r
CC=dvyukov, golang-codereviews, iant, khr
https://codereview.appspot.com/134200044
Issue 134200044: code review 134200044: runtime: convert traceback*.c to Go
(Closed)
Created 10 years, 6 months ago by rsc
Modified 10 years, 6 months ago
Reviewers:
Base URL:
Comments: 4