home *** CD-ROM | disk | FTP | other *** search
-
- /* u4huge_a.c Huge Memory Allocation
- (c)Copyright Sequiter Software Inc., 1987-1990. All rights reserved.
- */
-
- #include "p4misc.h"
- #include "d4all.h"
- #include "u4error.h"
-
- #ifdef NO_HUGE
- #include <stdlib.h>
- #else
- #ifdef TURBO
- #include <dos.h>
- #include <alloc.h>
- #else
- #include <malloc.h>
- #endif
- #endif
-
-
- #ifdef IS_386
- #define MAX_ALLOC 0x7FFFFFFFL
- #else
- #ifdef NO_HUGE
- #define MAX_ALLOC 0xFFE0
- #endif
- #endif
-
-
- void H_PTR u4huge_alloc( long num )
- {
- #ifdef NO_HUGE
- if ( num > MAX_ALLOC )
- return( (void H_PTR) 0 ) ;
-
- return( h4alloc_try( (int) num) ) ;
- #else
- #ifdef TURBO
- if ( num >= 700000L )
- return( (void H_PTR) 0 ) ;
- return( (void H_PTR) farmalloc((unsigned long) num) ) ;
- #else
- return( halloc( num, 1 ) ) ;
- #endif
- #endif
- }
-
-
- void u4huge_free( void H_PTR ptr )
- {
- #ifdef NO_HUGE
- h4free_memory( ptr ) ;
- #else
- #ifdef TURBO
- farfree( (void far *) ptr ) ;
- #else
- hfree(ptr) ;
- #endif
- #endif
- }
-