mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
Bug 1400278 - Remove RuntimeAllocPolicy now it's no longer used r=sfink
This commit is contained in:
parent
bccffc2ea8
commit
5b67de0d02
@ -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
|
||||
|
@ -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 <typename T>
|
||||
T* maybe_pod_malloc(size_t numElems) {
|
||||
return runtime->maybe_pod_malloc<T>(numElems);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T* maybe_pod_calloc(size_t numElems) {
|
||||
return runtime->maybe_pod_calloc<T>(numElems);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T* maybe_pod_realloc(T* p, size_t oldSize, size_t newSize) {
|
||||
return runtime->maybe_pod_realloc<T>(p, oldSize, newSize);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T* pod_malloc(size_t numElems) {
|
||||
return runtime->pod_malloc<T>(numElems);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T* pod_calloc(size_t numElems) {
|
||||
return runtime->pod_calloc<T>(numElems);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T* pod_realloc(T* p, size_t oldSize, size_t newSize) {
|
||||
return runtime->pod_realloc<T>(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&
|
||||
|
Loading…
Reference in New Issue
Block a user