~ubuntu-branches/debian/sid/ocaml/sid

« back to all changes in this revision

Viewing changes to byterun/roots.c

  • Committer: Bazaar Package Importer
  • Author(s): Stefano Zacchiroli
  • Date: 2009-02-22 08:49:13 UTC
  • mfrom: (12.1.1 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090222084913-3i0uw2bhd0lgw0ok
* Uploading to unstable
* debian/control: bump dh-ocaml to (>= 0.4) to avoid buggy ocamlinit.mk

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
/*                                                                     */
12
12
/***********************************************************************/
13
13
 
14
 
/* $Id: roots.c,v 1.29 2005/09/22 14:21:50 xleroy Exp $ */
 
14
/* $Id: roots.c,v 1.30 2008/03/10 19:56:39 xleroy Exp $ */
15
15
 
16
16
/* To walk the memory roots for garbage collection */
17
17
 
36
36
void caml_oldify_local_roots (void)
37
37
{
38
38
  register value * sp;
39
 
  struct global_root * gr;
40
39
  struct caml__roots_block *lr;
41
40
  intnat i, j;
42
41
 
54
53
    }
55
54
  }
56
55
  /* Global C roots */
57
 
  for (gr = caml_global_roots.forward[0]; gr != NULL; gr = gr->forward[0]) {
58
 
    caml_oldify_one(*(gr->root), gr->root);
59
 
  }
 
56
  caml_scan_global_young_roots(&caml_oldify_one);
60
57
  /* Finalised values */
61
58
  caml_final_do_young_roots (&caml_oldify_one);
62
59
  /* Hook */
72
69
 
73
70
void caml_do_roots (scanning_action f)
74
71
{
75
 
  struct global_root * gr;
76
 
 
77
72
  /* Global variables */
78
73
  f(caml_global_data, &caml_global_data);
79
 
 
80
74
  /* The stack and the local C roots */
81
75
  caml_do_local_roots(f, caml_extern_sp, caml_stack_high, caml_local_roots);
82
 
 
83
76
  /* Global C roots */
84
 
  for (gr = caml_global_roots.forward[0]; gr != NULL; gr = gr->forward[0]) {
85
 
    f(*(gr->root), gr->root);
86
 
  }
 
77
  caml_scan_global_roots(f);
87
78
  /* Finalised values */
88
79
  caml_final_do_strong_roots (f);
89
80
  /* Hook */