1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-19 00:39:37 +01:00
nix/src
Sergei Zimmerman 738924b705
libexpr: Slim down Bindings to 8 bytes (on 64 bit systems)
Since the only construction and push_back() calls
to Bindings happen through the `BindingsBuilder` [1] we don't
need to keep `capacity` around on the heap anymore. This saves 8 bytes
(because of the member alignment padding)
per one Bindings allocation. This isn't that much, but it does
save significant memory.

This also shows that the Bindings don't necessarily have to
be mutable, which opens up opportunities for doing small bindings
optimization and storing a 1-element Bindings directly in Value.

For the following scenario:

nix-env --query --available --out-path --file ../nixpkgs --eval-system x86_64-linux

(nixpkgs revision: ddcddd7b09a417ca9a88899f4bd43a8edb72308d)

This patch results in reduction of `sets.bytes` 13115104016 -> 12653087640,
which amounts to 462 MB less bytes allocated for Bindings.

[1]: Not actually, `getBuiltins` does mutate bindings, but this is pretty
     inconsequential and doesn't lead to problems.
2025-09-06 00:23:54 +03:00
..
external-api-docs meson: Apply formatting universally 2025-08-07 02:58:29 +03:00
internal-api-docs meson: Apply formatting universally 2025-08-07 02:58:29 +03:00
libcmd libexpr: Statically allocate commonly used symbols 2025-08-31 13:24:06 +02:00
libexpr libexpr: Slim down Bindings to 8 bytes (on 64 bit systems) 2025-09-06 00:23:54 +03:00
libexpr-c libexpr: Slim down Bindings to 8 bytes (on 64 bit systems) 2025-09-06 00:23:54 +03:00
libexpr-test-support treewide: Bump C++ standard version to C++23 2025-08-19 15:33:27 +03:00
libexpr-tests libexpr: Slim down Bindings to 8 bytes (on 64 bit systems) 2025-09-06 00:23:54 +03:00
libfetchers libfetchers: Fix SSH key identifiers for sk type keys 2025-09-03 22:56:33 +02:00
libfetchers-c More extern "C" for FFI 2025-09-03 22:50:42 +02:00
libfetchers-tests No more globals.hh in headers 2025-08-20 16:24:37 -04:00
libflake libexpr: Statically allocate commonly used symbols 2025-08-31 13:24:06 +02:00
libflake-c More extern "C" for FFI 2025-09-03 22:50:42 +02:00
libflake-tests libfetchers: Restore path separator ignoring behavior for indirect and git-archive flakerefs 2025-08-30 14:40:56 +03:00
libmain treewide: Bump C++ standard version to C++23 2025-08-19 15:33:27 +03:00
libmain-c More extern "C" for FFI 2025-09-03 22:50:42 +02:00
libstore Merge pull request #13900 from NixOS/fix-mingw-windows-build 2025-09-04 21:05:12 -04:00
libstore-c nix_store_realise: Improve typing of store path 2025-09-03 22:50:42 +02:00
libstore-test-support No more globals.hh in headers 2025-08-20 16:24:37 -04:00
libstore-tests Separate internal from non-internal unit tests of the C API 2025-09-03 22:50:42 +02:00
libutil Fix downstream MinGW build by not looking for Boost Regex 2025-09-02 10:41:39 -04:00
libutil-c More extern "C" for FFI 2025-09-03 22:50:42 +02:00
libutil-test-support Separate internal from non-internal unit tests of the C API 2025-09-03 22:50:42 +02:00
libutil-tests Separate internal from non-internal unit tests of the C API 2025-09-03 22:50:42 +02:00
nix Re-introduce mkStringNoCopy (revised) 2025-09-02 00:16:06 +03:00
perl flake: Apply nixfmt 1.0.0 2025-08-18 20:29:45 +03:00
nix-functional-tests Build Functional tests with Meson 2024-08-14 15:35:40 -04:00
nix-manual Build the manual with Meson 2024-10-09 11:58:17 -04:00