/* $Id: q_malloc.h 5897 2009-07-20 14:52:34Z bogdan_iancu $ * * simple & fast malloc library * * Copyright (C) 2001-2003 FhG Fokus * * This file is part of opensips, a free SIP server. * * opensips is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version * * opensips is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * History: * -------- * 2003-05-21 on sparc64 roundto 8 even in debugging mode (so malloc'ed * long longs will be 64 bit aligned) (andrei) * 2004-07-19 support for 64 bit (2^64 mem. block) and more info * for the future de-fragmentation support (andrei) * 2004-11-10 support for > 4Gb mem. (switched to long) (andrei) */ #if !defined(q_malloc_h) #define q_malloc_h #ifdef __cplusplus extern "C" { #endif #include "config.h" /* defs*/ #ifdef NO_FIXED_ADDR //#define RELATIVE_ADDR //there are no help between different processes #endif // NO_FIXED_ADDR /* size we round to, must be = 2^n and also sizeof(qm_frag)+sizeof(qm_frag_end) must be multiple of ROUNDTO!*/ #define ROUNDTO 16UL #define MIN_FRAG_SIZE ROUNDTO #define QM_MALLOC_OPTIMIZE_FACTOR 14UL /*used below */ #define QM_MALLOC_OPTIMIZE ((unsigned long)(1UL<