forked from panda3d/panda3d
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmemory
More file actions
48 lines (38 loc) · 1.22 KB
/
memory
File metadata and controls
48 lines (38 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Filename: allocator
// Created by: drose (12May00)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) Carnegie Mellon University. All rights reserved.
//
// All use of this software is subject to the terms of the revised BSD
// license. You should have received a copy of this license along
// with this source code in a file named "LICENSE."
//
////////////////////////////////////////////////////////////////////
// This file, and all the other files in this directory, aren't
// intended to be compiled--they're just parsed by CPPParser (and
// interrogate) in lieu of the actual system headers, to generate the
// interrogate database.
#ifndef ALLOCATOR_H
#define ALLOCATOR_H
#include <stdtypedefs.h>
#ifdef GCC_STYLE_ALLOCATOR
class alloc {
public:
static void *allocate(size_t n);
static void deallocate(void *p, size_t n);
};
#else // GCC_STYLE_ALLOCATOR
template<class Type>
class allocator {
public:
typedef Type *pointer;
typedef const Type *const_pointer;
typedef size_t size_type;
INLINE pointer allocate(size_type n, allocator<void>::const_pointer hint = 0);
INLINE void deallocate(pointer p, size_type n);
};
#endif // GCC_STYLE_ALLOCATOR
#endif