1 | /* $Id: mem.c,v 1.1 2000-05-23 20:40:41 jeroen Exp $ */
|
---|
2 |
|
---|
3 | /*
|
---|
4 | * Mesa 3-D graphics library
|
---|
5 | * Version: 3.3
|
---|
6 | *
|
---|
7 | * Copyright (C) 1999 Brian Paul All Rights Reserved.
|
---|
8 | *
|
---|
9 | * Permission is hereby granted, free of charge, to any person obtaining a
|
---|
10 | * copy of this software and associated documentation files (the "Software"),
|
---|
11 | * to deal in the Software without restriction, including without limitation
|
---|
12 | * the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
---|
13 | * and/or sell copies of the Software, and to permit persons to whom the
|
---|
14 | * Software is furnished to do so, subject to the following conditions:
|
---|
15 | *
|
---|
16 | * The above copyright notice and this permission notice shall be included
|
---|
17 | * in all copies or substantial portions of the Software.
|
---|
18 | *
|
---|
19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
---|
20 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
---|
21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
---|
22 | * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
---|
23 | * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
---|
24 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
---|
25 | */
|
---|
26 |
|
---|
27 |
|
---|
28 | /*
|
---|
29 | * Memory allocation functions. Called via the MALLOC, CALLOC and
|
---|
30 | * FREE macros when DEBUG symbol is defined.
|
---|
31 | * You might want to set breakpoints on these functions or plug in
|
---|
32 | * other memory allocation functions. The Mesa sources should only
|
---|
33 | * use the MALLOC and FREE macros (which could also be overriden).
|
---|
34 | */
|
---|
35 |
|
---|
36 | #ifdef PC_HEADER
|
---|
37 | #include "all.h"
|
---|
38 | #else
|
---|
39 | #include "glheader.h"
|
---|
40 | #include "mem.h"
|
---|
41 | #endif
|
---|
42 |
|
---|
43 |
|
---|
44 |
|
---|
45 | /*
|
---|
46 | * Allocate memory (uninitialized)
|
---|
47 | */
|
---|
48 | void *
|
---|
49 | _mesa_malloc(size_t bytes)
|
---|
50 | {
|
---|
51 | return malloc(bytes);
|
---|
52 | }
|
---|
53 |
|
---|
54 |
|
---|
55 | /*
|
---|
56 | * Allocate memory and initialize to zero.
|
---|
57 | */
|
---|
58 | void *
|
---|
59 | _mesa_calloc(size_t bytes)
|
---|
60 | {
|
---|
61 | return calloc(1, bytes);
|
---|
62 | }
|
---|
63 |
|
---|
64 |
|
---|
65 | /*
|
---|
66 | * Free memory
|
---|
67 | */
|
---|
68 | void
|
---|
69 | _mesa_free(void *ptr)
|
---|
70 | {
|
---|
71 | free(ptr);
|
---|
72 | }
|
---|
73 |
|
---|
74 |
|
---|