Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pybind11
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
pybind11
Commits
d40885a1
Commit
d40885a1
authored
Apr 13, 2016
by
Wenzel Jakob
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clarified pickling docs
parent
3d0e6fff
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
docs/advanced.rst
+5
-2
No files found.
docs/advanced.rst
View file @
d40885a1
...
...
@@ -1225,7 +1225,8 @@ looks as follows:
if (t.size() != 2)
throw std::runtime_error("Invalid state!");
/* Invoke the constructor (need to use in-place version) */
/* Invoke the in-place constructor. Note that this is needed even
when the object just has a trivial default constructor */
new (&p) Pickleable(t[0].cast<std::string>());
/* Assign any additional state */
...
...
@@ -1247,7 +1248,9 @@ An instance can now be pickled as follows:
Note that only the cPickle module is supported on Python 2.7. It is also
important to request usage of the highest protocol version using the ``-1``
argument to ``dumps``.
argument to ``dumps``. Failure to follow these two steps will lead to important
pybind11 memory allocation routines to be skipped during unpickling, which will
likely cause memory corruption and/or segmentation faults.
.. seealso::
...
...
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