~siretart/ubuntu/utopic/blender/libav10

« back to all changes in this revision

Viewing changes to intern/guardedalloc/cpp/mallocn.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Kevin Roy
  • Date: 2011-02-08 22:20:54 UTC
  • mfrom: (1.4.2 upstream)
  • mto: (14.2.6 sid) (1.5.1)
  • mto: This revision was merged to the branch mainline in revision 27.
  • Revision ID: james.westby@ubuntu.com-20110208222054-kk0gwa4bu8h5lyq4
Tags: upstream-2.56.1-beta-svn34076
ImportĀ upstreamĀ versionĀ 2.56.1-beta-svn34076

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * $Id: mallocn.cpp 32382 2010-10-08 20:40:42Z jesterking $
 
3
 * ***** BEGIN GPL LICENSE BLOCK *****
 
4
 *
 
5
 * This program is free software; you can redistribute it and/or
 
6
 * modify it under the terms of the GNU General Public License
 
7
 * as published by the Free Software Foundation; either version 2
 
8
 * of the License, or (at your option) any later version.
 
9
 *
 
10
 * This program is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 * GNU General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU General Public License
 
16
 * along with this program; if not, write to the Free Software Foundation,
 
17
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
18
 *
 
19
 * Contributor(s): Campbell Barton
 
20
 *
 
21
 * ***** END GPL LICENSE BLOCK *****
 
22
 */
 
23
 
 
24
#include <new>
 
25
#include "../MEM_guardedalloc.h"
 
26
 
 
27
void* operator new (size_t size)
 
28
{
 
29
        return MEM_mallocN(size, "C++/anonymous");
 
30
}
 
31
 
 
32
/* not default but can be used when needing to set a string */
 
33
void* operator new (size_t size, const char *str)
 
34
{
 
35
        return MEM_mallocN(size, str);
 
36
}
 
37
 
 
38
void operator delete (void *p)
 
39
{
 
40
        MEM_freeN(p);
 
41
}