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

Unified Diff: courgette/encoded_program.h

Issue 6597038: Implementation of an STL compatible allocator for Courgette on Windows.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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: courgette/encoded_program.h
===================================================================
--- courgette/encoded_program.h (revision 76195)
+++ courgette/encoded_program.h (working copy)
@@ -9,6 +9,7 @@
#include "base/basictypes.h"
#include "courgette/image_info.h"
+#include "courgette/memory_allocator.h"
namespace courgette {
@@ -37,7 +38,7 @@
// (3) Add instructions in the order needed to generate bytes of file.
void AddOrigin(RVA rva);
- void AddCopy(int count, const void* bytes);
+ void AddCopy(uint32 count, const void* bytes);
void AddRel32(int label_index);
void AddAbs32(int label_index);
void AddMakeRelocs();
@@ -67,25 +68,30 @@
OP_LAST
};
+ typedef std::vector<RVA, MemoryAllocator<RVA> > RvaVector;
+ typedef std::vector<uint32, MemoryAllocator<uint32> > UInt32Vector;
+ typedef std::vector<uint8, MemoryAllocator<uint8> > UInt8Vector;
+ typedef std::vector<OP, MemoryAllocator<OP> > OPVector;
+
void DebuggingSummary();
void GenerateBaseRelocations(SinkStream *buffer);
- void DefineLabelCommon(std::vector<RVA>*, int, RVA);
- void FinishLabelsCommon(std::vector<RVA>* addresses);
+ void DefineLabelCommon(RvaVector*, int, RVA);
+ void FinishLabelsCommon(RvaVector* addresses);
// Binary assembly language tables.
uint64 image_base_;
- std::vector<RVA> rel32_rva_;
- std::vector<RVA> abs32_rva_;
- std::vector<OP> ops_;
- std::vector<RVA> origins_;
- std::vector<int> copy_counts_;
- std::vector<uint8> copy_bytes_;
- std::vector<uint32> rel32_ix_;
- std::vector<uint32> abs32_ix_;
+ RvaVector rel32_rva_;
+ RvaVector abs32_rva_;
+ OPVector ops_;
+ RvaVector origins_;
+ UInt32Vector copy_counts_;
+ UInt8Vector copy_bytes_;
+ UInt32Vector rel32_ix_;
+ UInt32Vector abs32_ix_;
// Table of the addresses containing abs32 relocations; computed during
// assembly, used to generate base relocation table.
- std::vector<uint32> abs32_relocs_;
+ UInt32Vector abs32_relocs_;
DISALLOW_COPY_AND_ASSIGN(EncodedProgram);
};

Powered by Google App Engine
This is Rietveld 408576698