Browse Prior Art Database

Automatic Subset Length Calculation on Memory Requests

IP.com Disclosure Number: IPCOM000108218D
Original Publication Date: 1992-May-01
Included in the Prior Art Database: 2005-Mar-22
Document File: 1 page(s) / 41K

Publishing Venue

IBM

Related People

Cox, DR: AUTHOR [+3]

Abstract

This article describes a method for automatically calculating the appropriate memory subset length, as required by the operating system, on a memory subset request. OS/2* requires a caller to request subset size in a multiple of four bytes using the DosSubAlloc()API. To properly free each subset of memory, the application program must maintain the length of each subset, and supply this length as input to the DosSubFree()API.

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

Automatic Subset Length Calculation on Memory Requests

       This article describes a method for automatically
calculating the appropriate memory subset length, as required by the
operating system, on a memory subset request.  OS/2* requires a
caller to request subset size in a multiple of four bytes using the
DosSubAlloc()API.  To properly free each subset of memory, the
application program must maintain the length of each subset, and
supply this length as input to the DosSubFree()API.

      In order to overcome memory related problems in our application
systems, OfficeVision*/2 (OV/2) Office built a Memory Management
subsystem, providing a layer of independence between applications
programs and the OS/2 operating system.  This subsystem is described
in (*).

      Using this subsystem as a base for solving the length
calculation problem, we enhanced the system to automatically adjust
the requested allocation size when a memory subset request is made.
Using the enhanced subsystem, when an application requests a subset
of memory, the subsystem will recalculate and adjust the requested
allocation size so that it is aligned on the four byte boundary
required by OS/2. The application program will be returned an address
of the memory subset, and the actual length of the subset which was
allocated.

      This approach alleviates the application program from having to
calculate the size of each subset in a multiple of four bytes.
*  Tradmark of IBM Corp.

 ...