Commits

Anonymous committed 06f8239

code cleanup. remove unused code and/or elements

Comments (0)

Files changed (4)

 endif
 
 ifeq (Linux, $(uname_S))
-	CFLAGS+=-lneko -lrt -ldl -lm -lev -pthread
+	CFLAGS+=-lneko -lrt -ldl -lm
 endif
 
 
 
 #include "nuv.h"
 
-
-DEFINE_KIND(k_nuv_vdns);
-
 typedef struct {
   uv_getaddrinfo_t resolver;
   addrinfo hints;
 #include "nuv.h"
 
 DEFINE_KIND(k_nuv_loop);
-DEFINE_KIND(k_nuv_stack);
 
-uv_loop_t *__nuv_get_vm_loop() {
-  return (uv_loop_t*)neko_vm_custom(neko_vm_current(), k_nuv_loop);
-}
+value hx_nuv_loop_shutdown();
 
-uv_loop_t *__nuv_get_kind_loop(value l) {
+uv_loop_t *__nuv_get_vm_loop() {
   return (uv_loop_t*)neko_vm_custom(neko_vm_current(), k_nuv_loop);
 }
 
 static void __nuv_gc_loop(value k) {
+  hx_nuv_loop_shutdown();
   val_gc(k, 0);
 
 }
 
-int __hx_nuv_add_to_stack(void* ptr) {
-  auto stack = (value*)neko_vm_custom(neko_vm_current(), k_nuv_stack);
-}
-
-value* __hx_nuv_setup_stack() {
-  return &val_null;
-
-  auto root = alloc_root(65536);
-  neko_vm_set_custom( neko_vm_current(), k_nuv_stack, root );
-  return root;
-}
-
-void __hx_nuv_teardown_stack(value* stack) {
-  return;
-
-  free_root( (value*)neko_vm_custom( neko_vm_current(), k_nuv_stack) );
-  neko_vm_set_custom( neko_vm_current() , k_nuv_stack, NULL );
-}
-
 static void __nuv_shutdown_loop(uv_handle_t* handle, void* arg) {
   NEKO_UV_CLOSE_HANDLE(handle);
 }
 // we don't expect operating single loop in multiple
 // thread. Users would mostly use the bg work system to handle processing
 // but per-thread makes it possible to write a multi-loop
-// multi-service system
+// multi-service systems
 value hx_nuv_loop_init (value type_) {
 
   // alloc loop object for this thread
 }
 
 value hx_nuv_loop_run () {
-
-  auto stack = __hx_nuv_setup_stack();
-
-  auto v = alloc_int( uv_run( __nuv_get_vm_loop() ) );
-
-  __hx_nuv_teardown_stack(stack);
-
-  return v;
+  return alloc_int( uv_run( __nuv_get_vm_loop() ) );
 }
 
 value hx_nuv_loop_run_once () {
-  auto stack = __hx_nuv_setup_stack();
-
-  auto v = alloc_int( uv_run_once( __nuv_get_vm_loop() ) );
-
-  __hx_nuv_teardown_stack(stack);
-
-  return v;
+  return alloc_int( uv_run_once( __nuv_get_vm_loop() ) );
 }
 
 

ndll/src/nutils.c

     if(fam == AF_INET) uv_ip4_name( &addr.address4, buf, sizeof(buf) );
     else if(fam == AF_INET6) uv_ip6_name( &addr.address6, buf, sizeof(buf) );
 
-    alloc_field( obj, val_id("type"), alloc_string(fam == AF_INET ? "v4" : "v6") );
+    alloc_field( obj, val_id("version"), alloc_int(fam == AF_INET ? 4 : 6) );
     alloc_field( obj, val_id("ip"), alloc_string(buf) );
   }
 
   uv_free_interface_addresses(info, count);
-  
+
   return arr;
 }