4343#include "valueshashtable.h"
4444
4545#ifdef HAVE_PLATFORM_ATOMIC_H
46- #include "platform_atomic.h"
46+ # include "platform_atomic.h"
4747#else
48- #if defined(HAVE_ATOMIC )
49- #include <stdatomic.h>
50- #define ATOMIC_COMPARE_EXCHANGE_WEAK_PTR atomic_compare_exchange_weak
51- #endif
48+ # if defined(HAVE_ATOMIC )
49+ # include <stdatomic.h>
50+ # define ATOMIC_COMPARE_EXCHANGE_WEAK_PTR atomic_compare_exchange_weak
51+ # endif
5252#endif
5353
5454struct RegisteredProcess
@@ -134,9 +134,9 @@ GlobalContext *globalcontext_new(void)
134134#if HAVE_OPEN && HAVE_CLOSE
135135 glb -> posix_fd_resource_type = enif_init_resource_type (& env , "posix_fd" , & posix_fd_resource_type_init , ERL_NIF_RT_CREATE , NULL );
136136 if (IS_NULL_PTR (glb -> posix_fd_resource_type )) {
137- #ifndef AVM_NO_SMP
137+ # ifndef AVM_NO_SMP
138138 smp_rwlock_destroy (glb -> modules_lock );
139- #endif
139+ # endif
140140 free (glb -> modules_table );
141141 atom_table_destroy (glb -> atom_table );
142142 free (glb );
@@ -149,9 +149,9 @@ GlobalContext *globalcontext_new(void)
149149 erl_nif_env_partial_init_from_globalcontext (& dir_env , glb );
150150 glb -> posix_dir_resource_type = enif_init_resource_type (& env , "posix_dir" , & posix_dir_resource_type_init , ERL_NIF_RT_CREATE , NULL );
151151 if (IS_NULL_PTR (glb -> posix_dir_resource_type )) {
152- #ifndef AVM_NO_SMP
152+ # ifndef AVM_NO_SMP
153153 smp_rwlock_destroy (glb -> modules_lock );
154- #endif
154+ # endif
155155 free (glb -> modules_table );
156156 atom_table_destroy (glb -> atom_table );
157157 free (glb );
@@ -164,9 +164,9 @@ GlobalContext *globalcontext_new(void)
164164#ifndef AVM_NO_SMP
165165 glb -> schedulers_mutex = smp_mutex_create ();
166166 if (IS_NULL_PTR (glb -> schedulers_mutex )) {
167- #if HAVE_OPEN && HAVE_CLOSE
167+ # if HAVE_OPEN && HAVE_CLOSE
168168 resource_type_destroy (glb -> posix_fd_resource_type );
169- #endif
169+ # endif
170170 smp_rwlock_destroy (glb -> modules_lock );
171171 free (glb -> modules_table );
172172 atom_table_destroy (glb -> atom_table );
@@ -176,9 +176,9 @@ GlobalContext *globalcontext_new(void)
176176 glb -> schedulers_cv = smp_condvar_create ();
177177 if (IS_NULL_PTR (glb -> schedulers_cv )) {
178178 smp_mutex_destroy (glb -> schedulers_mutex );
179- #if HAVE_OPEN && HAVE_CLOSE
179+ # if HAVE_OPEN && HAVE_CLOSE
180180 resource_type_destroy (glb -> posix_fd_resource_type );
181- #endif
181+ # endif
182182 smp_rwlock_destroy (glb -> modules_lock );
183183 free (glb -> modules_table );
184184 atom_table_destroy (glb -> atom_table );
@@ -372,7 +372,7 @@ static inline enum SendMessageResult globalcontext_send_message_from_task_common
372372{
373373 enum SendMessageResult result = SEND_MESSAGE_PROCESS_NOT_FOUND ;
374374 bool postponed = false;
375- #ifndef AVM_NO_SMP
375+ # ifndef AVM_NO_SMP
376376 Context * p = NULL ;
377377 if (globalcontext_get_process_trylock (glb , process_id , & p )) {
378378 if (p ) {
@@ -394,10 +394,10 @@ static inline enum SendMessageResult globalcontext_send_message_from_task_common
394394 } else {
395395 postponed = true;
396396 }
397- #else
397+ # else
398398 // Without SMP, we have no lock, so we must always enqueue.
399399 postponed = true;
400- #endif
400+ # endif
401401 if (postponed ) {
402402 if (message == NULL ) {
403403 message = mailbox_message_create_from_term (type , t );
0 commit comments