121498Sjmacd/*
221498Sjmacd * libntp local override of isc/mem.h to stub it out.
3146520Sru *
4146520Sru * include/isc is searched before any of the lib/isc include
521498Sjmacd * directories and should be used only for replacement NTP headers
693142Sru * overriding headers of the same name under lib/isc.
7146520Sru *
893142Sru * NOTE: this assumes the system malloc is thread-safe and does
9146520Sru *	 not use any normal lib/isc locking.
1093142Sru */
11146520Sru
1293142Sru/*
13146520Sru * Copyright (C) 2004-2009  Internet Systems Consortium, Inc. ("ISC")
1493142Sru * Copyright (C) 1997-2001  Internet Software Consortium.
15146520Sru *
1693142Sru * Permission to use, copy, modify, and/or distribute this software for any
17146520Sru * purpose with or without fee is hereby granted, provided that the above
1893142Sru * copyright notice and this permission notice appear in all copies.
19146520Sru *
2093142Sru * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
21146520Sru * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
2293142Sru * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
23146520Sru * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
2493142Sru * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
25146520Sru * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
2693142Sru * PERFORMANCE OF THIS SOFTWARE.
27146520Sru */
2893142Sru
29146520Sru/* $Id: mem.h,v 1.78.120.3 2009/02/11 03:07:01 jinmei Exp $ */
3093142Sru
31146520Sru#ifndef ISC_MEM_H
3293142Sru#define ISC_MEM_H 1
33146520Sru
3493142Sru#include <stdio.h>
35146520Sru
3693142Sru#include <isc/lang.h>
37146520Sru#include <isc/mutex.h>
3893142Sru#include <isc/platform.h>
39146520Sru#include <isc/types.h>
4093142Sru#include <isc/xml.h>
41146520Sru
4293142Sru#include <ntp_stdlib.h>
43146520Sru
4493142Sru
45146520Sru#define ISC_MEM_UNUSED_ARG(a)		((void)(a))
4693142Sru
47146520Sru#define isc_mem_allocate(c, cnt)	isc_mem_get(c, cnt)
4893142Sru#define isc_mem_get(c, cnt)		\
49146520Sru	( ISC_MEM_UNUSED_ARG(c),	emalloc(cnt) )
5093142Sru
51146520Sru#define isc_mem_reallocate(c, mem, cnt)	\
5293142Sru	( ISC_MEM_UNUSED_ARG(c),	erealloc((mem), cnt) )
53146520Sru
5493142Sru#define isc_mem_put(c, mem, cnt)	\
55146520Sru	( ISC_MEM_UNUSED_ARG(cnt),	isc_mem_free(c, (mem)) )
5693142Sru
57146520Sru#define isc_mem_free(c, mem)		\
5893142Sru	( ISC_MEM_UNUSED_ARG(c),	free(mem) )
59146520Sru
6093142Sru#define isc_mem_strdup(c, str)		\
61146520Sru	( ISC_MEM_UNUSED_ARG(c),	estrdup(str) )
6293142Sru
63146520Sru#define isc__mem_attach(src, ptgt)	do { *(ptgt) = (src); } while (0)
6493142Sru#define isc__mem_detach(c)		ISC_MEM_UNUSED_ARG(c)
65146520Sru#define isc__mem_printallactive(s)	fprintf((s), \
6693142Sru					"isc_mem_printallactive() stubbed.\n")
67146520Sru
6893142Sru#endif /* ISC_MEM_H */
69146520Sru