diff options
Diffstat (limited to 'src/3rdparty/zlib/zutil.c')
| -rw-r--r-- | src/3rdparty/zlib/zutil.c | 78 | 
1 files changed, 0 insertions, 78 deletions
| diff --git a/src/3rdparty/zlib/zutil.c b/src/3rdparty/zlib/zutil.c index 0ef4f99f5..11cafad6b 100644 --- a/src/3rdparty/zlib/zutil.c +++ b/src/3rdparty/zlib/zutil.c @@ -185,84 +185,6 @@ void zmemzero(dest, len)  #ifdef SYS16BIT -#ifdef __TURBOC__ -/* Turbo C in 16-bit mode */ - -#  define MY_ZCALLOC - -/* Turbo C malloc() does not allow dynamic allocation of 64K bytes - * and farmalloc(64K) returns a pointer with an offset of 8, so we - * must fix the pointer. Warning: the pointer must be put back to its - * original form in order to free it, use zcfree(). - */ - -#define MAX_PTR 10 -/* 10*64K = 640K */ - -local int next_ptr = 0; - -typedef struct ptr_table_s { -    voidpf org_ptr; -    voidpf new_ptr; -} ptr_table; - -local ptr_table table[MAX_PTR]; -/* This table is used to remember the original form of pointers - * to large buffers (64K). Such pointers are normalized with a zero offset. - * Since MSDOS is not a preemptive multitasking OS, this table is not - * protected from concurrent access. This hack doesn't work anyway on - * a protected system like OS/2. Use Microsoft C instead. - */ - -voidpf zcalloc (voidpf opaque, unsigned items, unsigned size) -{ -    voidpf buf = opaque; /* just to make some compilers happy */ -    ulg bsize = (ulg)items*size; - -    /* If we allocate less than 65520 bytes, we assume that farmalloc -     * will return a usable pointer which doesn't have to be normalized. -     */ -    if (bsize < 65520L) { -        buf = farmalloc(bsize); -        if (*(ush*)&buf != 0) return buf; -    } else { -        buf = farmalloc(bsize + 16L); -    } -    if (buf == NULL || next_ptr >= MAX_PTR) return NULL; -    table[next_ptr].org_ptr = buf; - -    /* Normalize the pointer to seg:0 */ -    *((ush*)&buf+1) += ((ush)((uch*)buf-0) + 15) >> 4; -    *(ush*)&buf = 0; -    table[next_ptr++].new_ptr = buf; -    return buf; -} - -void  zcfree (voidpf opaque, voidpf ptr) -{ -    int n; -    if (*(ush*)&ptr != 0) { /* object < 64K */ -        farfree(ptr); -        return; -    } -    /* Find the original pointer */ -    for (n = 0; n < next_ptr; n++) { -        if (ptr != table[n].new_ptr) continue; - -        farfree(table[n].org_ptr); -        while (++n < next_ptr) { -            table[n-1] = table[n]; -        } -        next_ptr--; -        return; -    } -    ptr = opaque; /* just to make some compilers happy */ -    Assert(0, "zcfree: ptr not found"); -} - -#endif /* __TURBOC__ */ - -  #ifdef M_I86  /* Microsoft C in 16-bit mode */ | 
