bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: strcache scaling issue


From: Mark Marshall
Subject: Re: strcache scaling issue
Date: Mon, 10 Jan 2011 12:27:15 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7

On 09/01/2011 07:59, Ralf Wildenhues wrote:
Index: strcache.c
===================================================================
RCS file: /cvsroot/make/make/strcache.c,v
retrieving revision 2.9
diff -u -r2.9 strcache.c
--- strcache.c  13 Jul 2010 01:20:43 -0000      2.9
+++ strcache.c  9 Jan 2011 07:55:51 -0000
@@ -1,5 +1,5 @@
  /* Constant string caching for GNU Make.
-Copyright (C) 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
  This file is part of GNU Make.

  GNU Make is free software; you can redistribute it and/or modify it under the
@@ -20,10 +20,6 @@

  #include "hash.h"

-/* The size (in bytes) of each cache buffer.
-   Try to pick something that will map well into the heap.  */
-#define CACHE_BUFFER_SIZE   (8192 - 16)
-

  /* A string cached here will never be freed, so we don't need to worry about
     reference counting.  We just store the string, and then remember it in a
@@ -34,9 +30,18 @@
    char *end;                /* Pointer to the beginning of the free space.  */
    int count;                /* # of strings in this buffer (for stats).  */
    int bytesfree;            /* The amount of the buffer that is free.  */
-  char buffer[1];           /* The buffer comes after this.  */
+  char buffer[1];           /* The buffer starts here.  */
  };

+/* The size of the strcache struct overhead.  */
+#define STRCACHE_HEADER_SIZE (sizeof (struct strcache) - 1)

This would be better written:

#define STRCACHE_HEADER_SIZE offsetof (struct strcache, buffer)

MM




reply via email to

[Prev in Thread] Current Thread [Next in Thread]