/*
* This module derived from code donated to the FreeBSD Project by
* Matthew Dillon <dillon@backplane.com>
*
* Copyright (c) 1998 The FreeBSD Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
__FBSDID("$FreeBSD$");
/*
* MALLOC.C - malloc equivalent, runs on top of zalloc and uses sbrk
*/
#include "zalloc_defs.h"
#ifdef DMALLOCDEBUG
static int MallocMax;
static int MallocCount;
void mallocstats(void);
#endif
#ifdef malloc
#endif
void *
{
#ifdef USEENDGUARD
#else
bytes += MALLOCALIGN;
#endif
char *base;
return(NULL);
}
#ifdef DMALLOCDEBUG
if (++MallocCount > MallocMax)
#endif
#ifdef USEGUARD
#endif
#ifdef USEENDGUARD
#endif
return((char *)res + MALLOCALIGN);
}
void
{
file = "unknown";
#ifdef USEGUARD
return;
}
#endif
#ifdef USEENDGUARD
return;
}
#endif
#ifdef DMALLOCDEBUG
--MallocCount;
#endif
}
}
void *
{
void *res;
#ifdef DMALLOCDEBUG
if (++MallocCount > MallocMax)
#endif
}
return(res);
}
/*
* realloc() - I could be fancier here and free the old buffer before
* allocating the new one (saving potential fragmentation
* and potential buffer copies). But I don't bother.
*/
void *
{
void *res;
if (ptr) {
else
} else {
#ifdef DMALLOCDEBUG
if (++MallocCount > MallocMax)
#ifdef EXITSTATS
if (DidAtExit == 0) {
DidAtExit = 1;
}
#endif
#endif
}
}
return(res);
}
void *
{
void *res;
return(res);
}
#ifdef DMALLOCDEBUG
void
mallocstats(void)
{
#ifdef ZALLOCDEBUG
#endif
}
#endif