summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorrmawatson <rmawatson@hotmail.com>2017-12-01 18:15:41 +0100
committerWouter van Oortmerssen <aardappel@gmail.com>2017-12-01 09:15:41 -0800
commit53a897731e23320e67602d3d4c56e09caffb98ca (patch)
treec6737d0959d8bc4996f9aa146c25ce684d862dff /python
parentba08b0ec0266f505bfe06e49e993091157e19c93 (diff)
downloadflatbuffers-53a897731e23320e67602d3d4c56e09caffb98ca.tar.gz
flatbuffers-53a897731e23320e67602d3d4c56e09caffb98ca.tar.bz2
flatbuffers-53a897731e23320e67602d3d4c56e09caffb98ca.zip
this is allow custom allocator for obj-api structs/tables. (#4520)
added "native_custom_alloc" attribute to tables/structs, eg. table parent_table( native_custom_alloc:"custom_alloc_name" ) { ... } with a custom allocator defined as template <typename T> class custom_alloc_name : public std::allocator<T> { public: typedef T* pointer; template <class U> struct rebind { typedef custom_alloc_name<U> other; }; pointer allocate(const std::size_t n) { return ....; } void deallocate(T* ptr, std::size_t n) { ... } custom_alloc_name() throw() {} template <class U> custom_alloc_name(const custom_alloc_name<U>&) throw() {} }; };
Diffstat (limited to 'python')
0 files changed, 0 insertions, 0 deletions