Merge pull request #9882 from dra27/cygwin64-prereq-4

Tidy CAML_INTERNALS in minor_gc.h and memory.h [Cygwin64 pre-req 4/6]
master
David Allsopp 2020-09-09 09:23:50 +01:00 committed by GitHub
commit f62d519be7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 6 deletions

View File

@ -57,11 +57,13 @@ CAMLextern void caml_free_dependent_memory (mlsize_t bsz);
CAMLextern void caml_modify (value *, value);
CAMLextern void caml_initialize (value *, value);
CAMLextern value caml_check_urgent_gc (value);
CAMLextern color_t caml_allocation_color (void *hp);
#ifdef CAML_INTERNALS
CAMLextern char *caml_alloc_for_heap (asize_t request); /* Size in bytes. */
CAMLextern void caml_free_for_heap (char *mem);
CAMLextern void caml_disown_for_heap (char *mem);
CAMLextern int caml_add_to_heap (char *mem);
CAMLextern color_t caml_allocation_color (void *hp);
#endif /* CAML_INTERNALS */
CAMLextern int caml_huge_fallback_count;

View File

@ -63,11 +63,13 @@ struct caml_custom_table CAML_TABLE_STRUCT(struct caml_custom_elt);
/* Table of custom blocks in the minor heap that contain finalizers
or GC speed parameters. */
CAMLextern void caml_minor_collection (void);
#ifdef CAML_INTERNALS
extern void caml_set_minor_heap_size (asize_t); /* size in bytes */
extern void caml_empty_minor_heap (void);
CAMLextern void caml_gc_dispatch (void);
CAMLextern void caml_minor_collection (void);
CAMLextern void garbage_collection (void); /* runtime/signals_nat.c */
extern void caml_gc_dispatch (void);
extern void caml_garbage_collection (void); /* runtime/signals_nat.c */
extern void caml_oldify_one (value, value *);
extern void caml_oldify_mopup (void);
@ -131,4 +133,6 @@ Caml_inline void add_to_custom_table (struct caml_custom_table *tbl, value v,
elt->max = max;
}
#endif /* CAML_INTERNALS */
#endif /* CAML_MINOR_GC_H */

View File

@ -455,7 +455,7 @@ void caml_shrink_heap (char *chunk)
caml_free_for_heap (chunk);
}
color_t caml_allocation_color (void *hp)
CAMLexport color_t caml_allocation_color (void *hp)
{
if (caml_gc_phase == Phase_mark || caml_gc_phase == Phase_clean ||
(caml_gc_phase == Phase_sweep && (char *)hp >= (char *)caml_gc_sweep_hp)){

View File

@ -462,7 +462,7 @@ extern uintnat caml_instr_alloc_jump;
Leave enough room in the minor heap to allocate at least one object.
Guaranteed not to call any OCaml callback.
*/
CAMLexport void caml_gc_dispatch (void)
void caml_gc_dispatch (void)
{
value *trigger = Caml_state->young_trigger; /* save old value of trigger */