X-Git-Url: http://git.chise.org/gitweb/?p=chise%2Fxemacs-chise.git.1;a=blobdiff_plain;f=src%2Fgmalloc.c;h=56badbad79f2f815cbc16414e33324a65e3fab64;hp=3aad687d1d97b3b3553b0cef8652f724e81eb3d7;hb=716cfba952c1dc0d2cf5c968971f3780ba728a89;hpb=d74da9234cc42e8018b1500105c3892a5c46d5e3;ds=sidebyside diff --git a/src/gmalloc.c b/src/gmalloc.c index 3aad687..56badba 100644 --- a/src/gmalloc.c +++ b/src/gmalloc.c @@ -1018,79 +1018,6 @@ Boston, MA 02111-1307, USA. #include #endif -#if 0 /* FSFmacs */ -/* XEmacs requires an ANSI compiler, and memmove() is part of the ANSI- - mandated functions. For losing systems like SunOS 4, we provide - our own memmove(). */ - -#if (defined (MEMMOVE_MISSING) || \ - !defined(_LIBC) && !defined(STDC_HEADERS) && !defined(USG)) - -/* Snarfed directly from Emacs src/dispnew.c: - XXX Should use system bcopy if it handles overlap. */ -#ifndef emacs - -/* Like bcopy except never gets confused by overlap. */ - -static void -safe_bcopy (char *from, char *to, int size) -{ - if (size <= 0 || from == to) - return; - - /* If the source and destination don't overlap, then bcopy can - handle it. If they do overlap, but the destination is lower in - memory than the source, we'll assume bcopy can handle that. */ - if (to < from || from + size <= to) - bcopy (from, to, size); - - /* Otherwise, we'll copy from the end. */ - else - { - char *endf = from + size; - char *endt = to + size; - - /* If TO - FROM is large, then we should break the copy into - nonoverlapping chunks of TO - FROM bytes each. However, if - TO - FROM is small, then the bcopy function call overhead - makes this not worth it. The crossover point could be about - anywhere. Since I don't think the obvious copy loop is too - bad, I'm trying to err in its favor. */ - if (to - from < 64) - { - do - *--endt = *--endf; - while (endf != from); - } - else - { - for (;;) - { - endt -= (to - from); - endf -= (to - from); - - if (endt < to) - break; - - bcopy (endf, endt, to - from); - } - - /* If SIZE wasn't a multiple of TO - FROM, there will be a - little left over. The amount left over is - (endt + (to - from)) - to, which is endt - from. */ - bcopy (from, to, endt - from); - } - } -} -#endif /* Not emacs. */ - -#define memmove(to, from, size) safe_bcopy ((from), (to), (size)) - -#endif - -#endif /* FSFmacs */ - - #ifndef min #define min(A, B) ((A) < (B) ? (A) : (B)) #endif