TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Jonathan de Boyne Pollard
from: Mike Bilow
date: 1995-07-31 17:21:59
subject: compiling P

Jonathan de Boyne Pollard wrote in a message to Phil Crown:

  > I tried Mike's suggestion and add memset() after each malloc() and it
  > still crashes.

 JdBP>   In which case it cannot *possibly* be a problem with
 JdBP> uncommitted memory. 

 JdBP>   Therefore it never *was* a problem with uncommitted
 JdBP> memory. 

Agreed.

 JdBP>   Which fits my assertion that those people who told Mike
 JdBP> that Borland C++'s malloc() allocated uncommitted memory
 JdBP> were talking a load of old tosh.

It is certainly possible, but I was not in a position to test it personally.

 JdBP>   Therefore the best design is to leave the task of freeing
 JdBP> memory up to   the entity that allocated it, and the second
 JdBP> best design is to always   require that memory objects for
 JdBP> which ownership is transferred between   DLLs to be
 JdBP> allocated using the system-level API and not the C++  
 JdBP> runtime heap.

All of what you say is applicable to Phil Crown's problem of interfacing
with "P," but not to my old problem where I neither allocated nor
freed the memory inside the device driver.  I am annoyed that we never had
time to investigate what was really causing the failure I was seeing, since
the workaround worked and the code had to go out the door.
 
-- Mike


---
* Origin: N1BEE BBS +1 401 944 8498 V.34/V.FC/V.32bis/HST16.8 (1:323/107)
SEEN-BY: 105/42 620/243 711/401 409 410 413 430 807 808 809 934 712/407 515
SEEN-BY: 712/628 704 713/888 800/1 7877/2809
@PATH: 323/107 150 3615/50 396/1 270/101 105/103 42 712/515 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.