Subject: | [PATCH] Name structs so pahole can see them |
Date: | Thu, 17 Sep 2020 19:16:12 +0100 |
To: | bug-Object-Pad [...] rt.cpan.org |
From: | ilmari [...] ilmari.org (Dagfinn Ilmari Mannsåker) |
Hi Paul,
The pahole tool from the dwarves package is handy for spotting holes in
structs, but it can only work with named structs. Attached is a patch
that gives them names, not just typedefs.
- ilmari
--
- Twitter seems more influential [than blogs] in the 'gets reported in
the mainstream press' sense at least. - Matt McLeod
- That'd be because the content of a tweet is easier to condense down
to a mainstream media article. - Calle Dybedahl
From 10987368d2028c4fdd8714f125d6f5c60b44fad0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dagfinn=20Ilmari=20Manns=C3=A5ker?= <ilmari@ilmari.org>
Date: Wed, 16 Sep 2020 12:55:17 +0100
Subject: [PATCH] Name structs so pahole can see them
---
lib/Object/Pad.xs | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/Object/Pad.xs b/lib/Object/Pad.xs
index e65222e..045c71d 100644
--- a/lib/Object/Pad.xs
+++ b/lib/Object/Pad.xs
@@ -41,7 +41,7 @@
#endif
#ifndef HAVE_UNOP_AUX
-typedef struct {
+typedef struct UNOP_with_IV {
UNOP baseop;
IV iv;
} UNOP_with_IV;
@@ -282,14 +282,14 @@ typedef IV SLOTOFFSET;
typedef struct ClassMeta ClassMeta;
-typedef struct {
+typedef struct SlotMeta {
SV *name;
ClassMeta *class;
SV *defaultsv;
SLOTOFFSET slotix;
} SlotMeta;
-typedef struct {
+typedef struct MethodMeta {
SV *name;
ClassMeta *class;
ClassMeta *role; /* set if inherited from a role */
@@ -333,7 +333,7 @@ struct ClassMeta {
};
/* Metadata about the embedding of a role into a class */
-typedef struct {
+typedef struct RoleEmbedding {
SV *embeddingsv;
struct ClassMeta *rolemeta;
struct ClassMeta *classmeta;
--
2.27.0