[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/unexmacosx.c [lexbind]
From: |
Miles Bader |
Subject: |
[Emacs-diffs] Changes to emacs/src/unexmacosx.c [lexbind] |
Date: |
Tue, 14 Oct 2003 19:23:27 -0400 |
Index: emacs/src/unexmacosx.c
diff -c emacs/src/unexmacosx.c:1.1.2.1 emacs/src/unexmacosx.c:1.1.2.2
*** emacs/src/unexmacosx.c:1.1.2.1 Fri Apr 4 01:21:03 2003
--- emacs/src/unexmacosx.c Tue Oct 14 19:22:47 2003
***************
*** 364,370 ****
}
! #define MAX_UNEXEC_REGIONS 30
int num_unexec_regions;
vm_range_t unexec_regions[MAX_UNEXEC_REGIONS];
--- 364,370 ----
}
! #define MAX_UNEXEC_REGIONS 200
int num_unexec_regions;
vm_range_t unexec_regions[MAX_UNEXEC_REGIONS];
***************
*** 403,408 ****
--- 403,448 ----
unexec_regions_recorder);
}
+ static int
+ unexec_regions_sort_compare (const void *a, const void *b)
+ {
+ vm_address_t aa = ((vm_range_t *) a)->address;
+ vm_address_t bb = ((vm_range_t *) b)->address;
+
+ if (aa < bb)
+ return -1;
+ else if (aa > bb)
+ return 1;
+ else
+ return 0;
+ }
+
+ static void
+ unexec_regions_merge ()
+ {
+ int i, n;
+ vm_range_t r;
+
+ qsort (unexec_regions, num_unexec_regions, sizeof (unexec_regions[0]),
+ &unexec_regions_sort_compare);
+ n = 0;
+ r = unexec_regions[0];
+ for (i = 1; i < num_unexec_regions; i++)
+ {
+ if (r.address + r.size == unexec_regions[i].address)
+ {
+ r.size += unexec_regions[i].size;
+ }
+ else
+ {
+ unexec_regions[n++] = r;
+ r = unexec_regions[i];
+ }
+ }
+ unexec_regions[n++] = r;
+ num_unexec_regions = n;
+ }
+
/* More informational messages routines. */
***************
*** 863,868 ****
--- 903,909 ----
read_load_commands ();
find_emacs_zone_regions ();
+ unexec_regions_merge ();
in_dumped_exec = 1;
***************
*** 935,937 ****
--- 976,981 ----
else
malloc_zone_free (emacs_zone, ptr);
}
+
+ /* arch-tag: 1a784f7b-a184-4c4f-9544-da8619593d72
+ (do not change this comment) */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] Changes to emacs/src/unexmacosx.c [lexbind],
Miles Bader <=