aboutsummaryrefslogtreecommitdiff
path: root/src/js/out/InternalModuleRegistryConstants.h
diff options
context:
space:
mode:
authorGravatar WingLim <winglims@gmail.com> 2023-09-14 08:41:09 +0800
committerGravatar GitHub <noreply@github.com> 2023-09-13 17:41:09 -0700
commit932fa35f9965a9f3565cfed0fbf71f01ad5fd818 (patch)
treee88b9b7ac3c9646a296616e0f54e95a36c544ee8 /src/js/out/InternalModuleRegistryConstants.h
parent9c9f4ed6ad39f92cb331e21a6b6dc0847e66510e (diff)
downloadbun-932fa35f9965a9f3565cfed0fbf71f01ad5fd818.tar.gz
bun-932fa35f9965a9f3565cfed0fbf71f01ad5fd818.tar.zst
bun-932fa35f9965a9f3565cfed0fbf71f01ad5fd818.zip
feat(nodejs): implement `os.availableParallelism` (#5109)
* feat(nodejs): implement `os.availableParallelism` * chore: do not throw error as same as node * refactor: use `navigator.hardwareConcurrency`
Diffstat (limited to 'src/js/out/InternalModuleRegistryConstants.h')
-rw-r--r--src/js/out/InternalModuleRegistryConstants.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/js/out/InternalModuleRegistryConstants.h b/src/js/out/InternalModuleRegistryConstants.h
index bd8894b0c..14c772834 100644
--- a/src/js/out/InternalModuleRegistryConstants.h
+++ b/src/js/out/InternalModuleRegistryConstants.h
@@ -110,7 +110,7 @@ static constexpr ASCIILiteral NodeNetCode = "(function (){\"use strict\";// src/
//
//
-static constexpr ASCIILiteral NodeOSCode = "(function (){\"use strict\";// src/js/out/tmp/node/os.ts\nvar lazyCpus = function({ cpus }) {\n return () => {\n const array = new Array(navigator.hardwareConcurrency);\n function populate() {\n const results = cpus(), length = results.length;\n array.length = length;\n for (let i = 0;i < length; i++)\n array[i] = results[i];\n }\n for (let i = 0;i < array.length; i++) {\n const instance = {\n get model() {\n if (array[i] === instance)\n populate();\n return array[i].model;\n },\n set model(value) {\n if (array[i] === instance)\n populate();\n array[i].model = value;\n },\n get speed() {\n if (array[i] === instance)\n populate();\n return array[i].speed;\n },\n set speed(value) {\n if (array[i] === instance)\n populate();\n array[i].speed = value;\n },\n get times() {\n if (array[i] === instance)\n populate();\n return array[i].times;\n },\n set times(value) {\n if (array[i] === instance)\n populate();\n array[i].times = value;\n },\n toJSON() {\n if (array[i] === instance)\n populate();\n return array[i];\n }\n };\n array[i] = instance;\n }\n return array;\n };\n}, bound = function(obj) {\n return {\n arch: obj.arch.bind(obj),\n cpus: lazyCpus(obj),\n endianness: obj.endianness.bind(obj),\n freemem: obj.freemem.bind(obj),\n getPriority: obj.getPriority.bind(obj),\n homedir: obj.homedir.bind(obj),\n hostname: obj.hostname.bind(obj),\n loadavg: obj.loadavg.bind(obj),\n networkInterfaces: obj.networkInterfaces.bind(obj),\n platform: obj.platform.bind(obj),\n release: obj.release.bind(obj),\n setPriority: obj.setPriority.bind(obj),\n get tmpdir() {\n return tmpdir;\n },\n totalmem: obj.totalmem.bind(obj),\n type: obj.type.bind(obj),\n uptime: obj.uptime.bind(obj),\n userInfo: obj.userInfo.bind(obj),\n version: obj.version.bind(obj),\n machine: obj.machine.bind(obj),\n devNull: obj.devNull,\n EOL: obj.EOL,\n constants: @processBindingConstants.os\n };\n}, tmpdir = function() {\n var env = Bun.env;\n return tmpdir = function() {\n var path = env.TMPDIR || env.TMP || env.TEMP || \"/tmp\";\n const length = path.length;\n if (length > 1 && path[length - 1] === \"/\")\n path = path.slice(0, -1);\n return path;\n }, tmpdir();\n};\nreturn bound(Bun._Os())})\n"_s;
+static constexpr ASCIILiteral NodeOSCode = "(function (){\"use strict\";// src/js/out/tmp/node/os.ts\nvar lazyCpus = function({ cpus }) {\n return () => {\n const array = new Array(navigator.hardwareConcurrency);\n function populate() {\n const results = cpus(), length = results.length;\n array.length = length;\n for (let i = 0;i < length; i++)\n array[i] = results[i];\n }\n for (let i = 0;i < array.length; i++) {\n const instance = {\n get model() {\n if (array[i] === instance)\n populate();\n return array[i].model;\n },\n set model(value) {\n if (array[i] === instance)\n populate();\n array[i].model = value;\n },\n get speed() {\n if (array[i] === instance)\n populate();\n return array[i].speed;\n },\n set speed(value) {\n if (array[i] === instance)\n populate();\n array[i].speed = value;\n },\n get times() {\n if (array[i] === instance)\n populate();\n return array[i].times;\n },\n set times(value) {\n if (array[i] === instance)\n populate();\n array[i].times = value;\n },\n toJSON() {\n if (array[i] === instance)\n populate();\n return array[i];\n }\n };\n array[i] = instance;\n }\n return array;\n };\n}, bound = function(obj) {\n return {\n availableParallelism: () => {\n return navigator.hardwareConcurrency;\n },\n arch: obj.arch.bind(obj),\n cpus: lazyCpus(obj),\n endianness: obj.endianness.bind(obj),\n freemem: obj.freemem.bind(obj),\n getPriority: obj.getPriority.bind(obj),\n homedir: obj.homedir.bind(obj),\n hostname: obj.hostname.bind(obj),\n loadavg: obj.loadavg.bind(obj),\n networkInterfaces: obj.networkInterfaces.bind(obj),\n platform: obj.platform.bind(obj),\n release: obj.release.bind(obj),\n setPriority: obj.setPriority.bind(obj),\n get tmpdir() {\n return tmpdir;\n },\n totalmem: obj.totalmem.bind(obj),\n type: obj.type.bind(obj),\n uptime: obj.uptime.bind(obj),\n userInfo: obj.userInfo.bind(obj),\n version: obj.version.bind(obj),\n machine: obj.machine.bind(obj),\n devNull: obj.devNull,\n EOL: obj.EOL,\n constants: @processBindingConstants.os\n };\n}, tmpdir = function() {\n var env = Bun.env;\n return tmpdir = function() {\n var path = env.TMPDIR || env.TMP || env.TEMP || \"/tmp\";\n const length = path.length;\n if (length > 1 && path[length - 1] === \"/\")\n path = path.slice(0, -1);\n return path;\n }, tmpdir();\n};\nreturn bound(Bun._Os())})\n"_s;
//
//
@@ -351,7 +351,7 @@ static constexpr ASCIILiteral NodeNetCode = "(function (){\"use strict\";// src/
//
//
-static constexpr ASCIILiteral NodeOSCode = "(function (){\"use strict\";// src/js/out/tmp/node/os.ts\nvar lazyCpus = function({ cpus }) {\n return () => {\n const array = new Array(navigator.hardwareConcurrency);\n function populate() {\n const results = cpus(), length = results.length;\n array.length = length;\n for (let i = 0;i < length; i++)\n array[i] = results[i];\n }\n for (let i = 0;i < array.length; i++) {\n const instance = {\n get model() {\n if (array[i] === instance)\n populate();\n return array[i].model;\n },\n set model(value) {\n if (array[i] === instance)\n populate();\n array[i].model = value;\n },\n get speed() {\n if (array[i] === instance)\n populate();\n return array[i].speed;\n },\n set speed(value) {\n if (array[i] === instance)\n populate();\n array[i].speed = value;\n },\n get times() {\n if (array[i] === instance)\n populate();\n return array[i].times;\n },\n set times(value) {\n if (array[i] === instance)\n populate();\n array[i].times = value;\n },\n toJSON() {\n if (array[i] === instance)\n populate();\n return array[i];\n }\n };\n array[i] = instance;\n }\n return array;\n };\n}, bound = function(obj) {\n return {\n arch: obj.arch.bind(obj),\n cpus: lazyCpus(obj),\n endianness: obj.endianness.bind(obj),\n freemem: obj.freemem.bind(obj),\n getPriority: obj.getPriority.bind(obj),\n homedir: obj.homedir.bind(obj),\n hostname: obj.hostname.bind(obj),\n loadavg: obj.loadavg.bind(obj),\n networkInterfaces: obj.networkInterfaces.bind(obj),\n platform: obj.platform.bind(obj),\n release: obj.release.bind(obj),\n setPriority: obj.setPriority.bind(obj),\n get tmpdir() {\n return tmpdir;\n },\n totalmem: obj.totalmem.bind(obj),\n type: obj.type.bind(obj),\n uptime: obj.uptime.bind(obj),\n userInfo: obj.userInfo.bind(obj),\n version: obj.version.bind(obj),\n machine: obj.machine.bind(obj),\n devNull: obj.devNull,\n EOL: obj.EOL,\n constants: @processBindingConstants.os\n };\n}, tmpdir = function() {\n var env = Bun.env;\n return tmpdir = function() {\n var path = env.TMPDIR || env.TMP || env.TEMP || \"/tmp\";\n const length = path.length;\n if (length > 1 && path[length - 1] === \"/\")\n path = path.slice(0, -1);\n return path;\n }, tmpdir();\n};\nreturn bound(Bun._Os())})\n"_s;
+static constexpr ASCIILiteral NodeOSCode = "(function (){\"use strict\";// src/js/out/tmp/node/os.ts\nvar lazyCpus = function({ cpus }) {\n return () => {\n const array = new Array(navigator.hardwareConcurrency);\n function populate() {\n const results = cpus(), length = results.length;\n array.length = length;\n for (let i = 0;i < length; i++)\n array[i] = results[i];\n }\n for (let i = 0;i < array.length; i++) {\n const instance = {\n get model() {\n if (array[i] === instance)\n populate();\n return array[i].model;\n },\n set model(value) {\n if (array[i] === instance)\n populate();\n array[i].model = value;\n },\n get speed() {\n if (array[i] === instance)\n populate();\n return array[i].speed;\n },\n set speed(value) {\n if (array[i] === instance)\n populate();\n array[i].speed = value;\n },\n get times() {\n if (array[i] === instance)\n populate();\n return array[i].times;\n },\n set times(value) {\n if (array[i] === instance)\n populate();\n array[i].times = value;\n },\n toJSON() {\n if (array[i] === instance)\n populate();\n return array[i];\n }\n };\n array[i] = instance;\n }\n return array;\n };\n}, bound = function(obj) {\n return {\n availableParallelism: () => {\n return navigator.hardwareConcurrency;\n },\n arch: obj.arch.bind(obj),\n cpus: lazyCpus(obj),\n endianness: obj.endianness.bind(obj),\n freemem: obj.freemem.bind(obj),\n getPriority: obj.getPriority.bind(obj),\n homedir: obj.homedir.bind(obj),\n hostname: obj.hostname.bind(obj),\n loadavg: obj.loadavg.bind(obj),\n networkInterfaces: obj.networkInterfaces.bind(obj),\n platform: obj.platform.bind(obj),\n release: obj.release.bind(obj),\n setPriority: obj.setPriority.bind(obj),\n get tmpdir() {\n return tmpdir;\n },\n totalmem: obj.totalmem.bind(obj),\n type: obj.type.bind(obj),\n uptime: obj.uptime.bind(obj),\n userInfo: obj.userInfo.bind(obj),\n version: obj.version.bind(obj),\n machine: obj.machine.bind(obj),\n devNull: obj.devNull,\n EOL: obj.EOL,\n constants: @processBindingConstants.os\n };\n}, tmpdir = function() {\n var env = Bun.env;\n return tmpdir = function() {\n var path = env.TMPDIR || env.TMP || env.TEMP || \"/tmp\";\n const length = path.length;\n if (length > 1 && path[length - 1] === \"/\")\n path = path.slice(0, -1);\n return path;\n }, tmpdir();\n};\nreturn bound(Bun._Os())})\n"_s;
//
//
@@ -593,7 +593,7 @@ static constexpr ASCIILiteral NodeNetCode = "(function (){\"use strict\";// src/
//
//
-static constexpr ASCIILiteral NodeOSCode = "(function (){\"use strict\";// src/js/out/tmp/node/os.ts\nvar lazyCpus = function({ cpus }) {\n return () => {\n const array = new Array(navigator.hardwareConcurrency);\n function populate() {\n const results = cpus(), length = results.length;\n array.length = length;\n for (let i = 0;i < length; i++)\n array[i] = results[i];\n }\n for (let i = 0;i < array.length; i++) {\n const instance = {\n get model() {\n if (array[i] === instance)\n populate();\n return array[i].model;\n },\n set model(value) {\n if (array[i] === instance)\n populate();\n array[i].model = value;\n },\n get speed() {\n if (array[i] === instance)\n populate();\n return array[i].speed;\n },\n set speed(value) {\n if (array[i] === instance)\n populate();\n array[i].speed = value;\n },\n get times() {\n if (array[i] === instance)\n populate();\n return array[i].times;\n },\n set times(value) {\n if (array[i] === instance)\n populate();\n array[i].times = value;\n },\n toJSON() {\n if (array[i] === instance)\n populate();\n return array[i];\n }\n };\n array[i] = instance;\n }\n return array;\n };\n}, bound = function(obj) {\n return {\n arch: obj.arch.bind(obj),\n cpus: lazyCpus(obj),\n endianness: obj.endianness.bind(obj),\n freemem: obj.freemem.bind(obj),\n getPriority: obj.getPriority.bind(obj),\n homedir: obj.homedir.bind(obj),\n hostname: obj.hostname.bind(obj),\n loadavg: obj.loadavg.bind(obj),\n networkInterfaces: obj.networkInterfaces.bind(obj),\n platform: obj.platform.bind(obj),\n release: obj.release.bind(obj),\n setPriority: obj.setPriority.bind(obj),\n get tmpdir() {\n return tmpdir;\n },\n totalmem: obj.totalmem.bind(obj),\n type: obj.type.bind(obj),\n uptime: obj.uptime.bind(obj),\n userInfo: obj.userInfo.bind(obj),\n version: obj.version.bind(obj),\n machine: obj.machine.bind(obj),\n devNull: obj.devNull,\n EOL: obj.EOL,\n constants: @processBindingConstants.os\n };\n}, tmpdir = function() {\n var env = Bun.env;\n return tmpdir = function() {\n var path = env.TMPDIR || env.TMP || env.TEMP || \"/tmp\";\n const length = path.length;\n if (length > 1 && path[length - 1] === \"/\")\n path = path.slice(0, -1);\n return path;\n }, tmpdir();\n};\nreturn bound(Bun._Os())})\n"_s;
+static constexpr ASCIILiteral NodeOSCode = "(function (){\"use strict\";// src/js/out/tmp/node/os.ts\nvar lazyCpus = function({ cpus }) {\n return () => {\n const array = new Array(navigator.hardwareConcurrency);\n function populate() {\n const results = cpus(), length = results.length;\n array.length = length;\n for (let i = 0;i < length; i++)\n array[i] = results[i];\n }\n for (let i = 0;i < array.length; i++) {\n const instance = {\n get model() {\n if (array[i] === instance)\n populate();\n return array[i].model;\n },\n set model(value) {\n if (array[i] === instance)\n populate();\n array[i].model = value;\n },\n get speed() {\n if (array[i] === instance)\n populate();\n return array[i].speed;\n },\n set speed(value) {\n if (array[i] === instance)\n populate();\n array[i].speed = value;\n },\n get times() {\n if (array[i] === instance)\n populate();\n return array[i].times;\n },\n set times(value) {\n if (array[i] === instance)\n populate();\n array[i].times = value;\n },\n toJSON() {\n if (array[i] === instance)\n populate();\n return array[i];\n }\n };\n array[i] = instance;\n }\n return array;\n };\n}, bound = function(obj) {\n return {\n availableParallelism: () => {\n return navigator.hardwareConcurrency;\n },\n arch: obj.arch.bind(obj),\n cpus: lazyCpus(obj),\n endianness: obj.endianness.bind(obj),\n freemem: obj.freemem.bind(obj),\n getPriority: obj.getPriority.bind(obj),\n homedir: obj.homedir.bind(obj),\n hostname: obj.hostname.bind(obj),\n loadavg: obj.loadavg.bind(obj),\n networkInterfaces: obj.networkInterfaces.bind(obj),\n platform: obj.platform.bind(obj),\n release: obj.release.bind(obj),\n setPriority: obj.setPriority.bind(obj),\n get tmpdir() {\n return tmpdir;\n },\n totalmem: obj.totalmem.bind(obj),\n type: obj.type.bind(obj),\n uptime: obj.uptime.bind(obj),\n userInfo: obj.userInfo.bind(obj),\n version: obj.version.bind(obj),\n machine: obj.machine.bind(obj),\n devNull: obj.devNull,\n EOL: obj.EOL,\n constants: @processBindingConstants.os\n };\n}, tmpdir = function() {\n var env = Bun.env;\n return tmpdir = function() {\n var path = env.TMPDIR || env.TMP || env.TEMP || \"/tmp\";\n const length = path.length;\n if (length > 1 && path[length - 1] === \"/\")\n path = path.slice(0, -1);\n return path;\n }, tmpdir();\n};\nreturn bound(Bun._Os())})\n"_s;
//
//