• Ian Lance Taylor's avatar
    cmd/cgo: use alias for unsafe rather than separate functions · 3c1e1c30
    Ian Lance Taylor authored
    When we need to generate a call to _cgoCheckPointer, we need to type
    assert the result back to the desired type. That is harder when the type
    is unsafe.Pointer, as the package can have values of unsafe.Pointer
    types without actually importing unsafe, by mixing C void* and :=. We
    used to handle this by generating a special function for each needed
    type, and defining that function in a separate file where we did import
    unsafe.
    
    Simplify the code by not generating those functions, but instead just
    import unsafe under the alias _cgo_unsafe. This is a simplification step
    toward a fix for issue #16591.
    
    Change-Id: I0edb3e04b6400ca068751709fe063397cf960a54
    Reviewed-on: https://go-review.googlesource.com/30973
    Run-TryBot: Ian Lance Taylor <iant@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    3c1e1c30
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...