From 52b23b8a6ae372d7a5d65e7e1f6aeca467f73b97 Mon Sep 17 00:00:00 2001 From: Joshua Warner Date: Tue, 25 Feb 2014 11:32:17 -0700 Subject: [PATCH] move Allocator to include, properly namespaced --- include/avian/codegen/architecture.h | 8 ++++-- include/avian/codegen/promise.h | 18 +++++++----- include/avian/heap/heap.h | 9 +++--- include/avian/system/system.h | 4 +-- include/avian/util/abort.h | 4 +++ include/avian/util/allocator.h | 34 ++++++++++++++++++++++ include/avian/util/list.h | 10 ++++++- src/avian/alloc-vector.h | 17 +++++------ src/avian/{allocator.h => append.h} | 36 +++++++++--------------- src/avian/finder.h | 20 +++++++++---- src/avian/lzma-util.h | 2 +- src/avian/lzma.h | 23 ++++++++++----- src/avian/processor.h | 3 +- src/avian/zone.h | 5 ++-- src/codegen/target/arm/assembler.cpp | 6 ++-- src/codegen/target/arm/context.cpp | 21 ++++++++++---- src/codegen/target/arm/context.h | 4 +-- src/codegen/target/powerpc/assembler.cpp | 9 +++--- src/codegen/target/powerpc/context.cpp | 22 ++++++++++----- src/codegen/target/powerpc/context.h | 8 ++++-- src/codegen/target/x86/assembler.cpp | 11 ++++---- src/codegen/target/x86/context.cpp | 22 +++++++++++---- src/codegen/target/x86/context.h | 5 +++- src/codegen/target/x86/fixup.cpp | 2 +- src/codegen/target/x86/operations.cpp | 2 +- src/finder.cpp | 2 +- src/main.cpp | 2 +- src/system/posix.cpp | 4 ++- src/system/windows.cpp | 5 +++- src/tools/binary-to-object/main.cpp | 1 + src/tools/type-generator/main.cpp | 2 +- 31 files changed, 214 insertions(+), 107 deletions(-) create mode 100644 include/avian/util/allocator.h rename src/avian/{allocator.h => append.h} (60%) diff --git a/include/avian/codegen/architecture.h b/include/avian/codegen/architecture.h index 8e6d4e7734..dca414fcfd 100644 --- a/include/avian/codegen/architecture.h +++ b/include/avian/codegen/architecture.h @@ -12,11 +12,15 @@ #define AVIAN_CODEGEN_ARCHITECTURE_H namespace vm { -class Allocator; class Zone; } namespace avian { + +namespace util { +class Allocator; +} + namespace codegen { class Assembler; @@ -125,7 +129,7 @@ virtual void planDestination unsigned bSize, const OperandMask& bMask, unsigned cSize, OperandMask& cMask) = 0; -virtual Assembler* makeAssembler(vm::Allocator*, vm::Zone*) = 0; +virtual Assembler* makeAssembler(util::Allocator*, vm::Zone*) = 0; virtual void acquire() = 0; virtual void release() = 0; diff --git a/include/avian/codegen/promise.h b/include/avian/codegen/promise.h index f94615c5e0..2e8633307b 100644 --- a/include/avian/codegen/promise.h +++ b/include/avian/codegen/promise.h @@ -11,7 +11,9 @@ #ifndef AVIAN_CODEGEN_PROMISE_H #define AVIAN_CODEGEN_PROMISE_H -#include "avian/allocator.h" +#include +#include +#include namespace avian { namespace codegen { @@ -102,8 +104,8 @@ class OffsetPromise: public Promise { class ListenPromise: public Promise { public: - ListenPromise(vm::System* s, vm::Allocator* allocator): - s(s), allocator(allocator), listener(0) + ListenPromise(vm::System* s, util::Allocator* allocator) + : s(s), allocator(allocator), listener(0) { } virtual int64_t value() { @@ -122,16 +124,18 @@ class ListenPromise: public Promise { } vm::System* s; - vm::Allocator* allocator; + util::Allocator* allocator; Listener* listener; Promise* promise; }; class DelayedPromise: public ListenPromise { public: - DelayedPromise(vm::System* s, vm::Allocator* allocator, Promise* basis, - DelayedPromise* next): - ListenPromise(s, allocator), basis(basis), next(next) + DelayedPromise(vm::System* s, + util::Allocator* allocator, + Promise* basis, + DelayedPromise* next) + : ListenPromise(s, allocator), basis(basis), next(next) { } virtual int64_t value() { diff --git a/include/avian/heap/heap.h b/include/avian/heap/heap.h index bd09c881f8..1e6c1a39fd 100644 --- a/include/avian/heap/heap.h +++ b/include/avian/heap/heap.h @@ -12,7 +12,7 @@ #define HEAP_H #include -#include "avian/allocator.h" +#include namespace vm { @@ -22,7 +22,7 @@ const unsigned TenureThreshold = 3; const unsigned FixieTenureThreshold = TenureThreshold + 2; -class Heap: public Allocator { +class Heap : public avian::util::Allocator { public: enum CollectionType { MinorCollection, @@ -65,9 +65,10 @@ class Heap: public Allocator { virtual void collect(CollectionType type, unsigned footprint, int pendingAllocation) = 0; virtual unsigned fixedFootprint(unsigned sizeInWords, bool objectMask) = 0; - virtual void* allocateFixed(Allocator* allocator, unsigned sizeInWords, + virtual void* allocateFixed(avian::util::Allocator* allocator, + unsigned sizeInWords, bool objectMask) = 0; - virtual void* allocateImmortalFixed(Allocator* allocator, + virtual void* allocateImmortalFixed(avian::util::Allocator* allocator, unsigned sizeInWords, bool objectMask) = 0; virtual void mark(void* p, unsigned offset, unsigned count) = 0; diff --git a/include/avian/system/system.h b/include/avian/system/system.h index 2427fd1f57..41fa8441af 100644 --- a/include/avian/system/system.h +++ b/include/avian/system/system.h @@ -12,7 +12,7 @@ #define SYSTEM_H #include "avian/common.h" -#include "avian/allocator.h" +#include #include namespace vm { @@ -139,7 +139,7 @@ class System : public avian::util::Aborter { virtual Status load(Library**, const char* name) = 0; virtual char pathSeparator() = 0; virtual char fileSeparator() = 0; - virtual const char* toAbsolutePath(Allocator* allocator, + virtual const char* toAbsolutePath(avian::util::Allocator* allocator, const char* name) = 0; virtual int64_t now() = 0; virtual void yield() = 0; diff --git a/include/avian/util/abort.h b/include/avian/util/abort.h index 571379e83c..daaf8a7b7c 100644 --- a/include/avian/util/abort.h +++ b/include/avian/util/abort.h @@ -11,6 +11,10 @@ #ifndef AVIAN_UTIL_ABORT_H #define AVIAN_UTIL_ABORT_H +// TODO: remove reference back into the source directory! +// Note: this is needed for UNLIKELY +#include + namespace avian { namespace util { diff --git a/include/avian/util/allocator.h b/include/avian/util/allocator.h new file mode 100644 index 0000000000..8b964717d9 --- /dev/null +++ b/include/avian/util/allocator.h @@ -0,0 +1,34 @@ +/* Copyright (c) 2008-2013, Avian Contributors + + Permission to use, copy, modify, and/or distribute this software + for any purpose with or without fee is hereby granted, provided + that the above copyright notice and this permission notice appear + in all copies. + + There is NO WARRANTY for this software. See license.txt for + details. */ + +#ifndef AVIAN_UTIL_ALLOCATOR_H +#define AVIAN_UTIL_ALLOCATOR_H + +#include + +namespace avian { +namespace util { + +class Allocator { + public: + virtual void* tryAllocate(unsigned size) = 0; + virtual void* allocate(unsigned size) = 0; + virtual void free(const void* p, unsigned size) = 0; +}; + +} // namespace util +} // namespace avian + +inline void* operator new(size_t size, avian::util::Allocator* allocator) +{ + return allocator->allocate(size); +} + +#endif // AVIAN_UTIL_ALLOCATOR_H diff --git a/include/avian/util/list.h b/include/avian/util/list.h index 240aac539b..a18d26bcac 100644 --- a/include/avian/util/list.h +++ b/include/avian/util/list.h @@ -11,6 +11,11 @@ #ifndef AVIAN_UTIL_LIST_H #define AVIAN_UTIL_LIST_H +#include "allocator.h" + +namespace avian { +namespace util { + template class List { public: @@ -32,4 +37,7 @@ public: List* next; }; -#endif // AVIAN_UTIL_LIST_H +} // namespace util +} // namespace avian + +#endif // AVIAN_UTIL_LIST_H diff --git a/src/avian/alloc-vector.h b/src/avian/alloc-vector.h index fe486a11ca..051a50bd3e 100644 --- a/src/avian/alloc-vector.h +++ b/src/avian/alloc-vector.h @@ -15,6 +15,7 @@ #include "avian/target.h" #include +#include #undef max #undef min @@ -23,13 +24,13 @@ namespace vm { class Vector { public: - Vector(System* s, Allocator* allocator, unsigned minimumCapacity): - s(s), - allocator(allocator), - data(0), - position(0), - capacity(0), - minimumCapacity(minimumCapacity) + Vector(System* s, avian::util::Allocator* allocator, unsigned minimumCapacity) + : s(s), + allocator(allocator), + data(0), + position(0), + capacity(0), + minimumCapacity(minimumCapacity) { } ~Vector() { @@ -157,7 +158,7 @@ class Vector { } System* s; - Allocator* allocator; + avian::util::Allocator* allocator; uint8_t* data; unsigned position; unsigned capacity; diff --git a/src/avian/allocator.h b/src/avian/append.h similarity index 60% rename from src/avian/allocator.h rename to src/avian/append.h index 51d69c4a41..f238a66e57 100644 --- a/src/avian/allocator.h +++ b/src/avian/append.h @@ -8,22 +8,18 @@ There is NO WARRANTY for this software. See license.txt for details. */ -#ifndef ALLOCATOR_H -#define ALLOCATOR_H +#ifndef APPEND_H +#define APPEND_H -#include "avian/common.h" +#include +#include namespace vm { -class Allocator { - public: - virtual void* tryAllocate(unsigned size) = 0; - virtual void* allocate(unsigned size) = 0; - virtual void free(const void* p, unsigned size) = 0; -}; - -inline const char* -append(Allocator* allocator, const char* a, const char* b, const char* c) +inline const char* append(avian::util::Allocator* allocator, + const char* a, + const char* b, + const char* c) { unsigned al = strlen(a); unsigned bl = strlen(b); @@ -35,8 +31,9 @@ append(Allocator* allocator, const char* a, const char* b, const char* c) return p; } -inline const char* -append(Allocator* allocator, const char* a, const char* b) +inline const char* append(avian::util::Allocator* allocator, + const char* a, + const char* b) { unsigned al = strlen(a); unsigned bl = strlen(b); @@ -46,8 +43,7 @@ append(Allocator* allocator, const char* a, const char* b) return p; } -inline const char* -copy(Allocator* allocator, const char* a) +inline const char* copy(avian::util::Allocator* allocator, const char* a) { unsigned al = strlen(a); char* p = static_cast(allocator->allocate(al + 1)); @@ -55,10 +51,6 @@ copy(Allocator* allocator, const char* a) return p; } -} // namespace vm +} // namespace vm -inline void* operator new (size_t size, vm::Allocator* allocator) { - return allocator->allocate(size); -} - -#endif//ALLOCATOR_H +#endif // APPEND_H diff --git a/src/avian/finder.h b/src/avian/finder.h index ff5a3db917..87b1bc4d6e 100644 --- a/src/avian/finder.h +++ b/src/avian/finder.h @@ -13,7 +13,12 @@ #include "avian/common.h" #include -#include "avian/allocator.h" + +namespace avian { +namespace util { +class Allocator; +} +} namespace vm { @@ -174,12 +179,15 @@ class Finder { virtual void dispose() = 0; }; -AVIAN_EXPORT Finder* -makeFinder(System* s, Allocator* a, const char* path, const char* bootLibrary); +AVIAN_EXPORT Finder* makeFinder(System* s, + avian::util::Allocator* a, + const char* path, + const char* bootLibrary); -Finder* -makeFinder(System* s, Allocator* a, const uint8_t* jarData, - unsigned jarLength); +Finder* makeFinder(System* s, + avian::util::Allocator* a, + const uint8_t* jarData, + unsigned jarLength); } // namespace vm diff --git a/src/avian/lzma-util.h b/src/avian/lzma-util.h index 29aa97c0ab..16673e0f28 100644 --- a/src/avian/lzma-util.h +++ b/src/avian/lzma-util.h @@ -14,7 +14,7 @@ #include "avian/lzma.h" #include "C/Types.h" #include -#include "avian/allocator.h" +#include "avian/util/allocator.h" namespace vm { diff --git a/src/avian/lzma.h b/src/avian/lzma.h index 5cdde89989..803b6b3223 100644 --- a/src/avian/lzma.h +++ b/src/avian/lzma.h @@ -12,17 +12,26 @@ #define LZMA_H #include -#include "avian/allocator.h" + +namespace avian { +namespace util { +class Allocator; +} +} namespace vm { -uint8_t* -decodeLZMA(System* s, Allocator* a, uint8_t* in, unsigned inSize, - unsigned* outSize); +uint8_t* decodeLZMA(System* s, + avian::util::Allocator* a, + uint8_t* in, + unsigned inSize, + unsigned* outSize); -uint8_t* -encodeLZMA(System* s, Allocator* a, uint8_t* in, unsigned inSize, - unsigned* outSize); +uint8_t* encodeLZMA(System* s, + avian::util::Allocator* a, + uint8_t* in, + unsigned inSize, + unsigned* outSize); } // namespace vm diff --git a/src/avian/processor.h b/src/avian/processor.h index 94ad8b7d0e..8744d25a6b 100644 --- a/src/avian/processor.h +++ b/src/avian/processor.h @@ -14,6 +14,7 @@ #include "avian/common.h" #include #include +#include #include "bootimage.h" #include "avian/heapwalk.h" #include "avian/zone.h" @@ -209,7 +210,7 @@ class Processor { }; Processor* makeProcessor(System* system, - Allocator* allocator, + avian::util::Allocator* allocator, const char* crashDumpDirectory, bool useNativeFeatures); diff --git a/src/avian/zone.h b/src/avian/zone.h index e21841f2ea..eb8f215de1 100644 --- a/src/avian/zone.h +++ b/src/avian/zone.h @@ -12,13 +12,12 @@ #define ZONE_H #include -#include "avian/allocator.h" - +#include #include namespace vm { -class Zone: public Allocator { +class Zone : public avian::util::Allocator { public: class Segment { public: diff --git a/src/codegen/target/arm/assembler.cpp b/src/codegen/target/arm/assembler.cpp index 41b18c2d9b..e4be4f18f4 100644 --- a/src/codegen/target/arm/assembler.cpp +++ b/src/codegen/target/arm/assembler.cpp @@ -38,14 +38,14 @@ namespace isa { // HARDWARE FLAGS bool vfpSupported() { // TODO: Use at runtime detection -#if defined(__ARM_PCS_VFP) +#if defined(__ARM_PCS_VFP) // armhf return true; #else // armel // TODO: allow VFP use for -mfloat-abi=softfp armel builds. // GCC -mfloat-abi=softfp flag allows use of VFP while remaining compatible - // with soft-float code. + // with soft-float code. return false; #endif } @@ -793,7 +793,7 @@ class MyAssembler: public Assembler { assert(&con, b.size == c.size); assert(&con, b.type == lir::RegisterOperand); assert(&con, c.type == lir::RegisterOperand); - + arch_->con.ternaryOperations[index(&(arch_->con), op, a.type)] (&con, b.size, a.operand, b.operand, c.operand); } diff --git a/src/codegen/target/arm/context.cpp b/src/codegen/target/arm/context.cpp index 8afb6aefbd..7eb9c58893 100644 --- a/src/codegen/target/arm/context.cpp +++ b/src/codegen/target/arm/context.cpp @@ -15,12 +15,21 @@ namespace avian { namespace codegen { namespace arm { -Context::Context(vm::System* s, vm::Allocator* a, vm::Zone* zone): - s(s), zone(zone), client(0), code(s, a, 1024), tasks(0), result(0), - firstBlock(new(zone) MyBlock(this, 0)), - lastBlock(firstBlock), poolOffsetHead(0), poolOffsetTail(0), - constantPool(0), constantPoolCount(0) -{ } +Context::Context(vm::System* s, util::Allocator* a, vm::Zone* zone) + : s(s), + zone(zone), + client(0), + code(s, a, 1024), + tasks(0), + result(0), + firstBlock(new (zone) MyBlock(this, 0)), + lastBlock(firstBlock), + poolOffsetHead(0), + poolOffsetTail(0), + constantPool(0), + constantPoolCount(0) +{ +} } // namespace arm } // namespace codegen diff --git a/src/codegen/target/arm/context.h b/src/codegen/target/arm/context.h index 791ac3ebf7..42e176fef1 100644 --- a/src/codegen/target/arm/context.h +++ b/src/codegen/target/arm/context.h @@ -17,7 +17,6 @@ namespace vm { class System; -class Allocator; class Zone; } // namespace vm @@ -25,6 +24,7 @@ namespace avian { namespace util { class Aborter; +class Allocator; } // namespace util namespace codegen { @@ -37,7 +37,7 @@ class ConstantPoolEntry; class Context { public: - Context(vm::System* s, vm::Allocator* a, vm::Zone* zone); + Context(vm::System* s, util::Allocator* a, vm::Zone* zone); vm::System* s; vm::Zone* zone; diff --git a/src/codegen/target/powerpc/assembler.cpp b/src/codegen/target/powerpc/assembler.cpp index cff041d38c..cc300b1768 100644 --- a/src/codegen/target/powerpc/assembler.cpp +++ b/src/codegen/target/powerpc/assembler.cpp @@ -586,7 +586,7 @@ class MyArchitecture: public Architecture { } } - virtual Assembler* makeAssembler(Allocator* allocator, Zone* zone); + virtual Assembler* makeAssembler(util::Allocator* allocator, Zone* zone); virtual void acquire() { ++ referenceCount; @@ -604,8 +604,8 @@ class MyArchitecture: public Architecture { class MyAssembler: public Assembler { public: - MyAssembler(System* s, Allocator* a, Zone* zone, MyArchitecture* arch): - c(s, a, zone), arch_(arch) + MyAssembler(System* s, util::Allocator* a, Zone* zone, MyArchitecture* arch) + : c(s, a, zone), arch_(arch) { } virtual void setClient(Client* client) { @@ -992,7 +992,8 @@ class MyAssembler: public Assembler { MyArchitecture* arch_; }; -Assembler* MyArchitecture::makeAssembler(Allocator* allocator, Zone* zone) { +Assembler* MyArchitecture::makeAssembler(util::Allocator* allocator, Zone* zone) +{ return new(zone) MyAssembler(this->c.s, allocator, zone, this); } diff --git a/src/codegen/target/powerpc/context.cpp b/src/codegen/target/powerpc/context.cpp index 69021a4b23..34a566c7a9 100644 --- a/src/codegen/target/powerpc/context.cpp +++ b/src/codegen/target/powerpc/context.cpp @@ -16,13 +16,21 @@ namespace avian { namespace codegen { namespace powerpc { - -Context::Context(vm::System* s, vm::Allocator* a, vm::Zone* zone): - s(s), zone(zone), client(0), code(s, a, 1024), tasks(0), result(0), - firstBlock(new(zone) MyBlock(this, 0)), - lastBlock(firstBlock), jumpOffsetHead(0), jumpOffsetTail(0), - constantPool(0), constantPoolCount(0) -{ } +Context::Context(vm::System* s, util::Allocator* a, vm::Zone* zone) + : s(s), + zone(zone), + client(0), + code(s, a, 1024), + tasks(0), + result(0), + firstBlock(new (zone) MyBlock(this, 0)), + lastBlock(firstBlock), + jumpOffsetHead(0), + jumpOffsetTail(0), + constantPool(0), + constantPoolCount(0) +{ +} } // namespace powerpc } // namespace codegen diff --git a/src/codegen/target/powerpc/context.h b/src/codegen/target/powerpc/context.h index d0467f759b..b642b11302 100644 --- a/src/codegen/target/powerpc/context.h +++ b/src/codegen/target/powerpc/context.h @@ -20,12 +20,16 @@ namespace vm { class System; -class Allocator; class Zone; } // namespace vm namespace avian { + +namespace util { +class Allocator; +} + namespace codegen { namespace powerpc { @@ -36,7 +40,7 @@ class MyBlock; class Context { public: - Context(vm::System* s, vm::Allocator* a, vm::Zone* zone); + Context(vm::System* s, util::Allocator* a, vm::Zone* zone); vm::System* s; vm::Zone* zone; diff --git a/src/codegen/target/x86/assembler.cpp b/src/codegen/target/x86/assembler.cpp index 83519bb083..dcf49e78fe 100644 --- a/src/codegen/target/x86/assembler.cpp +++ b/src/codegen/target/x86/assembler.cpp @@ -15,7 +15,7 @@ #include "avian/target.h" #include "avian/alloc-vector.h" #include "avian/common.h" -#include "avian/allocator.h" +#include "avian/util/allocator.h" #include "avian/zone.h" #include @@ -790,7 +790,7 @@ class MyArchitecture: public Architecture { } } - virtual Assembler* makeAssembler(Allocator* allocator, Zone* zone); + virtual Assembler* makeAssembler(util::Allocator* allocator, Zone* zone); virtual void acquire() { ++ referenceCount; @@ -809,8 +809,8 @@ class MyArchitecture: public Architecture { class MyAssembler: public Assembler { public: - MyAssembler(System* s, Allocator* a, Zone* zone, MyArchitecture* arch): - c(s, a, zone, &(arch->c)), arch_(arch) + MyAssembler(System* s, util::Allocator* a, Zone* zone, MyArchitecture* arch) + : c(s, a, zone, &(arch->c)), arch_(arch) { } virtual void setClient(Client* client) { @@ -1142,7 +1142,8 @@ class MyAssembler: public Assembler { MyArchitecture* arch_; }; -Assembler* MyArchitecture::makeAssembler(Allocator* allocator, Zone* zone) { +Assembler* MyArchitecture::makeAssembler(util::Allocator* allocator, Zone* zone) +{ return new(zone) MyAssembler(c.s, allocator, zone, this); } diff --git a/src/codegen/target/x86/context.cpp b/src/codegen/target/x86/context.cpp index 41a6fc1dc1..62c435f600 100644 --- a/src/codegen/target/x86/context.cpp +++ b/src/codegen/target/x86/context.cpp @@ -8,7 +8,7 @@ There is NO WARRANTY for this software. See license.txt for details. */ -#include "avian/allocator.h" +#include "avian/util/allocator.h" #include "avian/zone.h" #include "context.h" @@ -22,11 +22,21 @@ ArchitectureContext::ArchitectureContext(vm::System* s, bool useNativeFeatures): s(s), useNativeFeatures(useNativeFeatures) { } -Context::Context(vm::System* s, vm::Allocator* a, vm::Zone* zone, ArchitectureContext* ac): - s(s), zone(zone), client(0), code(s, a, 1024), tasks(0), result(0), - firstBlock(new(zone) MyBlock(0)), - lastBlock(firstBlock), ac(ac) -{ } +Context::Context(vm::System* s, + util::Allocator* a, + vm::Zone* zone, + ArchitectureContext* ac) + : s(s), + zone(zone), + client(0), + code(s, a, 1024), + tasks(0), + result(0), + firstBlock(new (zone) MyBlock(0)), + lastBlock(firstBlock), + ac(ac) +{ +} } // namespace x86 } // namespace codegen diff --git a/src/codegen/target/x86/context.h b/src/codegen/target/x86/context.h index 79e94a2211..67bdcf4a4d 100644 --- a/src/codegen/target/x86/context.h +++ b/src/codegen/target/x86/context.h @@ -75,7 +75,10 @@ class ArchitectureContext { class Context { public: - Context(vm::System* s, vm::Allocator* a, vm::Zone* zone, ArchitectureContext* ac); + Context(vm::System* s, + util::Allocator* a, + vm::Zone* zone, + ArchitectureContext* ac); vm::System* s; vm::Zone* zone; diff --git a/src/codegen/target/x86/fixup.cpp b/src/codegen/target/x86/fixup.cpp index 73f9736712..637c62f383 100644 --- a/src/codegen/target/x86/fixup.cpp +++ b/src/codegen/target/x86/fixup.cpp @@ -10,7 +10,7 @@ #include -#include "avian/allocator.h" +#include "avian/util/allocator.h" #include "avian/alloc-vector.h" #include "avian/common.h" #include "avian/zone.h" diff --git a/src/codegen/target/x86/operations.cpp b/src/codegen/target/x86/operations.cpp index 5c3fde81fc..0b7b960c72 100644 --- a/src/codegen/target/x86/operations.cpp +++ b/src/codegen/target/x86/operations.cpp @@ -10,7 +10,7 @@ #include "avian/target.h" #include "avian/alloc-vector.h" -#include "avian/allocator.h" +#include "avian/util/allocator.h" #include "avian/zone.h" #include diff --git a/src/finder.cpp b/src/finder.cpp index aa45a2d1a5..5a119fd495 100644 --- a/src/finder.cpp +++ b/src/finder.cpp @@ -16,7 +16,7 @@ #include "avian/zlib-custom.h" #include "avian/finder.h" #include "avian/lzma.h" - +#include "avian/append.h" using namespace vm; using namespace avian::util; diff --git a/src/main.cpp b/src/main.cpp index b1a1be458d..7788e557c5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -61,7 +61,7 @@ mainClass(const char* jar) System* system = makeSystem(); - class MyAllocator: public Allocator { + class MyAllocator : public avian::util::Allocator { public: MyAllocator(System* s): s(s) { } diff --git a/src/system/posix.cpp b/src/system/posix.cpp index a27090453d..e688854652 100644 --- a/src/system/posix.cpp +++ b/src/system/posix.cpp @@ -48,7 +48,9 @@ #include "stdint.h" #include "dirent.h" #include "sched.h" -#include "avian/arch.h" + +#include +#include #include #include diff --git a/src/system/windows.cpp b/src/system/windows.cpp index bf3b2eae39..d0bcd79e8e 100644 --- a/src/system/windows.cpp +++ b/src/system/windows.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #if defined(WINAPI_FAMILY) @@ -842,7 +843,9 @@ class MySystem: public System { return SO_SUFFIX; } - virtual const char* toAbsolutePath(Allocator* allocator, const char* name) { + virtual const char* toAbsolutePath(avian::util::Allocator* allocator, + const char* name) + { #if !defined(WINAPI_FAMILY) || WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) if (strncmp(name, "//", 2) == 0 or strncmp(name, "\\\\", 2) == 0 diff --git a/src/tools/binary-to-object/main.cpp b/src/tools/binary-to-object/main.cpp index e79954bb3a..a8b5e47bc0 100644 --- a/src/tools/binary-to-object/main.cpp +++ b/src/tools/binary-to-object/main.cpp @@ -38,6 +38,7 @@ void operator delete(void*) { abort(); } namespace { using namespace avian::tools; +using namespace avian::util; bool writeObject(uint8_t* data, size_t size, OutputStream* out, const char* startName, diff --git a/src/tools/type-generator/main.cpp b/src/tools/type-generator/main.cpp index a08a5be3ff..2d436b3c93 100644 --- a/src/tools/type-generator/main.cpp +++ b/src/tools/type-generator/main.cpp @@ -1943,7 +1943,7 @@ main(int ac, char** av) System* system = makeSystem(); - class MyAllocator: public Allocator { + class MyAllocator : public avian::util::Allocator { public: MyAllocator(System* s): s(s) { }