aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/value.hh
AgeCommit message (Collapse)Author
2017-03-24use std::tuple for ValueMap allocatorDaiderd Jordan
2017-02-08Include config.h implicitly with '-include config.h' in CFLAGSTuomas Tynkkynen
Because config.h can #define things like _FILE_OFFSET_BITS=64 and not every compilation unit includes config.h, we currently compile half of Nix with _FILE_OFFSET_BITS=64 and other half with _FILE_OFFSET_BITS unset. This causes major havoc with the Settings class on e.g. 32-bit ARM, where different compilation units disagree with the struct layout. E.g.: diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc @@ -166,6 +166,8 @@ void Settings::update() _get(useSubstitutes, "build-use-substitutes"); + fprintf(stderr, "at Settings::update(): &useSubstitutes = %p\n", &nix::settings.useSubstitutes); _get(buildUsersGroup, "build-users-group"); diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc +++ b/src/libstore/remote-store.cc @@ -138,6 +138,8 @@ void RemoteStore::initConnection(Connection & conn) void RemoteStore::setOptions(Connection & conn) { + fprintf(stderr, "at RemoteStore::setOptions(): &useSubstitutes = %p\n", &nix::settings.useSubstitutes); conn.to << wopSetOptions Gave me: at Settings::update(): &useSubstitutes = 0xb6e5c5cb at RemoteStore::setOptions(): &useSubstitutes = 0xb6e5c5c7 That was not a fun one to debug!
2016-08-30Fix GC buildEelco Dolstra
2016-08-29Add builtin function "partition"Eelco Dolstra
The implementation of "partition" in Nixpkgs is O(n^2) (because of the use of ++), and for some reason was causing stack overflows in multi-threaded evaluation (not sure why). This reduces "nix-env -qa --drv-path" runtime by 0.197s and memory usage by 298 MiB (in non-Boehm mode).
2016-08-29nix path-info: Add --json flagEelco Dolstra
Also, factor out JSON generation from value-to-json.{cc,hh}, and support producing indented JSON.
2016-01-06@eelco's feedback: downgrade to regular float for size, remove unused function.Christian Theune
2016-01-05First hit at providing support for floats in the language.Christian Theune
2015-07-23Optimize small listsEelco Dolstra
The value pointers of lists with 1 or 2 elements are now stored in the list value itself. In particular, this makes the "concatMap (x: if cond then [(f x)] else [])" idiom cheaper.
2014-12-02Make all ExternalValueBase functions constShea Levy
2014-12-02Allow external code using libnixexpr to add typesShea Levy
Code that links to libnixexpr (e.g. plugins loaded with importNative, or nix-exec) may want to provide custom value types and operations on values of those types. For example, nix-exec is currently using sets where a custom IO value type would be more appropriate. This commit provides a generic hook for such types in the form of tExternal and the ExternalBase virtual class, which contains all functions necessary for libnixexpr's type-polymorphic functions (e.g. `showType`) to be implemented.
2014-10-09mkList: Scrub betterEelco Dolstra
Clearing v.app.right was not enough, because the length field of a list only takes 32 bits, so the most significant 32 bits of v.app.left (a.k.a. v.thunk.env) would remain. This could cause Boehm GC to interpret it as a valid pointer. This change reduces maximum RSS for evaluating the ‘tested’ job in nixos/release-small.nix from 1.33 GiB to 0.80 GiB, and runtime by about 8%.
2014-10-09TypoEelco Dolstra
2014-09-22Add a function ‘valueSize’Eelco Dolstra
It returns the size of value, including all other values and environments reachable from it. It is intended for debugging memory consumption issues.
2014-01-21Fix some clang warningsEelco Dolstra
2013-11-18Add a primop unsafeGetAttrPos to return the position of an attributeEelco Dolstra
2013-08-19Store Nix integers as longsEelco Dolstra
So on 64-bit systems, integers are now 64-bit. Fixes #158.
2013-08-06Remove obsolete reference to ATermsEelco Dolstra
2012-12-13fix use-after-free bug in mkString(Value&, Symbol&)Stuart Pernsteiner
2012-07-18Use "#pragma once" to prevent repeated header file inclusionEelco Dolstra
2012-01-07* Don't create thunks for simple constants (integers, strings, paths)Eelco Dolstra
and allocate them only once. * Move Value and related functions into value.hh.