mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-20 16:55:40 +00:00
ad89036000
This tracks TlsAlloc() and TlsFree() calls on Windows for diagnosing crashes when a proces reaches its limit (1088) for TLS slots. Tracking of TLS allocation is done by intercepting TlsAlloc() and TlsFree() in kernel32.dll. After initialization, we start tracking the number of allocated TLS slots. If the number of observed TLS allocations exceeds a high water mark, we record the stack when TlsAlloc() is called, and the recorded stacks gets serialized in a JSON string ready for crash annotation. MozReview-Commit-ID: 5fHVr0eiMy5
28 lines
595 B
C++
28 lines
595 B
C++
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
/* 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/. */
|
|
|
|
#ifndef mozilla_TlsAllocationTracker_h
|
|
#define mozilla_TlsAllocationTracker_h
|
|
|
|
#include <string>
|
|
|
|
#include "mozilla/Types.h"
|
|
|
|
namespace mozilla {
|
|
|
|
void
|
|
InitTlsAllocationTracker();
|
|
|
|
const char*
|
|
GetTlsAllocationStacks();
|
|
|
|
void
|
|
ShutdownTlsAllocationTracker();
|
|
|
|
}
|
|
|
|
#endif
|