Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
capnproto
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
capnproto
Commits
70fcf7f5
Commit
70fcf7f5
authored
Aug 12, 2018
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update allocateSegment() doc comment. Fixes #636.
parent
d5346e46
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
message.h
c++/src/capnp/message.h
+8
-6
No files found.
c++/src/capnp/message.h
View file @
70fcf7f5
...
...
@@ -183,13 +183,15 @@ public:
// new objects in this message.
virtual
kj
::
ArrayPtr
<
word
>
allocateSegment
(
uint
minimumSize
)
=
0
;
// Allocates an array of at least the given number of words, throwing an exception or crashing if
// this is not possible. It is expected that this method will usually return more space than
// requested, and the caller should use that extra space as much as possible before allocating
// more. The returned space remains valid at least until the MessageBuilder is destroyed.
// Allocates an array of at least the given number of zero'd words, throwing an exception or
// crashing if this is not possible. It is expected that this method will usually return more
// space than requested, and the caller should use that extra space as much as possible before
// allocating more. The returned space remains valid at least until the MessageBuilder is
// destroyed.
//
// Cap'n Proto will only call this once at a time, so the subclass need not worry about
// thread-safety.
// allocateSegment() is responsible for zeroing the memory before returning. This is required
// because otherwise the Cap'n Proto implementation would have to zero the memory anyway, and
// many allocators are able to provide already-zero'd memory more efficiently.
template
<
typename
RootType
>
typename
RootType
::
Builder
initRoot
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment