Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
This commit is contained in:
parent
93e3a48004
commit
b38dea0597
25901 changed files with 9982925 additions and 369 deletions
33
assets/webapps/membuster.gaiamobile.org/index.html
Normal file
33
assets/webapps/membuster.gaiamobile.org/index.html
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1">
|
||||
<meta charset="utf-8">
|
||||
<title>Template</title>
|
||||
|
||||
<style>
|
||||
#canvases {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 0px;
|
||||
}
|
||||
canvas {
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
}
|
||||
</style>
|
||||
<script src="membuster.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div>
|
||||
<button id="sys">Bust system memory</button>
|
||||
<button id="gfx">Bust graphics memory</button>
|
||||
</div>
|
||||
<div><span id="log"></span></div>
|
||||
<div id="canvases"></div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
1
assets/webapps/membuster.gaiamobile.org/manifest.webapp
Executable file
1
assets/webapps/membuster.gaiamobile.org/manifest.webapp
Executable file
|
|
@ -0,0 +1 @@
|
|||
{"name":"Membuster","description":"Busts your memory","launch_path":"/index.html","developer":{"name":"The Gaia Team","url":"https://github.com/mozilla-b2g/gaia"},"locales":{"ar":{"name":"Membuster","description":"Busts your memory"},"bg":{"name":"Membuster","description":"Busts your memory"},"bn-BD":{"name":"Membuster","description":"Busts your memory"},"ca":{"name":"Membuster","description":"Busts your memory"},"cs":{"name":"Membuster","description":"Busts your memory"},"da":{"name":"Membuster","description":"Busts your memory"},"de":{"name":"Membuster","description":"Busts your memory"},"el":{"name":"Membuster","description":"Busts your memory"},"en-US":{"name":"Membuster","description":"Busts your memory"},"es":{"name":"Membuster","description":"Busts your memory"},"eu":{"name":"Membuster","description":"Busts your memory"},"fr":{"name":"Membuster","description":"Busts your memory"},"gl":{"name":"Membuster","description":"Busts your memory"},"hr":{"name":"Membuster","description":"Busts your memory"},"hu":{"name":"Membuster","description":"Busts your memory"},"it":{"name":"Membuster","description":"Busts your memory"},"ja":{"name":"Membuster","description":"Busts your memory"},"km":{"name":"Membuster","description":"Busts your memory"},"ko":{"name":"Membuster","description":"Busts your memory"},"lt":{"name":"Membuster","description":"Busts your memory"},"mk":{"name":"Membuster","description":"Busts your memory"},"ms":{"name":"Membuster","description":"Busts your memory"},"ne-NP":{"name":"Membuster","description":"Busts your memory"},"nl":{"name":"Membuster","description":"Busts your memory"},"pa":{"name":"Membuster","description":"Busts your memory"},"pl":{"name":"Membuster","description":"Busts your memory"},"pt-BR":{"name":"Membuster","description":"Busts your memory"},"ro":{"name":"Membuster","description":"Busts your memory"},"ru":{"name":"Membuster","description":"Busts your memory"},"sk":{"name":"Membuster","description":"Busts your memory"},"sq":{"name":"Membuster","description":"Busts your memory"},"sr-Cyrl":{"name":"Membuster","description":"Busts your memory"},"sr-Latn":{"name":"Membuster","description":"Busts your memory"},"sv-SE":{"name":"Membuster","description":"Busts your memory"},"tr":{"name":"Membuster","description":"Busts your memory"},"zh-CN":{"name":"Membuster","description":"Busts your memory"},"zh-TW":{"name":"Membuster","description":"Busts your memory"}},"default_locale":"en-US","icons":{"84":"/style/icons/membuster_84.png","126":"/style/icons/membuster_126.png","142":"/style/icons/membuster_142.png","189":"/style/icons/membuster_189.png","284":"/style/icons/membuster_284.png"},"origin":"app://membuster.gaiamobile.org","version":"2.5"}
|
||||
66
assets/webapps/membuster.gaiamobile.org/membuster.js
Normal file
66
assets/webapps/membuster.gaiamobile.org/membuster.js
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
var arr = [];
|
||||
function bustSysmem() {
|
||||
setInterval(allocChunk, 1000);
|
||||
}
|
||||
|
||||
var chunks = [ ]; // root the chunks
|
||||
var nextChunkMB = 32;
|
||||
var totalAllocMB = 0;
|
||||
function allocChunk() {
|
||||
var allocSizeMB = nextChunkMB * 1024 * 1024;
|
||||
var array = new ArrayBuffer(allocSizeMB);
|
||||
|
||||
// Ensure all pages are committed.
|
||||
var view = new Int32Array(array);
|
||||
for (var j = 0; j < view.length; j += 1024) {
|
||||
view[j] = 42;
|
||||
}
|
||||
|
||||
totalAllocMB += nextChunkMB;
|
||||
log("Allocated "+ nextChunkMB +"MB; total so far is "+ totalAllocMB+ "MB");
|
||||
|
||||
if (nextChunkMB > 1) {
|
||||
nextChunkMB >>= 1
|
||||
}
|
||||
|
||||
chunks.push(array);
|
||||
}
|
||||
|
||||
function bustGfxmem() {
|
||||
setInterval(allocCanvas, 1000);
|
||||
}
|
||||
|
||||
var totalGfxMB = 0;
|
||||
function allocCanvas() {
|
||||
var c = document.createElement("canvas");
|
||||
// We want to allocate 1MB of gfx mem. Canvases are double buffered
|
||||
// and default to RGBA. So we create one with 128K pixels.
|
||||
var w = 128, h = 1024;
|
||||
c.width = w;
|
||||
c.height = h;
|
||||
|
||||
var ctx = c.getContext('2d');
|
||||
ctx.clearRect(0, 0, w, h);
|
||||
ctx.fillStyle = 'rgba(0, 0, 255, 0.1)';
|
||||
ctx.rect(0, 0, w, h);
|
||||
ctx.fill();
|
||||
|
||||
++totalGfxMB;
|
||||
log("Allocated 1MB gfx memory; total so far is ~"+ totalGfxMB +"MB");
|
||||
|
||||
document.getElementById("canvases").appendChild(c);
|
||||
}
|
||||
|
||||
var logElt;
|
||||
function log(msg) {
|
||||
if (!logElt) {
|
||||
logElt = document.getElementById("log");
|
||||
}
|
||||
logElt.textContent = msg;
|
||||
console.log(msg);
|
||||
}
|
||||
|
||||
window.onload = function() {
|
||||
document.getElementById("sys").onclick = function() { bustSysmem(); };
|
||||
document.getElementById("gfx").onclick = function() { bustGfxmem(); };
|
||||
};
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.4 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.4 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
Loading…
Reference in a new issue