Replace time-based GC with allocation-count trigger, migrate all Create factories to GCList::Create(), fix VFSPath root path, reorder TObject variant
All checks were successful
Build and Deploy on Tag / 🔨 Build for PowerPC (push) Successful in 32s
Build and Deploy on Tag / 🔨 Build for everything else (git.tesses.org/tesses50/linux-riscv64:latest, riscv64-linux-gnu, riscv64) (push) Successful in 3m33s
Build and Deploy on Tag / 🔨 Build for everything else (git.tesses.org/tesses50/linux-x64:latest, x86_64-linux-gnu, amd64) (push) Successful in 3m42s
Build and Deploy on Tag / 🔨 Build for everything else (git.tesses.org/tesses50/linux-arm64:latest, aarch64-linux-gnu, arm64) (push) Successful in 4m1s
Build and Deploy on Tag / 🔨 Build for everything else (git.tesses.org/tesses50/linux-arm:latest, arm-linux-gnueabihf, arm7) (push) Successful in 4m1s
Build and Deploy on Tag / update-tap (push) Successful in 3m55s
Build and Deploy on Tag / 🔨 Build for everything else (git.tesses.org/tesses50/linux-x86:latest, i386-linux-gnu, 386) (push) Successful in 59s
All checks were successful
Build and Deploy on Tag / 🔨 Build for PowerPC (push) Successful in 32s
Build and Deploy on Tag / 🔨 Build for everything else (git.tesses.org/tesses50/linux-riscv64:latest, riscv64-linux-gnu, riscv64) (push) Successful in 3m33s
Build and Deploy on Tag / 🔨 Build for everything else (git.tesses.org/tesses50/linux-x64:latest, x86_64-linux-gnu, amd64) (push) Successful in 3m42s
Build and Deploy on Tag / 🔨 Build for everything else (git.tesses.org/tesses50/linux-arm64:latest, aarch64-linux-gnu, arm64) (push) Successful in 4m1s
Build and Deploy on Tag / 🔨 Build for everything else (git.tesses.org/tesses50/linux-arm:latest, arm-linux-gnueabihf, arm7) (push) Successful in 4m1s
Build and Deploy on Tag / update-tap (push) Successful in 3m55s
Build and Deploy on Tag / 🔨 Build for everything else (git.tesses.org/tesses50/linux-x86:latest, i386-linux-gnu, 386) (push) Successful in 59s
This commit is contained in:
@@ -1815,7 +1815,7 @@ class EnvironmentPermissions {
|
||||
bool canRegisterPath;
|
||||
bool canRegisterOGC;
|
||||
bool canRegisterEnv;
|
||||
bool canRegisterClass;
|
||||
bool canRegisterZeClass;
|
||||
bool sqlite3Scoped;
|
||||
bool locked;
|
||||
TDictionary *customConsole = nullptr;
|
||||
@@ -1903,7 +1903,7 @@ class TStd {
|
||||
static void RegisterOGC(std::shared_ptr<GC> gc, TRootEnvironment *env);
|
||||
static void RegisterEnv(std::shared_ptr<GC> gc, TRootEnvironment *env);
|
||||
static void RegisterProcess(std::shared_ptr<GC> gc, TRootEnvironment *env);
|
||||
static void RegisterClass(std::shared_ptr<GC> gc, TRootEnvironment *env);
|
||||
static void RegisterZeClass(std::shared_ptr<GC> gc, TRootEnvironment *env);
|
||||
};
|
||||
|
||||
class TSubEnvironment : public TEnvironment {
|
||||
|
||||
@@ -192,7 +192,7 @@ void CrossLangCompiler(std::vector<std::string> &argv) {
|
||||
|
||||
if (comptime == "secure") {
|
||||
TStd::RegisterConsole(gc, env);
|
||||
TStd::RegisterClass(gc, env);
|
||||
TStd::RegisterZeClass(gc, env);
|
||||
TStd::RegisterCrypto(gc, env);
|
||||
TStd::RegisterDictionary(gc, env);
|
||||
TStd::RegisterJson(gc, env);
|
||||
@@ -201,7 +201,7 @@ void CrossLangCompiler(std::vector<std::string> &argv) {
|
||||
env->permissions.locked = true;
|
||||
} else if (comptime == "secure_file") {
|
||||
TStd::RegisterConsole(gc, env);
|
||||
TStd::RegisterClass(gc, env);
|
||||
TStd::RegisterZeClass(gc, env);
|
||||
TStd::RegisterCrypto(gc, env);
|
||||
TStd::RegisterDictionary(gc, env);
|
||||
TStd::RegisterJson(gc, env);
|
||||
|
||||
@@ -190,9 +190,9 @@ static TObject Class_GetInfo(TRootEnvironment *env, GCList &ls,
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
void TStd::RegisterClass(std::shared_ptr<GC> gc, TRootEnvironment *env) {
|
||||
void TStd::RegisterZeClass(std::shared_ptr<GC> gc, TRootEnvironment *env) {
|
||||
GCList ls(gc);
|
||||
env->permissions.canRegisterClass = true;
|
||||
env->permissions.canRegisterZeClass = true;
|
||||
TDictionary *cls = env->EnsureDictionary(gc, "Class");
|
||||
gc->BarrierBegin();
|
||||
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
#include "CrossLang.hpp"
|
||||
#include "TessesFramework/Serialization/BitConverter.hpp"
|
||||
|
||||
#if defined(_WIN32)
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
namespace Tesses::CrossLang {
|
||||
using namespace Tesses::Framework::Platform::Environment;
|
||||
#if defined(_WIN32)
|
||||
|
||||
@@ -823,8 +823,8 @@ static TObject Net_Http_ListenOnUnusedPort(GCList &ls,
|
||||
static TObject Net_Http_MimeType(GCList &ls, std::vector<TObject> args) {
|
||||
Tesses::Framework::Filesystem::VFSPath p;
|
||||
if (GetArgumentAsPath(args, 0, p)) {
|
||||
std::filesystem::path p2 = p.GetFileName();
|
||||
return HttpUtils::GetMimeType(p2);
|
||||
|
||||
return HttpUtils::GetMimeTypePath(p);
|
||||
}
|
||||
return std::string("application/octet-stream");
|
||||
}
|
||||
|
||||
@@ -6,28 +6,17 @@
|
||||
#include <memory>
|
||||
#include <variant>
|
||||
#include <vector>
|
||||
|
||||
#if !defined(CROSSLANG_STATIC)
|
||||
#if defined(CROSSLANG_ENABLE_FFI)
|
||||
#include <ffi.h>
|
||||
#endif
|
||||
#if defined(_WIN32)
|
||||
#include <windows.h>
|
||||
|
||||
#include <time.h>
|
||||
#undef min
|
||||
#undef max
|
||||
#else
|
||||
#if !defined(_WIN32)
|
||||
#include <dlfcn.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#else
|
||||
#if defined(_WIN32)
|
||||
#include <windows.h>
|
||||
|
||||
#include <time.h>
|
||||
#undef min
|
||||
#undef max
|
||||
#else
|
||||
#if !defined(_WIN32)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#endif
|
||||
@@ -70,15 +59,18 @@ class DL {
|
||||
Tesses::Framework::Filesystem::LocalFilesystem lfs;
|
||||
std::string str = lfs.VFSPathToSystem(p);
|
||||
#if defined(_WIN32)
|
||||
handle =
|
||||
LoadLibraryExA(str.c_str(), NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
|
||||
|
||||
throw std::runtime_error("I removed support on this platform");
|
||||
// handle =LoadLibraryExA(str.c_str(), NULL,
|
||||
// LOAD_WITH_ALTERED_SEARCH_PATH);
|
||||
#else
|
||||
handle = dlopen(str.c_str(), RTLD_LAZY);
|
||||
#endif
|
||||
}
|
||||
template <typename T> T Resolve(std::string name) {
|
||||
#if defined(_WIN32)
|
||||
return (T)GetProcAddress((HMODULE)handle, name.c_str());
|
||||
throw std::runtime_error("I removed support on this platform");
|
||||
// return (T)GetProcAddress((HMODULE)handle, name.c_str());
|
||||
#else
|
||||
return (T)dlsym(handle, name.c_str());
|
||||
|
||||
@@ -86,7 +78,9 @@ class DL {
|
||||
}
|
||||
~DL() {
|
||||
#if defined(_WIN32)
|
||||
FreeLibrary((HMODULE)handle);
|
||||
|
||||
throw std::runtime_error("I removed support on this platform");
|
||||
// FreeLibrary((HMODULE)handle);
|
||||
#else
|
||||
dlclose(handle);
|
||||
#endif
|
||||
@@ -1004,11 +998,7 @@ static TObject YieldEnumerableFunc(GCList &ls, std::vector<TObject> args) {
|
||||
static TObject DateTime_Sleep(GCList &ls, std::vector<TObject> args) {
|
||||
int64_t msec;
|
||||
if (GetArgument(args, 0, msec)) {
|
||||
#if defined(_WIN32)
|
||||
Sleep((int)msec);
|
||||
#else
|
||||
usleep(1000 * msec);
|
||||
#endif
|
||||
Tesses::Framework::TF_Sleep(msec);
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
@@ -1587,7 +1577,7 @@ void TStd::RegisterStd(
|
||||
RegisterCrypto(gc, env);
|
||||
RegisterOGC(gc, env);
|
||||
RegisterProcess(gc, env);
|
||||
RegisterClass(gc, env);
|
||||
RegisterZeClass(gc, env);
|
||||
|
||||
gc->RegisterEverything(env);
|
||||
|
||||
|
||||
@@ -2292,9 +2292,9 @@ bool InterperterThread::ExecuteMethod2(std::shared_ptr<GC> gc, TObject instance,
|
||||
}
|
||||
if (key == "RegisterClass") {
|
||||
if ((myEnv->permissions.canRegisterEverything ||
|
||||
myEnv->permissions.canRegisterClass) &&
|
||||
myEnv->permissions.canRegisterZeClass) &&
|
||||
!rootEnv->permissions.locked)
|
||||
TStd::RegisterClass(gc, rootEnv);
|
||||
TStd::RegisterZeClass(gc, rootEnv);
|
||||
cse.back()->Push(gc, nullptr);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2,9 +2,7 @@
|
||||
#include <chrono>
|
||||
#include <iostream>
|
||||
#include <time.h>
|
||||
#if defined(_WIN32)
|
||||
#include <windows.h>
|
||||
#else
|
||||
#if !defined(_WIN32)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
@@ -85,7 +83,6 @@ TDictionary *CreateThread(GCList &ls, TCallable *callable, bool detached) {
|
||||
TObject cb = th->callable->Call(ls, {});
|
||||
gc->BarrierBegin();
|
||||
th->returnValue = cb;
|
||||
std::map<pthread_t, int> mt;
|
||||
#if defined(GEKKO) || defined(_EE)
|
||||
current_funcs_mtx.Lock();
|
||||
current_funcs.erase(pthread_self());
|
||||
|
||||
Reference in New Issue
Block a user