Staging
v0.5.1
https://github.com/python/cpython
Revision 82550d5b8654cee55357cef303038effa4e0448a authored by Tim Peters on 08 April 2003, 19:02:34 UTC, committed by Tim Peters on 08 April 2003, 19:02:34 UTC
backporting fixes so that garbage collection doesn't have to trigger
execution of arbitrary Python code just to figure out whether
an object has a __del__ method.
1 parent 71e300e
Raw File
Tip revision: 82550d5b8654cee55357cef303038effa4e0448a authored by Tim Peters on 08 April 2003, 19:02:34 UTC
Added private API function _PyInstance_Lookup(). This is part of
Tip revision: 82550d5
memmove.c

/* A perhaps slow but I hope correct implementation of memmove */

extern char *memcpy(char *, char *, int);

char *
memmove(char *dst, char *src, int n)
{
	char *realdst = dst;
	if (n <= 0)
		return dst;
	if (src >= dst+n || dst >= src+n)
		return memcpy(dst, src, n);
	if (src > dst) {
		while (--n >= 0)
			*dst++ = *src++;
	}
	else if (src < dst) {
		src += n;
		dst += n;
		while (--n >= 0)
			*--dst = *--src;
	}
	return realdst;
}
back to top