File tree Expand file tree Collapse file tree 1 file changed +22
-3
lines changed Expand file tree Collapse file tree 1 file changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -76,24 +76,43 @@ PyGccCallgraphNode_get_callers(struct PyGccCallgraphNode * self)
7676 add_cgraph_edge_to_list )
7777}
7878
79+ union gcc_cgraph_edge_as_ptr {
80+ gcc_cgraph_edge edge ;
81+ void * ptr ;
82+ };
83+
7984PyObject *
80- PyGccCallgraphEdge_New ( gcc_cgraph_edge edge )
85+ real_make_cgraph_edge_wrapper ( void * ptr )
8186{
8287 struct PyGccCallgraphEdge * obj = NULL ;
88+ union gcc_cgraph_edge_as_ptr u ;
89+ u .ptr = ptr ;
8390
84- obj = PyGccWrapper_New (struct PyGccCallgraphEdge , & PyGccCallgraphEdge_TypeObj );
91+ obj = PyGccWrapper_New (struct PyGccCallgraphEdge ,
92+ & PyGccCallgraphEdge_TypeObj );
8593 if (!obj ) {
8694 goto error ;
8795 }
8896
89- obj -> edge = edge ;
97+ obj -> edge = u . edge ;
9098
9199 return (PyObject * )obj ;
92100
93101error :
94102 return NULL ;
95103}
96104
105+ static PyObject * cgraph_edge_wrapper_cache = NULL ;
106+ PyObject *
107+ PyGccCallgraphEdge_New (gcc_cgraph_edge edge )
108+ {
109+ union gcc_cgraph_edge_as_ptr u ;
110+ u .edge = edge ;
111+ return PyGcc_LazilyCreateWrapper (& cgraph_edge_wrapper_cache ,
112+ u .ptr ,
113+ real_make_cgraph_edge_wrapper );
114+ }
115+
97116void
98117PyGcc_WrtpMarkForPyGccCallgraphEdge (PyGccCallgraphEdge * wrapper )
99118{
You can’t perform that action at this time.
0 commit comments