(wangle) comment cleanup
[folly.git] / folly / MemoryMapping.cpp
index 1d926a1df2895749c3d9a4e85e5143f9da40176f..e08cea90ae729d5faf7980700b160fde67925bd4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2013 Facebook, Inc.
+ * Copyright 2014 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,6 +21,7 @@
 #include <sys/mman.h>
 #include <sys/types.h>
 #include <system_error>
+#include <gflags/gflags.h>
 
 DEFINE_int64(mlock_chunk_size, 1 << 20,  // 1MB
              "Maximum bytes to mlock/munlock/munmap at once "
@@ -43,6 +44,12 @@ MemoryMapping::MemoryMapping(File file, off_t offset, off_t length)
   init(std::move(file), offset, length, PROT_READ, false);
 }
 
+MemoryMapping::MemoryMapping(const char* name, off_t offset, off_t length)
+  : MemoryMapping(File(name), offset, length) { }
+
+MemoryMapping::MemoryMapping(int fd, off_t offset, off_t length)
+  : MemoryMapping(File(fd), offset, length) { }
+
 void MemoryMapping::init(File file,
                          off_t offset, off_t length,
                          int prot,