You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 16, 2024. It is now read-only.
<noscript><linkrel="stylesheet" href="../../noscript.css"></noscript><linkrel="icon" type="image/svg+xml" href="../../logo.svg"></head><bodyclass="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><navclass="sidebar"><divclass="sidebar-menu" role="button">☰</div><aclass="sidebar-logo" href="../../alloc/index.html"><divclass="logo-container"><imgclass="rust-logo" src="../../logo.svg" alt="logo"></div>
3
+
</a><divclass="sidebar-elems"><h2class="location">Other items in<br><ahref="../index.html">alloc</a>::<wbr><ahref="index.html">alloc</a></h2><divid="sidebar-vars" data-name="alloc" data-ty="fn" data-relpath=""></div><scriptdefersrc="sidebar-items.js"></script></div></nav><main><divclass="width-limiter"><divclass="sub-container"><aclass="sub-logo-container" href="../../alloc/index.html"><imgclass="rust-logo" src="../../logo.svg" alt="logo"></a><navclass="sub"><divclass="theme-picker"><buttonid="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><imgwidth="18" height="18" alt="Pick another theme!" src="../../brush.svg"></button><divid="theme-choices" role="menu"></div></div><formclass="search-form"><divclass="search-container"><div><selectid="crate-search"><optionvalue="All crates">All crates</option></select><inputclass="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><buttontype="button" id="help-button" title="help">?</button><aid="settings-menu" href="../../settings.html" title="settings"><imgwidth="18" height="18" alt="Change settings" src="../../wheel.svg"></a></div></form></nav></div><sectionid="main-content" class="content"><h1class="fqn"><spanclass="in-band">Function <ahref="../index.html">alloc</a>::<wbr><ahref="index.html">alloc</a>::<wbr><aclass="fn" href="#">alloc</a><buttonid="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><imgsrc="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><spanclass="out-of-band"><spanclass="since" title="Stable since Rust version 1.28.0">1.28.0</span><spanid="render-detail"><aid="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<spanclass="inner">−</span>]</a></span><aclass="srclink" href="../../src/alloc/alloc.rs.html#88-90" title="goto source code">[src]</a></span></h1><divclass="docblock item-decl"><preclass="rust fn"><code>pub unsafe fn alloc(layout: <aclass="struct" href="struct.Layout.html" title="struct alloc::alloc::Layout">Layout</a>) -> <aclass="primitive" href="../../core/primitive.pointer.html">*mut </a><aclass="primitive" href="../../core/primitive.u8.html">u8</a></code></pre></div><detailsclass="rustdoc-toggle top-doc" open><summaryclass="hideme"><span>Expand description</span></summary><divclass="docblock"><p>Allocate memory with the global allocator.</p>
3
4
<p>This function forwards calls to the <ahref="trait.GlobalAlloc.html#tymethod.alloc" title="GlobalAlloc::alloc"><code>GlobalAlloc::alloc</code></a> method
4
5
of the allocator registered with the <code>#[global_allocator]</code> attribute
5
6
if there is one, or the <code>std</code> crate’s default.</p>
<noscript><linkrel="stylesheet" href="../../noscript.css"></noscript><linkrel="icon" type="image/svg+xml" href="../../logo.svg"></head><bodyclass="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><navclass="sidebar"><divclass="sidebar-menu" role="button">☰</div><aclass="sidebar-logo" href="../../alloc/index.html"><divclass="logo-container"><imgclass="rust-logo" src="../../logo.svg" alt="logo"></div>
3
+
</a><divclass="sidebar-elems"><h2class="location">Other items in<br><ahref="../index.html">alloc</a>::<wbr><ahref="index.html">alloc</a></h2><divid="sidebar-vars" data-name="alloc_zeroed" data-ty="fn" data-relpath=""></div><scriptdefersrc="sidebar-items.js"></script></div></nav><main><divclass="width-limiter"><divclass="sub-container"><aclass="sub-logo-container" href="../../alloc/index.html"><imgclass="rust-logo" src="../../logo.svg" alt="logo"></a><navclass="sub"><divclass="theme-picker"><buttonid="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><imgwidth="18" height="18" alt="Pick another theme!" src="../../brush.svg"></button><divid="theme-choices" role="menu"></div></div><formclass="search-form"><divclass="search-container"><div><selectid="crate-search"><optionvalue="All crates">All crates</option></select><inputclass="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><buttontype="button" id="help-button" title="help">?</button><aid="settings-menu" href="../../settings.html" title="settings"><imgwidth="18" height="18" alt="Change settings" src="../../wheel.svg"></a></div></form></nav></div><sectionid="main-content" class="content"><h1class="fqn"><spanclass="in-band">Function <ahref="../index.html">alloc</a>::<wbr><ahref="index.html">alloc</a>::<wbr><aclass="fn" href="#">alloc_zeroed</a><buttonid="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><imgsrc="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><spanclass="out-of-band"><spanclass="since" title="Stable since Rust version 1.28.0">1.28.0</span><spanid="render-detail"><aid="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<spanclass="inner">−</span>]</a></span><aclass="srclink" href="../../src/alloc/alloc.rs.html#159-161" title="goto source code">[src]</a></span></h1><divclass="docblock item-decl"><preclass="rust fn"><code>pub unsafe fn alloc_zeroed(layout: <aclass="struct" href="struct.Layout.html" title="struct alloc::alloc::Layout">Layout</a>) -> <aclass="primitive" href="../../core/primitive.pointer.html">*mut </a><aclass="primitive" href="../../core/primitive.u8.html">u8</a></code></pre></div><detailsclass="rustdoc-toggle top-doc" open><summaryclass="hideme"><span>Expand description</span></summary><divclass="docblock"><p>Allocate zero-initialized memory with the global allocator.</p>
3
4
<p>This function forwards calls to the <ahref="trait.GlobalAlloc.html#method.alloc_zeroed" title="GlobalAlloc::alloc_zeroed"><code>GlobalAlloc::alloc_zeroed</code></a> method
4
5
of the allocator registered with the <code>#[global_allocator]</code> attribute
5
6
if there is one, or the <code>std</code> crate’s default.</p>
0 commit comments