media/libnestegg/src/halloc.h
author Gregory Szorc <gps@mozilla.com>
Tue, 24 Feb 2015 15:16:54 -0800
changeset 245746 6d143a910f5ecf67d9dec302087aa20777ec6772
parent 43338 b391708e95527fd56770a343036d46669220df40
permissions -rw-r--r--
Bug 1132771 - Add Files to moz.build with ability to define Bugzilla component The Files sub-context allows us to attach metadata to files based on pattern matching rules. Patterns are matched against files in a last-write-wins fashion. The sub-context defines the BUG_COMPONENT variable, which is a 2-tuple (actually a named tuple) defining the Bugzilla product and component for files. There are no consumers yet. But an eventual use case will be to suggest a bug component for a patch/commit. Another will be to automatically suggest a bug component for a failing test.

/*
 *	Copyright (c) 2004-2010 Alex Pankratov. All rights reserved.
 *
 *	Hierarchical memory allocator, 1.2.1
 *	http://swapped.cc/halloc
 */

/*
 *	The program is distributed under terms of BSD license. 
 *	You can obtain the copy of the license by visiting:
 *	
 *	http://www.opensource.org/licenses/bsd-license.php
 */

#ifndef _LIBP_HALLOC_H_
#define _LIBP_HALLOC_H_

#include <stddef.h>  /* size_t */

/*
 *	Core API
 */
void * halloc (void * block, size_t len);
void   hattach(void * block, void * parent);

/*
 *	standard malloc/free api
 */
void * h_malloc (size_t len);
void * h_calloc (size_t n, size_t len);
void * h_realloc(void * p, size_t len);
void   h_free   (void * p);
char * h_strdup (const char * str);

/*
 *	the underlying allocator
 */
typedef void * (* realloc_t)(void * ptr, size_t len);

extern realloc_t halloc_allocator;

#endif