Skip to content

Commit

Permalink
Add page size system features
Browse files Browse the repository at this point in the history
  • Loading branch information
RossComputerGuy committed Feb 11, 2025
1 parent 2d9b213 commit ad924a9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/libstore/globals.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
#include <sys/sysctl.h>
#endif

#include <sys/auxv.h>

#include "strings.hh"

namespace nix {
Expand Down Expand Up @@ -196,6 +198,11 @@ StringSet Settings::getDefaultSystemFeatures()
features.insert("apple-virt");
#endif

unsigned long pgsize = getauxval(AT_PAGESZ);
for (; pgsize <= (64 * 1024); pgsize *= 2) {
features.insert(fmt("pages-%1%k", pgsize / 1024));
}

return features;
}

Expand Down

0 comments on commit ad924a9

Please sign in to comment.