mirror of
https://github.com/corda/corda.git
synced 2025-06-16 14:18:20 +00:00
write java symbols to bootimage
This commit is contained in:
@ -12,6 +12,7 @@
|
||||
#define AVIAN_TOOLS_H_
|
||||
|
||||
#include "environment.h"
|
||||
#include <malloc.h>
|
||||
|
||||
namespace avian {
|
||||
|
||||
@ -86,6 +87,10 @@ public:
|
||||
items(items),
|
||||
count(count) {}
|
||||
|
||||
inline Slice(const Slice<T>& copy):
|
||||
items(copy.items),
|
||||
count(copy.count) {}
|
||||
|
||||
inline T* begin() {
|
||||
return items;
|
||||
}
|
||||
@ -95,6 +100,31 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
template<class T>
|
||||
class DynamicArray : public Slice<T> {
|
||||
public:
|
||||
size_t capacity;
|
||||
|
||||
DynamicArray():
|
||||
Slice<T>((T*)malloc(10 * sizeof(T)), 0),
|
||||
capacity(10) {}
|
||||
~DynamicArray() {
|
||||
free(Slice<T>::items);
|
||||
}
|
||||
|
||||
void ensure(size_t more) {
|
||||
if(Slice<T>::count + more > capacity) {
|
||||
capacity = capacity * 2 + more;
|
||||
Slice<T>::items = (T*)realloc(Slice<T>::items, capacity * sizeof(T));
|
||||
}
|
||||
}
|
||||
|
||||
void add(const T& item) {
|
||||
ensure(1);
|
||||
Slice<T>::items[Slice<T>::count++] = item;
|
||||
}
|
||||
};
|
||||
|
||||
class PlatformInfo {
|
||||
public:
|
||||
enum OperatingSystem {
|
||||
|
Reference in New Issue
Block a user