A sub-process contains its own arena's and heaps that are fully separate from the main (sub) process. More...
Typedefs | |
| typedef void * | mi_subproc_id_t |
| A process can associate threads with sub-processes. | |
| typedef bool | mi_heap_visit_fun(mi_heap_t *heap, void *arg) |
| The type of a heap visitor function. | |
Functions | |
| mi_subproc_id_t | mi_subproc_main (void) |
| Get the main sub-process identifier. | |
| mi_subproc_id_t | mi_subproc_current (void) |
| Get the current sub-process identifier of this thread. | |
| mi_subproc_id_t | mi_subproc_new (void) |
| Create a fresh sub-process (with no associated threads yet). | |
| void | mi_subproc_destroy (mi_subproc_id_t subproc) |
| v3: Destroy a previously created sub-process. | |
| void | mi_subproc_delete (mi_subproc_id_t subproc) |
| v1,v2: Delete a previously created sub-process. | |
| void | mi_subproc_add_current_thread (mi_subproc_id_t subproc) |
| Add the current thread to the given sub-process. | |
| bool | mi_subproc_visit_heaps (mi_subproc_id_t subproc, mi_heap_visit_fun *visitor, void *arg) |
| Visit all heaps belonging to a subprocess. | |
A sub-process contains its own arena's and heaps that are fully separate from the main (sub) process.
A thread can belong to only one subprocess at a time. This can be used to separate out logically separate parts of a program (like running multiple interpreter instances in CPython).
| typedef bool mi_heap_visit_fun(mi_heap_t *heap, void *arg) |
The type of a heap visitor function.
true to keep visiting. Returning false will stop visiting further heaps. | typedef void* mi_subproc_id_t |
A process can associate threads with sub-processes.
Sub-processes are isolated and will not reclaim or visit memory from other sub-processes. Each subprocess always has an associated main heap.
| void mi_subproc_add_current_thread | ( | mi_subproc_id_t | subproc | ) |
Add the current thread to the given sub-process.
This should be called right after a thread is created (and no allocation has taken place yet).
| mi_subproc_id_t mi_subproc_current | ( | void | ) |
Get the current sub-process identifier of this thread.
| void mi_subproc_delete | ( | mi_subproc_id_t | subproc | ) |
v1,v2: Delete a previously created sub-process.
| subproc | The sub-process identifier. Only delete sub-processes if all associated threads have terminated. |
| void mi_subproc_destroy | ( | mi_subproc_id_t | subproc | ) |
v3: Destroy a previously created sub-process.
| subproc | The sub-process identifier. Only destroy sub-processes if all associated threads have terminated. |
| mi_subproc_id_t mi_subproc_main | ( | void | ) |
Get the main sub-process identifier.
| mi_subproc_id_t mi_subproc_new | ( | void | ) |
Create a fresh sub-process (with no associated threads yet).
| bool mi_subproc_visit_heaps | ( | mi_subproc_id_t | subproc, |
| mi_heap_visit_fun * | visitor, | ||
| void * | arg ) |
Visit all heaps belonging to a subprocess.
| subproc | The subprocess that the heaps should belong to |
| visitor | The visitor function is called with each heap in subproc |
| arg | A user argument that is passed to each visitor function call. Return true if all heaps are visited (and false otherwise). |