1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/extensions/spellcheck/hunspell/src/hunspell_alloc_hooks.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,58 @@ 1.4 +/******* BEGIN LICENSE BLOCK ******* 1.5 + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 1.6 + * 1.7 + * The contents of this file are subject to the Mozilla Public License Version 1.8 + * 1.1 (the "License"); you may not use this file except in compliance with 1.9 + * the License. You may obtain a copy of the License at 1.10 + * http://www.mozilla.org/MPL/ 1.11 + * 1.12 + * Software distributed under the License is distributed on an "AS IS" basis, 1.13 + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 1.14 + * for the specific language governing rights and limitations under the 1.15 + * License. 1.16 + * 1.17 + * The Initial Developers of the Original Code is Mozilla Foundation. 1.18 + * Portions created by the Initial Developers 1.19 + * are Copyright (C) 2011 the Initial Developers. All Rights Reserved. 1.20 + * 1.21 + * Contributor(s): 1.22 + * 1.23 + * Alternatively, the contents of this file may be used under the terms of 1.24 + * either the GNU General Public License Version 2 or later (the "GPL"), or 1.25 + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 1.26 + * in which case the provisions of the GPL or the LGPL are applicable instead 1.27 + * of those above. If you wish to allow use of your version of this file only 1.28 + * under the terms of either the GPL or the LGPL, and not to allow others to 1.29 + * use your version of this file under the terms of the MPL, indicate your 1.30 + * decision by deleting the provisions above and replace them with the notice 1.31 + * and other provisions required by the GPL or the LGPL. If you do not delete 1.32 + * the provisions above, a recipient may use your version of this file under 1.33 + * the terms of any one of the MPL, the GPL or the LGPL. 1.34 + * 1.35 + ******* END LICENSE BLOCK *******/ 1.36 + 1.37 +#ifndef alloc_hooks_h__ 1.38 +#define alloc_hooks_h__ 1.39 + 1.40 +/** 1.41 + * This file is force-included in hunspell code. Its purpose is to add memory 1.42 + * reporting to hunspell without modifying its code, in order to ease future 1.43 + * upgrades. 1.44 + * 1.45 + * This file is force-included through mozilla-config.h which is generated 1.46 + * during the configure step. 1.47 + * 1.48 + * Currently, the memory allocated using operator new/new[] is not being 1.49 + * tracked, but that's OK, since almost all of the memory used by Hunspell is 1.50 + * allocated using C memory allocation functions. 1.51 + */ 1.52 + 1.53 +#include "mozilla/mozalloc.h" 1.54 +#include "mozHunspellAllocator.h" 1.55 + 1.56 +#define malloc(size) HunspellAllocator::CountingMalloc(size) 1.57 +#define calloc(count, size) HunspellAllocator::CountingCalloc(count, size) 1.58 +#define free(ptr) HunspellAllocator::CountingFree(ptr) 1.59 +#define realloc(ptr, size) HunspellAllocator::CountingRealloc(ptr, size) 1.60 + 1.61 +#endif