return new ESmall(ERT.threadPoolSize());
} else if (type == am_os_type) {
String os = System.getProperty("os.name");
if (os.startsWith("Windows")) {
return ETuple.make(am_win32, new EString(os));
} else {
return ETuple.make(am_unix, new EString(os));
}
} else if (type == am_threads) {
return ERT.TRUE;
} else if (type == am_version) {
String erts_version = ERT.runtime_info.erts_version;
// remove prefix
String prefix = "erts-";
if (erts_version.startsWith(prefix)) {
erts_version = erts_version.substring(prefix.length());
}
return EString.fromString(erts_version);
} else if (type == am_otp_release) {
return new EString(ERT.runtime_info.otp_version);
} else if (type == am_logical_processors) {
// TODO: be smarter somehow
return ERT.box(Runtime.getRuntime().availableProcessors());
} else if (type == am_global_heaps_size) {
return ERT.box(Runtime.getRuntime().totalMemory());
} else if (type == am_process_count) {
return ERT.box(EProc.process_count());
} else if (type == am_system_architecture) {
return new EString(Main.SYSTEM_ARCHITECTURE);
} else if (type == am_driver_version) {
// TODO: be smarter somehow
return new EString(Main.DRIVER_VERSION);
} else if (type == am_wordsize) {
return new ESmall(4);
} else if (type == am_debug_compiled || type == am_lock_checking) {
throw ERT.badarg(type);
} else if (type == am_hipe_architecture) {
return am_undefined;
} else if (type == am_build_type) {
return EAtom.intern("opt");
} else if (type == am_system_version) {
return new EString("Erjang ["+ ERT.runtime_info.erts_version+"]");
} else if ((tup=ETuple2.cast(type)) != null) {
if (tup.elem1 == am_allocator) {
if (tup.elem2 == am_ets_alloc) {