public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Ken Brown <kbrown@cornell.edu>
To: cygwin@cygwin.com
Subject: Re: Sv: Sv: Limit for number of child processes
Date: Sat, 29 Aug 2020 06:01:30 -0400	[thread overview]
Message-ID: <26f151fd-7be0-c9d4-e471-e0987476f9a9@cornell.edu> (raw)
In-Reply-To: <20200828173950.GM3272@calimero.vinschen.de>

On 8/28/2020 1:39 PM, Corinna Vinschen wrote:
> On Aug 28 12:02, Ken Brown via Cygwin wrote:
>> On 8/28/2020 9:36 AM, Corinna Vinschen wrote:
>>> As POC, I added a bit of code to maintain a second array, which is only
>>> allocated (using HeapAlloc so as not to spill into the child processes)
>>
>> Should there be a call to HeapFree somewhere, or is there some reason this
>> isn't needed?
> 
> It's local memory in a single process, and it's allocated only once.
> There's no reason to shrink or free this ever again.

It took a night's sleep for this to fully sink in, but I get it now.  A class 
that allocates memory would normally have a destructor that frees the memory. 
But only one instance of this class is created per process, so there's no need 
for the destructor.

I'll send a patch with a comment in case you think it might be helpful to future 
readers of the code.

Ken

      reply	other threads:[~2020-08-29 10:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-26 12:00 sten.kristian.ivarsson
2020-08-26 17:57 ` Corinna Vinschen
2020-08-27 12:17   ` Sv: " sten.kristian.ivarsson
2020-08-28  1:42     ` Ken Brown
2020-08-28  8:35       ` Corinna Vinschen
2020-08-28  8:38       ` Sv: " sten.kristian.ivarsson
2020-08-28 12:29         ` Ken Brown
2020-08-28 13:36           ` Corinna Vinschen
2020-08-28 14:09             ` Sv: " sten.kristian.ivarsson
2020-08-28 16:02             ` Ken Brown
2020-08-28 17:39               ` Corinna Vinschen
2020-08-29 10:01                 ` Ken Brown [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=26f151fd-7be0-c9d4-e471-e0987476f9a9@cornell.edu \
    --to=kbrown@cornell.edu \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).