New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mention in Gc documentation that compaction is currently not implemented. #11816
base: trunk
Are you sure you want to change the base?
Changes from 1 commit
039ee40
cf28163
b8d5879
48fa0da
498e9ce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,7 +79,9 @@ type stat = | |
are not available for allocation. *) | ||
|
||
compactions : int; | ||
(** Number of heap compactions since the program was started. *) | ||
(** Note: As of OCaml 5.0, compaction is not available and this field's | ||
value will always be zero. | ||
Number of heap compactions since the program was started. *) | ||
|
||
top_heap_words : int; | ||
(** Maximum size reached by the major heap, in words. *) | ||
|
@@ -143,7 +145,9 @@ type control = | |
Default: 0. *) | ||
|
||
max_overhead : int; | ||
(** Heap compaction is triggered when the estimated amount | ||
(** Note: As of OCaml 5.0, compaction is not implemented, and this field | ||
will have no effect. | ||
Heap compaction is triggered when the estimated amount | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For the control words, I think this ought to be stronger - i.e. "must be zero" and There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems to me that raising There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My rationale is that these functions should be being called correctly - i.e. that it's a programming error to call |
||
of "wasted" memory is more than [max_overhead] percent of the | ||
amount of live data. If [max_overhead] is set to 0, heap | ||
compaction is triggered at the end of each major GC cycle | ||
|
@@ -300,7 +304,9 @@ external full_major : unit -> unit = "caml_gc_full_major" | |
unreachable blocks. *) | ||
|
||
external compact : unit -> unit = "caml_gc_compaction" | ||
(** Perform a full major collection and compact the heap. Note that heap | ||
(** Note: As of OCaml 5.0, compaction is not implemented, and calling this | ||
function will only trigger a major collection. | ||
Perform a full major collection and compact the heap. Note that heap | ||
Comment on lines
+299
to
+301
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was going to suggest that this should presumably be equivalent to |
||
compaction is a lengthy operation. *) | ||
|
||
val print_stat : out_channel -> unit | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would remove the last sentence - i.e. we just state that it's always zero because compaction was removed.