<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title>김 용묵의 절대공간 - 블로그: new와-delete-연산자-이야기에 달린 최근 댓글/트랙백 목록</title>
		<link>http://moogi.new21.org/tc/</link>
		<description>그런즉 이제 애호박, 단호박, 늙은호박 이 셋은 항상 있으나, 그 중에 제일은 늙은호박이니라.</description>
		<language>ko</language>
		<pubDate>Sun, 25 Feb 2024 15:59:41 +0900</pubDate>
		<generator>Textcube 1.7.8 : Con moto</generator>
		<image>
		<title>김 용묵의 절대공간 - 블로그: new와-delete-연산자-이야기에 달린 최근 댓글/트랙백 목록</title>
		<url>http://moogi.new21.org/tc/attach/1/1226640661.jpg</url>
		<link>http://moogi.new21.org/tc/</link>
		<width>216</width>
		<height>185</height>
		<description>그런즉 이제 애호박, 단호박, 늙은호박 이 셋은 항상 있으나, 그 중에 제일은 늙은호박이니라.</description>
		</image>
		<item>
			<title>삼각형님의 댓글</title>
			<link>http://moogi.new21.org/tc/332#comment676</link>
			<description>new와 malloc에 관계에 대해 생각해 본 일이 없었는데 그런거군요. C와 C++은 다른 언어라고 생각하고 보는지라.

new/delete, malloc/free를 섞어 사용해도 작동하는군요.

마지막 문단에
new로 할당한 메모리를 delete로 해제...
에서 delete가 아니라, free아닌가요?</description>
			<author>(삼각형)</author>
			<guid>http://moogi.new21.org/tc/332#comment676</guid>
			<comments>http://moogi.new21.org/tc/332#comment</comments>
			<pubDate>Wed, 28 Jul 2010 14:17:53 +0900</pubDate>
		</item>
		<item>
			<title>사무엘님의 댓글</title>
			<link>http://moogi.new21.org/tc/332#comment677</link>
			<description>예. 어차피 메모리 할당하고 해제하는 건 똑같고, C++ 라이브러리는 C 라이브러리에 의존성이 있는 형태이니까요.
그리고 free가 맞습니다. 저의 실수군요. ^^ 고쳤습니다.</description>
			<author>(사무엘)</author>
			<guid>http://moogi.new21.org/tc/332#comment677</guid>
			<comments>http://moogi.new21.org/tc/332#comment</comments>
			<pubDate>Wed, 28 Jul 2010 21:27:47 +0900</pubDate>
		</item>
		<item>
			<title>김재주님의 댓글</title>
			<link>http://moogi.new21.org/tc/332#comment678</link>
			<description>섞어 쓰면 문제가 될 가능성이 꽤 크죠. 일단 생성자와 소멸자라는 C++ 객체 시스템의 근간을 뒤흔드는 짓이니까요. 어리석은 행동이 될 가능성이 매우 높습니다.</description>
			<author>(김재주)</author>
			<guid>http://moogi.new21.org/tc/332#comment678</guid>
			<comments>http://moogi.new21.org/tc/332#comment</comments>
			<pubDate>Thu, 29 Jul 2010 01:06:54 +0900</pubDate>
		</item>
		<item>
			<title>사무엘님의 댓글</title>
			<link>http://moogi.new21.org/tc/332#comment679</link>
			<description>생성자/소멸자나 가상 함수가 있는 개체를 malloc/free질 하는 건 당연히 있을 수 없는 일이고요.
순수하게 메모리 할당/해제만 하면 되는 기본 자료형이나 구조체만으로 한정해도 C 방식과 C++ 방식의 혼용은 비추라는 것입니다. ^^</description>
			<author>(사무엘)</author>
			<guid>http://moogi.new21.org/tc/332#comment679</guid>
			<comments>http://moogi.new21.org/tc/332#comment</comments>
			<pubDate>Thu, 29 Jul 2010 15:18:18 +0900</pubDate>
		</item>
		<item>
			<title>김기윤님의 댓글</title>
			<link>http://moogi.new21.org/tc/332#comment680</link>
			<description>디버깅할때 new 문장 에서 step into 하면 들어가는 void *__CRTDECL operator new(size_t size) _THROW1(_STD bad_alloc) 이 그거군요!

평소에는 제대로 쳐다보지도 않았는데, 자세히 보니 malloc 사용된게 보이네요!

그런데, delete 에서는 free가 사용되었다는 예측은 가지만, step into 해도 따로 함수로 들어가지는 않네요.</description>
			<author>(김기윤)</author>
			<guid>http://moogi.new21.org/tc/332#comment680</guid>
			<comments>http://moogi.new21.org/tc/332#comment</comments>
			<pubDate>Thu, 20 Jan 2011 14:16:01 +0900</pubDate>
		</item>
		<item>
			<title>사무엘님의 댓글</title>
			<link>http://moogi.new21.org/tc/332#comment681</link>
			<description>아무래도 delete 연산자에 대해 step in을 하면, 해당 개체의 소멸자 함수로 들어가지, operator delete 안으로 들어가는 건 딱히 못 본 것 같습니다. 그래도 heap 쪽에서 에러가 나면, 디버거가 operator delete 안에서 멈춰섰다고 안내는 잘 해 줍니다. ^^</description>
			<author>(사무엘)</author>
			<guid>http://moogi.new21.org/tc/332#comment681</guid>
			<comments>http://moogi.new21.org/tc/332#comment</comments>
			<pubDate>Thu, 20 Jan 2011 17:47:54 +0900</pubDate>
		</item>
	</channel>
</rss>
