Dismiss
InnovationQ will be updated on Sunday, Oct. 22, from 10am ET - noon. You may experience brief service interruptions during that time.
Browse Prior Art Database

16-Bit Memory Allocation in a 32-Bit Operating System

IP.com Disclosure Number: IPCOM000118784D
Original Publication Date: 1997-Jul-01
Included in the Prior Art Database: 2005-Apr-01
Document File: 2 page(s) / 52K

Publishing Venue

IBM

Related People

Campbell, RG: AUTHOR [+2]

Abstract

Disclosed is a memory management scheme in 32-bit code using sparsely, tiled, sub-allocated memory. The invention solves the problem in a large application that is a mixture of 16- and 32-bit Dynamic Link Libraries (DLLs), of 16-bit code gaining access to 32-bit memory that straddles a 64K segment boundary.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 60% of the total text.

16-Bit Memory Allocation in a 32-Bit Operating System

      Disclosed is a memory management scheme in 32-bit code using
sparsely, tiled, sub-allocated memory.  The invention solves the
problem in a large application that is a mixture of 16- and 32-bit
Dynamic Link Libraries (DLLs), of 16-bit code gaining access to
32-bit memory that straddles a 64K segment boundary.

      In a 32-bit operating system environment (in this case, OS/2*),
when memory for 16-bit code is "suballocated" out of a memory pool, a
risk arises that a portion of the memory returned to the 16-bit code
will overrun a 64K segment boundary.  Since 16-bit memory cannot
address memory that falls on the far side of a 64K segment boundary,
the 16-bit code simply wraps the higher memory back onto itself
inside the 64K segment it currently has access to.  The memory would
then be corrupted, causing the program to die an ungracious death at
random intervals.

      The solution is an initialization-time protection scheme, which
is allocated 16-byte blocks, 8 bytes on each side of a 64K boundary
in the first half of our memory pool.  By using DosAllocSharedMem()
to allocate 4 Megabytes (MB) of memory (sparse and tiled), a function
is coded that places these 16-byte "retired" allocations on each 64KB
boundary from 0MB to 2MB.  Since memory is now allocated on the 64KB
boundaries, this prevents the operating system from suballocating
memory that straddles these boundaries.  This scheme forces the...