remset.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Part of Scheme 48 1.9. See file COPYING for notices and license.
  3. *
  4. * Authors: David Frese
  5. */
  6. #ifndef __S48_REMEMBERED_SET
  7. #define __S48_REMEMBERED_SET
  8. #include "utils.h"
  9. #include "memory.h"
  10. #include "gc_config.h"
  11. #if (S48_USE_REMEMBERED_SETS)
  12. #if S48_REMEMBERED_SET_TYPE==S48_DYNAMIC_REMEMBERED_SETS
  13. /* Remembered Intergenerational Pointer Structure */
  14. typedef struct Rem_ip{
  15. s48_address ip;
  16. struct Rem_ip* next_ip;
  17. } Rem_ip;
  18. #endif
  19. typedef struct RemSet {
  20. #if S48_REMEMBERED_SET_TYPE==S48_DYNAMIC_REMEMBERED_SETS
  21. Rem_ip* first_el;
  22. Rem_ip* last_el;
  23. #elif S48_REMEMBERED_SET_TYPE==S48_STATIC_REMEMBERED_SETS
  24. s48_address elements[S48_REMEMBERED_SET_SIZE];
  25. int free_index;
  26. #elif S48_REMEMBERED_SET_TYPE==S48_EXTENSIBLE_REMEMBERED_SETS
  27. s48_address elements[S48_REMEMBERED_SET_SIZE];
  28. int free_index;
  29. struct RemSet* next_remset;
  30. #endif
  31. }RemSet;
  32. /* RemSet Structure Construction */
  33. RemSet* s48_make_remset();
  34. void s48_free_remset(RemSet* remset);
  35. /* Operations on RemSet */
  36. int s48_remset_add(s48_address ip, RemSet* remset);
  37. int s48_remset_size(RemSet* remset);
  38. void s48_trace_remset(RemSet* remset);
  39. /* checks if all locations are inside the heap */
  40. void s48_check_remset(RemSet* remset);
  41. #endif /* #if (S48_USE_REMEMBERED_SETS) */
  42. #endif