Permalink
Browse files

pkrumins's memory leak fix

  • Loading branch information...
1 parent ed2bf0f commit cd115a908c3de7a5fa9493733cdd28c07a467770 Brainfucker committed May 24, 2010
View
@@ -2,7 +2,7 @@ argv = ['/usr/local/bin/node-waf', 'configure', 'build']
blddir = '/home/brainfucker/Projects/node-base64/build'
commands = {'dist': 0, 'configure': True, 'distcheck': 0, 'install': 0, 'build': True, 'clean': 0, 'distclean': 0, 'check': 0, 'uninstall': 0}
cwd = '/home/brainfucker/Projects/node-base64'
-environ = {'GDM_KEYBOARD_LAYOUT': 'us', 'GNOME_DESKTOP_SESSION_ID': 'this-is-deprecated', 'LESSOPEN': '| /usr/bin/lesspipe %s', 'LOGNAME': 'brainfucker', 'USER': 'brainfucker', 'HOME': '/home/brainfucker', 'PATH': '/var/lib/gems/1.8/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/brainfucker/Dropbox/Bin', 'DISPLAY': ':0.0', 'MAKEFLAGS': '', 'SSH_AGENT_PID': '2302', 'LANG': 'en_US.UTF-8', 'SPEECHD_PORT': '7560', 'TERM': 'xterm', 'SHELL': '/bin/bash', 'XAUTHORITY': '/var/run/gdm/auth-for-brainfucker-kwgER8/database', 'SESSION_MANAGER': 'local/brainfucker-laptop:@/tmp/.ICE-unix/1912,unix/brainfucker-laptop:/tmp/.ICE-unix/1912', 'XDG_DATA_DIRS': '/usr/share/gnome:/usr/local/share/:/usr/share/', '_': '/usr/bin/make', 'DESKTOP_AUTOSTART_ID': '10b374455bf6c1a5bd126729185530846000000019120000', 'MFLAGS': '', 'USERNAME': 'brainfucker', 'MAKELEVEL': '1', 'SSH_AUTH_SOCK': '/tmp/keyring-bIcbQb/socket.ssh', 'GNOME_KEYRING_SOCKET': '/tmp/keyring-bIcbQb/socket', 'GDMSESSION': 'gnome', 'DBUS_SESSION_BUS_ADDRESS': 'unix:abstract=/tmp/dbus-Z1ED5bhgUq,guid=fc64a21067f6fa40e3b69d8e4b8956cd', 'ORBIT_SOCKETDIR': '/tmp/orbit-brainfucker', 'XDG_SESSION_COOKIE': '8143f1ef8b2173edae5c4ea34aed6323-1267291850.718575-993010146', 'DESKTOP_SESSION': 'gnome', 'LESSCLOSE': '/usr/bin/lesspipe %s %s', 'GTK_MODULES': 'canberra-gtk-module', 'OLDPWD': '/home/brainfucker/Projects', 'GDM_LANG': 'en_US.UTF-8', 'HISTCONTROL': 'ignoreboth', 'SHLVL': '1', 'PWD': '/home/brainfucker/Projects/node-base64', 'GTK_RC_FILES': '/etc/gtk/gtkrc:/home/brainfucker/.gtkrc-1.2-gnome2', 'LS_COLORS': 'rs=0:di=01;34:ln=01;36:hl=44;37:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:'}
+environ = {'GDM_KEYBOARD_LAYOUT': 'us', 'GNOME_DESKTOP_SESSION_ID': 'this-is-deprecated', 'LESSOPEN': '| /usr/bin/lesspipe %s', 'LOGNAME': 'brainfucker', 'USER': 'brainfucker', 'GNOME_KEYRING_CONTROL': '/tmp/keyring-P68Qbn', 'HOME': '/home/brainfucker', 'DISPLAY': ':0.0', 'MAKEFLAGS': '', 'SSH_AGENT_PID': '1536', 'LANG': 'en_US.utf8', 'SPEECHD_PORT': '7560', 'TERM': 'xterm', 'SHELL': '/bin/bash', 'XAUTHORITY': '/var/run/gdm/auth-for-brainfucker-tAsHVG/database', 'SESSION_MANAGER': 'local/brainfucker-laptop:@/tmp/.ICE-unix/1484,unix/brainfucker-laptop:/tmp/.ICE-unix/1484', 'XDG_DATA_DIRS': '/usr/share/gnome:/usr/local/share/:/usr/share/', 'MANDATORY_PATH': '/usr/share/gconf/gnome.mandatory.path', '_': '/usr/bin/make', 'DESKTOP_AUTOSTART_ID': '10986ace429022bece127472750098968900000014840000', 'MFLAGS': '', 'USERNAME': 'brainfucker', 'MAKELEVEL': '1', 'SSH_AUTH_SOCK': '/tmp/keyring-P68Qbn/ssh', 'PATH': '/var/lib/gems/1.8/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/brainfucker/Dropbox/Bin', 'LESSCLOSE': '/usr/bin/lesspipe %s %s', 'DBUS_SESSION_BUS_ADDRESS': 'unix:abstract=/tmp/dbus-GolIFvNwDX,guid=36fcbc258b5978fc97789b834bfacc4c', 'ORBIT_SOCKETDIR': '/tmp/orbit-brainfucker', 'XDG_SESSION_COOKIE': '3a187eea083ec2bc11a802b04bdb1f30-1274727500.89562-1146222661', 'GDMSESSION': 'gnome', 'DESKTOP_SESSION': 'gnome', 'XDG_CONFIG_DIRS': '/etc/xdg/xdg-gnome:/etc/xdg', 'DEFAULTS_PATH': '/usr/share/gconf/gnome.default.path', 'OLDPWD': '/home/brainfucker', 'GDM_LANG': 'en_US.utf8', 'GTK_MODULES': 'canberra-gtk-module', 'HISTCONTROL': 'ignoreboth', 'SHLVL': '1', 'PWD': '/home/brainfucker/Projects/node-base64', 'LS_COLORS': 'rs=0:di=01;34:ln=01;36:hl=44;37:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:'}
files = []
hash = 0
options = {'compile_targets': None, 'force': False, 'verbose': 0, 'nocache': False, 'progress_bar': 0, 'destdir': '', 'keep': False, 'zones': '', 'blddir': '', 'prefix': '/usr/local/', 'jobs': 2, 'srcdir': '', 'check_cxx_compiler': 'g++ icpc sunc++', 'check_c_compiler': 'gcc icc suncc'}
View
@@ -167,12 +167,13 @@ unsigned char *base64_decode(const unsigned char *str, int length, int *ret_leng
Handle<Value>
base64_encode_binding(const Arguments& args)
{
- HandleScope scope;
- String::Utf8Value data(args[0]->ToString());
- int len;
- unsigned char* str=base64_encode((unsigned char*)*data,data.length(),&len);
-
- return String::New((const char*)str,len);
+ HandleScope scope;
+ String::Utf8Value data(args[0]->ToString());
+ int len;
+ unsigned char* str=base64_encode((unsigned char*)*data,data.length(),&len);
+ Local<String> ret = String::New((const char*)str,len);
+ free(str);
+ return ret;
}
View
Binary file not shown.
@@ -0,0 +1,2 @@
+version = 0x105016
+tools = [{'tool': 'ar', 'tooldir': None, 'funs': None}, {'tool': 'cxx', 'tooldir': None, 'funs': None}, {'tool': 'gxx', 'tooldir': None, 'funs': None}, {'tool': 'compiler_cxx', 'tooldir': None, 'funs': None}, {'tool': 'cc', 'tooldir': None, 'funs': None}, {'tool': 'gcc', 'tooldir': None, 'funs': None}, {'tool': 'compiler_cc', 'tooldir': None, 'funs': None}, {'tool': 'node_addon', 'tooldir': None, 'funs': None}]
@@ -0,0 +1,56 @@
+AR = '/usr/bin/ar'
+ARFLAGS = 'rcs'
+CC = ['/usr/bin/gcc']
+CCDEFINES_ST = '-D%s'
+CCFLAGS = ['-O3']
+CCFLAGS_DEBUG = ['-g']
+CCFLAGS_MACBUNDLE = ['-fPIC']
+CCFLAGS_RELEASE = ['-O2']
+CCLNK_SRC_F = ''
+CCLNK_TGT_F = ['-o', '']
+CC_NAME = 'gcc'
+CC_SRC_F = ''
+CC_TGT_F = ['-c', '-o', '']
+CC_VERSION = ('4', '4', '3')
+COMPILER_CC = 'gcc'
+COMPILER_CXX = 'g++'
+CPP = '/usr/bin/cpp'
+CPPFLAGS_NODE = '-DEV_MULTIPLICITY=0'
+CPPPATH_NODE = '/usr/local/include/node'
+CPPPATH_ST = '-I%s'
+CXX = ['/usr/bin/g++']
+CXXDEFINES_ST = '-D%s'
+CXXFLAGS_DEBUG = ['-g']
+CXXFLAGS_RELEASE = ['-O2']
+CXXLNK_SRC_F = ''
+CXXLNK_TGT_F = ['-o', '']
+CXX_NAME = 'gcc'
+CXX_SRC_F = ''
+CXX_TGT_F = ['-c', '-o', '']
+DEST_BINFMT = 'elf'
+DEST_CPU = 'x86_64'
+DEST_OS = 'linux'
+FULLSTATIC_MARKER = '-static'
+LIBPATH_NODE = '/usr/local/lib'
+LIBPATH_ST = '-L%s'
+LIB_ST = '-l%s'
+LINKFLAGS_MACBUNDLE = ['-bundle', '-undefined', 'dynamic_lookup']
+LINK_CC = ['/usr/bin/gcc']
+LINK_CXX = ['/usr/bin/g++']
+PREFIX = '/usr/local'
+PREFIX_NODE = '/usr/local'
+RANLIB = '/usr/bin/ranlib'
+RPATH_ST = '-Wl,-rpath,%s'
+SHLIB_MARKER = '-Wl,-Bdynamic'
+SONAME_ST = '-Wl,-h,%s'
+STATICLIBPATH_ST = '-L%s'
+STATICLIB_MARKER = '-Wl,-Bstatic'
+STATICLIB_ST = '-l%s'
+macbundle_PATTERN = '%s.bundle'
+program_PATTERN = '%s'
+shlib_CCFLAGS = ['-fPIC', '-DPIC']
+shlib_CXXFLAGS = ['-fPIC', '-DPIC']
+shlib_LINKFLAGS = ['-shared']
+shlib_PATTERN = 'lib%s.so'
+staticlib_LINKFLAGS = ['-Wl,-Bstatic']
+staticlib_PATTERN = 'lib%s.a'
View
@@ -0,0 +1,41 @@
+# project noname (0.0.1) configured on Tue May 25 00:11:18 2010 by
+# waf 1.5.16 (abi 7, python 20605f0 on linux2)
+# using /usr/local/bin/node-waf configure build
+#
+
+----------------------------------------
+Checking for program g++ or c++
+ find program=['g++', 'c++'] paths=[] var='CXX'
+ -> '/usr/bin/g++'
+
+----------------------------------------
+Checking for program cpp
+ find program=['cpp'] paths=[] var='CPP'
+ -> '/usr/bin/cpp'
+
+----------------------------------------
+Checking for program ar
+ find program=['ar'] paths=[] var='AR'
+ -> '/usr/bin/ar'
+
+----------------------------------------
+Checking for program ranlib
+ find program=['ranlib'] paths=[] var='RANLIB'
+ -> '/usr/bin/ranlib'
+
+----------------------------------------
+Checking for g++
+ok
+
+----------------------------------------
+Checking for program gcc or cc
+ find program=['gcc', 'cc'] paths=[] var='CC'
+ -> '/usr/bin/gcc'
+
+----------------------------------------
+Checking for gcc
+ok
+
+----------------------------------------
+Checking for node prefix
+ok /usr/local
View
Binary file not shown.
View
Binary file not shown.
View
@@ -1,6 +1,5 @@
<?php
-echo(base64_encode('wow'));
-die();
+
$m1=microtime();
for($i=0;$i<10000;$i++) {
$h=base64_decode(base64_encode('EdPy2H71Q1MjTzkuRxAr1CJWs2ZapZEuaY3XwJL8mpxaTBLWZPkw1yakKLv2r79eHmNQ1m2Cc6PErAkH5FR3Nmd011F09LCas76Z'.$i));

0 comments on commit cd115a9

Please sign in to comment.