blob: 094c67bc9e3d1033a848cc54db3e21804895762e (
plain)
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
|
/*
* libdect utility functions
*
* Copyright (c) 2009-2010 Patrick McHardy <kaber@trash.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <stdio.h>
#include <stdbool.h>
#include <unistd.h>
#include <string.h>
#include <libdect.h>
#include <utils.h>
void *dect_malloc(const struct dect_handle *dh, size_t size)
{
return dh->ops->malloc(size);
}
void *dect_zalloc(const struct dect_handle *dh, size_t size)
{
void *ptr;
ptr = dect_malloc(dh, size);
if (ptr != NULL)
memset(ptr, 0, size);
return ptr;
}
void dect_free(const struct dect_handle *dh, void *ptr)
{
dh->ops->free(ptr);
}
|