www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/09/17/09:48:26

Date: Thu, 17 Sep 1998 16:48:15 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Rob Kramer <robk AT cyberway DOT com DOT sg>
cc: djgpp AT delorie DOT com
Subject: Re: IRQ callback wrapper?
In-Reply-To: <MPG.106b5a86e2f92b14989681@news.cyberway.com.sg>
Message-ID: <Pine.SUN.3.91.980917164307.13805H-100000@is>
MIME-Version: 1.0

On Thu, 17 Sep 1998, Rob Kramer wrote:

> I'm using _go32_dpmi_allocate_real_mode_callback_retf() to allocate a
> callback wrapper. Can anyone tell me if it is a terrible sin not to free
> that wrapper before exiting my program?

I think you should free it yourself, since some DPMI servers (notably 
Windows 9X and NT) don't clean up some resources correctly, and a 
real-mode callback is a scarce resource: a server is only required to 
provide 16 callbacks per task.

I don't think it should be a problem with CWSDPMI, though.

Can't you register a function with `atexit' that frees the callback?

> And what about memory that I locked, do I have to unlock it?

No.  Locking memory just tells the VM machinery to never page it out, but 
it doesn't prevent that memory from being released just like any other 
memory.

> I'm experiencing weird crashes of things that I run after my program has
> finished. Running the same program twice won't always work either.

Maybe if you posted the messages printed when they crash, you could get 
more efficient help?

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019