home *** CD-ROM | disk | FTP | other *** search
- page ,132
- title vmem - VM heap memory routines
- ;***
- ;vmem.asm - VM heap memory routines
- ;
- ; Copyright (c) 1992, Microsoft Corporation. All rights reserved.
- ;
- ;Purpose: To allocate heap memory for VM when we don't know if the fmalloc
- ; and ffree have been compiled large or small.
- ;
- ;*******************************************************************************
-
- include version.inc
- .model large,c
-
- extrn C _ffree:far
- extrn C _fmalloc:far
-
- .data?
-
- extrn C _asizeC:byte
-
- pReturn dd ?
-
- .code _TEXT
-
- _VmMalloc proc
-
- pop word ptr [pReturn+0]
- pop word ptr [pReturn+2]
-
- cmp [_asizeC],0 ;Near code model?
- je @F ;Brif so
- call far ptr _fmalloc
- jmp short Exit
- @@:
- call near ptr _fmalloc
-
- Exit:
- jmp [pReturn] ;Return to caller
-
- _VmMalloc endp
-
-
- _VmFree proc
-
- pop word ptr [pReturn+0]
- pop word ptr [pReturn+2]
-
- cmp [_asizeC],0 ;Near code model?
- je @F ;Brif so
- call far ptr _ffree
- jmp short Exit
- @@:
- call near ptr _ffree
-
- Exit:
- jmp [pReturn] ;Return to caller
-
- _VmFree endp
-
- end
-