home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 8 Other
/
08-Other.zip
/
S12001.ZIP
/
HALLOC.TXT
< prev
next >
Wrap
Text File
|
1988-07-08
|
4KB
|
96 lines
Library fix for 4M halloc/_fmalloc limit
The files on this disk are for use by owners of Microsoft C Optimizing
Compiler only. These objects may be distributed subject to the restrictions
specified in the Microsoft License Agreement provided with the product.
Copyright (c) Microsoft Corp 1984, 1985, 1986, 1987, 1988. All rights reserved.
-----------------------------------------------------------------------------
The _fmalloc (which is equivalent to malloc in large and compact models)
runtime library functions that was released with version 5.1 of the
Microsoft C Optimizing Compiler imposed an arbitrary limit of 4M as the
amount of memory you could allocate in OS/2. In addition, the halloc runtime
library routine imposed a single allocation limit of 4M on memory requests.
The files described below can be used to replace existing modules in your
libraries in order to overcome these limits. The new limit for _fmalloc
is 16M while the new limit on single allocations with halloc is a function
of the operating system; i.e. you can allocate as much memory as OS/2 will
allow.
To update your libraries, you should copy all of the files on this disk
into the same directory as your libraries. Make sure that the library
manager LIB.EXE is also in the current directory or else in your PATH.
You can then run the file LIBFIX.CMD to update your libraries. If you are
running in DOS or in the DOS Compatibility Box in OS/2, you can run the
batch file LIBFIX.BAT.
NOTE1: LIBFIX.CMD and LIBFIX.BAT assume that your protect mode com-
bined libraries use the default naming convention; i.e. that the protect
mode combined library names are of the form:
XLIBCYP.LIB
where X is the memory model (S,M,C,L) and Y is the floating point option
(E,A,7). For example, LIBFIX will attempt to update the file SLIBCEP.LIB-
the small model emulator library for protect mode. If your protect mode
combined libraries are not of the form given above, it will be necessary
for you to update your libraries manually or else modify the .BAT or .CMD
file so that the proper libraries are updated. A sample command line to
the library manager is:
lib -+halloc.s -+crt0.s slibcep.lib ;
which will update the small model protect mode combined library. If your
protect mode library has a different name- slibce.lib for example, you
would use the command line:
lib -+halloc.s -+crt0.s slibce.lib ;
It is not necessary to update the real mode combined libraries since
the fix to the libraries does not effect programs that use the real mode
libraries.
NOTE2: The library manager will create a backup of each library that
it updates. Once you are satisfied that the update procedure completed
successfully, you can delete the files with the .BAK extension.
Here is a description of the .OBJ files included with this application
note:
============
Replacement modules to fix limit on halloc:
halloc.s halloc.obj for small model libraries
halloc.m halloc.obj for medium model libraries
halloc.c halloc.obj for compact model libraries
halloc.l halloc.obj for large model libraries including
multi-thread and dynamic link libraries
============
Replacement modules to fix limit on _fmalloc:
crt0.s crt0.obj for small model libraries
crt0.m crt0.obj for medium model libraries
crt0.c crt0.obj for compact model libraries
crt0.l crt0.obj for large model libraries
crt0.mt crt0.obj for multi-thread support library LLIBMT.LIB
crt0.cdl crt0.obj for multi-thread DLL library CDLLOBJS.LIB
csu.dll crt0.obj for single thread DLL library LLIBCDLL.LIB
-----------------------------------------------------------------------------
If you are using _fmalloc and you require more than 16M of memory,
you can edit the file BRKCTL.INC which is included with the startup
source code. You will need to change the value MAXSEG_PM in this file
and then rebuild the appropriate modules as outlined in the README.DOC
that is included in the startup code directory. This value was originally
64; the CRT0.OBJ modules on this disk were assembled with the value of
MAXSEG_PM set to 256. If the startup code is not on your hard disk, you
will need to go through the C 5.1 Setup procedure again and choose the
option to copy the startup code to your hard disk.