Movatterモバイル変換


[0]ホーム

URL:


D Logo
Menu
Search

Library Reference

version 2.112.0

overview

Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.Requires a signed-in GitHub account. This works well for small changes.If you'd like to make larger changes you may want to consider usinga local clone.

dmd.common.smallbuffer

Common string functions including filename manipulation.
Authors:
Walter Bright,https://www.digitalmars.com
License:
Boost License 1.0

Sourcecommon/smallbuffer.d

Documentationhttps://dlang.org/phobos/dmd_common_smallbuffer.html

Coveragehttps://codecov.io/gh/dlang/dmd/src/master/compiler/src/dmd/common/smallbuffer.d

structSmallBuffer(Element);
Defines a temporary array ofElements using a fixed-length buffer as back store. If the lengthof the buffer suffices, it is readily used. Otherwise,malloc is used toallocate memory for the array andfree is used for deallocation in thedestructor.
This type is meant to use exclusively as an automatic variable. It is notdefault constructible or copyable.
Examples:
ditto
char[230] buf =void;auto a =SmallBuffer!char(10, buf);assert(a[]is buf[0 .. 10]);auto b =SmallBuffer!char(1000, buf);assert(b[] !is buf[]);b.create(1000);assert(b.length == 1000);assert(b[] !is buf[]);
this(size_tlen, return scope Element[]buffer) scope;
Construct a SmallBuffer
Parameters:
size_tlennumber of elements in array
Element[]bufferslice to use as backing-store, if len will fit in it
voidcreate(size_tlen) scope;
Resize existing SmallBuffer.
Parameters:
size_tlennumber of elements after resize
Copyright © 1999-2026 by theD Language Foundation | Page generated byDdoc on Fri Feb 20 17:56:13 2026

[8]ページ先頭

©2009-2026 Movatter.jp