pidref: introduce hash ops that doesn't come with destructor
This commit is contained in:
+5
-6
@@ -278,9 +278,8 @@ static int pidref_compare_func(const PidRef *a, const PidRef *b) {
|
||||
return CMP(a->pid, b->pid);
|
||||
}
|
||||
|
||||
DEFINE_HASH_OPS_WITH_KEY_DESTRUCTOR(
|
||||
pidref_hash_ops,
|
||||
PidRef,
|
||||
pidref_hash_func,
|
||||
pidref_compare_func,
|
||||
pidref_free);
|
||||
DEFINE_HASH_OPS(pidref_hash_ops, PidRef, pidref_hash_func, pidref_compare_func);
|
||||
|
||||
DEFINE_HASH_OPS_WITH_KEY_DESTRUCTOR(pidref_hash_ops_free,
|
||||
PidRef, pidref_hash_func, pidref_compare_func,
|
||||
pidref_free);
|
||||
|
||||
+2
-1
@@ -61,4 +61,5 @@ int pidref_verify(const PidRef *pidref);
|
||||
|
||||
#define TAKE_PIDREF(p) TAKE_GENERIC((p), PidRef, PIDREF_NULL)
|
||||
|
||||
extern const struct hash_ops pidref_hash_ops; /* Has destructor call for pidref_free(), i.e. expects heap allocated PidRef as keys */
|
||||
extern const struct hash_ops pidref_hash_ops;
|
||||
extern const struct hash_ops pidref_hash_ops_free; /* Has destructor call for pidref_free(), i.e. expects heap allocated PidRef as keys */
|
||||
|
||||
Reference in New Issue
Block a user