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:
parent
bebee700ea
commit
ded0ef6f6c
7 changed files with 71 additions and 81 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue