Commit 7a91c3db authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent bccb2434
...@@ -227,14 +227,12 @@ int M(VMA *vma, pgoff_t idx) { return bitmap_test_bit(vma->page_ismappedv, idx) ...@@ -227,14 +227,12 @@ int M(VMA *vma, pgoff_t idx) { return bitmap_test_bit(vma->page_ismappedv, idx)
/* _pagev_str returns string representation for vector of pages. /* _pagev_str returns string representation for vector of pages.
* the memory has to be freed by user. */ * the memory has to be freed by user. */
char *_pagev_str(Page **pagev, int pagec) { char *_pagev_str(Page **pagev, int pagec) {
char *vstr; char *vstr; size_t _;
size_t _;
FILE *w = open_memstream(&vstr, &_); FILE *w = open_memstream(&vstr, &_);
fprintf(w, "[");
for (int i=0; i<pagec; i++) for (int i=0; i<pagec; i++)
fprintf(w, "%sp%ld", (i > 0 ? ", " : ""), pagev[i]->f_pgoffset); fprintf(w, "%sp%ld%s", (i == 0 ? "[" : ", "),
fprintf(w, "]"); pagev[i]->f_pgoffset, (i == pagec - 1 ? "]" : ""));
fclose(w); fclose(w);
return vstr; return vstr;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment