00001 /* 00002 * To change this license header, choose License Headers in Project Properties. 00003 * To change this template file, choose Tools | Templates 00004 * and open the template in the editor. 00005 */ 00006 00007 /* 00008 * File: gru_alloc.h 00009 * Author: opiske 00010 * 00011 * Created on September 20, 2016, 2:43 PM 00012 */ 00013 00014 #ifndef GRU_ALLOC_H 00015 #define GRU_ALLOC_H 00016 00017 #ifdef __cplusplus 00018 extern "C" { 00019 #endif 00020 00021 #include "gru_base.h" 00022 #include "gru_status.h" 00023 00030 gru_export void *gru_alloc(size_t size, gru_status_t *status); 00031 00036 gru_export void gru_dealloc(void **obj); 00037 00042 gru_export void gru_dealloc_string(char **obj); 00043 00048 gru_export void gru_dealloc_const_string(const char **obj); 00049 00053 #define gru_alloc_check(obj, ret) \ 00054 if ((obj) == NULL) \ 00055 return ret; 00056 00057 #ifdef __cplusplus 00058 } 00059 #endif 00060 00061 #endif /* GRU_ALLOC_H */