Home

Communication Horizons
established 1986

Home
Contact

 

Knowledgebase Index
About Us
Contact
Legacy Products


Communication Horizons
65 High Ridge Rd. #428
Stamford CT 06905

support

800-480-1604
203-321-1278
fax  286-1056

       

Knowledgebase


>>ITEM : N01002

>>DATE: 07/30/97

>>TYPE:

>>TITLE:
N_COMPRESS or N_DCOMPRESS cause GPF or memory fault

>>PRODUCT(S):
NetLib 2.5x for FoxPro Windows
NetLib 2.5x for FoxPro DOS
NetLib 6.5x for Clipper

>>PLATFORMS(S):

>>SUMMARY:
When repeatedly calling N_COMPRESS or N_DCOMPRESS with large buffers, the program may eventually crash with a GPF error or an "out of memory" error.

>>MORE INFORMATION:
Due to FoxPro's internal memory management, this problem occurs primarily in FoxPro. However, the recommendations below are also applicable to Clipper.

>>RESOLUTION/FIX:

  1. Use A_ALLOC() instead of SPACE() or REPL() to create a receive buffer for N_COMPRESS, N_DCOMPRESS.
  2. Add a small amount of "slack space" (about 32 bytes) to each receive buffer, since NetLib also uses the receive buffer as an internal work buffer. See example below.

>>EXAMPLE(S):
** Before...
cIn = A->memo
nLen = LEN(cIn)
cOut = SPACE(nLen)
nLen = N_COMPRESS(cIn, @cOut, nLen)
REPLACE A->memo WITH LEFT(cOut,nLen)

** After ...
#define SLACK_SPACE 32 && provide additional work space
cIn = A->memo
nLen = LEN(cIn)
Out = A_ALLOC(nLen+SLACK_SPACE)
nLen = N_COMPRESS(cIn,Out,nLen)
REPLACE A->memo WITH A_STRING(Out,nLen)
=A_FREE(Out)

>>SEE ALSO:

>>COPYRIGHT 1997 Communication Horizons
All rights reserved worldwide. No distribution without specific consent of publisher.


Knowledgebase Top Home

 

© Copyright 2001 Communication Horizons LLC.
“NetLib” and “Encryptionizer” are Registered Trademarks of Communication Horizons.
US and international patents pending.
Updated 29 Dec 2001