[Gc] Re: Re: Re: Program broken

Hugn up2dream at gmail.com
Thu Sep 24 19:15:09 PDT 2009


Ivan Maidanski <ivmai at ...> writes:

> 
> Hi!
> 
> Hugh <up2dream at ...> wrote:
> > thanks. I add Zi option, But the error occurs in my code (not in gc code).
> > In my program I defined some global pointers and vars, when it running, in
> 
> These ones shouldn't be thread-local.
> 
> > some functions I will put pointer 'create with new (GC) XXX' to that global
> > vars.
> > Is this right? Do I need use GC_add_roots? And How can I use GC_add_roots?
> 
> You don't need GC_add_roots typically (unless you're using GC_clear_roots, 
GC_no_dls,
> GC_remove_roots(), GC_exclude_static_roots()) - the static roots are 
registered automatically.
My platform is wince 5(Pocket PC). I didn't using GC_clear_roots, 
GC_remove_roots and GC_exclude_static_roots. In my WinMain, I called GC_dump. 
But it print no static root. Is this right?
I try to Add the code below:
FormatterFactory::formatterFactory = edp_new FormatterFactory();
GC_add_roots(&formatterFactory, &formatterFactory+4);

Then the program don't crash on that point.

I saw the code below in gc:
# ifdef MSWINCE
  /* Do we need to separately register the main static data segment? */
  GC_bool GC_register_main_static_data(void)
  {
    return FALSE;
  }
# else /* win32 */

it simplly return FALSE. Is this right?
> 
> Bye.
> 






More information about the Gc mailing list