Great, this is very helpful.

On Fri, Nov 1, 2019 at 4:53 PM Matthew Flatt <mfl...@cs.utah.edu> wrote:

> At Fri, 1 Nov 2019 10:34:50 -0700 (PDT), Thomas Dickerson wrote:
> Only pointers to GCable memory --- which tends to be the things passed
> to a Racket function, but more generally corresponds to things that
> come from Racket .
>

Is it an error to register things which are not GCable, or just unnecessary?
Also - are there ever likely to be pointers which could hold memory which
may or may not be GCable depending on the code path?
(e.g. a `const char*` that is sometimes converted from a Racket string, and
sometimes provided by a C string)

> - Do I need to register the data pointer passed to
> > `scheme_main_stack_setup`, even though this is above the GC's stack base?
>
> No. As you say, that's before the GC is ready.
>
> > - In an instance method, does `this` need to be registered? What about
> > reference types?
>
> A `this` pointer does not point to GCable memory, unless you do well
> out of your way to allocate an object with Racket's allocator.
>
> The value of a variable with a reference type would normally correspond
> to an address on the C stack, so it would not need to be registered.
>

Great, this matches my mental model of what should be happening, but I've
been seeing very strange behavior, so I was getting paranoid.

-- 
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/CA%2BHWosXA2oFQT0igYpGrKY%3DJLAV5dc2cU9rY1frhU5ig34a2PQ%40mail.gmail.com.

Reply via email to