1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/xpcom/base/AvailableMemoryTracker.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,30 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* vim:set ts=2 sw=2 sts=2 ci et: */ 1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +#ifndef mozilla_AvailableMemoryTracker_h 1.11 +#define mozilla_AvailableMemoryTracker_h 1.12 + 1.13 +namespace mozilla { 1.14 +namespace AvailableMemoryTracker { 1.15 + 1.16 +// The AvailableMemoryTracker launches a memory pressure watcher on all 1.17 +// platforms to react to low-memory situations and on Windows it implements 1.18 +// the full functionality used to monitor how much memory is available. 1.19 +// 1.20 +// Init() must be called before any other threads have started, because it 1.21 +// modifies the in-memory implementations of some DLL functions in 1.22 +// non-thread-safe ways. 1.23 +// 1.24 +// The hooks don't do anything until Activate() is called. It's an error to 1.25 +// call Activate() without first calling Init(). 1.26 + 1.27 +void Init(); 1.28 +void Activate(); 1.29 + 1.30 +} // namespace AvailableMemoryTracker 1.31 +} // namespace mozilla 1.32 + 1.33 +#endif // ifndef mozilla_AvailableMemoryTracker_h