[gs-cvs] gs/src

Ralph Giles giles at ghostscript.com
Tue Dec 7 21:04:32 PST 2004


Update of /cvs/ghostscript/gs/src
In directory casper2:/tmp/cvs-serv812

Modified Files:
	gp_mac.c gp_macio.c 
Log Message:
Convert gs_malloc() calls in the MacOS gp_* code to unwrapped libc malloc()
now that gs_malloc() requires a memory pointer, which is not available.

Partial fix for bug 687830.

DETAILS:

Only the call in getenv() is active; the one in gp_init() is not used.

This may have been what the earlier libctx patch was trying to do when
it touched gp_macio.c, changing the function call, but not the arguments,
and breaking the 


Index: gp_mac.c
===================================================================
RCS file: /cvs/ghostscript/gs/src/gp_mac.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- gp_mac.c	4 Aug 2004 19:36:12 -0000	1.16
+++ gp_mac.c	8 Dec 2004 05:04:29 -0000	1.17
@@ -89,7 +89,7 @@
 		{
 			GetIndString (string, MACSTRS_RES_ID, i);
 			(void) PtoCstr (string);
-			*p = gs_malloc (1, (size_t) (strlen ((char *) string) + 1), "gp_init");
+			*p = malloc ((size_t) (strlen ((char *) string) + 1));
 			strcpy (*p, (char *) string);
 		}
 	}

Index: gp_macio.c
===================================================================
RCS file: /cvs/ghostscript/gs/src/gp_macio.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- gp_macio.c	10 Aug 2004 13:02:36 -0000	1.34
+++ gp_macio.c	8 Dec 2004 05:04:29 -0000	1.35
@@ -164,7 +164,7 @@
 //		FSMakeFSSpec(pFile.vRefNum, pFile.parID,thepfname, &pfile);
 		convertSpecToPath(&pFile, fpath, 256);
 //		sprintf(fpath,"%s",fpath);
-		p = (char*)malloc(1, (size_t) ( 4*strlen(fpath) + 40), "getenv");
+		p = (char*)malloc((size_t) ( 4*strlen(fpath) + 40));
 		sprintf(p,"%s,%sGhostscript:lib,%sGhostscript:fonts",
 						(char *)&fpath[0],(char *)&fpath[0],
 						(char *)&fpath[0] );
@@ -956,7 +956,7 @@
 	
 	FMDisposeFontIterator(Iterator);
 	
-    /* free any gs_malloc() stuff here */
+    /* free any malloc'd stuff here */
     if (state->name) free(state->name);
     if (state->path) free(state->path);
     if (state->last_container_path) free(state->last_container_path);



More information about the gs-cvs mailing list