At Fri, 1 Nov 2019 10:34:50 -0700 (PDT), Thomas Dickerson wrote: > The documentation says: > "The 3m collector needs to know the address of every local or temporary > pointer within a function call at any point when a collection can be > triggered." > > A couple questions: > - Is this "every pointer which might be passed to a Racket function, or > contain the result of a Racket function"? Or is it truly *every pointer*?
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 . > - 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. At Fri, 1 Nov 2019 11:41:18 -0700 (PDT), Thomas Dickerson wrote: > The output of `raco ctool --c-mods` has the form: > > #ifdef MZ_XFORM > > XFORM_START_SKIP; > > #endif > > static void declare_modules(Scheme_Env *env) { > > static unsigned char data[] = { /* bytes go here */ }; > > scheme_register_embedded_load(NUM_BYTES, (const char *)data); > > scheme_embedded_load(NUM_BYTES, (const char *)data, 1); > > } > > #ifdef MZ_XFORM > > XFORM_END_SKIP; > > #endif > > > > As I understand it, this means there's no reason to pass it through `raco > ctool --xform`, which presumably means we don't need need to register `env` > or `data`, but we are seeing `scheme_embedded_load` in the stack trace of > some Racket routines that triggered a watchpoint on memory that it > shouldn't be touching, so I just wanted to double check that's indicative > of a problem upstream. The `data` pointer is ok because it refers to statically allocated memory, which is not managed by the GC. The `env` pointer isn't registered because it isn't used, so it's ok if `env` gets out of date. -- 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/5dbc9b32.1c69fb81.678eb.59b1SMTPIN_ADDED_MISSING%40gmr-mx.google.com.