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
863afbe2
Commit
863afbe2
authored
Aug 20, 2013
by
Kenton Varda
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch
parents
70a7bcb7
a2b0c058
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
67 additions
and
48 deletions
+67
-48
layout.c++
c++/src/capnp/layout.c++
+54
-45
2013-08-19-capnproto-0.2.1.md
doc/_posts/2013-08-19-capnproto-0.2.1.md
+10
-0
install.md
doc/install.md
+3
-3
No files found.
c++/src/capnp/layout.c++
View file @
863afbe2
...
...
@@ -119,60 +119,69 @@ struct WirePointer {
// -----------------------------------------------------------------
// Part of pointer that depends on the kind.
union
{
uint32_t
upper32Bits
;
// Note: Originally StructRef, ListRef, and FarRef were unnamed types, but this somehow
// tickled a bug in GCC:
// http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58192
struct
StructRef
{
WireValue
<
WordCount16
>
dataSize
;
WireValue
<
WirePointerCount16
>
ptrCount
;
inline
WordCount
wordSize
()
const
{
return
dataSize
.
get
()
+
ptrCount
.
get
()
*
WORDS_PER_POINTER
;
}
struct
{
WireValue
<
WordCount16
>
dataSize
;
WireValue
<
WirePointerCount16
>
ptrCount
;
KJ_ALWAYS_INLINE
(
void
set
(
WordCount
ds
,
WirePointerCount
rc
))
{
dataSize
.
set
(
ds
);
ptrCount
.
set
(
rc
);
}
KJ_ALWAYS_INLINE
(
void
set
(
StructSize
size
))
{
dataSize
.
set
(
size
.
data
);
ptrCount
.
set
(
size
.
pointers
);
}
};
inline
WordCount
wordSize
()
const
{
return
dataSize
.
get
()
+
ptrCount
.
get
()
*
WORDS_PER_POINTER
;
}
struct
ListRef
{
WireValue
<
uint32_t
>
elementSizeAndCount
;
KJ_ALWAYS_INLINE
(
void
set
(
WordCount
ds
,
WirePointerCount
rc
))
{
dataSize
.
set
(
ds
);
ptrCount
.
set
(
rc
);
}
KJ_ALWAYS_INLINE
(
void
set
(
StructSize
size
))
{
dataSize
.
set
(
size
.
data
);
ptrCount
.
set
(
size
.
pointers
);
}
}
structRef
;
// Also covers capabilities.
KJ_ALWAYS_INLINE
(
FieldSize
elementSize
()
const
)
{
return
static_cast
<
FieldSize
>
(
elementSizeAndCount
.
get
()
&
7
);
}
KJ_ALWAYS_INLINE
(
ElementCount
elementCount
()
const
)
{
return
(
elementSizeAndCount
.
get
()
>>
3
)
*
ELEMENTS
;
}
KJ_ALWAYS_INLINE
(
WordCount
inlineCompositeWordCount
()
const
)
{
return
elementCount
()
*
(
1
*
WORDS
/
ELEMENTS
);
}
struct
{
WireValue
<
uint32_t
>
elementSizeAndCount
;
KJ_ALWAYS_INLINE
(
void
set
(
FieldSize
es
,
ElementCount
ec
))
{
KJ_DREQUIRE
(
ec
<
(
1
<<
29
)
*
ELEMENTS
,
"Lists are limited to 2**29 elements."
);
elementSizeAndCount
.
set
(((
ec
/
ELEMENTS
)
<<
3
)
|
static_cast
<
int
>
(
es
));
}
KJ_ALWAYS_INLINE
(
FieldSize
elementSize
()
const
)
{
return
static_cast
<
FieldSize
>
(
elementSizeAndCount
.
get
()
&
7
);
}
KJ_ALWAYS_INLINE
(
ElementCount
elementCount
()
const
)
{
return
(
elementSizeAndCount
.
get
()
>>
3
)
*
ELEMENTS
;
}
KJ_ALWAYS_INLINE
(
WordCount
inlineCompositeWordCount
()
const
)
{
return
elementCount
()
*
(
1
*
WORDS
/
ELEMENTS
);
}
KJ_ALWAYS_INLINE
(
void
setInlineComposite
(
WordCount
wc
))
{
KJ_DREQUIRE
(
wc
<
(
1
<<
29
)
*
WORDS
,
"Inline composite lists are limited to 2**29 words."
);
elementSizeAndCount
.
set
(((
wc
/
WORDS
)
<<
3
)
|
static_cast
<
int
>
(
FieldSize
::
INLINE_COMPOSITE
));
}
};
KJ_ALWAYS_INLINE
(
void
set
(
FieldSize
es
,
ElementCount
ec
))
{
KJ_DREQUIRE
(
ec
<
(
1
<<
29
)
*
ELEMENTS
,
"Lists are limited to 2**29 elements."
);
elementSizeAndCount
.
set
(((
ec
/
ELEMENTS
)
<<
3
)
|
static_cast
<
int
>
(
es
));
}
struct
FarRef
{
WireValue
<
SegmentId
>
segmentId
;
KJ_ALWAYS_INLINE
(
void
setInlineComposite
(
WordCount
wc
))
{
KJ_DREQUIRE
(
wc
<
(
1
<<
29
)
*
WORDS
,
"Inline composite lists are limited to 2**29 words."
);
elementSizeAndCount
.
set
(((
wc
/
WORDS
)
<<
3
)
|
static_cast
<
int
>
(
FieldSize
::
INLINE_COMPOSITE
));
}
}
listRef
;
KJ_ALWAYS_INLINE
(
void
set
(
SegmentId
si
))
{
segmentId
.
set
(
si
);
}
};
struct
{
WireValue
<
SegmentId
>
segmentId
;
union
{
uint32_t
upper32Bits
;
KJ_ALWAYS_INLINE
(
void
set
(
SegmentId
si
))
{
segmentId
.
set
(
si
);
}
}
farRef
;
StructRef
structRef
;
// Also covers capabilities.
ListRef
listRef
;
FarRef
farRef
;
};
KJ_ALWAYS_INLINE
(
bool
isNull
()
const
)
{
...
...
doc/_posts/2013-08-19-capnproto-0.2.1.md
0 → 100644
View file @
863afbe2
---
layout
:
post
title
:
"
Cap'n
Proto
v0.2.1:
Minor
bug
fixes"
author
:
kentonv
---
Cap'n Proto was just bumped to v0.2.1. This release contains a couple bug fixes, including
a work-around for
[
a GCC bug
](
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58192
)
. If you were
observing any odd memory corruption or crashes in 0.2.0 -- especially if you are compiling with
GCC with optimization enabled but without
`-DNDEBUG`
-- you should upgrade.
doc/install.md
View file @
863afbe2
...
...
@@ -94,9 +94,9 @@ Hopefully, Xcode 5.0 will be released soon with a newer Clang, making this extra
You may download and install the release version of Cap'n Proto like so:
<pre><code>
curl -O
<a
href=
"http://capnproto.org/capnproto-c++-0.2.
0.tar.gz"
>
http://capnproto.org/capnproto-c++-0.2.0
.tar.gz
</a>
tar zxf capnproto-c++-0.2.
0
.tar.gz
cd capnproto-c++-0.2.
0
<pre><code>
curl -O
<a
href=
"http://capnproto.org/capnproto-c++-0.2.
1.tar.gz"
>
http://capnproto.org/capnproto-c++-0.2.1
.tar.gz
</a>
tar zxf capnproto-c++-0.2.
1
.tar.gz
cd capnproto-c++-0.2.
1
./configure
make -j6 check
sudo make install
</code></pre>
...
...
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