GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — src: read exactly two tokens from Linux THP sysfs config · nodejs/node@00309ee

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src/large_pages
    • node_large_page.cc
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/large_pages/node_large_page.cc‎

Copy file name to clipboardExpand all lines: src/large_pages/node_large_page.cc
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,8 @@ struct text_region FindNodeTextRegion() {
260260
bool IsTransparentHugePagesEnabled() {
261261
std::ifstream ifs;
262262

263+
// File format reference:
264+
// https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/mm/huge_memory.c?id=13391c60da3308ed9980de0168f74cce6c62ac1d#n163
263265
ifs.open("/sys/kernel/mm/transparent_hugepage/enabled");
264266
if (!ifs) {
265267
PrintWarning("could not open /sys/kernel/mm/transparent_hugepage/enabled");
@@ -268,7 +270,7 @@ bool IsTransparentHugePagesEnabled() {
268270

269271
std::string always, madvise;
270272
if (ifs.is_open()) {
271-
while (ifs >> always >> madvise) {}
273+
ifs >> always >> madvise;
272274
}
273275
ifs.close();
274276

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.