|
|
Microsoft OS/2 SDK 03-01-1988
/*
* Example of DosReallocSeg.
*
* Shows how to allocate a segment, then change
* it's size. DosReallocSeg can be used to grow or
* shrink a segment. Works Family API.
*
* Compile as: cl -AL -G0 -Lp realloc.c
*
* Created by Microsoft Corp. 1986
*/
#define INCL_DOSMEMMGR
#include <os2def.h>
#include <bsedos.h>
#define NOTSHARED 0
main()
{
SEL segment;
/* allocate a segment, 1024 bytes big */
DosAllocSeg(1024, &segment, NOTSHARED);
/* now grow it to 4000 bytes */
DosReallocSeg(4000, segment);
/* now shrink it to 20 bytes */
DosReallocSeg(20, segment);
}
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.