1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-13 14:02:42 +01: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

@ -159,18 +159,17 @@ typedef struct NixCExternalValueDesc {
/**
* @brief Create an external value, that can be given to nix_set_external
*
* Pass a gcref to keep a reference.
* Owned by the GC. Use nix_gc_decref when you're done with the pointer.
*
* @param[out] context Optional, stores error information
* @param[in] desc a NixCExternalValueDesc, you should keep this alive as long
* as the ExternalValue lives
* @param[in] v the value to store
* @param[out] ref Optional, will store a reference to the returned value.
* @returns external value, owned by the garbage collector
* @see nix_set_external
*/
ExternalValue *nix_create_external_value(nix_c_context *context,
NixCExternalValueDesc *desc, void *v,
GCRef *ref);
NixCExternalValueDesc *desc, void *v);
/**
* @brief Extract the pointer from a nix c external value.