1. first case

```go
func do(x SomeInterface) {...}
func outer() {
  var x = new(A)
  do(x)
  markDelete(x) // explicit delete x if we know x's lifetime end here
}
```

if we know in advance that x's lifetime will finish when outer end. can we 
mark delete x. and the compiler can safely alloc x on stack.

2. second case

```go
func loop(ch <-chan *A) {
  for x := range ch {
    use(x)
    markDelete(x)
  }
}
```

most times, we know which objects could safely be deallocated just like in 
lang without gc, could we delete them immediately to relief gc pressure ?

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/dd5aba59-512c-4b9b-b365-2b509edd74e7n%40googlegroups.com.

Reply via email to