Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Linux/arch/nios2/lib/   (Open Source Betriebssystem Version 6.17.9©)  Datei vom 24.10.2025 mit Größe 1 kB image not shown  

Quelle  memmove.c   Sprache: C

 
/*
 * Copyright (C) 2011 Tobias Klauser <tklauser@distanz.ch>
 * Copyright (C) 2004 Microtronix Datacom Ltd
 *
 * This file is subject to the terms and conditions of the GNU General Public
 * License.  See the file "COPYING" in the main directory of this archive
 * for more details.
 */


#include <linux/types.h>
#include <linux/string.h>

void *memmove(void *d, const void *s, size_t count)
{
 unsigned long dst, src;

 if (!count)
  return d;

 if (d < s) {
  dst = (unsigned long) d;
  src = (unsigned long) s;

  if ((count < 8) || ((dst ^ src) & 3))
   goto restup;

  if (dst & 1) {
   *(char *)dst++ = *(char *)src++;
   count--;
  }
  if (dst & 2) {
   *(short *)dst = *(short *)src;
   src += 2;
   dst += 2;
   count -= 2;
  }
  while (count > 3) {
   *(long *)dst = *(long *)src;
   src += 4;
   dst += 4;
   count -= 4;
  }
restup:
  while (count--)
   *(char *)dst++ = *(char *)src++;
 } else {
  dst = (unsigned long) d + count;
  src = (unsigned long) s + count;

  if ((count < 8) || ((dst ^ src) & 3))
   goto restdown;

  if (dst & 1) {
   src--;
   dst--;
   count--;
   *(char *)dst = *(char *)src;
  }
  if (dst & 2) {
   src -= 2;
   dst -= 2;
   count -= 2;
   *(short *)dst = *(short *)src;
  }
  while (count > 3) {
   src -= 4;
   dst -= 4;
   count -= 4;
   *(long *)dst = *(long *)src;
  }
restdown:
  while (count--) {
   src--;
   dst--;
   *(char *)dst = *(char *)src;
  }
 }

 return d;
}

Messung V0.5
C=95 H=92 G=93

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.