Large diffs are not rendered by default.

@@ -2,7 +2,7 @@ TITLE sha512-586.asm
IF @Version LT 800
ECHO MASM version 8.00 or later is strongly recommended.
ENDIF
.586
.686
.MODEL FLAT
OPTION DOTNAME
IF @Version LT 800
@@ -104,31 +104,30 @@ ALIGN 16
$L00300_15:
mov ebx,DWORD PTR 92[esp]
mov ecx,edx
ror ecx,6
mov edi,edx
ror edi,11
ror ecx,14
mov esi,DWORD PTR 20[esp]
xor ecx,edi
ror edi,14
xor ecx,edi
xor ecx,edx
ror ecx,5
xor ecx,edx
ror ecx,6
mov edi,DWORD PTR 24[esp]
add ebx,ecx
mov DWORD PTR 16[esp],edx
xor esi,edi
mov DWORD PTR 16[esp],edx
mov ecx,eax
and esi,edx
mov edx,DWORD PTR 12[esp]
xor esi,edi
mov edi,eax
add ebx,esi
ror ecx,2
ror ecx,9
add ebx,DWORD PTR 28[esp]
ror edi,13
xor ecx,eax
ror ecx,11
mov esi,DWORD PTR 4[esp]
xor ecx,edi
ror edi,9
xor ecx,eax
ror ecx,2
add edx,ebx
xor ecx,edi
mov edi,DWORD PTR 8[esp]
add ebx,ecx
mov DWORD PTR [esp],eax
@@ -150,48 +149,46 @@ ALIGN 16
$L00416_63:
mov esi,ebx
mov ecx,DWORD PTR 100[esp]
shr ebx,3
ror esi,7
xor ebx,esi
ror esi,11
mov edi,ecx
xor esi,ebx
ror esi,7
shr ebx,3
ror edi,2
xor ebx,esi
shr ecx,10
mov esi,DWORD PTR 156[esp]
xor edi,ecx
ror edi,17
xor ecx,edi
ror edi,2
add ebx,esi
shr ecx,10
add ebx,DWORD PTR 156[esp]
xor edi,ecx
add ebx,edi
mov ecx,edx
add ebx,DWORD PTR 120[esp]
ror ecx,6
mov edi,edx
ror edi,11
mov ecx,edx
add ebx,edi
ror ecx,14
mov esi,DWORD PTR 20[esp]
xor ecx,edi
ror edi,14
xor ecx,edx
ror ecx,5
mov DWORD PTR 92[esp],ebx
xor ecx,edi
xor ecx,edx
ror ecx,6
mov edi,DWORD PTR 24[esp]
add ebx,ecx
mov DWORD PTR 16[esp],edx
xor esi,edi
mov DWORD PTR 16[esp],edx
mov ecx,eax
and esi,edx
mov edx,DWORD PTR 12[esp]
xor esi,edi
mov edi,eax
add ebx,esi
ror ecx,2
ror ecx,9
add ebx,DWORD PTR 28[esp]
ror edi,13
xor ecx,eax
ror ecx,11
mov esi,DWORD PTR 4[esp]
xor ecx,edi
ror edi,9
xor ecx,eax
ror ecx,2
add edx,ebx
xor ecx,edi
mov edi,DWORD PTR 8[esp]
add ebx,ecx
mov DWORD PTR [esp],eax
@@ -2,7 +2,7 @@ TITLE sha512-586.asm
IF @Version LT 800
ECHO MASM version 8.00 or later is strongly recommended.
ENDIF
.586
.686
.MODEL FLAT
OPTION DOTNAME
IF @Version LT 800
@@ -2,7 +2,7 @@ TITLE x86cpuid.asm
IF @Version LT 800
ECHO MASM version 8.00 or later is strongly recommended.
ENDIF
.586
.686
.MODEL FLAT
OPTION DOTNAME
IF @Version LT 800
@@ -27,9 +27,9 @@ $L_OPENSSL_ia32_cpuid_begin::
pushfd
pop eax
xor ecx,eax
bt ecx,21
jnc $L000done
xor eax,eax
bt ecx,21
jnc $L000nocpuid
cpuid
mov edi,eax
xor eax,eax
@@ -55,7 +55,14 @@ $L_OPENSSL_ia32_cpuid_begin::
jnz $L001intel
mov eax,2147483648
cpuid
cmp eax,2147483656
cmp eax,2147483649
jb $L001intel
mov esi,eax
mov eax,2147483649
cpuid
or ebp,ecx
and ebp,2049
cmp esi,2147483656
jb $L001intel
mov eax,2147483656
cpuid
@@ -64,46 +71,68 @@ $L_OPENSSL_ia32_cpuid_begin::
mov eax,1
cpuid
bt edx,28
jnc $L000done
jnc $L002generic
shr ebx,16
and ebx,255
cmp ebx,esi
ja $L000done
ja $L002generic
and edx,4026531839
jmp $L000done
jmp $L002generic
$L001intel:
cmp edi,4
mov edi,-1
jb $L002nocacheinfo
jb $L003nocacheinfo
mov eax,4
mov ecx,0
cpuid
mov edi,eax
shr edi,14
and edi,4095
$L002nocacheinfo:
$L003nocacheinfo:
mov eax,1
cpuid
and edx,3220176895
cmp ebp,0
jne $L003notP4
jne $L004notintel
or edx,1073741824
and ah,15
cmp ah,15
jne $L003notP4
jne $L004notintel
or edx,1048576
$L003notP4:
$L004notintel:
bt edx,28
jnc $L000done
jnc $L002generic
and edx,4026531839
cmp edi,0
je $L000done
je $L002generic
or edx,268435456
shr ebx,16
cmp bl,1
ja $L000done
ja $L002generic
and edx,4026531839
$L000done:
mov eax,edx
mov edx,ecx
$L002generic:
and ebp,2048
and ecx,4294965247
mov esi,edx
or ebp,ecx
bt ecx,27
jnc $L005clear_avx
xor ecx,ecx
DB 15,1,208
and eax,6
cmp eax,6
je $L006done
cmp eax,2
je $L005clear_avx
$L007clear_xmm:
and ebp,4261412861
and esi,4278190079
$L005clear_avx:
and ebp,4026525695
$L006done:
mov eax,esi
mov edx,ebp
$L000nocpuid:
pop edi
pop esi
pop ebx
@@ -118,24 +147,24 @@ $L_OPENSSL_rdtsc_begin::
xor edx,edx
lea ecx,DWORD PTR _OPENSSL_ia32cap_P
bt DWORD PTR [ecx],4
jnc $L004notsc
jnc $L008notsc
rdtsc
$L004notsc:
$L008notsc:
ret
_OPENSSL_rdtsc ENDP
ALIGN 16
_OPENSSL_instrument_halt PROC PUBLIC
$L_OPENSSL_instrument_halt_begin::
lea ecx,DWORD PTR _OPENSSL_ia32cap_P
bt DWORD PTR [ecx],4
jnc $L005nohalt
jnc $L009nohalt
DD 2421723150
and eax,3
jnz $L005nohalt
jnz $L009nohalt
pushfd
pop eax
bt eax,9
jnc $L005nohalt
jnc $L009nohalt
rdtsc
push edx
push eax
@@ -145,7 +174,7 @@ DD 2421723150
sbb edx,DWORD PTR 4[esp]
add esp,8
ret
$L005nohalt:
$L009nohalt:
xor eax,eax
xor edx,edx
ret
@@ -156,21 +185,21 @@ $L_OPENSSL_far_spin_begin::
pushfd
pop eax
bt eax,9
jnc $L006nospin
jnc $L010nospin
mov eax,DWORD PTR 4[esp]
mov ecx,DWORD PTR 8[esp]
DD 2430111262
xor eax,eax
mov edx,DWORD PTR [ecx]
jmp $L007spin
jmp $L011spin
ALIGN 16
$L007spin:
$L011spin:
inc eax
cmp edx,DWORD PTR [ecx]
je $L007spin
je $L011spin
DD 529567888
ret
$L006nospin:
$L010nospin:
xor eax,eax
xor edx,edx
ret
@@ -183,9 +212,9 @@ $L_OPENSSL_wipe_cpu_begin::
lea ecx,DWORD PTR _OPENSSL_ia32cap_P
mov ecx,DWORD PTR [ecx]
bt DWORD PTR [ecx],1
jnc $L008no_x87
jnc $L012no_x87
DD 4007259865,4007259865,4007259865,4007259865,2430851995
$L008no_x87:
$L012no_x87:
lea eax,DWORD PTR 4[esp]
ret
_OPENSSL_wipe_cpu ENDP
@@ -197,11 +226,11 @@ $L_OPENSSL_atomic_add_begin::
push ebx
nop
mov eax,DWORD PTR [edx]
$L009spin:
$L013spin:
lea ebx,DWORD PTR [ecx*1+eax]
nop
DD 447811568
jne $L009spin
jne $L013spin
mov eax,ebx
pop ebx
ret
@@ -238,37 +267,50 @@ $L_OPENSSL_cleanse_begin::
mov ecx,DWORD PTR 8[esp]
xor eax,eax
cmp ecx,7
jae $L010lot
jae $L014lot
cmp ecx,0
je $L011ret
$L012little:
je $L015ret
$L016little:
mov BYTE PTR [edx],al
sub ecx,1
lea edx,DWORD PTR 1[edx]
jnz $L012little
$L011ret:
jnz $L016little
$L015ret:
ret
ALIGN 16
$L010lot:
$L014lot:
test edx,3
jz $L013aligned
jz $L017aligned
mov BYTE PTR [edx],al
lea ecx,DWORD PTR [ecx-1]
lea edx,DWORD PTR 1[edx]
jmp $L010lot
$L013aligned:
jmp $L014lot
$L017aligned:
mov DWORD PTR [edx],eax
lea ecx,DWORD PTR [ecx-4]
test ecx,-4
lea edx,DWORD PTR 4[edx]
jnz $L013aligned
jnz $L017aligned
cmp ecx,0
jne $L012little
jne $L016little
ret
_OPENSSL_cleanse ENDP
ALIGN 16
_OPENSSL_ia32_rdrand PROC PUBLIC
$L_OPENSSL_ia32_rdrand_begin::
mov ecx,8
$L018loop:
DB 15,199,240
jc $L019break
loop $L018loop
$L019break:
cmp eax,0
cmove eax,ecx
ret
_OPENSSL_ia32_rdrand ENDP
.text$ ENDS
.bss SEGMENT 'BSS'
COMM _OPENSSL_ia32cap_P:DWORD
COMM _OPENSSL_ia32cap_P:QWORD
.bss ENDS
.CRT$XCU SEGMENT DWORD PUBLIC 'DATA'
EXTERN _OPENSSL_cpuid_setup:NEAR

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

@@ -0,0 +1,333 @@
/* opensslconf.h */
/* WARNING: Generated automatically from opensslconf.h.in by Configure. */

/* OpenSSL was configured with the following options: */
#undef OPENSSL_SYSNAME_WIN32
#if defined(_WIN32)
# define OPENSSL_SYSNAME_WIN32
#endif

#ifndef OPENSSL_DOING_MAKEDEPEND
# ifndef OPENSSL_NO_CAPIENG
# define OPENSSL_NO_CAPIENG
# endif
# ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
# define OPENSSL_NO_EC_NISTP_64_GCC_128
# endif
# ifndef OPENSSL_NO_GMP
# define OPENSSL_NO_GMP
# endif
# ifndef OPENSSL_NO_GOST
# define OPENSSL_NO_GOST
# endif
# ifndef OPENSSL_NO_HW_PADLOCK
# define OPENSSL_NO_HW_PADLOCK
# endif
# ifndef OPENSSL_NO_JPAKE
# define OPENSSL_NO_JPAKE
# endif
# ifndef OPENSSL_NO_KRB5
# define OPENSSL_NO_KRB5
# endif
# ifndef OPENSSL_NO_MD2
# define OPENSSL_NO_MD2
# endif
# ifndef OPENSSL_NO_RC5
# define OPENSSL_NO_RC5
# endif
# ifndef OPENSSL_NO_RFC3779
# define OPENSSL_NO_RFC3779
# endif
# ifndef OPENSSL_NO_SCTP
# define OPENSSL_NO_SCTP
# endif
# ifndef OPENSSL_NO_STORE
# define OPENSSL_NO_STORE
# endif
#endif /* OPENSSL_DOING_MAKEDEPEND */

#ifndef OPENSSL_THREADS
# define OPENSSL_THREADS
#endif
#ifndef OPENSSL_NO_DYNAMIC_ENGINE
# define OPENSSL_NO_DYNAMIC_ENGINE
#endif

/* The OPENSSL_NO_* macros are also defined as NO_* if the application
asks for it. This is a transient feature that is provided for those
who haven't had the time to do the appropriate changes in their
applications. */
#ifdef OPENSSL_ALGORITHM_DEFINES
# if defined(OPENSSL_NO_CAMELLIA) && !defined(NO_CAMELLIA)
# define NO_CAMELLIA
# endif
# if defined(OPENSSL_NO_CAPIENG) && !defined(NO_CAPIENG)
# define NO_CAPIENG
# endif
# if defined(OPENSSL_NO_CAST) && !defined(NO_CAST)
# define NO_CAST
# endif
# if defined(OPENSSL_NO_CMS) && !defined(NO_CMS)
# define NO_CMS
# endif
# if defined(OPENSSL_NO_FIPS) && !defined(NO_FIPS)
# define NO_FIPS
# endif
# if defined(OPENSSL_NO_GMP) && !defined(NO_GMP)
# define NO_GMP
# endif
# if defined(OPENSSL_NO_IDEA) && !defined(NO_IDEA)
# define NO_IDEA
# endif
# if defined(OPENSSL_NO_JPAKE) && !defined(NO_JPAKE)
# define NO_JPAKE
# endif
# if defined(OPENSSL_NO_KRB5) && !defined(NO_KRB5)
# define NO_KRB5
# endif
# if defined(OPENSSL_NO_MD2) && !defined(NO_MD2)
# define NO_MD2
# endif
# if defined(OPENSSL_NO_MDC2) && !defined(NO_MDC2)
# define NO_MDC2
# endif
# if defined(OPENSSL_NO_RC5) && !defined(NO_RC5)
# define NO_RC5
# endif
# if defined(OPENSSL_NO_RFC3779) && !defined(NO_RFC3779)
# define NO_RFC3779
# endif
# if defined(OPENSSL_NO_SEED) && !defined(NO_SEED)
# define NO_SEED
# endif
# if defined(OPENSSL_NO_SHA0) && !defined(NO_SHA0)
# define NO_SHA0
# endif
# if defined(OPENSSL_NO_STORE) && !defined(NO_STORE)
# define NO_STORE
# endif
# if defined(OPENSSL_NO_WHRLPOOL) && !defined(NO_WHRLPOOL)
# define NO_WHRLPOOL
# endif
# if defined(OPENSSL_NO_MDC2) && !defined(NO_MDC2)
# define NO_MDC2
# endif
#endif

/* crypto/opensslconf.h.in */

#ifdef OPENSSL_DOING_MAKEDEPEND
/* Include any symbols here that have to be explicitly set to enable a feature
* that should be visible to makedepend.
*
* [Our "make depend" doesn't actually look at this, we use actual build settings
* instead; we want to make it easy to remove subdirectories with disabled algorithms.]
*/
# ifndef OPENSSL_FIPS
# define OPENSSL_FIPS
# endif
#endif

/* Generate 80386 code? */
#undef I386_ONLY

#if !(defined(VMS) || defined(__VMS)) /* VMS uses logical names instead */
# if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR)
# if defined(_WIN32)
# define ENGINESDIR "ssl/lib/engines"
# define OPENSSLDIR "ssl"
# else
# define ENGINESDIR "/usr/local/ssl/lib/engines"
# define OPENSSLDIR "/usr/local/ssl"
# endif
# endif
#endif

#undef OPENSSL_UNISTD
#define OPENSSL_UNISTD <unistd.h>
#if !defined(_WIN32) && !defined(__arm__) && !defined(SWIG)
# include <unistd.h>
#endif

#undef OPENSSL_EXPORT_VAR_AS_FUNCTION
#if defined(_WIN32)
# define OPENSSL_EXPORT_VAR_AS_FUNCTION
#endif

#if defined(HEADER_IDEA_H)
# undef IDEA_INT
# define IDEA_INT unsigned int
#endif

#if defined(HEADER_MD2_H)
# undef MD2_INT
# define MD2_INT unsigned int
#endif

#if defined(HEADER_RC2_H)
/* I need to put in a mod for the alpha - eay */
# undef RC2_INT
# define RC2_INT unsigned int
#endif

#if defined(HEADER_RC4_H)
/* using int types make the structure larger but make the code faster
* on most boxes I have tested - up to %20 faster. */
/*
* I don't know what does "most" mean, but declaring "int" is a must on:
* - Intel P6 because partial register stalls are very expensive;
* - elder Alpha because it lacks byte load/store instructions;
*/
# undef RC4_INT
# if defined(__arm__)
# define RC4_INT unsigned char
# else
# define RC4_INT unsigned int
# endif

/*
* This enables code handling data aligned at natural CPU word
* boundary. See crypto/rc4/rc4_enc.c for further details.
*/
# undef RC4_CHUNK
# if (defined(_M_X64) || defined(__x86_64__)) && defined(_WIN32)
# define RC4_CHUNK unsigned long long
# elif (defined(_M_X64) || defined(__x86_64__)) && !defined(_WIN32)
# define RC4_CHUNK unsigned long
# elif defined(__arm__)
# define RC4_CHUNK unsigned long
# else
/* On x86 RC4_CHUNK is not defined */
# endif
#endif

#if defined(HEADER_NEW_DES_H) || defined(HEADER_DES_H)
/* If this is set to 'unsigned int' on a DEC Alpha, this gives about a
* %20 speed up (longs are 8 bytes, int's are 4). */
# undef DES_LONG
# if defined(_M_X64) || defined(__x86_64__) || defined(__arm__)
# define DES_LONG unsigned int
# elif defined(_M_IX86) || defined(__i386__)
# define DES_LONG unsigned long
# endif
#endif

#if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H)
# define CONFIG_HEADER_BN_H

# undef BL_LLONG
# if defined(_M_IX86) || defined(__i386__) || defined(__arm__)
# define BL_LLONG
# endif

/* Should we define BN_DIV2W here? */

/* Only one for the following should be defined */
/* The prime number generation stuff may not work when
* EIGHT_BIT but I don't care since I've only used this mode
* for debuging the bignum libraries */
# undef SIXTY_FOUR_BIT_LONG
# undef SIXTY_FOUR_BIT
# undef THIRTY_TWO_BIT
# undef SIXTEEN_BIT
# undef EIGHT_BIT
# if (defined(_M_X64) || defined(__x86_64__)) && defined(_WIN32)
# define SIXTY_FOUR_BIT
# elif (defined(_M_X64) || defined(__x86_64__)) && !defined(_WIN32)
# define SIXTY_FOUR_BIT_LONG
# elif defined(_M_IX86) || defined(__i386__) || defined(__arm__)
# define THIRTY_TWO_BIT
# endif
#endif

#if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H)
# define CONFIG_HEADER_RC4_LOCL_H
/* if this is defined data[i] is used instead of *data, this is a %20
* speedup on x86 */
# undef RC4_INDEX
# if defined(_M_IX86) || defined(__i386__)
# define RC4_INDEX
# endif
#endif

#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H)
# define CONFIG_HEADER_BF_LOCL_H
# undef BF_PTR
# if defined(__arm__)
# define BF_PTR
# endif
#endif /* HEADER_BF_LOCL_H */

#if defined(HEADER_DES_LOCL_H) && !defined(CONFIG_HEADER_DES_LOCL_H)
# define CONFIG_HEADER_DES_LOCL_H

# ifndef DES_DEFAULT_OPTIONS
/* the following is tweaked from a config script, that is why it is a
* protected undef/define */
# undef DES_PTR
# if !defined(_WIN32) && (defined(_M_IX86) || defined(__i386__))
# define DES_PTR
# endif

/* This helps C compiler generate the correct code for multiple functional
* units. It reduces register dependancies at the expense of 2 more
* registers */
# undef DES_RISC1
# if !defined(_WIN32) && (defined(_M_IX86) || defined(__i386__))
# define DES_RISC1
# endif

# undef DES_RISC2

# if defined(DES_RISC1) && defined(DES_RISC2)
# error YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
# endif

/* Unroll the inner loop, this sometimes helps, sometimes hinders.
* Very mucy CPU dependant */
# undef DES_UNROLL
# if !defined(_WIN32)
# define DES_UNROLL
# endif

/* These default values were supplied by
* Peter Gutman <pgut001@cs.auckland.ac.nz>
* They are only used if nothing else has been defined */
# if !defined(DES_PTR) && !defined(DES_RISC1) && !defined(DES_RISC2) && !defined(DES_UNROLL)
/* Special defines which change the way the code is built depending on the
CPU and OS. For SGI machines you can use _MIPS_SZLONG (32 or 64) to find
even newer MIPS CPU's, but at the moment one size fits all for
optimization options. Older Sparc's work better with only UNROLL, but
there's no way to tell at compile time what it is you're running on */
# if defined( sun ) /* Newer Sparc's */
# define DES_PTR
# define DES_RISC1
# define DES_UNROLL
# elif defined( __ultrix ) /* Older MIPS */
# define DES_PTR
# define DES_RISC2
# define DES_UNROLL
# elif defined( __osf1__ ) /* Alpha */
# define DES_PTR
# define DES_RISC2
# elif defined ( _AIX ) /* RS6000 */
/* Unknown */
# elif defined( __hpux ) /* HP-PA */
/* Unknown */
# elif defined( __aux ) /* 68K */
/* Unknown */
# elif defined( __dgux ) /* 88K (but P6 in latest boxes) */
# define DES_UNROLL
# elif defined( __sgi ) /* Newer MIPS */
# define DES_PTR
# define DES_RISC2
# define DES_UNROLL
# elif defined(i386) || defined(__i386__) /* x86 boxes, should be gcc */
# define DES_PTR
# define DES_RISC1
# define DES_UNROLL
# endif /* Systems-specific speed defines */
# endif

# endif /* DES_DEFAULT_OPTIONS */
#endif /* HEADER_DES_LOCL_H */

This file was deleted.

This file was deleted.

This file was deleted.

Large diffs are not rendered by default.

@@ -2054,8 +2054,8 @@ ()
&test ($s2,15);
&jnz (&label("slow_way"));
if (!$x86only) {
&bt (&DWP(0,$s0),28); # check for hyper-threading bit
&jc (&label("slow_way"));
#&bt (&DWP(0,$s0),28); # check for hyper-threading bit
#&jc (&label("slow_way"));
}
# pre-allocate aligned stack frame...
&lea ($acc,&DWP(-80-244,"esp"));
@@ -1683,8 +1683,8 @@ ()
jb .Lcbc_slow_prologue
test \$15,%rdx
jnz .Lcbc_slow_prologue
bt \$28,%r10d
jc .Lcbc_slow_prologue
#bt \$28,%r10d
#jc .Lcbc_slow_prologue
# allocate aligned stack frame...
lea -88-248(%rsp),$key
@@ -718,7 +718,7 @@ void OPENSSL_cpuid_setup(void)
unsigned long *OPENSSL_ia32cap_loc(void) { return NULL; }
#endif
int OPENSSL_NONPIC_relocated = 0;
#if !defined(OPENSSL_CPUID_SETUP)
#if !defined(OPENSSL_CPUID_SETUP) && !defined(OPENSSL_CPUID_OBJ)
void OPENSSL_cpuid_setup(void) {}
#endif

@@ -0,0 +1 @@
#include "../../config/opensslconf.h"
@@ -79,7 +79,7 @@ sub ::file
IF \@Version LT 800
ECHO MASM version 8.00 or later is strongly recommended.
ENDIF
.486
.686
.MODEL FLAT
OPTION DOTNAME
IF \@Version LT 800
@@ -0,0 +1 @@
#include "../../crypto/opensslconf.h"
@@ -197,7 +197,9 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
/* TODO batch up */
struct kevent events[1];
EV_SET(events + 0, fd, ev->filter, EV_DELETE, 0, 0, 0);
if (kevent(loop->backend_fd, events, 1, NULL, 0, NULL)) abort();
if (kevent(loop->backend_fd, events, 1, NULL, 0, NULL))
if (errno != ENOENT)
abort();
}
}

@@ -208,7 +210,9 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
/* TODO batch up */
struct kevent events[1];
EV_SET(events + 0, fd, ev->filter, EV_DELETE, 0, 0, 0);
if (kevent(loop->backend_fd, events, 1, NULL, 0, NULL)) abort();
if (kevent(loop->backend_fd, events, 1, NULL, 0, NULL))
if (errno != ENOENT)
abort();
}
}

@@ -376,7 +376,7 @@ int uv_fs_event_init(uv_loop_t* loop,


void uv__fs_event_close(uv_fs_event_t* handle) {
if (handle->fd == PORT_FIRED) {
if (handle->fd == PORT_FIRED || handle->fd == PORT_LOADED) {
port_dissociate(handle->loop->fs_fd, PORT_SOURCE_FILE, (uintptr_t)&handle->fo);
}
handle->fd = PORT_DELETED;
@@ -233,7 +233,7 @@ int uv_tcp_listen(uv_tcp_t* tcp, int backlog, uv_connection_cb cb) {

if (single_accept == -1) {
const char* val = getenv("UV_TCP_SINGLE_ACCEPT");
single_accept = (val == NULL) || (atoi(val) != 0); /* on by default */
single_accept = (val != NULL && atoi(val) != 0); /* Off by default. */
}

if (single_accept)
@@ -446,14 +446,12 @@ static int uv__udp_send(uv_udp_send_t* req,


int uv_udp_init(uv_loop_t* loop, uv_udp_t* handle) {
memset(handle, 0, sizeof *handle);

uv__handle_init(loop, (uv_handle_t*)handle, UV_UDP);
handle->io_watcher.fd = -1;
handle->alloc_cb = NULL;
handle->recv_cb = NULL;
uv__io_init(&handle->io_watcher, uv__udp_io, -1);
ngx_queue_init(&handle->write_queue);
ngx_queue_init(&handle->write_completed_queue);
uv__io_init(&handle->io_watcher, uv__udp_io, -1);

return 0;
}

@@ -21,11 +21,7 @@

#include "uv.h"
#include "task.h"

#include <stdlib.h>
#include <stdio.h>
#include <string.h> /* strlen */


#define CONCURRENT_CALLS 10
#define TOTAL_CALLS 10000
@@ -24,7 +24,6 @@

#include <stdlib.h>
#include <stdio.h>
#include <string.h> /* strlen */

/* Run the benchmark for this many ms */
#define TIME 5000
@@ -103,8 +102,7 @@ static void pinger_write_ping(pinger_t* pinger) {
uv_write_t* req;
uv_buf_t buf;

buf.base = (char*)&PING;
buf.len = strlen(PING);
buf = uv_buf_init(PING, sizeof(PING) - 1);

req = malloc(sizeof *req);
if (uv_write(req, (uv_stream_t*) &pinger->tcp, &buf, 1, pinger_write_cb)) {
@@ -19,6 +19,7 @@
* IN THE SOFTWARE.
*/

#include <errno.h>
#include <stdio.h>
#include <string.h>

@@ -99,7 +100,7 @@ static int maybe_run_test(int argc, char **argv) {

if (strcmp(argv[1], "spawn_helper3") == 0) {
char buffer[256];
fgets(buffer, sizeof(buffer) - 1, stdin);
ASSERT(buffer == fgets(buffer, sizeof(buffer) - 1, stdin));
buffer[sizeof(buffer) - 1] = '\0';
fputs(buffer, stdout);
return 1;
@@ -111,13 +112,20 @@ static int maybe_run_test(int argc, char **argv) {
}

if (strcmp(argv[1], "spawn_helper5") == 0) {
const char* out = "fourth stdio!\n\0";
const char out[] = "fourth stdio!\n";
#ifdef _WIN32
DWORD bytes;
WriteFile((HANDLE) _get_osfhandle(3), out, strlen(out), &bytes, NULL);
WriteFile((HANDLE) _get_osfhandle(3), out, sizeof(out) - 1, &bytes, NULL);
#else
write(3, out, strlen(out));
fsync(3);
{
ssize_t r;

do
r = write(3, out, sizeof(out) - 1);
while (r == -1 && errno == EINTR);

fsync(3);
}
#endif
return 1;
}
@@ -24,6 +24,7 @@

#include <stdint.h> /* uintptr_t */

#include <errno.h>
#include <unistd.h> /* usleep */
#include <string.h> /* strdup */
#include <stdio.h>
@@ -146,8 +147,11 @@ static void* dowait(void* data) {

if (args->pipe[1] >= 0) {
/* Write a character to the main thread to notify it about this. */
char c = 0;
write(args->pipe[1], &c, 1);
ssize_t r;

do
r = write(args->pipe[1], "", 1);
while (r == -1 && errno == EINTR);
}

return NULL;
@@ -296,6 +296,37 @@ TEST_IMPL(fs_event_watch_file_current_dir) {
return 0;
}

TEST_IMPL(fs_event_no_callback_after_close) {
uv_loop_t* loop = uv_default_loop();
int r;

/* Setup */
remove("watch_dir/file1");
remove("watch_dir/");
create_dir(loop, "watch_dir");
create_file(loop, "watch_dir/file1");

r = uv_fs_event_init(loop,
&fs_event,
"watch_dir/file1",
fs_event_cb_file,
0);
ASSERT(r != -1);

uv_close((uv_handle_t*)&fs_event, close_cb);
touch_file(loop, "watch_dir/file1");
uv_run(loop);

ASSERT(fs_event_cb_called == 0);
ASSERT(close_cb_called == 1);

/* Cleanup */
remove("watch_dir/file1");
remove("watch_dir/");

MAKE_VALGRIND_HAPPY();
return 0;
}

TEST_IMPL(fs_event_no_callback_on_close) {
uv_loop_t* loop = uv_default_loop();
@@ -21,11 +21,7 @@

#include "uv.h"
#include "task.h"

#include <stdlib.h>
#include <stdio.h>
#include <string.h> /* strlen */


#define CONCURRENT_COUNT 10

@@ -177,6 +177,7 @@ TEST_DECLARE (fs_event_watch_dir)
TEST_DECLARE (fs_event_watch_file)
TEST_DECLARE (fs_event_watch_file_twice)
TEST_DECLARE (fs_event_watch_file_current_dir)
TEST_DECLARE (fs_event_no_callback_after_close)
TEST_DECLARE (fs_event_no_callback_on_close)
TEST_DECLARE (fs_event_immediate_close)
TEST_DECLARE (fs_event_close_with_pending_event)
@@ -450,6 +451,7 @@ TASK_LIST_START
TEST_ENTRY (fs_event_watch_file)
TEST_ENTRY (fs_event_watch_file_twice)
TEST_ENTRY (fs_event_watch_file_current_dir)
TEST_ENTRY (fs_event_no_callback_after_close)
TEST_ENTRY (fs_event_no_callback_on_close)
TEST_ENTRY (fs_event_immediate_close)
TEST_ENTRY (fs_event_close_with_pending_event)
@@ -24,7 +24,6 @@

#include <stdlib.h>
#include <stdio.h>
#include <string.h> /* strlen */

static int completed_pingers = 0;

@@ -77,11 +76,9 @@ static void pinger_write_ping(pinger_t* pinger) {
uv_write_t *req;
uv_buf_t buf;

buf.base = (char*)&PING;
buf.len = strlen(PING);

req = malloc(sizeof(uv_write_t));
buf = uv_buf_init(PING, sizeof(PING) - 1);

req = malloc(sizeof(*req));
if (uv_write(req, (uv_stream_t*)&pinger->stream.tcp, &buf, 1, pinger_after_write)) {
FATAL("uv_write failed");
}
@@ -634,13 +634,20 @@ Returns a new ReadStream object (See `Readable Stream`).
encoding: null,
fd: null,
mode: 0666,
bufferSize: 64 * 1024
bufferSize: 64 * 1024,
autoClose: true
}

`options` can include `start` and `end` values to read a range of bytes from
the file instead of the entire file. Both `start` and `end` are inclusive and
start at 0. The `encoding` can be `'utf8'`, `'ascii'`, or `'base64'`.

If `autoClose` is false, then the file descriptor won't be closed, even if
there's an error. It is your responsiblity to close it and make sure
there's no file descriptor leak. If `autoClose` is set to true (default
behavior), on `error` or `end` the file descriptor will be closed
automatically.

An example to read the last 10 bytes of a file which is 100 bytes long:

fs.createReadStream('sample.txt', {start: 90, end: 99});

Large diffs are not rendered by default.

@@ -186,6 +186,8 @@ <h2 class="localized">Localized Sites</h2>
Spanish<br>
<a href="http://nodejskr.org">OctoberSkyJs</a> Korea Node.js
community<br>
<a href="https://plus.google.com/communities/113346206415381691435">FR . Node.js</a>
Google+ Community of Node.js French users
<a href="http://www.nodejstr.com/">Node.js TĂĽrkiye</a>
Node.js in Turkish
</p>
@@ -24,7 +24,6 @@ Readable.ReadableState = ReadableState;

var Stream = require('stream');
var util = require('util');
var assert = require('assert');
var StringDecoder;

util.inherits(Readable, Stream);
@@ -33,29 +32,21 @@ function ReadableState(options, stream) {
options = options || {};

// the argument passed to this._read(n,cb)
this.bufferSize = options.hasOwnProperty('bufferSize') ?
options.bufferSize : 16 * 1024;
this.bufferSize = options.bufferSize || 16 * 1024;

// the point at which it stops calling _read() to fill the buffer
this.highWaterMark = options.hasOwnProperty('highWaterMark') ?
options.highWaterMark : 16 * 1024;
// Note: 0 is a valid value, means "don't call _read preemptively ever"
var hwm = options.highWaterMark;
this.highWaterMark = (hwm || hwm === 0) ? hwm : 16 * 1024;

// the minimum number of bytes to buffer before emitting 'readable'
// default to pushing everything out as fast as possible.
this.lowWaterMark = options.hasOwnProperty('lowWaterMark') ?
options.lowWaterMark : 0;
this.lowWaterMark = options.lowWaterMark || 0;

// cast to ints.
assert(typeof this.bufferSize === 'number');
assert(typeof this.lowWaterMark === 'number');
assert(typeof this.highWaterMark === 'number');
this.bufferSize = ~~this.bufferSize;
this.lowWaterMark = ~~this.lowWaterMark;
this.highWaterMark = ~~this.highWaterMark;
assert(this.bufferSize >= 0);
assert(this.lowWaterMark >= 0);
assert(this.highWaterMark >= this.lowWaterMark,
this.highWaterMark + '>=' + this.lowWaterMark);

this.buffer = [];
this.length = 0;
@@ -36,22 +36,18 @@ function WritableState(options, stream) {
options = options || {};

// the point at which write() starts returning false
this.highWaterMark = options.hasOwnProperty('highWaterMark') ?
options.highWaterMark : 16 * 1024;
// Note: 0 is a valid value, means that we always return false if
// the entire buffer is not flushed immediately on write()
var hwm = options.highWaterMark;
this.highWaterMark = (hwm || hwm === 0) ? hwm : 16 * 1024;

// the point that it has to get to before we call _write(chunk,cb)
// default to pushing everything out as fast as possible.
this.lowWaterMark = options.hasOwnProperty('lowWaterMark') ?
options.lowWaterMark : 0;
this.lowWaterMark = options.lowWaterMark || 0;

// cast to ints.
assert(typeof this.lowWaterMark === 'number');
assert(typeof this.highWaterMark === 'number');
this.lowWaterMark = ~~this.lowWaterMark;
this.highWaterMark = ~~this.highWaterMark;
assert(this.lowWaterMark >= 0);
assert(this.highWaterMark >= this.lowWaterMark,
this.highWaterMark + '>=' + this.lowWaterMark);

this.needDrain = false;
// at the start of calling end()
@@ -66,8 +62,8 @@ function WritableState(options, stream) {
// should we decode strings into buffers before passing to _write?
// this is here so that some node-core streams can optimize string
// handling at a lower level.
this.decodeStrings = options.hasOwnProperty('decodeStrings') ?
options.decodeStrings : true;
var noDecode = options.decodeStrings === false;
this.decodeStrings = !noDecode;

// not an actual buffer we keep track of, but a measurement
// of how much we're waiting to get pushed to some underlying
@@ -81,6 +77,11 @@ function WritableState(options, stream) {
// or on a later tick.
this.sync = false;

// a flag to know if we're processing previously buffered items, which
// may call the _write() callback in the same tick, so that we don't
// end up in an overlapped onwrite situation.
this.bufferProcessing = false;

// the callback that's passed to _write(chunk,cb)
this.onwrite = function(er) {
onwrite(stream, er);
@@ -169,6 +170,9 @@ function onwrite(stream, er) {

if (er) {
if (cb) {
// If _write(chunk,cb) calls cb() in this tick, we still defer
// the *user's* write callback to the next tick.
// Never present an external API that is *sometimes* async!
if (sync)
process.nextTick(function() {
cb(er);
@@ -184,9 +188,8 @@ function onwrite(stream, er) {
state.length -= l;

if (cb) {
// don't call the cb until the next tick if we're in sync mode.
// also, defer if we're about to write some more right now.
if (sync || state.buffer.length)
// Don't call the cb until the next tick if we're in sync mode.
if (sync)
process.nextTick(cb);
else
cb();
@@ -201,24 +204,6 @@ function onwrite(stream, er) {
return;
}

// if there's something in the buffer waiting, then do that, too.
if (state.buffer.length) {
var chunkCb = state.buffer.shift();
var chunk = chunkCb[0];
cb = chunkCb[1];

if (false === state.decodeStrings)
l = chunk[0].length;
else
l = chunk.length;

state.writelen = l;
state.writecb = cb;
state.writechunk = chunk;
state.writing = true;
stream._write(chunk, state.onwrite);
}

if (state.length <= state.lowWaterMark && state.needDrain) {
// Must force callback to be called on nextTick, so that we don't
// emit 'drain' before the write() consumer gets the 'false' return
@@ -230,6 +215,49 @@ function onwrite(stream, er) {
stream.emit('drain');
});
}

// if there's something in the buffer waiting, then process it
// It would be nice if there were TCO in JS, and we could just
// shift the top off the buffer and _write that, but that approach
// causes RangeErrors when you have a very large number of very
// small writes, and is not very efficient otherwise.
if (!state.bufferProcessing && state.buffer.length) {
state.bufferProcessing = true;

for (var c = 0; c < state.buffer.length; c++) {
var chunkCb = state.buffer[c];
var chunk = chunkCb[0];
cb = chunkCb[1];

if (false === state.decodeStrings)
l = chunk[0].length;
else
l = chunk.length;

state.writelen = l;
state.writecb = cb;
state.writechunk = chunk;
state.writing = true;
state.sync = true;
stream._write(chunk, state.onwrite);
state.sync = false;

// if we didn't call the onwrite immediately, then
// it means that we need to wait until it does.
// also, that means that the chunk and cb are currently
// being processed, so move the buffer counter past them.
if (state.writing) {
c++;
break;
}
}

state.bufferProcessing = false;
if (c < state.buffer.length)
state.buffer = state.buffer.slice(c);
else
state.buffer.length = 0;
}
}

Writable.prototype._write = function(chunk, cb) {
@@ -20,7 +20,6 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.

var SlowBuffer = process.binding('buffer').SlowBuffer;
var kPoolSize = process.binding('buffer').kPoolSize;
var assert = require('assert');

exports.INSPECT_MAX_BYTES = 50;
@@ -298,7 +297,7 @@ Buffer.isEncoding = function(encoding) {



Buffer.poolSize = kPoolSize; // see src/node_buffer.h
Buffer.poolSize = 8 * 1024;
var pool;

function allocPool() {
@@ -1412,6 +1412,7 @@ function ReadStream(path, options) {

this.start = options.hasOwnProperty('start') ? options.start : undefined;
this.end = options.hasOwnProperty('start') ? options.end : undefined;
this.autoClose = options.hasOwnProperty('autoClose') ? options.autoClose : true;
this.pos = undefined;

if (this.start !== undefined) {
@@ -1435,7 +1436,9 @@ function ReadStream(path, options) {
this.open();

this.on('end', function() {
this.destroy();
if (this.autoClose) {
this.destroy();
}
});
}

@@ -1445,7 +1448,9 @@ ReadStream.prototype.open = function() {
var self = this;
fs.open(this.path, this.flags, this.mode, function(er, fd) {
if (er) {
self.destroy();
if (this.autoClose) {
self.destroy();
}
self.emit('error', er);
return;
}
@@ -1499,7 +1504,9 @@ ReadStream.prototype._read = function(n, cb) {

function onread(er, bytesRead) {
if (er) {
self.destroy();
if (self.autoClose) {
self.destroy();
}
return cb(er);
}

@@ -119,6 +119,11 @@ function parserOnHeadersComplete(info) {
function parserOnBody(b, start, len) {
var parser = this;
var stream = parser.incoming;

// if the stream has already been removed, then drop it.
if (!stream)
return;

var rs = stream._readableState;
var socket = stream.socket;

@@ -135,29 +140,29 @@ function parserOnBody(b, start, len) {
function parserOnMessageComplete() {
var parser = this;
var stream = parser.incoming;
var socket = stream.socket;

stream.complete = true;

// Emit any trailing headers.
var headers = parser._headers;
if (headers) {
for (var i = 0, n = headers.length; i < n; i += 2) {
var k = headers[i];
var v = headers[i + 1];
parser.incoming._addHeaderLine(k, v);
if (stream) {
stream.complete = true;
// Emit any trailing headers.
var headers = parser._headers;
if (headers) {
for (var i = 0, n = headers.length; i < n; i += 2) {
var k = headers[i];
var v = headers[i + 1];
parser.incoming._addHeaderLine(k, v);
}
parser._headers = [];
parser._url = '';
}
parser._headers = [];
parser._url = '';
}

if (!stream.upgrade)
// For upgraded connections, also emit this after parser.execute
stream._readableState.onread(null, null);
if (!stream.upgrade)
// For upgraded connections, also emit this after parser.execute
stream._readableState.onread(null, null);
}

if (parser.socket.readable) {
// force to read the next incoming message
socket.resume();
parser.socket.resume();
}
}

@@ -307,6 +312,7 @@ exports.IncomingMessage = IncomingMessage;

IncomingMessage.prototype.read = function(n) {
this._consuming = true;
this.read = Stream.Readable.prototype.read;
return Stream.Readable.prototype.read.call(this, n);
};

@@ -327,35 +333,6 @@ IncomingMessage.prototype.destroy = function(error) {
};





IncomingMessage.prototype._emitData = function(d) {
if (this._decoder) {
var string = this._decoder.write(d);
if (string.length) {
this.emit('data', string);
}
} else {
this.emit('data', d);
}
};


IncomingMessage.prototype._emitEnd = function() {
if (!this._endEmitted) {
if (this._decoder) {
var ret = this._decoder.end();
if (ret)
this.emit('data', ret);
}
this.emit('end');
}

this._endEmitted = true;
};


// Add the given (field, value) pair to the message
//
// Per RFC2616, section 4.2 it is acceptable to join multiple instances of the
@@ -415,6 +392,16 @@ IncomingMessage.prototype._addHeaderLine = function(field, value) {
};


// Call this instead of resume() if we want to just
// dump all the data to /dev/null
IncomingMessage.prototype._dump = function() {
this._dumped = true;
this.socket.parser.incoming = null;
this._readableState.onread(null, null);
this.socket.resume();
};


function OutgoingMessage() {
Stream.call(this);

@@ -756,6 +743,10 @@ OutgoingMessage.prototype.addTrailers = function(headers) {
};


var zero_chunk_buf = new Buffer('\r\n0\r\n');
var crlf_buf = new Buffer('\r\n');


OutgoingMessage.prototype.end = function(data, encoding) {
if (this.finished) {
return false;
@@ -773,8 +764,7 @@ OutgoingMessage.prototype.end = function(data, encoding) {
var ret;

var hot = this._headerSent === false &&
typeof(data) === 'string' &&
data.length > 0 &&
(data && data.length > 0) &&
this.output.length === 0 &&
this.connection &&
this.connection.writable &&
@@ -786,13 +776,73 @@ OutgoingMessage.prototype.end = function(data, encoding) {
// res.end(blah);
// HACKY.

if (this.chunkedEncoding) {
var l = Buffer.byteLength(data, encoding).toString(16);
ret = this.connection.write(this._header + l + CRLF +
data + '\r\n0\r\n' +
this._trailer + '\r\n', encoding);
if (typeof data === 'string') {
if (this.chunkedEncoding) {
var l = Buffer.byteLength(data, encoding).toString(16);
ret = this.connection.write(this._header + l + CRLF +
data + '\r\n0\r\n' +
this._trailer + '\r\n', encoding);
} else {
ret = this.connection.write(this._header + data, encoding);
}
} else if (Buffer.isBuffer(data)) {
if (this.chunkedEncoding) {
var chunk_size = data.length.toString(16);

// Skip expensive Buffer.byteLength() calls; only ISO-8859-1 characters
// are allowed in HTTP headers. Therefore:
//
// this._header.length == Buffer.byteLength(this._header.length)
// this._trailer.length == Buffer.byteLength(this._trailer.length)
//
var header_len = this._header.length;
var chunk_size_len = chunk_size.length;
var data_len = data.length;
var trailer_len = this._trailer.length;

var len = header_len
+ chunk_size_len
+ 2 // '\r\n'.length
+ data_len
+ 5 // '\r\n0\r\n'.length
+ trailer_len
+ 2; // '\r\n'.length

var buf = new Buffer(len);
var off = 0;

buf.write(this._header, off, header_len, 'ascii');
off += header_len;

buf.write(chunk_size, off, chunk_size_len, 'ascii');
off += chunk_size_len;

crlf_buf.copy(buf, off);
off += 2;

data.copy(buf, off);
off += data_len;

zero_chunk_buf.copy(buf, off);
off += 5;

if (trailer_len > 0) {
buf.write(this._trailer, off, trailer_len, 'ascii');
off += trailer_len;
}

crlf_buf.copy(buf, off);

ret = this.connection.write(buf);
} else {
var header_len = this._header.length;
var buf = new Buffer(header_len + data.length);
buf.write(this._header, 0, header_len, 'ascii');
data.copy(buf, header_len);
ret = this.connection.write(buf);
}
} else {
ret = this.connection.write(this._header + data, encoding);
throw new TypeError('first argument must be a string or Buffer');
}
this._headerSent = true;

@@ -1471,7 +1521,7 @@ function parserOnIncomingClient(res, shouldKeepAlive) {
// can't possibly read the data, so we .resume() it into the void
// so that the socket doesn't hang there in a paused state.
if (!handled)
res.resume();
res._dump();

return isHeadResponse;
}
@@ -1798,7 +1848,7 @@ function connectionListener(socket) {
// .resume() or .on('data'), then we call req.resume() so that the
// bytes will be pulled off the wire.
if (!req._consuming)
req.resume();
req._dump();

res.detachSocket(socket);

@@ -141,10 +141,13 @@ function Socket(options) {
this._handle = options.handle; // private
} else if (typeof options.fd === 'undefined') {
this._handle = options && options.handle; // private
this.readable = options.readable !== false;
this.writable = options.writable !== false;
} else {
this._handle = createPipe();
this._handle.open(options.fd);
this.readable = this.writable = true;
this.readable = options.readable !== false;
this.writable = options.writable !== false;
}

this.onend = null;
@@ -167,7 +170,7 @@ function Socket(options) {

// if we have a handle, then start the flow of data into the
// buffer. if not, then this will happen when we connect
if (this._handle && (!options || options.readable !== false))
if (this._handle && options.readable !== false)
this.read(0);
}
util.inherits(Socket, stream.Duplex);
@@ -595,9 +598,14 @@ Socket.prototype._write = function(dataEncoding, cb) {
return this._destroy(errnoException(errno, 'write'), cb);

writeReq.oncomplete = afterWrite;
writeReq.cb = cb;

this._bytesDispatched += writeReq.bytes;

// If it was entirely flushed, we can write some more right now.
// However, if more is left in the queue, then wait until that clears.
if (this._handle.writeQueueSize === 0)
cb();
else
writeReq.cb = cb;
};


@@ -607,6 +615,7 @@ Socket.prototype.__defineGetter__('bytesWritten', function() {
pending = this._pendingWrite;

state.buffer.forEach(function(el) {
el = el[0];
bytes += Buffer.byteLength(el[0], el[1]);
});

@@ -640,7 +649,8 @@ function afterWrite(status, handle, req) {
if (self !== process.stderr && self !== process.stdout)
debug('afterWrite call cb');

req.cb.call(self);
if (req.cb)
req.cb.call(self);
}


@@ -249,9 +249,6 @@
'defines!': [
'PLATFORM="mac"',
],
'xcode_settings': {
'DEAD_CODE_STRIPPING': 'YES',
},
'defines': [
# we need to use node's preferred "darwin" rather than gyp's preferred "mac"
'PLATFORM="darwin"',