2df6fee495f03ea02a595f6942c3f63f2603b6e8
[silc.git] / lib / silcutil / silcmemory.c
1 /*
2
3   silcmemory.c
4
5   Author: Pekka Riikonen <priikone@poseidon.pspt.fi>
6
7   Copyright (C) 1999 - 2000 Pekka Riikonen
8
9   This program is free software; you can redistribute it and/or modify
10   it under the terms of the GNU General Public License as published by
11   the Free Software Foundation; either version 2 of the License, or
12   (at your option) any later version.
13   
14   This program is distributed in the hope that it will be useful,
15   but WITHOUT ANY WARRANTY; without even the implied warranty of
16   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17   GNU General Public License for more details.
18
19 */
20 /* $Id$ */
21
22 #include "silcincludes.h"
23
24 void *silc_malloc(size_t size)
25 {
26   void *addr;
27   addr = malloc(size);
28   assert(addr != NULL);
29   return addr;
30 }
31
32 void *silc_calloc(size_t items, size_t size)
33 {
34   void *addr;
35   addr = calloc(items, size);
36   assert(addr != NULL);
37   return addr;
38 }
39
40 void *silc_realloc(void *ptr, size_t size)
41 {
42   void *addr;
43   addr = realloc(ptr, size);
44   assert(addr != NULL);
45   return addr;
46 }
47
48 void silc_free(void *ptr)
49 {
50   free(ptr);
51 }