www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/01/17/05:00:57

Date: Sun, 17 Jan 1999 11:59:37 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Harold Roman <harold AT giganet DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: UNchain_protected_mode_interrupt_vector?
In-Reply-To: <369E02C7.A7206CB1@giganet.com>
Message-ID: <Pine.SUN.3.91.990117115916.278C-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

On Thu, 14 Jan 1999, Harold Roman wrote:

> How would I use the "free_iret" function with the "chain"
> function?

Why do you need that at all?  Usually, you chain the interrupt at the
beginning of the program and unchain it before exiting.  All memory
allocated by a program is automatically freed when it exits, so you
shouldn't need to free the wrapper.

Are you calling the chain function more than once?  If so, don't.

> This makes the call to the "chain" function with the seginfo
> for the new handler and no wrapper is explicitly created.
> Are you suggesting that the two should be combined? that I
> should create a wrapper for the handler then call the
> "chain" function with the seginfo of the wrapper?

No, the chain function allocates the wrapper internally.

> Well, it is a strange application for sure :). It is a test
> program that exercises and tests a PCI card. It has a main
> loop that calls sub-tests that  test the card in different
> ways. Each sub-test will register it's own interrupt
> handlers, and then de-register them. So, in a long test run,
> thousands of wrappers may be allocated.

If so, you will probably need to change the source of
_go32_dpmi_chain_protected_mode_interrupt_vector.  Currently, it
doesn't plug the address of the wrapper it allocates, so you cannot
free it.

> I observed that memory is disapearing faster than a 100
> bytes at a time. I put calls to
> _go32_dpmi_remaining_virtual_memory around the "chain"
> function and I observed that some times no memory is
> consumed, other times 64KB is lost. (Perhaps this really a
> memory fragmentation problem?)

This probably has nothing to do with the wrappers.  See section 15.2
of the FAQ for some insight on this.

- Raw text -


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