• Keith Randall's avatar
    cmd/compile: keep pointer input arguments live throughout function · 3572c641
    Keith Randall authored
    Introduce a KeepAlive op which makes sure that its argument is kept
    live until the KeepAlive.  Use KeepAlive to mark pointer input
    arguments as live after each function call and at each return.
    
    We do this change only for pointer arguments.  Those are the
    critical ones to handle because they might have finalizers.
    Doing compound arguments (slices, structs, ...) is more complicated
    because we would need to track field liveness individually (we do
    that for auto variables now, but inputs requires extra trickery).
    
    Turn off the automatic marking of args as live.  That way, when args
    are explicitly nulled, plive will know that the original argument is
    dead.
    
    The KeepAlive op will be the eventual implementation of
    runtime.KeepAlive.
    
    Fixes #15277
    
    Change-Id: I5f223e65d99c9f8342c03fbb1512c4d363e903e5
    Reviewed-on: https://go-review.googlesource.com/22365Reviewed-by: 's avatarDavid Chase <drchase@google.com>
    Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
    3572c641
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...