|
|
@ -176,8 +176,8 @@ class PROTOBUF_EXPORT PROTOBUF_ALIGNAS(8) Arena final { |
|
|
|
|
|
|
|
|
|
|
|
inline ~Arena() = default; |
|
|
|
inline ~Arena() = default; |
|
|
|
|
|
|
|
|
|
|
|
// Deprecated. Use Create<T> instead. TODO: depreate OSS version
|
|
|
|
#ifndef PROTOBUF_FUTURE_REMOVE_CREATEMESSAGE |
|
|
|
// once internal migration to Arena::Create is done.
|
|
|
|
// Deprecated. Use Create<T> instead.
|
|
|
|
template <typename T, typename... Args> |
|
|
|
template <typename T, typename... Args> |
|
|
|
ABSL_DEPRECATED("Use Create") |
|
|
|
ABSL_DEPRECATED("Use Create") |
|
|
|
static T* CreateMessage(Arena* arena, Args&&... args) { |
|
|
|
static T* CreateMessage(Arena* arena, Args&&... args) { |
|
|
@ -187,6 +187,7 @@ class PROTOBUF_EXPORT PROTOBUF_ALIGNAS(8) Arena final { |
|
|
|
"CreateMessage can only construct types that are ArenaConstructable"); |
|
|
|
"CreateMessage can only construct types that are ArenaConstructable"); |
|
|
|
return Create<Type>(arena, std::forward<Args>(args)...); |
|
|
|
return Create<Type>(arena, std::forward<Args>(args)...); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
#endif // !PROTOBUF_FUTURE_REMOVE_CREATEMESSAGE
|
|
|
|
|
|
|
|
|
|
|
|
// Allocates an object type T if the arena passed in is not nullptr;
|
|
|
|
// Allocates an object type T if the arena passed in is not nullptr;
|
|
|
|
// otherwise, returns a heap-allocated object.
|
|
|
|
// otherwise, returns a heap-allocated object.
|
|
|
|