mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-25 23:36:16 +02:00
nix_api_expr: add nix_gc_now()
This commit is contained in:
parent
ded0ef6f6c
commit
ada2af4f88
2 changed files with 12 additions and 2 deletions
|
@ -132,9 +132,12 @@ void nix_gc_decref(const void *p) {
|
||||||
// todo: else { throw? }
|
// todo: else { throw? }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void nix_gc_now() { GC_gcollect(); }
|
||||||
|
|
||||||
#else
|
#else
|
||||||
void nix_gc_incref(const void *){};
|
void nix_gc_incref(const void *) {}
|
||||||
void nix_gc_decref(const void *){};
|
void nix_gc_decref(const void *) {}
|
||||||
|
void nix_gc_now() {}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void nix_gc_register_finalizer(void *obj, void *cd,
|
void nix_gc_register_finalizer(void *obj, void *cd,
|
||||||
|
|
|
@ -128,6 +128,13 @@ void nix_gc_incref(const void *);
|
||||||
*/
|
*/
|
||||||
void nix_gc_decref(const void *);
|
void nix_gc_decref(const void *);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Trigger the garbage collector manually
|
||||||
|
*
|
||||||
|
* You should not need to do this, but it can be useful for debugging.
|
||||||
|
*/
|
||||||
|
void nix_gc_now();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Register a callback that gets called when the object is garbage
|
* @brief Register a callback that gets called when the object is garbage
|
||||||
* collected.
|
* collected.
|
||||||
|
|
Loading…
Reference in a new issue