From 89ce804833a3d4f53cbdfdc728eea3c393a84ecd Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 4 Jun 2023 10:20:39 -0600 Subject: [PATCH] [serialize] Remove attribute malloc This broke tests. It wasn't technically correct. --- src/hb-serialize.hh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/hb-serialize.hh b/src/hb-serialize.hh index 08130f5f4..2e8817ba7 100644 --- a/src/hb-serialize.hh +++ b/src/hb-serialize.hh @@ -261,7 +261,7 @@ struct hb_serialize_context_t /* To be called around main operation. */ template - __attribute__((malloc, returns_nonnull)) + __attribute__((returns_nonnull)) Type *start_serialize () { DEBUG_MSG_LEVEL (SERIALIZE, this->start, 0, +1, @@ -304,7 +304,7 @@ struct hb_serialize_context_t } template - __attribute__((malloc, returns_nonnull)) + __attribute__((returns_nonnull)) Type *push () { if (unlikely (in_error ())) return start_embed (); @@ -605,7 +605,7 @@ struct hb_serialize_context_t } template - HB_NODISCARD __attribute__((malloc)) + HB_NODISCARD Type *allocate_size (size_t size, bool clear = true) { if (unlikely (in_error ())) return nullptr; @@ -627,7 +627,7 @@ struct hb_serialize_context_t { return this->allocate_size (Type::min_size); } template - HB_NODISCARD __attribute__((malloc)) + HB_NODISCARD Type *embed (const Type *obj) { unsigned int size = obj->get_size (); @@ -637,7 +637,7 @@ struct hb_serialize_context_t return ret; } template - HB_NODISCARD __attribute__((malloc)) + HB_NODISCARD Type *embed (const Type &obj) { return embed (std::addressof (obj)); } char *embed (const char *obj, unsigned size)