/* * ---------------------------------------------------------------- * Night Light Memory Allocation Library Header (memcalls_int.h) * ---------------------------------------------------------------- * Copyright (C) 1997-2007 Jonas Kvinge * All rights reserved. * * This program 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. * * This program 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., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Last modified by: * Jonas Kvinge (25.03.2007) * */ #ifdef MEMCALLS_INT_H #warning "memcalls_int.h already included." #else #define MEMCALLS_INT_H #define MALLOC_HASH_SIZE 65539 #ifndef MALLOC_LIMIT #define MALLOC_LIMIT 0xFFFFFFF #endif #define MALLOC_PREFIX "Hurricane" #define MALLOC_POSTFIX "SweetJane" #define MALLOC_PREFIX_LEN strlen(MALLOC_PREFIX) #define MALLOC_POSTFIX_LEN strlen(MALLOC_POSTFIX) #define MALLOC_REDBYTE 0xCD #define MALLOC_PRINT FALSE #define MallocHash(PTR) (((unsigned long) (PTR) >> 3) % MALLOC_HASH_SIZE) /* STRUCTURES - JONAS (21.09.2001) */ struct MemTable_Struct { const void *PTR; const char *File; unsigned short int Line; const char *Function; size_t Size; time_t Time; struct MemTable_Struct *Prev; struct MemTable_Struct *Next; struct MemTable_Struct *PrevH; struct MemTable_Struct *NextH; }; /* FUNCTION PROTOTYPES - JONAS (21.09.2001) */ void memtable_add(const void *const PTR, const char *const FilePT, const unsigned short int Line, const char *const FunctionPT, const size_t Size); void memtable_rem(struct MemTable_Struct *MemTableS); struct MemTable_Struct *memtable_get(const void *const PTR); #endif