diff --git a/js/src/vm/MallocProvider.h b/js/src/vm/MallocProvider.h index 2595edb8bd86..52f605607ad1 100644 --- a/js/src/vm/MallocProvider.h +++ b/js/src/vm/MallocProvider.h @@ -23,8 +23,6 @@ * - TempAllocPolicy: Adds automatic error reporting to the provided * JSContext when allocations fail. * - * - RuntimeAllocPolicy: Forwards to the JSRuntime MallocProvider. - * * - ZoneAllocPolicy: Forwards to the Zone MallocProvider. * * - MallocProvider. A mixin base class that handles automatically updating diff --git a/js/src/vm/Runtime.h b/js/src/vm/Runtime.h index e76b7cbc0f03..8b02b2beab05 100644 --- a/js/src/vm/Runtime.h +++ b/js/src/vm/Runtime.h @@ -1296,62 +1296,6 @@ SetValueRangeToNull(Value* vec, size_t len) SetValueRangeToNull(vec, vec + len); } -/* - * Allocation policy that uses JSRuntime::pod_malloc and friends, so that - * memory pressure is properly accounted for. This is suitable for - * long-lived objects owned by the JSRuntime. - * - * Since it doesn't hold a JSContext (those may not live long enough), it - * can't report out-of-memory conditions itself; the caller must check for - * OOM and take the appropriate action. - * - * FIXME bug 647103 - replace these *AllocPolicy names. - */ -class RuntimeAllocPolicy -{ - JSRuntime* const runtime; - - public: - MOZ_IMPLICIT RuntimeAllocPolicy(JSRuntime* rt) : runtime(rt) {} - - template - T* maybe_pod_malloc(size_t numElems) { - return runtime->maybe_pod_malloc(numElems); - } - - template - T* maybe_pod_calloc(size_t numElems) { - return runtime->maybe_pod_calloc(numElems); - } - - template - T* maybe_pod_realloc(T* p, size_t oldSize, size_t newSize) { - return runtime->maybe_pod_realloc(p, oldSize, newSize); - } - - template - T* pod_malloc(size_t numElems) { - return runtime->pod_malloc(numElems); - } - - template - T* pod_calloc(size_t numElems) { - return runtime->pod_calloc(numElems); - } - - template - T* pod_realloc(T* p, size_t oldSize, size_t newSize) { - return runtime->pod_realloc(p, oldSize, newSize); - } - - void free_(void* p) { js_free(p); } - void reportAllocOverflow() const {} - - bool checkSimulatedOOM() const { - return !js::oom::ShouldFailWithOOM(); - } -}; - extern const JSSecurityCallbacks NullSecurityCallbacks; inline Nursery&