flipboard.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
Welcome to Flipboard on Mastodon. A place for our community of curators and enthusiasts to inform and inspire each other. If you'd like to join please request an invitation via the sign-up page.

Administered by:

Server stats:

1.2K
active users

#記憶體管理

2 posts2 participants0 posts today
GripNews<p>🌘 mem-isolate:安全執行不安全代碼<br>➤ 使用 fork() 實現記憶體隔離,保障程式穩定性。<br>✤ <a href="https://github.com/brannondorsey/mem-isolate" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/brannondorsey/mem-i</span><span class="invisible">solate</span></a><br>mem-isolate 是一個 Rust crate,它允許開發者安全地執行可能不安全的代碼,例如包含記憶體洩漏或未定義行為的程式碼。它通過 fork() 系統呼叫創建一個隔離的子程序,在其中執行代碼,並將結果返回給父程序,從而防止子程序對父程序的記憶體產生任何影響。儘管引入了約 1 毫秒的運行開銷,但它在需要記憶體安全性的場景中提供了一個有價值的權衡。目前僅支援 POSIX 系統。<br>+ 這對於需要呼叫一些舊的 C 函式庫,但又擔心記憶體安全性的專案來說非常有用!<br>+ 雖然有 1 毫秒的開銷,但如果能避免記憶體錯誤,這絕對值得!<br><a href="https://mastodon.social/tags/%E8%BB%9F%E9%AB%94%E9%96%8B%E7%99%BC" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>軟體開發</span></a> <a href="https://mastodon.social/tags/%E5%AE%89%E5%85%A8%E6%80%A7" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>安全性</span></a> <a href="https://mastodon.social/tags/%E8%A8%98%E6%86%B6%E9%AB%94%E7%AE%A1%E7%90%86" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>記憶體管理</span></a></p>
GripNews<p>🌘 擴充緩衝區以避免資料複製<br>➤ 提升 C++ 應用程式效能的關鍵技巧<br>✤ <a href="https://johnnysswlab.com/growing-buffers-to-avoid-copying-data/" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">johnnysswlab.com/growing-buffe</span><span class="invisible">rs-to-avoid-copying-data/</span></a><br>Johnny's Software Lab 探討了在 C++ 中擴充緩衝區以避免不必要的資料複製的技巧。文章指出,資料複製在某些情況下可能非常耗費資源,因此盡量避免是效能優化的重要策略。在 C 語言中,`realloc` 函數可以擴充緩衝區,但 C++ 缺乏等效功能,需要透過自訂容器或模擬 `realloc` 的行為來實現。文章詳細探討了在 Linux 和 Windows 平臺上實現擴充緩衝區的策略,包括使用 `mmap` 和 `VirtualAlloc` 等系統呼叫,並介紹了 jemalloc 提供的相關功能。最後,作者分享了一個簡單的 `jsl::vector` 實作,展示了在擴充緩衝區時避免複製的實際效果。<br>+ 這篇文章深入淺出地解釋了緩衝區擴充的原理和實際操作,對於想提升 C++ 效能的工程師來說非常有幫助。<br>+ 我一直苦惱於資料複製的<br><a href="https://mastodon.social/tags/C" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>C</span></a>++效能 <a href="https://mastodon.social/tags/%E8%A8%98%E6%86%B6%E9%AB%94%E7%AE%A1%E7%90%86" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>記憶體管理</span></a> <a href="https://mastodon.social/tags/%E6%9C%80%E4%BD%B3%E5%8C%96" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>最佳化</span></a></p>
GripNews<p>🌘 理解記憶體管理,第二部分:C++與RAII<br>➤ 探索C++的物件導向特性與記憶體管理<br>✤ <a href="https://educatedguesswork.org/posts/memory-management-2/" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">educatedguesswork.org/posts/me</span><span class="invisible">mory-management-2/</span></a><br>本文探討C++中的記憶體管理,與C語言的手動分配和釋放記憶體的方式不同,C++引入了物件和類的概念,並包含許多進階功能,如模板和閉包。文中舉例闡述了C語言中的結構體及其如何與函數協作,以及如何利用指標修改原始資料。同時,也會簡要介紹類別的繼承特性。<br>+ 這篇文章讓我對C++的記憶體管理有了更深入的瞭解!<br>+ 希望能有更多實作範例來幫助理解類別與繼承的概念。<br><a href="https://mastodon.social/tags/%E8%A8%98%E6%86%B6%E9%AB%94%E7%AE%A1%E7%90%86" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>記憶體管理</span></a></p>
GripNews<p>🌘 理解記憶體管理,第一部分:C<br>➤ 說明瞭記憶體管理的基本概念和在電腦中存儲資料的方法。<br>✤ <a href="https://educatedguesswork.org/posts/memory-management-1/" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">educatedguesswork.org/posts/me</span><span class="invisible">mory-management-1/</span></a><br>本文介紹了軟體系統中的記憶體管理邏輯,從簡單的C語言記憶體管理開始,逐步探討更複雜的系統。透過一個Python程式範例,解釋瞭如何在電腦記憶體中存儲資料,並討論了利用堆疊和堆積兩種不同的記憶體區段來存儲程式資料。<br>+ 讀了這篇文章後,對於記憶體管理這個議題有了更清楚的理解。<br>+ 這篇文章提供了很好的範例,讓我更容易理解記憶體管理在程式設計中的重要性。<br><a href="https://mastodon.social/tags/%E8%A8%98%E6%86%B6%E9%AB%94%E7%AE%A1%E7%90%86" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>記憶體管理</span></a></p>
GripNews<p>🌘 每位開發人員都應該瞭解的記憶體管理<br>➤ 什麼是堆疊和堆?以及不同程式語言中的記憶體管理方式<br>✤ <a href="https://webdeveloper.beehiiv.com/p/memory-management-every-programmer-know" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">webdeveloper.beehiiv.com/p/mem</span><span class="invisible">ory-management-every-programmer-know</span></a><br>本文介紹了重要的編程基礎知識-記憶體管理,並說明瞭堆疊和堆在程式中的作用。堆疊用於記錄程式的函數調用,而堆則用於存儲動態數據,並解釋了不同程式語言中的記憶體管理方式。最後,本文提到了記憶體的釋放和各種程式語言中的記憶體管理方法。<br>+ 很有用的文章,謝謝分享這些有關記憶體管理的知識。<br>+ 對於開發人員來說,瞭解記憶體管理是非常重要的,這篇文章提供了很好的解釋和例子。<br><a href="https://mastodon.social/tags/%E8%A8%98%E6%86%B6%E9%AB%94%E7%AE%A1%E7%90%86" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>記憶體管理</span></a> <a href="https://mastodon.social/tags/%E9%96%8B%E7%99%BC%E4%BA%BA%E5%93%A1" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>開發人員</span></a></p>
GripNews<p>🌘 GitHub - DavidBuchanan314/unsafe-python:一個在「純」Python 程式中協助編寫不安全記憶體碼的函式庫,無需任何匯入(也就是沒有 ctypes 等)<br>➤ 支援在「純」Python 程式中進行不安全記憶體操作的庫<br>✤ <a href="https://github.com/DavidBuchanan314/unsafe-python" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/DavidBuchanan314/un</span><span class="invisible">safe-python</span></a><br>此庫可協助編寫不安全記憶體碼,支援在「純」Python 程式中進行記憶體操作,而無需匯入其他庫。它使用 CPython 的程式碼物件檢視 API 和堆積整理技術,在 CPython 自身的位元碼編譯器中製造「易受攻擊」的程式碼物件。<br>+ 這個函式庫看起來很有趣,但標題有點誇張。<br>+ 聽起來有點危險,但對於測試和研究非常有用。<br><a href="https://mastodon.social/tags/Python%E5%87%BD%E5%BC%8F%E5%BA%AB" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Python函式庫</span></a> <a href="https://mastodon.social/tags/%E8%A8%98%E6%86%B6%E9%AB%94%E7%AE%A1%E7%90%86" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>記憶體管理</span></a> <a href="https://mastodon.social/tags/%E5%AE%89%E5%85%A8%E5%95%8F%E9%A1%8C" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>安全問題</span></a></p>
GripNews<p>🌗 GitHub - ortuman/nuke: ⚡ Go 語言的記憶體管理單位實現<br>➤ Go 語言的記憶體管理方法及其優勢與應用<br>✤ <a href="https://github.com/ortuman/nuke" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="">github.com/ortuman/nuke</span><span class="invisible"></span></a><br>在Go語言中實現了一個記憶體管理單位,通過大塊內存分配節省調用內存分配器帶來的開銷,提高性能,增強快取的局部性,降低垃圾回收的負荷,但需要仔細考慮使用時的收益。具體用法及範例展示,同時支援並發操作。<br>+ 這篇文章以簡潔明瞭的方式介紹瞭如何在Go語言中實現有效的記憶體管理,非常實用。<br>+ 查閱這篇內容後,我對Go語言的記憶體管理有了更深入的瞭解,對此方法的優勢與應用有了清晰的認識。<br><a href="https://mastodon.social/tags/%E8%A8%98%E6%86%B6%E9%AB%94%E7%AE%A1%E7%90%86" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>記憶體管理</span></a> <a href="https://mastodon.social/tags/Go%E8%AA%9E%E8%A8%80" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Go語言</span></a> <a href="https://mastodon.social/tags/%E9%96%8B%E6%BA%90%E9%A0%85%E7%9B%AE" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>開源項目</span></a></p>
GripNews<p>🌘 瞭解堆疊 - 一個美麗的混亂<br>➤ 堆疊的重要概念及其實現方式<br>✤ <a href="https://jackfromeast.site/2023-01/understand-the-heap-a-beautiful-mess.html" rel="nofollow noopener noreferrer" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">jackfromeast.site/2023-01/unde</span><span class="invisible">rstand-the-heap-a-beautiful-mess.html</span></a><br>本文章將介紹堆疊的重要概念,並以Glibc 2.31庫中的ptmalloc為例。堆疊是一個美麗的混亂,我們通常使用它來指動態分配的虛擬記憶體段,但實際上它代表了記憶體池(動態記憶體分配器)的實現,這在不同的機器上可能是複雜且變化多樣的。文章從單線程案例開始介紹malloc的高級行為、堆疊和區塊的整體佈局、監控堆疊的資料結構等,然後引入多線程並介紹t-cache和競爭條件的相關知識。<br>+ 這篇文章對於堆疊的介紹非常詳細,並且以實際的庫為例子,很容易理解。<br>+ 這篇文章的翻譯工作很出色,能夠清楚地表達原文的意思並保持文章的流暢度。<br><a href="https://mastodon.social/tags/%E5%A0%86%E7%96%8A" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>堆疊</span></a> <a href="https://mastodon.social/tags/%E8%A8%98%E6%86%B6%E9%AB%94%E7%AE%A1%E7%90%86" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>記憶體管理</span></a></p>