gc_vector.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * Copyright 1988, 1989 Hans-J. Boehm, Alan J. Demers
  3. * Copyright (c) 1991-1995 by Xerox Corporation. All rights reserved.
  4. * Copyright 1996-1999 by Silicon Graphics. All rights reserved.
  5. * Copyright 1999 by Hewlett-Packard Company. All rights reserved.
  6. *
  7. * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
  8. * OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
  9. *
  10. * Permission is hereby granted to use or copy this program
  11. * for any purpose, provided the above notices are retained on all copies.
  12. * Permission to modify the code and to distribute modified code is granted,
  13. * provided the above notices are retained, and a notice that the code was
  14. * modified is included with the above copyright notice.
  15. */
  16. /* This file assumes the collector has been compiled with GC_GCJ_SUPPORT. */
  17. /*
  18. * We allocate objects whose first word contains a pointer to a struct
  19. * describing the object type. This struct contains a garbage collector mark
  20. * descriptor at offset MARK_DESCR_OFFSET. Alternatively, the objects
  21. * may be marked by the mark procedure passed to GC_init_gcj_malloc.
  22. */
  23. #ifndef GC_VECTOR_H
  24. #define GC_VECTOR_H
  25. /* Gcj keeps GC descriptor as second word of vtable. This */
  26. /* probably needs to be adjusted for other clients. */
  27. /* We currently assume that this offset is such that: */
  28. /* - all objects of this kind are large enough to have */
  29. /* a value at that offset, and */
  30. /* - it is not zero. */
  31. /* These assumptions allow objects on the free list to be */
  32. /* marked normally. */
  33. #ifndef GC_H
  34. # include "gc.h"
  35. #endif
  36. # include "gc_typed.h"
  37. #ifdef __cplusplus
  38. extern "C" {
  39. #endif
  40. GC_API void GC_CALL GC_init_gcj_vector (int /* mp_index */,
  41. void * /* really mark_proc */ /* mp */);
  42. GC_API GC_ATTR_MALLOC void * GC_CALL GC_gcj_vector_malloc(size_t /* lb */,
  43. void * /* ptr_to_struct_containing_descr */);
  44. GC_API struct GC_ms_entry *GC_CALL
  45. GC_gcj_vector_mark_proc (struct GC_ms_entry *mark_stack_ptr,
  46. struct GC_ms_entry* mark_stack_limit,
  47. GC_descr element_desc,
  48. GC_word*start,
  49. GC_word*end,
  50. int words_per_element);
  51. #ifdef __cplusplus
  52. } /* extern "C" */
  53. #endif
  54. #endif /* GC_VECTOR_H */