On 32-bit kernel we need ~26k per applet.
+Script:
+
+i=1000; while test $i != 0; do
+ echo -n .
+ busybox sleep 30 &
+ i=$((i - 1))
+done
+echo
+wait
+
(Data from NOMMU arches are sought. Provide 'size busybox' output too)
(see the rest of the file to get the idea)
This example completely eliminates globals in that module.
-Required memory is allocated in inflate_gunzip() [its main module]
+Required memory is allocated in unpack_gz_stream() [its main module]
and then passed down to all subroutines which need to access 'globals'
as a parameter.
ptr_to_globals is declared as constant pointer.
This helps gcc understand that it won't change, resulting in noticeably
-smaller code. In order to assign it, use PTR_TO_GLOBALS macro:
+smaller code. In order to assign it, use SET_PTR_TO_GLOBALS macro:
- PTR_TO_GLOBALS = xzalloc(sizeof(G));
+ SET_PTR_TO_GLOBALS(xzalloc(sizeof(G)));
Typically it is done in <applet>_main().