xref: /redis-3.2.3/src/sdsalloc.h (revision cb2782c3)
1*cb2782c3Santirez /* SDSLib 2.0 -- A C dynamic strings library
2*cb2782c3Santirez  *
3*cb2782c3Santirez  * Copyright (c) 2006-2015, Salvatore Sanfilippo <antirez at gmail dot com>
4*cb2782c3Santirez  * Copyright (c) 2015, Redis Labs, Inc
5*cb2782c3Santirez  * All rights reserved.
6*cb2782c3Santirez  *
7*cb2782c3Santirez  * Redistribution and use in source and binary forms, with or without
8*cb2782c3Santirez  * modification, are permitted provided that the following conditions are met:
9*cb2782c3Santirez  *
10*cb2782c3Santirez  *   * Redistributions of source code must retain the above copyright notice,
11*cb2782c3Santirez  *     this list of conditions and the following disclaimer.
12*cb2782c3Santirez  *   * Redistributions in binary form must reproduce the above copyright
13*cb2782c3Santirez  *     notice, this list of conditions and the following disclaimer in the
14*cb2782c3Santirez  *     documentation and/or other materials provided with the distribution.
15*cb2782c3Santirez  *   * Neither the name of Redis nor the names of its contributors may be used
16*cb2782c3Santirez  *     to endorse or promote products derived from this software without
17*cb2782c3Santirez  *     specific prior written permission.
18*cb2782c3Santirez  *
19*cb2782c3Santirez  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20*cb2782c3Santirez  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21*cb2782c3Santirez  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22*cb2782c3Santirez  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
23*cb2782c3Santirez  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24*cb2782c3Santirez  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25*cb2782c3Santirez  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26*cb2782c3Santirez  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27*cb2782c3Santirez  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28*cb2782c3Santirez  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29*cb2782c3Santirez  * POSSIBILITY OF SUCH DAMAGE.
30*cb2782c3Santirez  */
31*cb2782c3Santirez 
32*cb2782c3Santirez /* SDS allocator selection.
33*cb2782c3Santirez  *
34*cb2782c3Santirez  * This file is used in order to change the SDS allocator at compile time.
35*cb2782c3Santirez  * Just define the following defines to what you want to use. Also add
36*cb2782c3Santirez  * the include of your alternate allocator if needed (not needed in order
37*cb2782c3Santirez  * to use the default libc allocator). */
38*cb2782c3Santirez 
39*cb2782c3Santirez #include "zmalloc.h"
40*cb2782c3Santirez #define s_malloc zmalloc
41*cb2782c3Santirez #define s_realloc zrealloc
42*cb2782c3Santirez #define s_free zfree
43