Ultralight
Ultralight copied to clipboard
Option to create new ultralight::Buffer with just size
ultralight::Buffer is possible to be created by either adapting existing data and providing custom free function (cumbersome) or by creating a deep copy of existing buffer (not performant):
static RefPtr<Buffer> Create(void* data, size_t size, void* user_data,
DestroyBufferCallback destruction_callback);
static RefPtr<Buffer> CreateFromCopy(const void* data, size_t size);
There should be a third option to create an empty/unitialized buffer with just size as the parameter, where you could copy the data to directly, with no deep copy and without worrying about freeing it later with callback as the class would still own it...