At Wed, 2 Oct 2019 11:06:14 -0400, David Storrs wrote: > On Wed, Oct 2, 2019 at 8:42 AM Matthew Flatt <mfl...@cs.utah.edu> wrote: > > It depends on `process-file`. If `process-file` retains `msg` until it > > is otherwise done, then yes. But if `process-file` ignores the argument > > for `msg` or only uses it for the first part of its work, then `msg` > > can get GCed before `process-file` returns. > > If process-file looked like this: > > (define (process-file msg ch) > (define the-hash-str (file-info-hash msg)) > ...do stuff with the-hash-str... > ) > > I think this would mean that msg could get GC'd as early as right > after the first line, but it's not guaranteed as to when it would be > GC'd. Yes?
Yes, essentially. But depending on `file-info-hash`, `msg` might be GC'd before `file-info-hash` returns, which is even before the second line within `process-file`. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/20191002201621.3C8D0650197%40mail-svr1.cs.utah.edu.