git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] index-pack usage of mmap() is unacceptably slower on many OSes other than Linux

From
JGJeff Garzik <jeff@garzik.org>
Date
Dec 19, 2006, 20:02 UTC
Message-ID
<4588453A.3060904@garzik.org>
In-Reply-To
<Pine.LNX.4.64.0612191148270.3483@woody.osdl.org>
Linus Torvalds wrote:
Show 35 quoted lines
> diff --git a/convert-objects.c b/convert-objects.c
> index 8812583..a630132 100644
> --- a/convert-objects.c
> +++ b/convert-objects.c
> @@ -1,7 +1,3 @@
> -#define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */
> -#define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
> -#define _GNU_SOURCE
> -#include <time.h>
>  #include "cache.h"
>  #include "blob.h"
>  #include "commit.h"
> diff --git a/git-compat-util.h b/git-compat-util.h
> index 0272d04..e619e29 100644
> --- a/git-compat-util.h
> +++ b/git-compat-util.h
> @@ -11,6 +11,10 @@
>  
>  #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
>  
> +#define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */
> +#define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
> +#define _GNU_SOURCE
> +
>  #include <unistd.h>
>  #include <stdio.h>
>  #include <sys/stat.h>
> @@ -25,6 +29,10 @@
>  #include <netinet/in.h>
>  #include <sys/types.h>
>  #include <dirent.h>
> +#include <sys/time.h>
> +#include <time.h>
> +#include <signal.h>
> +#include <sys/wait.h>

If you are going to do this, you have to audit -every- file, to make sure git-compat-util.h is -always- the first header.

For example, builtin-mailinfo.c includes git-compat-util.h after ctype.h and iconv.h, which renders your #define _XOPEN_SOURCE 600 useless. /usr/include/features.h has already been included at that point.

	Jeff
Previous: Randal L. SchwartzNext: Junio C Hamano
Message 43 of 51 in “Re: [PATCH] fetch-pack: avoid fixing thin packs when unnecessary”
  1. Johannes SchindelinDec 18, 2006
  2. Nicolas PitreDec 18, 2006
  3. Randal L. SchwartzDec 18, 2006
  4. Nicolas PitreDec 18, 2006
  5. Randal L. SchwartzDec 18, 2006
  6. Nicolas PitreDec 18, 2006
  7. Linus TorvaldsDec 18, 2006
  8. Randal L. SchwartzDec 18, 2006
  9. Martin LanghoffDec 18, 2006
  10. Kyle MoffettDec 22, 2006
  11. Shawn PearceDec 22, 2006
  12. Marco RoelandDec 22, 2006
  13. Andreas EricssonJan 3, 2007
  14. Linus TorvaldsDec 18, 2006
  15. Nicolas PitreDec 19, 2006
  16. Theodore TsoDec 19, 2006
  17. Shawn PearceDec 19, 2006
  18. Linus TorvaldsDec 19, 2006
  19. Shawn PearceDec 19, 2006
  20. Marco RoelandDec 19, 2006
  21. Shawn PearceDec 19, 2006
  22. Shawn PearceDec 19, 2006
  23. Marco RoelandDec 19, 2006
  24. Shawn PearceDec 19, 2006
  25. Marco RoelandDec 19, 2006
  26. Alex RiesenDec 19, 2006
  27. Juergen RuehleDec 21, 2006
  28. Theodore TsoDec 19, 2006
  29. Linus TorvaldsDec 19, 2006
  30. Shawn PearceDec 20, 2006
  31. Shawn PearceDec 20, 2006
  32. Linus TorvaldsDec 19, 2006
  33. Johannes SchindelinDec 19, 2006
  34. Junio C HamanoDec 19, 2006
  35. Jeff KingDec 19, 2006
  36. Andy WhitcroftDec 19, 2006
  37. index-pack usage of mmap() is unacceptably slower on many OSes other than LinuxNicolas Pitre, Dec 19, 2006
  38. Junio C HamanoDec 19, 2006
  39. Nicolas PitreDec 19, 2006
  40. Linus TorvaldsDec 19, 2006
  41. Randal L. SchwartzDec 19, 2006
  42. Randal L. SchwartzDec 19, 2006
  43. Jeff GarzikDec 19, 2006
  44. Junio C HamanoDec 20, 2006
  45. Linus TorvaldsDec 20, 2006
  46. Jeff GarzikDec 20, 2006
  47. Junio C HamanoDec 20, 2006
  48. Junio C HamanoDec 20, 2006
  49. Linus TorvaldsDec 20, 2006
  50. Junio C HamanoDec 20, 2006
  51. Nikolai WeibullDec 20, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.