Mac OS X 10.4.9 for x86 Source Code gcc 实现源代码

源代码在线查看: new-delete-2.c

软件大小: 38649 K
上传用户: liuchuyuan
关键词: Source Code Mac for
下载地址: 免注册下载 普通下载 VIP

相关代码

				/* APPLE LOCAL file coalescing */				/* Make sure that weak '::new' and '::delete' operators wind				   up in a coalesced section and get called via a stub.  */				/* Author: Ziemowit Laski   */				/* { dg-do compile { target powerpc*-*-darwin* } } */								extern "C" void free(void *);								void operator delete(void*) throw() __attribute__((weak));				void operator delete(void* p) throw() { free(p); }								void operator delete(void*, int) throw() __attribute__((weak));								void *operator new(unsigned long) throw() __attribute__((weak));				void *operator new(unsigned long) throw() { return (void *)0; }								int *foo(void) {				  int *n = new int();				  ::operator delete(n, 0);				  ::operator delete(n);				  return 0;				}								/* { dg-final { scan-assembler "coal" } } */								/* { dg-final { scan-assembler "bl L__Znwm.stub" } } */				/* { dg-final { scan-assembler "bl L__ZdlPvi.stub" } } */				/* { dg-final { scan-assembler "bl L__ZdlPv.stub" } } */							

相关资源