Skip to content

Commit ff3d28d

Browse files
authored
Fix documentation of jl_gc_collect (#57757)
- wrong signature of `jl_gc_collect` in embedding docs - comment referring to values returned by `void` function
1 parent 3dc2f9a commit ff3d28d

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

doc/src/manual/embedding.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -449,12 +449,14 @@ jl_gc_wb(jl_array_owner(some_array), some_value);
449449
450450
There are some functions to control the GC. In normal use cases, these should not be necessary.
451451
452-
| Function | Description |
453-
|:-------------------- |:-------------------------------------------- |
454-
| `jl_gc_collect()` | Force a GC run |
455-
| `jl_gc_enable(0)` | Disable the GC, return previous state as int |
456-
| `jl_gc_enable(1)` | Enable the GC, return previous state as int |
457-
| `jl_gc_is_enabled()` | Return current state as int |
452+
| Function | Description |
453+
| :--------------------------------- | :------------------------------------------------------------------ |
454+
| `jl_gc_collect(JL_GC_FULL)` | Force a GC run on all objects |
455+
| `jl_gc_collect(JL_GC_INCREMENTAL)` | Force a GC run only on young objects |
456+
| `jl_gc_collect(JL_GC_AUTO)` | Force a GC run, automatically choosing between full and incremental |
457+
| `jl_gc_enable(0)` | Disable the GC, return previous state as int |
458+
| `jl_gc_enable(1)` | Enable the GC, return previous state as int |
459+
| `jl_gc_is_enabled()` | Return current state as int |
458460
459461
## Working with Arrays
460462

src/gc-interface.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,7 @@ JL_DLLEXPORT int jl_gc_is_enabled(void);
9797
// Sets a soft limit to Julia's heap.
9898
JL_DLLEXPORT void jl_gc_set_max_memory(uint64_t max_mem);
9999
// Runs a GC cycle. This function's parameter determines whether we're running an
100-
// incremental, full, or automatic (i.e. heuristic driven) collection. Returns whether we
101-
// should run a collection cycle again (e.g. a full mark right after a full sweep to ensure
102-
// we do a full heap traversal).
100+
// incremental, full, or automatic (i.e. heuristic driven) collection.
103101
JL_DLLEXPORT void jl_gc_collect(jl_gc_collection_t collection);
104102
// Returns whether the thread with `tid` is a collector thread
105103
JL_DLLEXPORT int gc_is_collector_thread(int tid) JL_NOTSAFEPOINT;

0 commit comments

Comments
 (0)