Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Wrong line the aligned data vector needs the proper value before allo…
…cation
  • Loading branch information
devnexen committed Jul 7, 2019
commit 4abe537ce5620b8475d315043ce4b16bf87ccc97
6 changes: 3 additions & 3 deletions src/large_pages/node_large_page.cc
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ static struct text_region FindNodeTextRegion() {
return nregion;
}

auto alg = std::vector<char>(numpg);

// for struct kinfo_vmentry
numpg = numpg * 4 / 3;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll take your word for it that that is big enough. ^^

auto alg = std::vector<char>(numpg);

if (sysctl(mib, miblen, alg.data(), &numpg, nullptr, 0) == -1) {
return nregion;
}
Expand Down Expand Up @@ -354,7 +354,7 @@ MoveTextRegionToLargePages(const text_region& r) {
int MapStaticCodeToLargePages() {
struct text_region r = FindNodeTextRegion();
if (r.found_text_region == false) {
fprintf(stderr, "Hugepages WARNING: failed to find text regionn");
fprintf(stderr, "Hugepages WARNING: failed to find text region\n");
return -1;
}

Expand Down