Skip to content

Instantly share code, notes, and snippets.

require 'formula'
class Jemallocfb < Formula
homepage 'http://www.canonware.com/jemalloc/download.html'
url 'http://www.canonware.com/download/jemalloc/jemalloc-3.4.0.tar.bz2'
sha1 '06f572f1cc6a4e4a68c7f9a354f12e17ba32f70b'
keg_only "We're just a patched version."
# __GLIBC__ is not defined, but we still want hooks!
diff --git hphp/util/embedded_data.cpp hphp/util/embedded_data.cpp
index 6b16dc9..a7da200 100644
--- hphp/util/embedded_data.cpp
+++ hphp/util/embedded_data.cpp
@@ -78,7 +78,7 @@ bool get_embedded_data(const char *section, embedded_data* desc) {
#else // __APPLE__
const struct section_64 *sect = getsectbyname("__text", section);
if (sect) {
- string path = current_executable();
+ std::string path = current_executable_path();
<?php
$element = simplexml_load_string(<<<EOF
<root>
<hello>world</hello>
</root>
EOF
);
echo $element->children()[0] . "\n";
<?php
class Test {
protected $_data = array();
public function __call($method, $args) {
if (substr($method, 0, 3) == 'set') {
$key = strtolower(substr($method, 3));
if (isset($args[0])) {
<?php
$config = simplexml_load_string('<config><prepare /></config>');
$configArray = (array)$config;
var_dump((bool)$config->prepare); // true
var_dump((bool)$configArray['prepare']); // false
<?php
require_once 'app/Mage.php';
Mage::init();
$attributes = Mage::getModel('eav/entity_attribute')->getCollection()
->addFieldToFilter('source_model', array('notnull' => true))
->addFieldToFilter('source_model', array('neq' => ''));
foreach ($attributes as $attribute) {
Index: src/windows/glog/stl_logging.h
===================================================================
diff --git a/src/windows/glog/stl_logging.h b/src/windows/glog/stl_logging.h
--- a/src/windows/glog/stl_logging.h (revision 133)
+++ b/src/windows/glog/stl_logging.h (revision 134)
@@ -38,6 +38,15 @@
// LOG(INFO) << "data: " << x;
// vector<int> v1, v2;
// CHECK_EQ(v1, v2);
+//
Index: src/stl_logging_unittest.cc
===================================================================
diff --git a/src/stl_logging_unittest.cc b/src/stl_logging_unittest.cc
--- a/src/stl_logging_unittest.cc (revision 134)
+++ b/src/stl_logging_unittest.cc (working copy)
@@ -34,10 +34,12 @@
#ifdef __GNUC__
// C++0x isn't enabled by default.
// # define GLOG_STL_LOGGING_FOR_UNORDERED
+# define GLOG_STL_LOGGING_FOR_EXT_HASH
This file has been truncated, but you can view the full file.
==24227== Memcheck, a memory error detector
==24227== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==24227== Using Valgrind-3.10.0.SVN and LibVEX; rerun with -h for copyright info
==24227== Command: /home/daniel/Code/hhvm/hphp/hhvm/hhvm -ms -vServer.Type=fastcgi -vServer.Port=9000 -vEval.EnableZendSorting=1 -vEval.Jit=0
==24227==
==24227== Invalid read of size 8
==24227== at 0xE49CE6: folly::fbstring_core<char>::fbstring_core(char const*, unsigned long) (FBString.h:399)
==24227== by 0xF381EA: void HPHP::IniSetting::Bind<std::string>(HPHP::Extension const*, HPHP::IniSetting::Mode, std::string const&, char const*, HPHP::IniSetting::SetAndGet<std::string>, std::string*) (FBString.h:1021)
==24227== by 0xF6CA3F: HPHP::RequestInjectionData::threadInit() (ini-setting.h:242)
==24227== by 0xEDE6CB: HPHP::ThreadInfo::ThreadInfo() (request-injection-data.h:61)
This file has been truncated, but you can view the full file.
==28108== Memcheck, a memory error detector
==28108== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==28108== Using Valgrind-3.10.0.SVN and LibVEX; rerun with -h for copyright info
==28108== Command: /home/daniel/Code/hhvm/hphp/hhvm/hhvm -ms -vServer.Type=fastcgi -vServer.Port=9000 -vEval.EnableZendSorting=1 -vEval.Jit=0
==28108==
==28108== Invalid read of size 8
==28108== at 0xE49D06: folly::fbstring_core<char>::fbstring_core(char const*, unsigned long) (FBString.h:399)
==28108== by 0xF3820A: void HPHP::IniSetting::Bind<std::string>(HPHP::Extension const*, HPHP::IniSetting::Mode, std::string const&, char const*, HPHP::IniSetting::SetAndGet<std::string>, std::string*) (FBString.h:1021)
==28108== by 0xF6CA5F: HPHP::RequestInjectionData::threadInit() (ini-setting.h:242)
==28108== by 0xEDE6EB: HPHP::ThreadInfo::ThreadInfo() (request-injection-data.h:61)