mirror of
https://github.com/NixOS/nix.git
synced 2025-11-08 19:46:02 +01:00
Merge pull request #14472 from Radvendii/exprs-alloc
libexpr: allocate the Exprs themselves in Exprs::alloc
This commit is contained in:
commit
d596b9754e
1 changed files with 3 additions and 3 deletions
|
|
@ -813,7 +813,7 @@ public:
|
||||||
[[gnu::always_inline]]
|
[[gnu::always_inline]]
|
||||||
C * add(auto &&... args)
|
C * add(auto &&... args)
|
||||||
{
|
{
|
||||||
return new C(std::forward<decltype(args)>(args)...);
|
return alloc.new_object<C>(std::forward<decltype(args)>(args)...);
|
||||||
}
|
}
|
||||||
|
|
||||||
// we define some calls to add explicitly so that the argument can be passed in as initializer lists
|
// we define some calls to add explicitly so that the argument can be passed in as initializer lists
|
||||||
|
|
@ -822,7 +822,7 @@ public:
|
||||||
C * add(const PosIdx & pos, Expr * fun, std::vector<Expr *> && args)
|
C * add(const PosIdx & pos, Expr * fun, std::vector<Expr *> && args)
|
||||||
requires(std::same_as<C, ExprCall>)
|
requires(std::same_as<C, ExprCall>)
|
||||||
{
|
{
|
||||||
return new C(pos, fun, std::move(args));
|
return alloc.new_object<C>(pos, fun, std::move(args));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class C>
|
template<class C>
|
||||||
|
|
@ -830,7 +830,7 @@ public:
|
||||||
C * add(const PosIdx & pos, Expr * fun, std::vector<Expr *> && args, PosIdx && cursedOrEndPos)
|
C * add(const PosIdx & pos, Expr * fun, std::vector<Expr *> && args, PosIdx && cursedOrEndPos)
|
||||||
requires(std::same_as<C, ExprCall>)
|
requires(std::same_as<C, ExprCall>)
|
||||||
{
|
{
|
||||||
return new C(pos, fun, std::move(args), std::move(cursedOrEndPos));
|
return alloc.new_object<C>(pos, fun, std::move(args), std::move(cursedOrEndPos));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class C>
|
template<class C>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue