You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/05/09 14:40:44 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #6197: libc: Implement userland implementations of exit functions

xiaoxiang781216 commented on code in PR #6197:
URL: https://github.com/apache/incubator-nuttx/pull/6197#discussion_r868064916


##########
libs/libxx/libxx_cxa_atexit.cxx:
##########
@@ -120,6 +123,7 @@ extern "C"
           return on_exit(__cxa_callback, alloc);
         }
       else
+

Review Comment:
   don't need change



##########
libs/libc/stdlib/lib_cxa_atexit.c:
##########
@@ -0,0 +1,142 @@
+/****************************************************************************
+ * libs/libc/stdlib/lib_cxa_atexit.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <nuttx/compiler.h>
+#include <nuttx/lib/lib.h>
+
+#include <assert.h>
+#include <stdlib.h>
+
+#include "atexit.h"
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Data
+ ****************************************************************************/
+
+#if defined(__cplusplus)
+extern "C"
+{
+#endif
+
+  FAR void *__dso_handle weak_data;
+
+#if defined(__cplusplus)
+}
+#endif
+
+FAR void *__dso_handle = &__dso_handle;
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+#if defined (CONFIG_BUILD_FLAT) && defined (CONFIG_SCHED_ONEXIT)
+struct __cxa_atexit_s
+{
+  void    (*func)(void *);

Review Comment:
   let's unify __cxa_atexit_s to atexit?



##########
libs/libc/stdlib/lib_atexit.c:
##########
@@ -0,0 +1,147 @@
+/****************************************************************************
+ * libs/libc/stdlib/lib_atexit.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+#include <sched.h>
+#include <stdlib.h>
+
+#include "atexit.h"
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+static struct atexit_list_s g_atexit_head;

Review Comment:
   g_atexit_head need move to include/nuttx/tls.h:task_info_s for flat and protected build



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org