2014-06-30 08:39:45 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 04:12:37 -07: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 11:48:38 -08:00
|
|
|
|
|
|
|
#ifndef mozilla_AvailableMemoryTracker_h
|
|
|
|
#define mozilla_AvailableMemoryTracker_h
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace AvailableMemoryTracker {
|
|
|
|
|
2012-11-12 08:41:23 -08: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 10:53:08 -07: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 11:48:38 -08:00
|
|
|
|
|
|
|
void Init();
|
2012-04-09 10:53:08 -07:00
|
|
|
void Activate();
|
2011-12-15 11:48:38 -08:00
|
|
|
|
|
|
|
} // namespace AvailableMemoryTracker
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // ifndef mozilla_AvailableMemoryTracker_h
|