refactor(3p/nix/libexpr): state->allocBindings -> Bindings::NewGC
EvalState::allocBindings had little to do with Bindings, other than returning them, and didn't belong in that class.
This commit is contained in:
parent
e24466c795
commit
b3c9166b23
10 changed files with 14 additions and 15 deletions
7
third_party/nix/src/libexpr/attr-set.cc
vendored
7
third_party/nix/src/libexpr/attr-set.cc
vendored
|
|
@ -49,10 +49,7 @@ void Bindings::merge(Bindings* other) {
|
|||
attributes_.swap(other->attributes_);
|
||||
}
|
||||
|
||||
// Allocate a new attribute set, making it visible to the garbage collector.
|
||||
Bindings* EvalState::allocBindings(size_t _capacity) {
|
||||
return new (GC) Bindings;
|
||||
}
|
||||
Bindings* Bindings::NewGC() { return new (GC) Bindings; }
|
||||
|
||||
void EvalState::mkAttrs(Value& v, size_t capacity) {
|
||||
if (capacity == 0) {
|
||||
|
|
@ -61,7 +58,7 @@ void EvalState::mkAttrs(Value& v, size_t capacity) {
|
|||
}
|
||||
clearValue(v);
|
||||
v.type = tAttrs;
|
||||
v.attrs = new (GC) Bindings;
|
||||
v.attrs = Bindings::NewGC();
|
||||
nrAttrsets++;
|
||||
nrAttrsInAttrsets += capacity;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue