xmemdup.c

来自「基于4个mips核的noc设计」· C语言 代码 · 共 26 行

C
26
字号
/* xmemdup.c -- Duplicate a memory buffer, using xcalloc.   This trivial function is in the public domain.   Jeff Garzik, September 1999.  */#ifdef HAVE_CONFIG_H#include "config.h"#endif#include "ansidecl.h"#include "libiberty.h"#include <sys/types.h> /* For size_t. */#ifdef HAVE_STRING_H#include <string.h>#endifPTRxmemdup (input, copy_size, alloc_size)  const PTR input;  size_t copy_size;  size_t alloc_size;{  PTR output = xcalloc (1, alloc_size);  memcpy (output, input, copy_size);  return output;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?