1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 21:01:16 +02:00

nix_api_expr: switch to refcounting

Remove GCRef, keep references in a map. Change to nix_gc_incref and
nix_gc_decref, where users will mostly use nix_gc_decref.
This commit is contained in:
Yorick van Pelt 2023-07-28 10:49:21 +02:00 committed by José Luis Lafuente
parent bebee700ea
commit ded0ef6f6c
No known key found for this signature in database
GPG key ID: 8A3455EBE455489A
7 changed files with 71 additions and 81 deletions

View file

@ -169,8 +169,7 @@ public:
};
ExternalValue *nix_create_external_value(nix_c_context *context,
NixCExternalValueDesc *desc, void *v,
GCRef *gc) {
NixCExternalValueDesc *desc, void *v) {
if (context)
context->last_err_code = NIX_OK;
try {
@ -179,8 +178,7 @@ ExternalValue *nix_create_external_value(nix_c_context *context,
(GC)
#endif
NixCExternalValue(*desc, v);
if (gc)
gc->ptr = ret;
nix_gc_incref(ret);
return (ExternalValue *)ret;
}
NIXC_CATCH_ERRS_NULL