X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2F16_hc.h;h=010d04f29011292c3f5915b125fe7e6c6b178750;hb=a565be31ce92d6168ae6983042da75b0b683e52b;hp=db0265a82832eba45a4496a59459a6771fd90be0;hpb=e0806081573e79828c100893f396dadc9d909f99;p=16.git diff --git a/src/lib/16_hc.h b/src/lib/16_hc.h old mode 100644 new mode 100755 index db0265a8..010d04f2 --- a/src/lib/16_hc.h +++ b/src/lib/16_hc.h @@ -1,56 +1,70 @@ -/* Project 16 Source Code~ - * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669 - * - * This file is part of Project 16. - * - * Project 16 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 3 of the License, or - * (at your option) any later version. - * - * Project 16 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, see , or - * write to the Free Software Foundation, Inc., 51 Franklin Street, - * Fifth Floor, Boston, MA 02110-1301 USA. - * - */ -/* - heap test stuff -*/ - -#ifndef __16HC__ -#define __16HC__ - -#include "src/lib/16_head.h" - -extern int heaphandle; - -#ifdef __BORLANDC__ -void * LargestFreeBlock(size_t* Size); -#endif -#ifdef __WATCOMC__ -void __near* LargestFreeBlock(size_t* Size); -#endif -size_t _coreleft(void); -void far* LargestFarFreeBlock(size_t* Size); -size_t _farcoreleft(void); -void huge* LargestHugeFreeBlock(size_t* Size); -size_t _hugecoreleft(void); -//void __based(__self)* LargestBasedFreeBlock(size_t* Size); -//size_t _basedcoreleft(void); -size_t GetFreeSize(void); -size_t GetFarFreeSize(void); -size_t GetNearFreeSize(void); -void heapdump(void); -void heapstat(int heap_status, byte *str); -void heapstat0(int heap_status); - -void HC_OpenDebug(); -void HC_CloseDebug(); - -#endif /* __16HC__ */ +/* Project 16 Source Code~ + * Copyright (C) 2012-2019 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover + * + * This file is part of Project 16. + * + * Project 16 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 3 of the License, or + * (at your option) any later version. + * + * Project 16 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, see , or + * write to the Free Software Foundation, Inc., 51 Franklin Street, + * Fifth Floor, Boston, MA 02110-1301 USA. + * + */ +/* + heap check +*/ + +#ifndef __16HC__ +#define __16HC__ + +#include "src/lib/16_head.h" + +typedef struct heapusage +{ + unsigned long h_free, h_total, h_used; + int heap_status; +} hc_use_t; + +#ifdef __WATCOMC__ +#define NPTR __near +#endif + +#ifdef __BORLANDC__ +#define NPTR + +#define _HEAPBADBEGIN 2 /* heap header is corrupted */ +#define _HEAPBADNODE 3 /* heap entry is corrupted */ +#define _HEAPBADPTR 5 /* invalid heap entry pointer (_heapwalk) */ +#endif + +//long HC_Newfarcoreleft(); +void NPTR* HC_LargestFreeBlock(size_t* Size); +size_t HC_coreleft(void); +void far* HC_LargestFarFreeBlock(dword* Size); +unsigned long HC_farcoreleft(void); +//size_t HC_GetFreeSize(void); +unsigned long HC_GetFarFreeSize(void); +size_t HC_GetNearFreeSize(void); + +void HC_heapdump(global_game_variables_t *gvar); +void HCL_heapstatLogWrite(global_game_variables_t *gvar, int heap_status, byte *str); +void HCL_heapstat(int heap_status); + +void HC_OpenDebug(global_game_variables_t *gvar); +void HC_CloseDebug(global_game_variables_t *gvar); + +#ifdef __WATCOMC__ +unsigned long farcoreleft(); +unsigned long coreleft(); +#endif + +#endif /* __16HC__ */