mirror of
https://github.com/corda/corda.git
synced 2025-01-08 14:03:06 +00:00
remove unused Heap::Client::outOfMemory method
The heap-dump-on-OOM feature has been moved to the collect function.
This commit is contained in:
parent
4d5aeb5ab2
commit
51a1081adc
@ -70,7 +70,6 @@ System* system(Context*);
|
|||||||
void* tryAllocate(Context* c, unsigned size);
|
void* tryAllocate(Context* c, unsigned size);
|
||||||
void* allocate(Context* c, unsigned size);
|
void* allocate(Context* c, unsigned size);
|
||||||
void free(Context* c, const void* p, unsigned size);
|
void free(Context* c, const void* p, unsigned size);
|
||||||
void outOfMemory(Context*);
|
|
||||||
|
|
||||||
#ifdef USE_ATOMIC_OPERATIONS
|
#ifdef USE_ATOMIC_OPERATIONS
|
||||||
inline void
|
inline void
|
||||||
@ -1780,12 +1779,6 @@ free_(Context* c, const void* p, unsigned size)
|
|||||||
free(c, p, size);
|
free(c, p, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
outOfMemory(Context* c)
|
|
||||||
{
|
|
||||||
c->client->outOfMemory();
|
|
||||||
}
|
|
||||||
|
|
||||||
class MyHeap: public Heap {
|
class MyHeap: public Heap {
|
||||||
public:
|
public:
|
||||||
MyHeap(System* system, unsigned limit):
|
MyHeap(System* system, unsigned limit):
|
||||||
|
@ -49,7 +49,6 @@ class Heap: public Allocator {
|
|||||||
virtual unsigned copiedSizeInWords(void*) = 0;
|
virtual unsigned copiedSizeInWords(void*) = 0;
|
||||||
virtual void copy(void*, void*) = 0;
|
virtual void copy(void*, void*) = 0;
|
||||||
virtual void walk(void*, Walker*) = 0;
|
virtual void walk(void*, Walker*) = 0;
|
||||||
virtual void outOfMemory() = 0;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
virtual void setClient(Client* client) = 0;
|
virtual void setClient(Client* client) = 0;
|
||||||
|
@ -2156,21 +2156,6 @@ class HeapClient: public Heap::Client {
|
|||||||
::walk(m->rootThread, w, o, 0);
|
::walk(m->rootThread, w, o, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void outOfMemory() {
|
|
||||||
#ifdef AVIAN_HEAPDUMP
|
|
||||||
const char* path = findProperty(m->rootThread, "avian.heap.dump");
|
|
||||||
if (path) {
|
|
||||||
FILE* out = vm::fopen(path, "wb");
|
|
||||||
if (out) {
|
|
||||||
dumpHeap(m->rootThread, out);
|
|
||||||
fclose(out);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif//AVIAN_HEAPDUMP
|
|
||||||
|
|
||||||
abort(m->system);
|
|
||||||
}
|
|
||||||
|
|
||||||
void dispose() {
|
void dispose() {
|
||||||
m->heap->free(this, sizeof(*this));
|
m->heap->free(this, sizeof(*this));
|
||||||
}
|
}
|
||||||
@ -2282,6 +2267,7 @@ Machine::Machine(System* system, Heap* heap, Finder* bootFinder,
|
|||||||
tenuredWeakReferences(0),
|
tenuredWeakReferences(0),
|
||||||
unsafe(false),
|
unsafe(false),
|
||||||
triedBuiltinOnLoad(false),
|
triedBuiltinOnLoad(false),
|
||||||
|
dumpedHeapOnOOM(false),
|
||||||
heapPoolIndex(0)
|
heapPoolIndex(0)
|
||||||
{
|
{
|
||||||
heap->setClient(heapClient);
|
heap->setClient(heapClient);
|
||||||
@ -3798,6 +3784,20 @@ collect(Thread* t, Heap::CollectionType type)
|
|||||||
// into the smallest possible space:
|
// into the smallest possible space:
|
||||||
doCollect(t, Heap::MajorCollection);
|
doCollect(t, Heap::MajorCollection);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef AVIAN_HEAPDUMP
|
||||||
|
if ((not t->m->dumpedHeapOnOOM) and t->m->heap->limitExceeded()) {
|
||||||
|
t->m->dumpedHeapOnOOM = true;
|
||||||
|
const char* path = findProperty(t, "avian.heap.dump");
|
||||||
|
if (path) {
|
||||||
|
FILE* out = vm::fopen(path, "wb");
|
||||||
|
if (out) {
|
||||||
|
dumpHeap(t, out);
|
||||||
|
fclose(out);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif//AVIAN_HEAPDUMP
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1307,6 +1307,7 @@ class Machine {
|
|||||||
object tenuredWeakReferences;
|
object tenuredWeakReferences;
|
||||||
bool unsafe;
|
bool unsafe;
|
||||||
bool triedBuiltinOnLoad;
|
bool triedBuiltinOnLoad;
|
||||||
|
bool dumpedHeapOnOOM;
|
||||||
JavaVMVTable javaVMVTable;
|
JavaVMVTable javaVMVTable;
|
||||||
JNIEnvVTable jniEnvVTable;
|
JNIEnvVTable jniEnvVTable;
|
||||||
uintptr_t* heapPool[ThreadHeapPoolSize];
|
uintptr_t* heapPool[ThreadHeapPoolSize];
|
||||||
|
Loading…
Reference in New Issue
Block a user