diff --git a/include/phoenix/cffi/Buffer.h b/include/phoenix/cffi/Buffer.h index f27af7a..ab88abd 100644 --- a/include/phoenix/cffi/Buffer.h +++ b/include/phoenix/cffi/Buffer.h @@ -17,3 +17,4 @@ PXC_API PxBuffer* pxBufferMmap(char const* file); PXC_API void pxBufferDestroy(PxBuffer* buffer); PXC_API uint64_t pxBufferSize(PxBuffer* buffer); PXC_API uint8_t* pxBufferArray(PxBuffer* buffer); +PXC_API uint8_t* pxBufferArrayNoalloc(PxBuffer* buffer); diff --git a/src/Buffer.cc b/src/Buffer.cc index c7f9535..7349eec 100644 --- a/src/Buffer.cc +++ b/src/Buffer.cc @@ -70,3 +70,8 @@ uint8_t* pxBufferArray(PxBuffer* buffer) { buffer->get(data, buffer->limit()); return data; } + +uint8_t* pxBufferArrayNoalloc(PxBuffer* buffer) { + return (uint8_t*) buffer->array(); +} +