mirror of
https://github.com/NixOS/nix.git
synced 2025-11-09 12:06:01 +01:00
libexpr: Move *StackReservation constants to gc-small-vector.hh
There are other places where it's useful to use these constants (notably in eval.hh).
This commit is contained in:
parent
b7c6cf900f
commit
9789019a50
2 changed files with 16 additions and 16 deletions
|
|
@ -26,4 +26,20 @@ using SmallValueVector = SmallVector<Value *, nItems>;
|
||||||
template<size_t nItems>
|
template<size_t nItems>
|
||||||
using SmallTemporaryValueVector = SmallVector<Value, nItems>;
|
using SmallTemporaryValueVector = SmallVector<Value, nItems>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* For functions where we do not expect deep recursion, we can use a sizable
|
||||||
|
* part of the stack a free allocation space.
|
||||||
|
*
|
||||||
|
* Note: this is expected to be multiplied by sizeof(Value), or about 24 bytes.
|
||||||
|
*/
|
||||||
|
constexpr size_t nonRecursiveStackReservation = 128;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Functions that maybe applied to self-similar inputs, such as concatMap on a
|
||||||
|
* tree, should reserve a smaller part of the stack for allocation.
|
||||||
|
*
|
||||||
|
* Note: this is expected to be multiplied by sizeof(Value), or about 24 bytes.
|
||||||
|
*/
|
||||||
|
constexpr size_t conservativeStackReservation = 16;
|
||||||
|
|
||||||
} // namespace nix
|
} // namespace nix
|
||||||
|
|
|
||||||
|
|
@ -8,22 +8,6 @@
|
||||||
|
|
||||||
namespace nix {
|
namespace nix {
|
||||||
|
|
||||||
/**
|
|
||||||
* For functions where we do not expect deep recursion, we can use a sizable
|
|
||||||
* part of the stack a free allocation space.
|
|
||||||
*
|
|
||||||
* Note: this is expected to be multiplied by sizeof(Value), or about 24 bytes.
|
|
||||||
*/
|
|
||||||
constexpr size_t nonRecursiveStackReservation = 128;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Functions that maybe applied to self-similar inputs, such as concatMap on a
|
|
||||||
* tree, should reserve a smaller part of the stack for allocation.
|
|
||||||
*
|
|
||||||
* Note: this is expected to be multiplied by sizeof(Value), or about 24 bytes.
|
|
||||||
*/
|
|
||||||
constexpr size_t conservativeStackReservation = 16;
|
|
||||||
|
|
||||||
struct RegisterPrimOp
|
struct RegisterPrimOp
|
||||||
{
|
{
|
||||||
typedef std::vector<PrimOp> PrimOps;
|
typedef std::vector<PrimOp> PrimOps;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue