1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/media/libnestegg/src/halloc.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,43 @@ 1.4 +/* 1.5 + * Copyright (c) 2004-2010 Alex Pankratov. All rights reserved. 1.6 + * 1.7 + * Hierarchical memory allocator, 1.2.1 1.8 + * http://swapped.cc/halloc 1.9 + */ 1.10 + 1.11 +/* 1.12 + * The program is distributed under terms of BSD license. 1.13 + * You can obtain the copy of the license by visiting: 1.14 + * 1.15 + * http://www.opensource.org/licenses/bsd-license.php 1.16 + */ 1.17 + 1.18 +#ifndef _LIBP_HALLOC_H_ 1.19 +#define _LIBP_HALLOC_H_ 1.20 + 1.21 +#include <stddef.h> /* size_t */ 1.22 + 1.23 +/* 1.24 + * Core API 1.25 + */ 1.26 +void * halloc (void * block, size_t len); 1.27 +void hattach(void * block, void * parent); 1.28 + 1.29 +/* 1.30 + * standard malloc/free api 1.31 + */ 1.32 +void * h_malloc (size_t len); 1.33 +void * h_calloc (size_t n, size_t len); 1.34 +void * h_realloc(void * p, size_t len); 1.35 +void h_free (void * p); 1.36 +char * h_strdup (const char * str); 1.37 + 1.38 +/* 1.39 + * the underlying allocator 1.40 + */ 1.41 +typedef void * (* realloc_t)(void * ptr, size_t len); 1.42 + 1.43 +extern realloc_t halloc_allocator; 1.44 + 1.45 +#endif 1.46 +