This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Run with: d8 --allow-natives-syntax callfunction.js | |
function f1(n, cb, thisArg) { | |
for (var i = 0; i < n; i++) { | |
cb.call(thisArg, i); | |
} | |
} | |
function f2(n, cb, thisArg) { | |
for (var i = 0; i < n; i++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef _ATOMIC_H | |
#define _ATOMIC_H | |
/* Check GCC version, just to be safe */ | |
#if !defined(__GNUC__) || (__GNUC__ < 4) || (__GNUC_MINOR__ < 1) | |
# error atomic.h works only with GCC newer than version 4.1 | |
#endif /* GNUC >= 4.1 */ | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Run this through the C/C++ preprocessor like this: | |
* | |
* cpp -nostdinc -w -P input.css.in | sed 'y/$/#/' > output.css | |
* | |
* Note that the C/C++ preprocessor always interprets octothorpe characters | |
* at beggining of lines as preprocessor directives. Use sollar signs instead | |
* to avoid the trouble. Dollar signs are changed into octothorpes using | |
* "sed" after passing the source through the preprocessor. | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CXXFLAGS += -Wall -std=gnu++11 $(OPT_CXXFLAGS) | |
LDFLAGS += -lv8 | |
CC = $(CXX) | |
all: v8-mem-accounting | |
v8-mem-accounting: v8-mem-accounting.o | |
clean: | |
$(RM) v8-mem-accounting v8-mem-accounting.o |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* memcount.cc | |
* Copyright (C) 2013 Adrian Perez <[email protected]> | |
* | |
* Distributed under terms of the MIT license. | |
* | |
* Building: | |
* ========= | |
* | |
* g++ -std=c++11 -shared -o memcount.so memcount.cc -fPIC -DTRACK_MEM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* clock.cc | |
* Copyright (C) 2013 Adrian Perez <[email protected]> | |
* | |
* Distributed under terms of the MIT license. | |
*/ | |
#ifndef _POSIX_C_SOURCE | |
#define _POSIX_C_SOURCE 199309L | |
#endif // !_POSIX_C_SOURCE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* array-custom-allocation.cc | |
* Copyright (C) 2013 Adrian Perez <[email protected]> | |
* | |
* Distributed under terms of the MIT license. | |
*/ | |
#include <cstdio> | |
#include <cstdlib> | |
#include <cstdarg> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* rand31.rs | |
* Copyright (C) 2013 Adrian Perez <[email protected]> | |
* | |
* Implements the rand31 random number generation algorithm, which is | |
* particularly suitable for use as white noise for sound applications. | |
* | |
* For more information on the algorithm, please refer to: | |
* http://www.firstptr.com.au/dsp/rand31/ | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* rand31.d | |
* Copyright (C) 2013 Adrian Perez <[email protected]> | |
* | |
* Implements the rand31 random number generation algorithm, which is | |
* particularly suitable for use as white noise for sound applications. | |
* | |
* For more information on the algorithm, please refer to: | |
* http://www.firstpr.com.au/dsp/rand31/ | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# | |
# android-4.3-encore-sdswap-ramdisk | |
# Copyright (C) 2013 Adrian Perez <[email protected]> | |
# | |
# Distributed under terms of the MIT license. | |
# | |
set -e | |
devices=$(adb devices | sed -e 1d -e '/^[:space:]$/d') |