chore: import upstream snapshot with attribution

This commit is contained in:
wehub-resource-sync
2026-07-13 12:47:05 +08:00
commit 4f3b7da785
7394 changed files with 2005594 additions and 0 deletions
@@ -0,0 +1,21 @@
#include <legacy/NativeOps.h>
#include <array/DataBufferLifecycleTracker.h>
#include <array/DataBuffer.h>
#include <vector>
SD_LIB_EXPORT void recordJavaDataBufferAllocation(OpaqueDataBuffer *buffer, long size, int dataType, bool isWorkspace) {
#if defined(SD_GCC_FUNCTRACE)
if (buffer != nullptr) {
sd::array::DataBufferLifecycleTracker::getInstance().recordAllocation(
buffer->primary(), size, (sd::DataType)dataType, sd::array::BufferType::PRIMARY, buffer, isWorkspace, sd::array::DataBufferSegment::JAVA);
}
#endif
}
SD_LIB_EXPORT void recordJavaDataBufferDeallocation(OpaqueDataBuffer *buffer) {
#if defined(SD_GCC_FUNCTRACE)
if (buffer != nullptr) {
sd::array::DataBufferLifecycleTracker::getInstance().recordDeallocation(buffer->primary(), sd::array::BufferType::PRIMARY);
}
#endif
}