delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/2001/09/06/13:27:53

Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-developers-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin-developers/>
List-Post: <mailto:cygwin-developers AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-developers-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-developers-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin-developers AT sources DOT redhat DOT com
Date: Thu, 6 Sep 2001 19:27:27 +0200
From: Corinna Vinschen <vinschen AT redhat DOT com>
To: cygwin-developers AT cygwin DOT com
Subject: Re: I know CVS is hosed
Message-ID: <20010906192727.P537@cygbert.vinschen.de>
Reply-To: cygdev <cygwin-developers AT cygwin DOT com>
Mail-Followup-To: cygwin-developers AT cygwin DOT com
References: <20010906113843 DOT A30174 AT redhat DOT com> <1614189623 DOT 20010906194903 AT logos-m DOT ru> <20010906115913 DOT A30555 AT redhat DOT com> <20010906124935 DOT A31212 AT redhat DOT com>
Mime-Version: 1.0
User-Agent: Mutt/1.2.5i
In-Reply-To: <20010906124935.A31212@redhat.com>; from cgf@redhat.com on Thu, Sep 06, 2001 at 12:49:35PM -0400

On Thu, Sep 06, 2001 at 12:49:35PM -0400, Christopher Faylor wrote:
> In the meantime, if you could check out the enclosed patch and verify
> or disappoint, I'd be grateful.

What exactly should HEAP_FREE be defined as??? Currently it isn't
anywhere.

Corinna

> 
> For the curious, most of the patch is actually just replacing
> cygheap->buckets with a macro so that I could switch back and forth
> between the static array and the cygheap->buckets.
> 
> cgf
> 
> Index: cygheap.cc
> ===================================================================
> RCS file: /cvs/uberbaum/winsup/cygwin/cygheap.cc,v
> retrieving revision 1.37
> diff -p -r1.37 cygheap.cc
> *** cygheap.cc	2001/09/06 03:39:18	1.37
> --- cygheap.cc	2001/09/06 16:47:38
> *************** struct cygheap_entry
> *** 36,41 ****
> --- 36,43 ----
>     };
>   
>   #define NBUCKETS (sizeof (cygheap->buckets) / sizeof (cygheap->buckets[0]))
> + #define cygbuckets cygheap->buckets
> + 
>   #define N0 ((_cmalloc_entry *) NULL)
>   #define to_cmalloc(s) ((_cmalloc_entry *) (((char *) (s)) - (int) (N0->data)))
>   
> *************** cygheap_fixup_in_child (child_info *ci, 
> *** 136,142 ****
>         for (_cmalloc_entry *rvc = cygheap->chain; rvc; rvc = rvc->prev)
>   	{
>   	  cygheap_entry *ce = (cygheap_entry *) rvc->data;
> ! 	  if (rvc->b >= NBUCKETS || ce->type <= HEAP_1_START)
>   	    continue;
>   	  else if (ce->type < HEAP_1_MAX)
>   	    ce->type += HEAP_1_MAX;	/* Mark for freeing after next exec */
> --- 138,144 ----
>         for (_cmalloc_entry *rvc = cygheap->chain; rvc; rvc = rvc->prev)
>   	{
>   	  cygheap_entry *ce = (cygheap_entry *) rvc->data;
> ! 	  if (ce->type < HEAP_1_START)
>   	    continue;
>   	  else if (ce->type < HEAP_1_MAX)
>   	    ce->type += HEAP_1_MAX;	/* Mark for freeing after next exec */
> *************** _cmalloc (int size)
> *** 200,209 ****
>       continue;
>   
>     cygheap_protect->acquire ();
> !   if (cygheap->buckets[b])
>       {
> !       rvc = (_cmalloc_entry *) cygheap->buckets[b];
> !       cygheap->buckets[b] = rvc->ptr;
>         rvc->b = b;
>       }
>     else
> --- 202,211 ----
>       continue;
>   
>     cygheap_protect->acquire ();
> !   if (cygbuckets[b])
>       {
> !       rvc = (_cmalloc_entry *) cygbuckets[b];
> !       cygbuckets[b] = rvc->ptr;
>         rvc->b = b;
>       }
>     else
> *************** static void __stdcall
> *** 223,232 ****
>   _cfree (void *ptr)
>   {
>     cygheap_protect->acquire ();
>     _cmalloc_entry *rvc = to_cmalloc (ptr);
>     DWORD b = rvc->b;
> !   rvc->ptr = cygheap->buckets[b];
> !   cygheap->buckets[b] = (char *) rvc;
>     cygheap_protect->release ();
>   }
>   
> --- 225,235 ----
>   _cfree (void *ptr)
>   {
>     cygheap_protect->acquire ();
> +   ((cygheap_entry *) ptr)->type = HEAP_FREE;
>     _cmalloc_entry *rvc = to_cmalloc (ptr);
>     DWORD b = rvc->b;
> !   rvc->ptr = cygbuckets[b];
> !   cygbuckets[b] = (char *) rvc;
>     cygheap_protect->release ();
>   }
>   

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin AT cygwin DOT com
Red Hat, Inc.

- Raw text -


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