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

This commit is contained in:
2026-09-01 06:04:58 -05:00
parent 2430b62232
commit c1c3d02bf0
8 changed files with 25 additions and 42 deletions

View File

@@ -1815,7 +1815,7 @@ class EnvironmentPermissions {
bool canRegisterPath; bool canRegisterPath;
bool canRegisterOGC; bool canRegisterOGC;
bool canRegisterEnv; bool canRegisterEnv;
bool canRegisterClass; bool canRegisterZeClass;
bool sqlite3Scoped; bool sqlite3Scoped;
bool locked; bool locked;
TDictionary *customConsole = nullptr; TDictionary *customConsole = nullptr;
@@ -1903,7 +1903,7 @@ class TStd {
static void RegisterOGC(std::shared_ptr<GC> gc, TRootEnvironment *env); static void RegisterOGC(std::shared_ptr<GC> gc, TRootEnvironment *env);
static void RegisterEnv(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 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 { class TSubEnvironment : public TEnvironment {

View File

@@ -192,7 +192,7 @@ void CrossLangCompiler(std::vector<std::string> &argv) {
if (comptime == "secure") { if (comptime == "secure") {
TStd::RegisterConsole(gc, env); TStd::RegisterConsole(gc, env);
TStd::RegisterClass(gc, env); TStd::RegisterZeClass(gc, env);
TStd::RegisterCrypto(gc, env); TStd::RegisterCrypto(gc, env);
TStd::RegisterDictionary(gc, env); TStd::RegisterDictionary(gc, env);
TStd::RegisterJson(gc, env); TStd::RegisterJson(gc, env);
@@ -201,7 +201,7 @@ void CrossLangCompiler(std::vector<std::string> &argv) {
env->permissions.locked = true; env->permissions.locked = true;
} else if (comptime == "secure_file") { } else if (comptime == "secure_file") {
TStd::RegisterConsole(gc, env); TStd::RegisterConsole(gc, env);
TStd::RegisterClass(gc, env); TStd::RegisterZeClass(gc, env);
TStd::RegisterCrypto(gc, env); TStd::RegisterCrypto(gc, env);
TStd::RegisterDictionary(gc, env); TStd::RegisterDictionary(gc, env);
TStd::RegisterJson(gc, env); TStd::RegisterJson(gc, env);

View File

@@ -190,9 +190,9 @@ static TObject Class_GetInfo(TRootEnvironment *env, GCList &ls,
return nullptr; 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); GCList ls(gc);
env->permissions.canRegisterClass = true; env->permissions.canRegisterZeClass = true;
TDictionary *cls = env->EnsureDictionary(gc, "Class"); TDictionary *cls = env->EnsureDictionary(gc, "Class");
gc->BarrierBegin(); gc->BarrierBegin();

View File

@@ -1,10 +1,6 @@
#include "CrossLang.hpp" #include "CrossLang.hpp"
#include "TessesFramework/Serialization/BitConverter.hpp" #include "TessesFramework/Serialization/BitConverter.hpp"
#if defined(_WIN32)
#include <windows.h>
#endif
namespace Tesses::CrossLang { namespace Tesses::CrossLang {
using namespace Tesses::Framework::Platform::Environment; using namespace Tesses::Framework::Platform::Environment;
#if defined(_WIN32) #if defined(_WIN32)

View File

@@ -823,8 +823,8 @@ static TObject Net_Http_ListenOnUnusedPort(GCList &ls,
static TObject Net_Http_MimeType(GCList &ls, std::vector<TObject> args) { static TObject Net_Http_MimeType(GCList &ls, std::vector<TObject> args) {
Tesses::Framework::Filesystem::VFSPath p; Tesses::Framework::Filesystem::VFSPath p;
if (GetArgumentAsPath(args, 0, 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"); return std::string("application/octet-stream");
} }

View File

@@ -6,28 +6,17 @@
#include <memory> #include <memory>
#include <variant> #include <variant>
#include <vector> #include <vector>
#if !defined(CROSSLANG_STATIC) #if !defined(CROSSLANG_STATIC)
#if defined(CROSSLANG_ENABLE_FFI) #if defined(CROSSLANG_ENABLE_FFI)
#include <ffi.h> #include <ffi.h>
#endif #endif
#if defined(_WIN32) #if !defined(_WIN32)
#include <windows.h>
#include <time.h>
#undef min
#undef max
#else
#include <dlfcn.h> #include <dlfcn.h>
#include <unistd.h> #include <unistd.h>
#endif #endif
#else #else
#if defined(_WIN32) #if !defined(_WIN32)
#include <windows.h>
#include <time.h>
#undef min
#undef max
#else
#include <unistd.h> #include <unistd.h>
#endif #endif
#endif #endif
@@ -70,15 +59,18 @@ class DL {
Tesses::Framework::Filesystem::LocalFilesystem lfs; Tesses::Framework::Filesystem::LocalFilesystem lfs;
std::string str = lfs.VFSPathToSystem(p); std::string str = lfs.VFSPathToSystem(p);
#if defined(_WIN32) #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 #else
handle = dlopen(str.c_str(), RTLD_LAZY); handle = dlopen(str.c_str(), RTLD_LAZY);
#endif #endif
} }
template <typename T> T Resolve(std::string name) { template <typename T> T Resolve(std::string name) {
#if defined(_WIN32) #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 #else
return (T)dlsym(handle, name.c_str()); return (T)dlsym(handle, name.c_str());
@@ -86,7 +78,9 @@ class DL {
} }
~DL() { ~DL() {
#if defined(_WIN32) #if defined(_WIN32)
FreeLibrary((HMODULE)handle);
throw std::runtime_error("I removed support on this platform");
// FreeLibrary((HMODULE)handle);
#else #else
dlclose(handle); dlclose(handle);
#endif #endif
@@ -1004,11 +998,7 @@ static TObject YieldEnumerableFunc(GCList &ls, std::vector<TObject> args) {
static TObject DateTime_Sleep(GCList &ls, std::vector<TObject> args) { static TObject DateTime_Sleep(GCList &ls, std::vector<TObject> args) {
int64_t msec; int64_t msec;
if (GetArgument(args, 0, msec)) { if (GetArgument(args, 0, msec)) {
#if defined(_WIN32) Tesses::Framework::TF_Sleep(msec);
Sleep((int)msec);
#else
usleep(1000 * msec);
#endif
} }
return nullptr; return nullptr;
} }
@@ -1587,7 +1577,7 @@ void TStd::RegisterStd(
RegisterCrypto(gc, env); RegisterCrypto(gc, env);
RegisterOGC(gc, env); RegisterOGC(gc, env);
RegisterProcess(gc, env); RegisterProcess(gc, env);
RegisterClass(gc, env); RegisterZeClass(gc, env);
gc->RegisterEverything(env); gc->RegisterEverything(env);

View File

@@ -2292,9 +2292,9 @@ bool InterperterThread::ExecuteMethod2(std::shared_ptr<GC> gc, TObject instance,
} }
if (key == "RegisterClass") { if (key == "RegisterClass") {
if ((myEnv->permissions.canRegisterEverything || if ((myEnv->permissions.canRegisterEverything ||
myEnv->permissions.canRegisterClass) && myEnv->permissions.canRegisterZeClass) &&
!rootEnv->permissions.locked) !rootEnv->permissions.locked)
TStd::RegisterClass(gc, rootEnv); TStd::RegisterZeClass(gc, rootEnv);
cse.back()->Push(gc, nullptr); cse.back()->Push(gc, nullptr);
return false; return false;
} }

View File

@@ -2,9 +2,7 @@
#include <chrono> #include <chrono>
#include <iostream> #include <iostream>
#include <time.h> #include <time.h>
#if defined(_WIN32) #if !defined(_WIN32)
#include <windows.h>
#else
#include <unistd.h> #include <unistd.h>
#endif #endif
@@ -85,7 +83,6 @@ TDictionary *CreateThread(GCList &ls, TCallable *callable, bool detached) {
TObject cb = th->callable->Call(ls, {}); TObject cb = th->callable->Call(ls, {});
gc->BarrierBegin(); gc->BarrierBegin();
th->returnValue = cb; th->returnValue = cb;
std::map<pthread_t, int> mt;
#if defined(GEKKO) || defined(_EE) #if defined(GEKKO) || defined(_EE)
current_funcs_mtx.Lock(); current_funcs_mtx.Lock();
current_funcs.erase(pthread_self()); current_funcs.erase(pthread_self());