OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [branches/] [oc/] [gdb-5.0/] [libiberty/] [xmemdup.c] - Blame information for rev 106

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 106 markom
/* xmemdup.c -- Duplicate a memory buffer, using xcalloc.
2
   This trivial function is in the public domain.
3
   Jeff Garzik, September 1999.  */
4
 
5
#ifdef HAVE_CONFIG_H
6
#include "config.h"
7
#endif
8
#include "ansidecl.h"
9
#include "libiberty.h"
10
 
11
#include <sys/types.h> /* For size_t. */
12
 
13
PTR
14
xmemdup (input, copy_size, alloc_size)
15
  const PTR input;
16
  size_t copy_size;
17
  size_t alloc_size;
18
{
19
  PTR output = xcalloc (1, alloc_size);
20
  memcpy (output, input, copy_size);
21
  return output;
22
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.