@@ -134,23 +134,23 @@ impl<'a> ObjectSkeletonConfigBuilder<'a> {
134134 }
135135
136136 fn build_progs (
137- & mut self ,
137+ progs : & mut [ ProgSkelConfig ] ,
138138 s : & mut bpf_object_skeleton ,
139139 string_pool : & mut Vec < CString > ,
140140 ) -> Option < Layout > {
141- if self . progs . is_empty ( ) {
141+ if progs. is_empty ( ) {
142142 return None ;
143143 }
144144
145- s. prog_cnt = self . progs . len ( ) as i32 ;
145+ s. prog_cnt = progs. len ( ) as i32 ;
146146 s. prog_skel_sz = size_of :: < bpf_prog_skeleton > ( ) as i32 ;
147147
148- let layout = Layout :: array :: < bpf_prog_skeleton > ( self . progs . len ( ) )
148+ let layout = Layout :: array :: < bpf_prog_skeleton > ( progs. len ( ) )
149149 . expect ( "Failed to allocate memory for progs skeleton" ) ;
150150
151151 unsafe {
152152 s. progs = alloc_zeroed ( layout) as * mut bpf_prog_skeleton ;
153- for ( i, prog) in self . progs . iter_mut ( ) . enumerate ( ) {
153+ for ( i, prog) in progs. iter_mut ( ) . enumerate ( ) {
154154 let current_prog = s. progs . add ( i) ;
155155
156156 // See above for `expect()` rationale
@@ -184,7 +184,7 @@ impl<'a> ObjectSkeletonConfigBuilder<'a> {
184184 s. obj = & mut * self . p ;
185185
186186 let maps_layout = Self :: build_maps ( & mut self . maps , & mut s, & mut string_pool) ;
187- let progs_layout = self . build_progs ( & mut s, & mut string_pool) ;
187+ let progs_layout = Self :: build_progs ( & mut self . progs , & mut s, & mut string_pool) ;
188188
189189 Ok ( ObjectSkeletonConfig {
190190 inner : s,
0 commit comments