2011-12-15 23:48:38 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim:set ts=2 sw=2 sts=2 ci et: */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2011-12-15 23:48:38 +04:00
|
|
|
|
|
|
|
#ifndef mozilla_AvailableMemoryTracker_h
|
|
|
|
#define mozilla_AvailableMemoryTracker_h
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace AvailableMemoryTracker {
|
|
|
|
|
2012-11-12 20:41:23 +04:00
|
|
|
// The AvailableMemoryTracker launches a memory pressure watcher on all
|
|
|
|
// platforms to react to low-memory situations and on Windows it implements
|
|
|
|
// the full functionality used to monitor how much memory is available.
|
2012-04-09 21:53:08 +04:00
|
|
|
//
|
|
|
|
// Init() must be called before any other threads have started, because it
|
|
|
|
// modifies the in-memory implementations of some DLL functions in
|
|
|
|
// non-thread-safe ways.
|
|
|
|
//
|
|
|
|
// The hooks don't do anything until Activate() is called. It's an error to
|
|
|
|
// call Activate() without first calling Init().
|
2011-12-15 23:48:38 +04:00
|
|
|
|
|
|
|
void Init();
|
2012-04-09 21:53:08 +04:00
|
|
|
void Activate();
|
2011-12-15 23:48:38 +04:00
|
|
|
|
|
|
|
} // namespace AvailableMemoryTracker
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // ifndef mozilla_AvailableMemoryTracker_h
|