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

Unified Diff: courgette/assembly_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/assembly_program.h
===================================================================
--- courgette/assembly_program.h (revision 76195)
+++ courgette/assembly_program.h (working copy)
@@ -12,12 +12,16 @@
#include "base/basictypes.h"
#include "courgette/image_info.h"
+#include "courgette/memory_allocator.h"
namespace courgette {
class EncodedProgram;
class Instruction;
+typedef std::vector<Instruction*, MemoryAllocator<Instruction*> >
+ InstructionVector;
+
// A Label is a symbolic reference to an address. Unlike a conventional
// assembly language, we always know the address. The address will later be
// stored in a table and the Label will be replaced with the index into the
@@ -89,7 +93,7 @@
EncodedProgram* Encode() const;
// Accessor for instruction list.
- const std::vector<Instruction*>& instructions() const {
+ const InstructionVector& instructions() const {
return instructions_;
}
@@ -101,7 +105,6 @@
// otherwise returns NULL.
Label* InstructionRel32Label(const Instruction* instruction) const;
-
private:
void Emit(Instruction* instruction) { instructions_.push_back(instruction); }
@@ -118,7 +121,7 @@
uint64 image_base_; // Desired or mandated base address of image.
- std::vector<Instruction*> instructions_; // All the instructions in program.
+ InstructionVector instructions_; // All the instructions in program.
// These are lookup maps to find the label associated with a given address.
// We have separate label spaces for addresses referenced by rel32 labels and

Powered by Google App Engine
This is Rietveld 408576698