Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(960)

Unified Diff: sandbox/linux/seccomp/library.h

Issue 1294001: Make the seccomp sandbox compatible with tcmalloc:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sandbox/linux/seccomp/library.h
===================================================================
--- sandbox/linux/seccomp/library.h (revision 42483)
+++ sandbox/linux/seccomp/library.h (working copy)
@@ -6,6 +6,7 @@
#define LIBRARY_H__
#include <elf.h>
+#include <functional>
#include <map>
#include <set>
#include <string>
@@ -135,6 +136,9 @@
private:
class GreaterThan : public std::binary_function<Elf_Addr, Elf_Addr, bool> {
+ // We create the RangeMap with a GreaterThan rather than the default
+ // comparator, as that allows us to use lower_bound() to find memory
+ // mappings.
public:
bool operator() (Elf_Addr s1, Elf_Addr s2) const {
return s1 > s2;
@@ -149,10 +153,19 @@
int prot;
};
- typedef std::map<Elf_Addr, Range, GreaterThan> RangeMap;
- typedef std::map<string, std::pair<int, Elf_Shdr> > SectionTable;
- typedef std::map<string, Elf_Sym> SymbolTable;
- typedef std::map<string, Elf_Addr> PltTable;
+ typedef std::map<Elf_Addr, Range, GreaterThan,
+ SystemAllocator<std::pair<const Elf_Addr,
+ Range> > > RangeMap;
+ typedef std::map<string, std::pair<int, Elf_Shdr>, std::less<string>,
+ SystemAllocator<std::pair<const string,
+ std::pair<int, Elf_Shdr> > > >
+ SectionTable;
+ typedef std::map<string, Elf_Sym, std::less<string>,
+ SystemAllocator<std::pair<const string,
+ Elf_Sym> > > SymbolTable;
+ typedef std::map<string, Elf_Addr, std::less<string>,
+ SystemAllocator<std::pair<const string,
+ Elf_Addr> > > PltTable;
char* getBytes(char* dst, const char* src, ssize_t len);
static bool isSafeInsn(unsigned short insn);
« no previous file with comments | « no previous file | sandbox/linux/seccomp/maps.h » ('j') | third_party/tcmalloc/chromium/src/base/spinlock_linux-inl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698