GRU - Generic Reusable Utilities
Loading...
Searching...
No Matches
gru_alloc.h
Go to the documentation of this file.
1/*
2 * To change this license header, choose License Headers in Project Properties.
3 * To change this template file, choose Tools | Templates
4 * and open the template in the editor.
5 */
6
7/*
8 * File: gru_alloc.h
9 * Author: opiske
10 *
11 * Created on September 20, 2016, 2:43 PM
12 */
13
14#ifndef GRU_ALLOC_H
15#define GRU_ALLOC_H
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
21#include "gru_base.h"
22#include "gru_status.h"
23
30gru_export void *gru_alloc(size_t size, gru_status_t *status);
31
36gru_export void gru_dealloc(void **obj);
37
42gru_export void gru_dealloc_string(char **obj);
43
48gru_export void gru_dealloc_const_string(const char **obj);
49
53#define gru_alloc_check(obj, ret) \
54 if ((obj) == NULL) \
55 return ret;
56
57#ifdef __cplusplus
58}
59#endif
60
61#endif /* GRU_ALLOC_H */
gru_export void * gru_alloc(size_t size, gru_status_t *status)
Allocate a block of memory.
Definition: gru_alloc.c:9
gru_export void gru_dealloc_const_string(const char **obj)
Deallocate a block of memory used by a const char * and set its pointer to NULL.
Definition: gru_alloc.c:36
gru_export void gru_dealloc(void **obj)
Deallocate a block of memory and set its pointer to NULL.
Definition: gru_alloc.c:21
gru_export void gru_dealloc_string(char **obj)
Deallocate a block of memory used by a char * and set its pointer to NULL.
Definition: gru_alloc.c:32
#define gru_export
Definition: gru_portable.h:19
Status type.
Definition: gru_status.h:47