GC and header fixes from Andrew Reilly

svn: r8385
This commit is contained in:
Matthew Flatt 2008-01-23 01:59:22 +00:00
parent b2dbe63ed1
commit 3443acd61a
6 changed files with 8 additions and 4 deletions

View File

@ -16,3 +16,5 @@ ways:
* Added case in "configure" sparc64-*-freebsd* to existing sparc64 line * Added case in "configure" sparc64-*-freebsd* to existing sparc64 line
* Added case in "configure" x86_64-*-openbsd* to the existing x86_64 line * Added case in "configure" x86_64-*-openbsd* to the existing x86_64 line
* Changed ffi_common.h to always include <string.h>

View File

@ -33,7 +33,7 @@ char *alloca ();
#endif #endif
/* Check for the existence of memcpy. */ /* Check for the existence of memcpy. */
#if STDC_HEADERS #if 1 || STDC_HEADERS
# include <string.h> # include <string.h>
#else #else
# ifndef HAVE_MEMCPY # ifndef HAVE_MEMCPY

View File

@ -291,13 +291,13 @@ inline static struct mpage **create_page_map(void *p) {
pos = (unsigned long)p >> 48; pos = (unsigned long)p >> 48;
page_maps = page_mapss[pos]; page_maps = page_mapss[pos];
if (!page_maps) { if (!page_maps) {
page_maps = (struct mpage ***)malloc(sizeof(struct mpage **) * (1 << 16)); page_maps = (struct mpage ***)calloc(1 << 16, sizeof(struct mpage **));
page_mapss[pos] = page_maps; page_mapss[pos] = page_maps;
} }
pos = ((unsigned long)p >> 32) & ((1 << 16) - 1); pos = ((unsigned long)p >> 32) & ((1 << 16) - 1);
page_map = page_maps[pos]; page_map = page_maps[pos];
if (!page_map) { if (!page_map) {
page_map = (struct mpage **)malloc(sizeof(struct mpage *) * (1 << USEFUL_ADDR_BITS)); page_map = (struct mpage **)calloc(1 << USEFUL_ADDR_BITS, sizeof(struct mpage *));
page_maps[pos] = page_map; page_maps[pos] = page_map;
} }
return page_map; return page_map;

View File

@ -53,7 +53,7 @@
extern FILE *popen(); extern FILE *popen();
#endif #endif
#if defined(SYSV) || defined(SVR4) || defined(VMS) #if defined(__FreeBSD__) || defined(SYSV) || defined(SVR4) || defined(VMS)
#include <string.h> #include <string.h>
#ifndef index #ifndef index

View File

@ -8,6 +8,7 @@
#include <assert.h> #include <assert.h>
#include <wxtimeout.h> #include <wxtimeout.h>
#include "xwTools3d.h" #include "xwTools3d.h"
#include "xwTabString.h"
#include <./xwArrowP.h> #include <./xwArrowP.h>
static void activate_and_start_timer( static void activate_and_start_timer(
#if NeedFunctionPrototypes #if NeedFunctionPrototypes

View File

@ -416,3 +416,4 @@ resource. It is the same routine as for the shadows in the XfwfFrame widget.
@incl <assert.h> @incl <assert.h>
@incl <wxtimeout.h> @incl <wxtimeout.h>
@incl "xwTools3d.h" @incl "xwTools3d.h"
@incl "xwTabString.h"