Print the addresses allocated
authorMatt Mullins <mmullins@mmlx.us>
Sat, 21 Sep 2013 04:13:47 +0000 (21:13 -0700)
committerMatt Mullins <mmullins@mmlx.us>
Sat, 21 Sep 2013 04:13:47 +0000 (21:13 -0700)
I like looking at /proc/maps to see what this did!

mmap_everything.c

index bc52ec6..2e9c7c3 100644 (file)
@@ -24,6 +24,7 @@ int main() {
                        p = mmap(0, size, PROT_READ, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
                        if (p != MAP_FAILED) {
                                allocated[bit]++;
+                               printf("mmap'ed 2**%zu bytes at %p\n", bit, p);
                        } else {
                                break;
                        }