<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>licheng</author_name>
  <author_url>https://blog.hatena.ne.jp/licheng/</author_url>
  <blog_title>滴了庵日録</blog_title>
  <blog_url>https://lipoyang.hatenablog.com/</blog_url>
  <categories>
    <anon>プログラミング</anon>
  </categories>
  <description>C言語と C#と Rustとで、動的メモリ管理の考え方の違いと、そのメリット・デメリットについて考えます。 (1) C言語の場合 C言語の場合、動的メモリ(ヒープ)は malloc関数で確保し、free関数で解放します。確保したメモリはプログラマが責任をもって解放しなければなりません。下記のコードでは hoge関数内で確保したメモリを呼び出し元の main関数に返し、main関数で利用してから解放しています。 #define _CRT_SECURE_NO_WARNINGS #include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; char* hoge(int cnt) { …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Flipoyang.hatenablog.com%2Fentry%2F2023%2F07%2F18%2F091818&quot; title=&quot;簡単な例で C/C#/Rust のメモリ管理を比較 - 滴了庵日録&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn-ak.f.st-hatena.com/images/fotolife/l/licheng/20230713/20230713101747.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2023-07-18 09:18:18</published>
  <title>簡単な例で C/C#/Rust のメモリ管理を比較</title>
  <type>rich</type>
  <url>https://lipoyang.hatenablog.com/entry/2023/07/18/091818</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
