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