]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - boehm-gc/include/gc_gcj.h
re PR target/78594 (Bug in November 11th, 2016 change to rs6000.md)
[thirdparty/gcc.git] / boehm-gc / include / gc_gcj.h
index 1dede5154b69edc82bcfcdc811ec4c23c7df6539..5e79e27b821606f267944e7da5df840fe56cd0be 100644 (file)
  * may be marked by the mark procedure passed to GC_init_gcj_malloc.
  */
 
+#ifndef GC_GCJ_H
+
+#define GC_GCJ_H
+
 #ifndef MARK_DESCR_OFFSET
 #  define MARK_DESCR_OFFSET    sizeof(word)
 #endif
 #endif
 
 /* The following allocators signal an out of memory condition with     */
-/* return GC_oom_action();                                             */
-/* The default GC_oom_action returns 0.                                        */
-/* This functionality is currently restricted to the gcj allocators.   */
-/* We may want to extend it to the others.                             */
-
-extern void * (*GC_oom_action)(void);
+/* return GC_oom_fn(bytes);                                            */
 
 /* The following function must be called before the gcj allocators     */
 /* can be invoked.                                                     */
@@ -54,12 +53,10 @@ extern void * (*GC_oom_action)(void);
 /* respectively for the allocated objects.  Mark_proc will be          */
 /* used to build the descriptor for objects allocated through the      */
 /* debugging interface.  The mark_proc will be invoked on all such     */
-/* objects with an "environment" value of 1.  The client may chose     */
+/* objects with an "environment" value of 1.  The client may choose    */
 /* to use the same mark_proc for some of its generated mark descriptors.*/
 /* In that case, it should use a different "environment" value to      */
 /* detect the presence or absence of the debug header.                 */
-
-/* the debugging interface.                                            */
 /* Mp is really of type mark_proc, as defined in gc_mark.h.  We don't  */
 /* want to include that here for namespace pollution reasons.          */
 extern void GC_init_gcj_malloc(int mp_index, void * /* really mark_proc */mp);
@@ -77,6 +74,9 @@ extern void * GC_debug_gcj_malloc(size_t lb,
 /* Similar to the above, but the size is in words, and we don't        */
 /* adjust it.  The size is assumed to be such that it can be   */
 /* allocated as a small object.                                        */
+/* Unless it is known that the collector is not configured     */
+/* with USE_MARK_BYTES and unless it is known that the object  */
+/* has weak alignment requirements, lw must be even.           */
 extern void * GC_gcj_fast_malloc(size_t lw,
                                 void * ptr_to_struct_containing_descr);
 extern void * GC_debug_gcj_fast_malloc(size_t lw,
@@ -88,14 +88,26 @@ extern void * GC_debug_gcj_fast_malloc(size_t lw,
 extern void * GC_gcj_malloc_ignore_off_page(size_t lb,
                                void * ptr_to_struct_containing_descr);
 
+/* The kind numbers of normal and debug gcj objects.           */
+/* Useful only for debug support, we hope.                     */
+extern int GC_gcj_kind;
+
+extern int GC_gcj_debug_kind;
+
+# if defined(GC_LOCAL_ALLOC_H) && defined(GC_REDIRECT_TO_LOCAL)
+    --> gc_local_alloc.h should be included after this.  Otherwise
+    --> we undo the redirection.
+# endif
+
 # ifdef GC_DEBUG
 #   define GC_GCJ_MALLOC(s,d) GC_debug_gcj_malloc(s,d,GC_EXTRAS)
 #   define GC_GCJ_FAST_MALLOC(s,d) GC_debug_gcj_fast_malloc(s,d,GC_EXTRAS)
-#   define GC_GCJ_MALLOC_IGNORE_OFF_PAGE(s,d) GC_gcj_debug_malloc(s,d,GC_EXTRAS)
+#   define GC_GCJ_MALLOC_IGNORE_OFF_PAGE(s,d) GC_debug_gcj_malloc(s,d,GC_EXTRAS)
 # else
 #   define GC_GCJ_MALLOC(s,d) GC_gcj_malloc(s,d)
 #   define GC_GCJ_FAST_MALLOC(s,d) GC_gcj_fast_malloc(s,d)
 #   define GC_GCJ_MALLOC_IGNORE_OFF_PAGE(s,d) \
-       GC_gcj_debug_malloc_ignore_off_page(s,d)
+       GC_gcj_malloc_ignore_off_page(s,d)
 # endif
 
+#endif /* GC_GCJ_H */