fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER START
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The contents of this file are subject to the terms of the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Common Development and Distribution License, Version 1.0 only
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * (the "License"). You may not use this file except in compliance
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * with the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * or http://www.opensolaris.org/os/licensing.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * See the License for the specific language governing permissions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and limitations under the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * When distributing Covered Code, include this CDDL HEADER in each
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * If applicable, add the following below this CDDL HEADER, with the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * fields enclosed by brackets "[]" replaced with your own identifying
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * information: Portions Copyright [yyyy] [name of copyright owner]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER END
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Copyright 1989 Sun Microsystems, Inc. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Use is subject to license terms.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Copyright (c) 1984 AT&T */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* All Rights Reserved */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#pragma ident "%Z%%M% %I% %E% SMI"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifndef __malloc_h
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define __malloc_h
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Constants defining mallopt operations
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define M_MXFAST 1 /* set size of 'small blocks' */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define M_NLBLKS 2 /* set num of small blocks in holding block */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define M_GRAIN 3 /* set rounding factor for small blocks */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define M_KEEP 4 /* (nop) retain contents of freed blocks */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * malloc information structure
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestruct mallinfo {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int arena; /* total space in arena */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int ordblks; /* number of ordinary blocks */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int smblks; /* number of small blocks */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int hblks; /* number of holding blocks */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int hblkhd; /* space in holding block headers */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int usmblks; /* space in small blocks in use */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int fsmblks; /* space in free small blocks */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int uordblks; /* space in ordinary blocks in use */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int fordblks; /* space in free ordinary blocks */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int keepcost; /* cost of enabling keep option */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int mxfast; /* max size of small blocks */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int nlblks; /* number of small blocks in a holding block */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int grain; /* small block rounding factor */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int uordbytes; /* space (including overhead) allocated in ord. blks */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int allocated; /* number of ordinary blocks allocated */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int treeoverhead; /* bytes used in maintaining the free tree */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte};
7014882c6a3672fd0e5d60200af8643ae53c5928Richard Lowe
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef char * malloc_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern malloc_t calloc(/* size_t nmemb, size_t size */);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int free(/* malloc_t ptr */);
7014882c6a3672fd0e5d60200af8643ae53c5928Richard Loweextern malloc_t malloc(/* size_t size */);
7014882c6a3672fd0e5d60200af8643ae53c5928Richard Loweextern malloc_t realloc(/* malloc_t ptr, size_t size */);
7014882c6a3672fd0e5d60200af8643ae53c5928Richard Loweextern int mallopt();
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern struct mallinfo mallinfo();
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* !__malloc_h */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte