Lines Matching refs:size

32     static size_t align(size_t size) {
34 return (size + (N-1)) & ~(N-1);
50 static void advance(void*& buffer, size_t& size, size_t offset) {
52 size -= offset;
55 static void advance(void const*& buffer, size_t& size, size_t offset) {
57 size -= offset;
62 static void write(void*& buffer, size_t& size, const T& value) {
64 advance(buffer, size, sizeof(T));
69 static void read(void const*& buffer, size_t& size, T& value) {
71 advance(buffer, size, sizeof(T));
85 // size in bytes of the flattened object
92 // size should be at least of getFlattenedSize()
96 inline status_t flatten(void*& buffer, size_t& size, int*& fds, size_t& count) const;
99 // size should be equal to the value of getFlattenedSize() when the
105 inline status_t unflatten(void const*& buffer, size_t& size, int const*& fds, size_t& count);
118 void*& buffer, size_t& size, int*& fds, size_t& count) const {
119 return static_cast<T const*>(this)->T::flatten(buffer, size, fds, count);
123 void const*& buffer, size_t& size, int const*& fds, size_t& count) {
124 return static_cast<T*>(this)->T::unflatten(buffer, size, fds, count);
130 * LightFlattenable is usually more size efficient than Flattenable.
136 // returns whether this object always flatten into the same size.
140 // returns size in bytes of the flattened object. must be a constant.
144 inline status_t flatten(void* buffer, size_t size) const;
146 // unflattens the object from buffer of given size.
147 inline status_t unflatten(void const* buffer, size_t size);
159 inline status_t LightFlattenable<T>::flatten(void* buffer, size_t size) const {
160 return static_cast<T const*>(this)->T::flatten(buffer, size);
163 inline status_t LightFlattenable<T>::unflatten(void const* buffer, size_t size) {
164 return static_cast<T*>(this)->T::unflatten(buffer, size);
183 inline status_t flatten(void* buffer, size_t size) const {
184 if (size < sizeof(T)) return NO_MEMORY;