dthelp: Remove spectaculaly obsolete MSDOS support

This commit is contained in:
Peter Howkins
2018-06-23 01:38:03 +01:00
parent 757249c65b
commit f89139dd84
117 changed files with 7 additions and 695 deletions

View File

@@ -28,9 +28,6 @@
/**/
#include <stdlib.h>
#include <stdio.h>
#if defined(MSDOS)
#include <process.h>
#endif
#include "basic.h"
extern LOGICAL m_heapchk ;
@@ -56,9 +53,6 @@ void m_free(void *block, char *msg)
{
char buffer[32] ;
#if defined(MSDOS)
if (m_heapchk) m_heapdump() ;
#endif
if (m_malftrace) {
#if defined(hpux) || defined(_AIX) || defined(sun)
snprintf(buffer, 32, "%5x:%5x",
@@ -73,46 +67,8 @@ void m_free(void *block, char *msg)
m_trace("\n") ;
}
free(block) ;
#if defined(MSDOS)
if (m_heapchk) m_heapdump() ;
#endif
}
#if defined(MSDOS)
void m_heapdump(void)
{
struct _heapinfo hinfo ;
int heapstatus ;
heapstatus = _heapchk() ;
if (heapstatus == _HEAPOK || heapstatus == _HEAPEMPTY) return ;
printf("\nDumping heap:\n") ;
hinfo._pentry = NULL ;
while ((heapstatus = _heapwalk(&hinfo)) == _HEAPOK)
printf("%6s block at %p of size %4.4X\n",
hinfo._useflag == _USEDENTRY ? "USED" : "FREE",
hinfo._pentry, hinfo._size) ;
switch(heapstatus) {
case _HEAPEMPTY:
printf("OK - empty heap\n\n") ;
break ;
case _HEAPEND:
printf("OK - end of heap\n\n") ;
break ;
case _HEAPBADPTR:
printf("Error - bad pointer to heap\n\n") ;
break ;
case _HEAPBADBEGIN:
printf("Error - bad start of heap\n\n") ;
break ;
case _HEAPBADNODE:
printf("Error - bad node in heap\n\n") ;
break ;
}
m_exit(TRUE) ;
}
#endif
void *m_malloc(size, msg)
int size ;
char *msg ;
@@ -121,14 +77,8 @@ void *m_malloc(size, msg)
void *p ;
size *= sizeof(M_WCHAR);
#if defined(MSDOS)
if (m_heapchk) m_heapdump() ;
#endif
if (! size) return(NULL) ;
p = (void *) malloc(size) ;
#if defined(MSDOS)
if (m_heapchk) m_heapdump() ;
#endif
if (! p) {
m_errline("Unable to allocate space for ") ;
m_errline(msg) ;
@@ -162,14 +112,8 @@ void *m_realloc(ptr, size, msg)
void *p ;
size *= sizeof(M_WCHAR);
#if defined(MSDOS)
if (m_heapchk) m_heapdump() ;
#endif
if (! size) return(NULL) ;
p = (void *) realloc(ptr, size) ;
#if defined(MSDOS)
if (m_heapchk) m_heapdump() ;
#endif
if (! p) {
m_errline("Unable to re-allocate space for ") ;
m_errline(msg) ;