From 0e57f0c510b7d7eb688695359048a1f0a585e26a Mon Sep 17 00:00:00 2001 From: rmanfredi Date: Thu, 24 Aug 2006 12:32:52 +0000 Subject: Moving project to sourceforge. git-svn-id: svn://svn.code.sf.net/p/dist/code/trunk/dist@1 2592e710-e01b-42a5-8df0-11608a6cc53d --- mcon/U/mallocsrc.U | 171 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 171 insertions(+) create mode 100644 mcon/U/mallocsrc.U (limited to 'mcon/U/mallocsrc.U') diff --git a/mcon/U/mallocsrc.U b/mcon/U/mallocsrc.U new file mode 100644 index 0000000..79da8a1 --- /dev/null +++ b/mcon/U/mallocsrc.U @@ -0,0 +1,171 @@ +?RCS: $Id$ +?RCS: +?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi +?RCS: +?RCS: You may redistribute only under the terms of the Artistic Licence, +?RCS: as specified in the README file that comes with the distribution. +?RCS: You may reuse parts of this distribution only within the terms of +?RCS: that same Artistic Licence; a copy of which may be found at the root +?RCS: of the source tree for dist 4.0. +?RCS: +?RCS: $Log: mallocsrc.U,v $ +?RCS: Revision 3.0.1.2 1997/02/28 16:10:26 ram +?RCS: patch61: added support for Free_t, the type of free() +?RCS: patch61: replaced .o with $_o all over the place +?RCS: +?RCS: Revision 3.0.1.1 1994/05/06 15:10:46 ram +?RCS: patch23: added support for MYMALLOC, mainly for perl5 (ADO) +?RCS: +?RCS: Revision 3.0 1993/08/18 12:09:12 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:mallocsrc mallocobj usemymalloc malloctype d_mymalloc \ + freetype: Myread \ + Oldconfig package Guess Setvar rm cat +cc +ccflags Findhdr \ + i_malloc i_stdlib sed libs _o ptrsize +?MAKE: -pick add $@ %< +?X: Put near top so that other tests don't erroneously include +?X: -lmalloc. --AD 22 June 1998 +?Y:TOP +?S:usemymalloc: +?S: This variable contains y if the malloc that comes with this package +?S: is desired over the system's version of malloc. People often include +?S: special versions of malloc for effiency, but such versions are often +?S: less portable. See also mallocsrc and mallocobj. +?S: If this is 'y', then -lmalloc is removed from $libs. +?S:. +?S:mallocsrc: +?S: This variable contains the name of the malloc.c that comes with +?S: the package, if that malloc.c is preferred over the system malloc. +?S: Otherwise the value is null. This variable is intended for generating +?S: Makefiles. +?S:. +?S:d_mymalloc: +?S: This variable conditionally defines MYMALLOC in case other parts +?S: of the source want to take special action if MYMALLOC is used. +?S: This may include different sorts of profiling or error detection. +?S:. +?S:mallocobj: +?S: This variable contains the name of the malloc.o that this package +?S: generates, if that malloc.o is preferred over the system malloc. +?S: Otherwise the value is null. This variable is intended for generating +?S: Makefiles. See mallocsrc. +?S:. +?S:freetype: +?S: This variable contains the return type of free(). It is usually +?S: void, but occasionally int. +?S:. +?S:malloctype: +?S: This variable contains the kind of ptr returned by malloc and realloc. +?S:. +?C:Free_t: +?C: This variable contains the return type of free(). It is usually +?C: void, but occasionally int. +?C:. +?C:Malloc_t (MALLOCPTRTYPE): +?C: This symbol is the type of pointer returned by malloc and realloc. +?C:. +?H:#define Malloc_t $malloctype /**/ +?H:#define Free_t $freetype /**/ +?H:. +?C:MYMALLOC: +?C: This symbol, if defined, indicates that we're using our own malloc. +?C:. +?H:#$d_mymalloc MYMALLOC /**/ +?H:. +?LINT:change libs +?X: Cannot test for mallocsrc; it is the unit's name and there is a bug in +?X: the interpreter which defines all the names, even though they are not used. +@if mallocobj +: determine which malloc to compile in +echo " " +case "$usemymalloc" in +[yY]*|true|$define) dflt='y' ;; +[nN]*|false|$undef) dflt='n' ;; +*) + case "$ptrsize" in + 4) dflt='y' ;; + *) dflt='n' ;; + esac + ;; +esac +rp="Do you wish to attempt to use the malloc that comes with $package?" +. ./myread +usemymalloc="$ans" +case "$ans" in +y*|true) + usemymalloc='y' + mallocsrc='malloc.c' + mallocobj="malloc$_o" + d_mymalloc="$define" +?X: Maybe libs.U should be dependent on mallocsrc.U, but then +?X: most packages that use dist probably don't supply their own +?X: malloc, so this is probably an o.k. comprpomise + case "$libs" in + *-lmalloc*) + : Remove malloc from list of libraries to use + echo "Removing unneeded -lmalloc from library list" >&4 + set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'` + shift + libs="$*" + echo "libs = $libs" >&4 + ;; + esac + ;; +*) + usemymalloc='n' + mallocsrc='' + mallocobj='' + d_mymalloc="$undef" + ;; +esac + +@end +@if MALLOCPTRTYPE || Malloc_t || Free_t +: compute the return types of malloc and free +echo " " +$cat >malloc.c < +#include +#ifdef I_MALLOC +#include +#endif +#ifdef I_STDLIB +#include +#endif +#ifdef TRY_MALLOC +void *malloc(); +#endif +#ifdef TRY_FREE +void free(); +#endif +END +@if MALLOCPTRTYPE || Malloc_t +case "$malloctype" in +'') + if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then + malloctype='void *' + else + malloctype='char *' + fi + ;; +esac +echo "Your system wants malloc to return '$malloctype', it would seem." >&4 +@end + +@if Free_t +case "$freetype" in +'') + if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then + freetype='void' + else + freetype='int' + fi + ;; +esac +echo "Your system uses $freetype free(), it would seem." >&4 +@end +$rm -f malloc.[co] +@end -- cgit v1.2.3 From ebbfa02182365d8f2c74f293f3384a73def7bba1 Mon Sep 17 00:00:00 2001 From: rmanfredi Date: Thu, 1 Nov 2012 14:12:29 +0000 Subject: Deprecate the MYMALLOC symbol in favor of USE_MY_MALLOC. git-svn-id: svn://svn.code.sf.net/p/dist/code/trunk/dist@148 2592e710-e01b-42a5-8df0-11608a6cc53d --- mcon/U/mallocsrc.U | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'mcon/U/mallocsrc.U') diff --git a/mcon/U/mallocsrc.U b/mcon/U/mallocsrc.U index 79da8a1..5a4197a 100644 --- a/mcon/U/mallocsrc.U +++ b/mcon/U/mallocsrc.U @@ -68,10 +68,10 @@ ?H:#define Malloc_t $malloctype /**/ ?H:#define Free_t $freetype /**/ ?H:. -?C:MYMALLOC: +?C:USE_MY_MALLOC (MYMALLOC): ?C: This symbol, if defined, indicates that we're using our own malloc. ?C:. -?H:#$d_mymalloc MYMALLOC /**/ +?H:#$d_mymalloc USE_MY_MALLOC /**/ ?H:. ?LINT:change libs ?X: Cannot test for mallocsrc; it is the unit's name and there is a bug in @@ -89,7 +89,7 @@ case "$usemymalloc" in esac ;; esac -rp="Do you wish to attempt to use the malloc that comes with $package?" +rp="Do you wish to attempt to use the malloc() that comes with $package?" . ./myread usemymalloc="$ans" case "$ans" in @@ -100,7 +100,7 @@ y*|true) d_mymalloc="$define" ?X: Maybe libs.U should be dependent on mallocsrc.U, but then ?X: most packages that use dist probably don't supply their own -?X: malloc, so this is probably an o.k. comprpomise +?X: malloc, so this is probably an o.k. compromise case "$libs" in *-lmalloc*) : Remove malloc from list of libraries to use -- cgit v1.2.3 From e7a8e31751b07ae420e647a881c7832bd60e77f2 Mon Sep 17 00:00:00 2001 From: rmanfredi Date: Sat, 3 Nov 2012 00:04:08 +0000 Subject: Added blurb for malloc() superseding. Also define the unit when USE_MY_MALLOC is present, not just $mallocobj. git-svn-id: svn://svn.code.sf.net/p/dist/code/trunk/dist@152 2592e710-e01b-42a5-8df0-11608a6cc53d --- mcon/U/mallocsrc.U | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'mcon/U/mallocsrc.U') diff --git a/mcon/U/mallocsrc.U b/mcon/U/mallocsrc.U index 5a4197a..66d304e 100644 --- a/mcon/U/mallocsrc.U +++ b/mcon/U/mallocsrc.U @@ -21,7 +21,7 @@ ?RCS: ?MAKE:mallocsrc mallocobj usemymalloc malloctype d_mymalloc \ freetype: Myread \ - Oldconfig package Guess Setvar rm cat +cc +ccflags Findhdr \ + Oldconfig package spackage Guess Setvar rm cat +cc +ccflags Findhdr \ i_malloc i_stdlib sed libs _o ptrsize ?MAKE: -pick add $@ %< ?X: Put near top so that other tests don't erroneously include @@ -76,7 +76,7 @@ ?LINT:change libs ?X: Cannot test for mallocsrc; it is the unit's name and there is a bug in ?X: the interpreter which defines all the names, even though they are not used. -@if mallocobj +@if mallocobj || USE_MY_MALLOC : determine which malloc to compile in echo " " case "$usemymalloc" in @@ -89,6 +89,16 @@ case "$usemymalloc" in esac ;; esac +$cat < Date: Wed, 8 May 2013 14:39:33 +0000 Subject: Jumbo typo-fixing patch, courtesy of H.Merijn Brand. git-svn-id: svn://svn.code.sf.net/p/dist/code/trunk/dist@166 2592e710-e01b-42a5-8df0-11608a6cc53d --- mcon/U/mallocsrc.U | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mcon/U/mallocsrc.U') diff --git a/mcon/U/mallocsrc.U b/mcon/U/mallocsrc.U index 66d304e..a71fa59 100644 --- a/mcon/U/mallocsrc.U +++ b/mcon/U/mallocsrc.U @@ -30,7 +30,7 @@ ?S:usemymalloc: ?S: This variable contains y if the malloc that comes with this package ?S: is desired over the system's version of malloc. People often include -?S: special versions of malloc for effiency, but such versions are often +?S: special versions of malloc for efficiency, but such versions are often ?S: less portable. See also mallocsrc and mallocobj. ?S: If this is 'y', then -lmalloc is removed from $libs. ?S:. -- cgit v1.2.3 From a48d4a094464be38b11b832a31394b240e88ea83 Mon Sep 17 00:00:00 2001 From: rmanfredi Date: Wed, 8 May 2013 17:58:00 +0000 Subject: Fixed spelling: Licence -> License. git-svn-id: svn://svn.code.sf.net/p/dist/code/trunk/dist@167 2592e710-e01b-42a5-8df0-11608a6cc53d --- mcon/U/mallocsrc.U | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mcon/U/mallocsrc.U') diff --git a/mcon/U/mallocsrc.U b/mcon/U/mallocsrc.U index a71fa59..a1fec47 100644 --- a/mcon/U/mallocsrc.U +++ b/mcon/U/mallocsrc.U @@ -2,10 +2,10 @@ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: -?RCS: You may redistribute only under the terms of the Artistic Licence, +?RCS: You may redistribute only under the terms of the Artistic License, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of -?RCS: that same Artistic Licence; a copy of which may be found at the root +?RCS: that same Artistic License; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: $Log: mallocsrc.U,v $ -- cgit v1.2.3 From 77e4271ceb24212cfd025be9ce880bdeb5a14013 Mon Sep 17 00:00:00 2001 From: "H.Merijn Brand" Date: Sun, 22 May 2016 17:07:59 +0200 Subject: Remove trailing whitespace in meta-lines in units (#3) --- mcon/U/mallocsrc.U | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mcon/U/mallocsrc.U') diff --git a/mcon/U/mallocsrc.U b/mcon/U/mallocsrc.U index a1fec47..233fc03 100644 --- a/mcon/U/mallocsrc.U +++ b/mcon/U/mallocsrc.U @@ -1,7 +1,7 @@ ?RCS: $Id$ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi -?RCS: +?RCS: ?RCS: You may redistribute only under the terms of the Artistic License, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of -- cgit v1.2.3