Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Revert "deps: upgrade libuv to 3c41597"
Browse files Browse the repository at this point in the history
This reverts commit 0db4dc0.

This commit makes a lot of tests fail due to reference counting errors. It's
not worth it to debug because the reference counting scheme is due to change
soon anyway.
  • Loading branch information
bnoordhuis committed Apr 11, 2012
1 parent 3ec84a1 commit e9dcfd4
Show file tree
Hide file tree
Showing 41 changed files with 795 additions and 1,250 deletions.
22 changes: 8 additions & 14 deletions deps/uv/config-unix.mk
Expand Up @@ -27,24 +27,18 @@ LINKFLAGS=-lm
CPPFLAGS += -D_LARGEFILE_SOURCE
CPPFLAGS += -D_FILE_OFFSET_BITS=64

OBJS += src/unix/async.o
OBJS += src/unix/cares.o
OBJS += src/unix/check.o
OBJS += src/unix/core.o
OBJS += src/unix/dl.o
OBJS += src/unix/error.o
OBJS += src/unix/fs.o
OBJS += src/unix/idle.o
OBJS += src/unix/loop.o
OBJS += src/unix/pipe.o
OBJS += src/unix/prepare.o
OBJS += src/unix/cares.o
OBJS += src/unix/udp.o
OBJS += src/unix/error.o
OBJS += src/unix/thread.o
OBJS += src/unix/process.o
OBJS += src/unix/stream.o
OBJS += src/unix/tcp.o
OBJS += src/unix/thread.o
OBJS += src/unix/timer.o
OBJS += src/unix/pipe.o
OBJS += src/unix/tty.o
OBJS += src/unix/udp.o
OBJS += src/unix/stream.o

ifeq (SunOS,$(uname_S))
EV_CONFIG=config_sunos.h
Expand All @@ -57,7 +51,7 @@ endif
ifeq (Darwin,$(uname_S))
EV_CONFIG=config_darwin.h
EIO_CONFIG=config_darwin.h
CPPFLAGS += -D_DARWIN_USE_64_BIT_INODE=1 -Isrc/ares/config_darwin
CPPFLAGS += -Isrc/ares/config_darwin
LINKFLAGS+=-framework CoreServices
OBJS += src/unix/darwin.o
OBJS += src/unix/kqueue.o
Expand All @@ -69,7 +63,7 @@ EIO_CONFIG=config_linux.h
CSTDFLAG += -D_GNU_SOURCE
CPPFLAGS += -Isrc/ares/config_linux
LINKFLAGS+=-ldl -lrt
OBJS += src/unix/linux/core.o src/unix/linux/inotify.o src/unix/linux/syscalls.o
OBJS += src/unix/linux/core.o src/unix/linux/inotify.o
endif

ifeq (FreeBSD,$(uname_S))
Expand Down
14 changes: 6 additions & 8 deletions deps/uv/include/uv-private/tree.h
Expand Up @@ -26,12 +26,10 @@
#ifndef UV_TREE_H_
#define UV_TREE_H_

#ifndef UV__UNUSED
# if __GNUC__
# define UV__UNUSED __attribute__((unused))
# else
# define UV__UNUSED
# endif
#if __GNUC__
# define __unused __attribute__((unused))
#else
# define __unused
#endif

/*
Expand Down Expand Up @@ -383,7 +381,7 @@ struct { \
#define RB_PROTOTYPE(name, type, field, cmp) \
RB_PROTOTYPE_INTERNAL(name, type, field, cmp,)
#define RB_PROTOTYPE_STATIC(name, type, field, cmp) \
RB_PROTOTYPE_INTERNAL(name, type, field, cmp, UV__UNUSED static)
RB_PROTOTYPE_INTERNAL(name, type, field, cmp, __unused static)
#define RB_PROTOTYPE_INTERNAL(name, type, field, cmp, attr) \
attr void name##_RB_INSERT_COLOR(struct name *, struct type *); \
attr void name##_RB_REMOVE_COLOR(struct name *, struct type *, struct type *);\
Expand All @@ -402,7 +400,7 @@ attr struct type *name##_RB_MINMAX(struct name *, int); \
#define RB_GENERATE(name, type, field, cmp) \
RB_GENERATE_INTERNAL(name, type, field, cmp,)
#define RB_GENERATE_STATIC(name, type, field, cmp) \
RB_GENERATE_INTERNAL(name, type, field, cmp, UV__UNUSED static)
RB_GENERATE_INTERNAL(name, type, field, cmp, __unused static)
#define RB_GENERATE_INTERNAL(name, type, field, cmp, attr) \
attr void \
name##_RB_INSERT_COLOR(struct name *head, struct type *elm) \
Expand Down
15 changes: 8 additions & 7 deletions deps/uv/include/uv-private/uv-unix.h
Expand Up @@ -55,9 +55,6 @@ typedef pthread_rwlock_t uv_rwlock_t;
typedef void* uv_lib_t;
#define UV_DYNAMIC /* empty */

#define UV_HANDLE_TYPE_PRIVATE /* empty */
#define UV_REQ_TYPE_PRIVATE /* empty */

#if __linux__
# define UV_LOOP_PRIVATE_PLATFORM_FIELDS \
/* RB_HEAD(uv__inotify_watchers, uv_fs_event_s) */ \
Expand All @@ -77,15 +74,14 @@ typedef void* uv_lib_t;
* sure that we're always calling ares_process. See the warning above the \
* definition of ares_timeout(). \
*/ \
uv_timer_t timer; \
ev_timer timer; \
/* Poll result queue */ \
eio_channel uv_eio_channel; \
struct ev_loop* ev; \
/* Various thing for libeio. */ \
uv_async_t uv_eio_want_poll_notifier; \
uv_async_t uv_eio_done_poll_notifier; \
uv_idle_t uv_eio_poller; \
uv_handle_t* endgame_handles; \
UV_LOOP_PRIVATE_PLATFORM_FIELDS

#define UV_REQ_BUFSML_SIZE (4)
Expand Down Expand Up @@ -122,7 +118,7 @@ typedef void* uv_lib_t;
#define UV_HANDLE_PRIVATE_FIELDS \
int fd; \
int flags; \
uv_handle_t* endgame_next; /* that's what uv-win calls it */ \
ev_idle next_watcher;


#define UV_STREAM_PRIVATE_FIELDS \
Expand Down Expand Up @@ -186,6 +182,11 @@ typedef void* uv_lib_t;
ev_timer timer_watcher; \
uv_timer_cb timer_cb;

#define UV_ARES_TASK_PRIVATE_FIELDS \
int sock; \
ev_io read_watcher; \
ev_io write_watcher;

#define UV_GETADDRINFO_PRIVATE_FIELDS \
uv_getaddrinfo_cb cb; \
struct addrinfo* hints; \
Expand Down Expand Up @@ -222,7 +223,7 @@ typedef void* uv_lib_t;
ev_io read_watcher; \
uv_fs_event_cb cb;

#elif defined(__APPLE__) \
#elif (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060) \
|| defined(__FreeBSD__) \
|| defined(__OpenBSD__) \
|| defined(__NetBSD__)
Expand Down
15 changes: 8 additions & 7 deletions deps/uv/include/uv-private/uv-win.h
Expand Up @@ -206,21 +206,15 @@ RB_HEAD(uv_timer_tree_s, uv_timer_s);
/* Counter to keep track of active udp streams */ \
unsigned int active_udp_streams;

#define UV_HANDLE_TYPE_PRIVATE \
UV_ARES_EVENT,

#define UV_REQ_TYPE_PRIVATE \
/* TODO: remove the req suffix */ \
UV_ACCEPT, \
UV_ARES_EVENT_REQ, \
UV_ARES_CLEANUP_REQ, \
UV_FS_EVENT_REQ, \
UV_GETADDRINFO_REQ, \
UV_PROCESS_EXIT, \
UV_PROCESS_CLOSE, \
UV_READ, \
UV_UDP_RECV, \
UV_WAKEUP,
UV_FS_EVENT_REQ

#define UV_REQ_PRIVATE_FIELDS \
union { \
Expand Down Expand Up @@ -396,6 +390,13 @@ RB_HEAD(uv_timer_tree_s, uv_timer_s);
uv_handle_t* endgame_next; \
unsigned int flags;

#define UV_ARES_TASK_PRIVATE_FIELDS \
struct uv_req_s ares_req; \
SOCKET sock; \
HANDLE h_wait; \
WSAEVENT h_event; \
HANDLE h_close_event;

#define UV_GETADDRINFO_PRIVATE_FIELDS \
struct uv_req_s getadddrinfo_req; \
uv_getaddrinfo_cb getaddrinfo_cb; \
Expand Down
78 changes: 23 additions & 55 deletions deps/uv/include/uv.h
Expand Up @@ -132,46 +132,37 @@ typedef enum {
} uv_err_code;
#undef UV_ERRNO_GEN

#define UV_HANDLE_TYPE_MAP(XX) \
XX(ARES_TASK, ares_task) \
XX(ASYNC, async) \
XX(CHECK, check) \
XX(FS_EVENT, fs_event) \
XX(IDLE, idle) \
XX(NAMED_PIPE, pipe) \
XX(PREPARE, prepare) \
XX(PROCESS, process) \
XX(TCP, tcp) \
XX(TIMER, timer) \
XX(TTY, tty) \
XX(UDP, udp) \

#define UV_REQ_TYPE_MAP(XX) \
XX(CONNECT, connect) \
XX(WRITE, write) \
XX(SHUTDOWN, shutdown) \
XX(UDP_SEND, udp_send) \
XX(FS, fs) \
XX(WORK, work) \
XX(GETADDRINFO, getaddrinfo) \

typedef enum {
UV_UNKNOWN_HANDLE = 0,
#define XX(uc, lc) UV_##uc,
UV_HANDLE_TYPE_MAP(XX)
#undef XX
UV_TCP,
UV_UDP,
UV_NAMED_PIPE,
UV_TTY,
UV_FILE,
UV_HANDLE_TYPE_PRIVATE
UV_HANDLE_TYPE_MAX
UV_TIMER,
UV_PREPARE,
UV_CHECK,
UV_IDLE,
UV_ASYNC,
UV_ARES_TASK,
UV_ARES_EVENT,
UV_PROCESS,
UV_FS_EVENT
} uv_handle_type;

typedef enum {
UV_UNKNOWN_REQ = 0,
#define XX(uc, lc) UV_##uc,
UV_REQ_TYPE_MAP(XX)
#undef XX
UV_CONNECT,
UV_ACCEPT,
UV_READ,
UV_WRITE,
UV_SHUTDOWN,
UV_WAKEUP,
UV_UDP_SEND,
UV_FS,
UV_WORK,
UV_GETADDRINFO,
UV_REQ_TYPE_PRIVATE
UV_REQ_TYPE_MAX
} uv_req_type;


Expand Down Expand Up @@ -382,18 +373,6 @@ struct uv_handle_s {
UV_HANDLE_FIELDS
};

/*
* Returns size of various handle types, useful for FFI
* bindings to allocate correct memory without copying struct
* definitions
*/
UV_EXTERN size_t uv_handle_size(uv_handle_type type);

/*
* Returns size of request types, useful for dynamic lookup with FFI
*/
UV_EXTERN size_t uv_req_size(uv_req_type type);

/*
* Returns 1 if the prepare/check/idle/timer handle has been started, 0
* otherwise. For other handle types this always returns 1.
Expand Down Expand Up @@ -543,16 +522,6 @@ UV_EXTERN int uv_is_readable(uv_stream_t* handle);
UV_EXTERN int uv_is_writable(uv_stream_t* handle);


/*
* Used to determine whether a stream is closing or closed.
*
* N.B. is only valid between the initialization of the handle
* and the arrival of the close callback, and cannot be used
* to validate the handle.
*/
UV_EXTERN int uv_is_closing(uv_handle_t* handle);


/*
* uv_tcp_t is a subclass of uv_stream_t
*
Expand Down Expand Up @@ -1532,7 +1501,6 @@ struct uv_loop_s {


/* Don't export the private CPP symbols. */
#undef UV_HANDLE_TYPE_PRIVATE
#undef UV_REQ_TYPE_PRIVATE
#undef UV_REQ_PRIVATE_FIELDS
#undef UV_STREAM_PRIVATE_FIELDS
Expand Down
58 changes: 0 additions & 58 deletions deps/uv/src/unix/async.c

This file was deleted.

0 comments on commit e9dcfd4

Please sign in to comment.