This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 854276285c76505c6b11e7a592513c1abfc6a55b
Author: Xiang Xiao <[email protected]>
AuthorDate: Tue Aug 4 11:58:41 2020 +0800

    sched/signal: Reduce the initial memory consumption
    
    1.Don't preallocate sigaction list since it's used only in the task context
    2.Reduce the preserved item which is used only in the task context from 16 
to 4
    The total memory decrease from 1280B to 480B
    
    Signed-off-by: Xiang Xiao <[email protected]>
    Change-Id: Ib5d5a7365c7d443fc0e99c0d3ea943e85f67ca8c
---
 sched/signal/sig_initialize.c |  2 --
 sched/signal/signal.h         | 16 ++++++++++------
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/sched/signal/sig_initialize.c b/sched/signal/sig_initialize.c
index 3f9bab9..0a03ff2 100644
--- a/sched/signal/sig_initialize.c
+++ b/sched/signal/sig_initialize.c
@@ -234,8 +234,6 @@ void nxsig_initialize(void)
                       SIG_ALLOC_IRQ);
   DEBUGASSERT(g_sigpendingirqactionalloc != NULL);
 
-  nxsig_alloc_actionblock();
-
   g_sigpendingsignalalloc =
     nxsig_alloc_pendingsignalblock(&g_sigpendingsignal,
                                    NUM_SIGNALS_PENDING,
diff --git a/sched/signal/signal.h b/sched/signal/signal.h
index 87710bd..e8d36d0 100644
--- a/sched/signal/signal.h
+++ b/sched/signal/signal.h
@@ -58,10 +58,10 @@
  * allocate in a block
  */
 
-#define NUM_SIGNAL_ACTIONS      16
-#define NUM_PENDING_ACTIONS     16
+#define NUM_SIGNAL_ACTIONS       4
+#define NUM_PENDING_ACTIONS      4
 #define NUM_PENDING_INT_ACTIONS  8
-#define NUM_SIGNALS_PENDING     16
+#define NUM_SIGNALS_PENDING      4
 #define NUM_INT_SIGNALS_PENDING  8
 
 /****************************************************************************
@@ -158,6 +158,7 @@ extern sq_queue_t  g_sigpendingirqsignal;
  ****************************************************************************/
 
 /* Internal signal-related interfaces ***************************************/
+
 /* Forward references */
 
 struct task_group_s;
@@ -187,7 +188,8 @@ sigset_t           nxsig_pendingset(FAR struct tcb_s *stcb);
 
 /* sig_dispatch.c */
 
-int                nxsig_tcbdispatch(FAR struct tcb_s *stcb, FAR siginfo_t 
*info);
+int                nxsig_tcbdispatch(FAR struct tcb_s *stcb,
+                                     FAR siginfo_t *info);
 int                nxsig_dispatch(pid_t pid, FAR siginfo_t *info);
 
 /* sig_cleanup.c */
@@ -205,11 +207,13 @@ void nxsig_wait_irq(FAR struct tcb_s *wtcb, int errcode);
 
 FAR sigq_t        *nxsig_alloc_pendingsigaction(void);
 void               nxsig_deliver(FAR struct tcb_s *stcb);
-FAR sigactq_t     *nxsig_find_action(FAR struct task_group_s *group, int 
signo);
+FAR sigactq_t     *nxsig_find_action(FAR struct task_group_s *group,
+                                     int signo);
 int                nxsig_lowest(FAR sigset_t *set);
 void               nxsig_release_pendingsigaction(FAR sigq_t *sigq);
 void               nxsig_release_pendingsignal(FAR sigpendq_t *sigpend);
-FAR sigpendq_t    *nxsig_remove_pendingsignal(FAR struct tcb_s *stcb, int 
signo);
+FAR sigpendq_t    *nxsig_remove_pendingsignal(FAR struct tcb_s *stcb,
+                                              int signo);
 bool               nxsig_unmask_pendingsignal(void);
 
 #endif /* __SCHED_SIGNAL_SIGNAL_H */

Reply via email to