/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1988 AT&T */
/* All Rights Reserved */
#ifndef _MALLINT_H
#define _MALLINT_H
#pragma ident "%Z%%M% %I% %E% SMI"
/* From: SVr4.0 libmalloc:mallint.h 1.3 */
/*
* number of bytes to align to (must be at least 4, because lower 2 bits
* are used for flags
*
* header and code assume ALIGNSZ is exact multiple of sizeof (struct header *)
* several places assume sizeof (long) == sizeof (struct holdblk *)
*/
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _LP64
#else
#endif
/*
* template for the header
*/
struct header {
};
/*
* template for a small block
*/
struct lblk {
union {
/*
* the next free little block in this holding block.
* This field is used when the block is free
*/
/*
* the holding block containing this little block.
* This field is used when the block is allocated
*/
/*
* Insure over head is multiple of ALIGNSZ
* assumes ALIGNSZ >= sizeof pointer
*/
} header;
/* There is no telling how big this field really is. */
/* This must be on a ALIGNSZ boundary */
char byte;
};
/*
* template for holding block
*/
struct holdblk {
/* This must be on a ALIGNSZ boundary */
};
/*
* The following manipulate the free queue
*
* DELFREEQ will remove x from the free queue
* ADDFREEQ will add an element to the head
* of the free queue.
* MOVEHEAD will move the free pointers so that
* x is at the front of the queue
*/
/*
* The following manipulate the busy flag
*/
/*
* The following manipulate the small block flag
*/
/*
* The following manipulate both flags. They must be
* type coerced
*/
/*
* Other useful constants
*/
#define FALSE 0
/* MINHEAD is the minimum size of an allocated block header */
/* min. block size must as big as HEADSZ */
/* memory is gotten from sbrk in multiples of BLOCKSZ */
#ifndef NULL
#define NULL (char *)0
#endif
/*
* Structures and constants describing the holding blocks
*/
/* default number of small blocks per holding block */
/* size of a holding block with small blocks of size blksz */
/* default maximum size block for fast allocation */
/* assumes initial value of grain == ALIGNSZ */
#ifdef debug
#else
#define CHECKQ
#endif
#ifdef __cplusplus
}
#endif
#endif /* _MALLINT_H */