Home
last modified time | relevance | path

Searched refs:SharedBuffer (Results 1 – 7 of 7) sorted by relevance

/system/core/libutils/
DSharedBuffer.h32 class SharedBuffer
44 static SharedBuffer* alloc(size_t size);
51 static void dealloc(const SharedBuffer* released);
63 static inline SharedBuffer* bufferFromData(void* data);
66 static inline const SharedBuffer* bufferFromData(const void* data);
72 SharedBuffer* edit() const;
75 SharedBuffer* editResize(size_t size) const;
78 SharedBuffer* attemptEdit() const;
81 SharedBuffer* reset(size_t size) const;
97 inline SharedBuffer() { } in SharedBuffer() function
[all …]
DSharedBuffer.cpp30 SharedBuffer* SharedBuffer::alloc(size_t size) in alloc()
34 LOG_ALWAYS_FATAL_IF((size >= (SIZE_MAX - sizeof(SharedBuffer))), in alloc()
37 SharedBuffer* sb = static_cast<SharedBuffer *>(malloc(sizeof(SharedBuffer) + size)); in alloc()
50 void SharedBuffer::dealloc(const SharedBuffer* released) in dealloc()
52 free(const_cast<SharedBuffer*>(released)); in dealloc()
55 SharedBuffer* SharedBuffer::edit() const in edit()
58 return const_cast<SharedBuffer*>(this); in edit()
60 SharedBuffer* sb = alloc(mSize); in edit()
68 SharedBuffer* SharedBuffer::editResize(size_t newSize) const in editResize()
71 SharedBuffer* buf = const_cast<SharedBuffer*>(this); in editResize()
[all …]
DSharedBuffer_test.cpp27 EXPECT_DEATH(android::SharedBuffer::alloc(SIZE_MAX), ""); in TEST()
28 EXPECT_DEATH(android::SharedBuffer::alloc(SIZE_MAX - sizeof(android::SharedBuffer)), ""); in TEST()
32 android::SharedBuffer* buf = in TEST()
33 android::SharedBuffer::alloc(SIZE_MAX - sizeof(android::SharedBuffer) - 1); in TEST()
36 buf = android::SharedBuffer::alloc(0); in TEST()
43 android::SharedBuffer* buf = android::SharedBuffer::alloc(10); in TEST()
44 EXPECT_DEATH(buf->editResize(SIZE_MAX - sizeof(android::SharedBuffer)), ""); in TEST()
45 buf = android::SharedBuffer::alloc(10); in TEST()
48 buf = android::SharedBuffer::alloc(10); in TEST()
51 buf = buf->editResize(SIZE_MAX - sizeof(android::SharedBuffer) - 1); in TEST()
[all …]
DString16.cpp36 SharedBuffer* buf = SharedBuffer::alloc(size); in alloc()
52 SharedBuffer* buf = static_cast<SharedBuffer*>(alloc(sizeof(char16_t) * (u16len + 1))); in allocFromUTF8()
75 SharedBuffer* buf = static_cast<SharedBuffer*>(alloc((u16len + 1) * sizeof(char16_t))); in allocFromUTF16()
134 return SharedBuffer::sizeFromData(mString) / sizeof(char16_t) - 1; in size()
178 SharedBuffer* buf = static_cast<SharedBuffer*>(editResize((len + 1) * sizeof(char16_t))); in setTo()
205 SharedBuffer* buf = in append()
206 static_cast<SharedBuffer*>(editResize((myLen + otherLen + 1) * sizeof(char16_t))); in append()
231 SharedBuffer* buf = in append()
232 static_cast<SharedBuffer*>(editResize((myLen + otherLen + 1) * sizeof(char16_t))); in append()
266 SharedBuffer* buf = in insert()
[all …]
DString8.cpp44 static SharedBuffer* gEmptyStringBuf = [] { in getEmptyString()
45 SharedBuffer* buf = SharedBuffer::alloc(1); in getEmptyString()
63 SharedBuffer* buf = SharedBuffer::alloc(len+1); in allocFromUTF8()
87 SharedBuffer* buf = SharedBuffer::alloc(resultStrLen); in allocFromUTF16()
109 SharedBuffer* buf = SharedBuffer::alloc(resultStrLen); in allocFromUTF32()
131 SharedBuffer::bufferFromData(mString)->acquire(); in String8()
177 SharedBuffer::bufferFromData(mString)->release(); in ~String8()
182 return SharedBuffer::sizeFromData(mString)-1; in length()
204 SharedBuffer::bufferFromData(mString)->release(); in clear()
210 SharedBuffer::bufferFromData(other.mString)->acquire(); in setTo()
[all …]
DVectorImpl.cpp54 SharedBuffer::bufferFromData(mStorage)->acquire(); in VectorImpl()
76 SharedBuffer::bufferFromData(mStorage)->acquire(); in operator =()
88 const SharedBuffer* sb = SharedBuffer::bufferFromData(mStorage); in editArrayImpl()
89 SharedBuffer* editable = sb->attemptEdit(); in editArrayImpl()
93 editable = SharedBuffer::alloc(sb->size()); in editArrayImpl()
109 return SharedBuffer::bufferFromData(mStorage)->size() / mItemSize; in capacity()
344 SharedBuffer* sb = SharedBuffer::alloc(new_allocation_size); in setCapacity()
369 const SharedBuffer* sb = SharedBuffer::bufferFromData(mStorage); in release_storage()
370 if (sb->release(SharedBuffer::eKeepStorage) == 1) { in release_storage()
372 SharedBuffer::dealloc(sb); in release_storage()
[all …]
DAndroid.bp137 "SharedBuffer.cpp",