Skip to content

EVENTLOOP: ensure exclusive Gambit thread exists. #418

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
5b2fe7b
CORE: fix extension of srfi-23 copy-time
0-8-15 Mar 14, 2021
0603b04
GLGUI: fix typo and backward compatible dispatch prefering new code
0-8-15 Jan 11, 2021
145d9b5
GLCORE: fix missing globalbinding and unbound variable
0-8-15 Apr 28, 2021
3c8055d
X11: fix hanging display
0-8-15 Feb 21, 2021
9f5e1c5
CLIPBOARD: make clipboard-copy work under Linux
0-8-15 Apr 29, 2021
bf2072a
X11 CLIPBOARD: fix off-by-one
0-8-15 Apr 29, 2021
4e9612e
GAMBIT: fix incorrect numbers - follwing fix in upstream
0-8-15 Mar 30, 2021
cb12f0d
JSON: add encoding options choice
0-8-15 Apr 11, 2021
4571ef9
ANDROID CLIPBOARD: support coerce mimetypes to text/plain
0-8-15 Apr 11, 2021
f8c84e1
BUILD: ensure failures to compile hook.c break build
0-8-15 Apr 24, 2021
b39b45b
MICROGL: add support for pageup/down
0-8-15 Feb 13, 2021
9c435d2
MICROGL X11: avoid some of the needless redraw events
0-8-15 Feb 13, 2021
fc63e27
EVENTLOOP: ensure exclusive Gambit thread exists.
0-8-15 Apr 29, 2021
8b3c784
EVENTLOOP: untested changes required by #fc63e27
0-8-15 Apr 28, 2021
44cbdc0
ANDROID: switch debug off by default
0-8-15 Apr 29, 2021
30aec58
CLIPBOARD on ANDROID: fix paste working one only
0-8-15 Jul 25, 2021
5dbd4fe
IRREGEX: follow upstream to 0.9.10
0-8-15 Jul 20, 2021
d5387ed
SRFI19: fix risky+damaging defaults
0-8-15 Jul 11, 2021
58d7394
SRFI19: fix julian day calculation
0-8-15 Jun 30, 2021
c583615
JSON: add option to generate newlines
0-8-15 Jul 2, 2021
304d5b7
SCM.sh: export ~~bld for SYS_HOSTPREFIX to gambit
0-8-15 Jun 6, 2021
f3f632e
MAKE.sh: enable substitutions for C startup
0-8-15 Jun 6, 2021
c60a74e
CONFIG: do not require microgl for console apps
0-8-15 May 31, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions LNCONFIG.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,19 @@ int scm_screenheight();

// hook prototype (performs scheme init)
void ffi_event(int,int,int);
void ln_gambit_unlock();
typedef struct {
int t;
int x;
int y;
int fd[2];
} ffi_event_params_t;
extern ffi_event_params_t ffi_event_params;

// C prototypes
// these are used by the desktop platforms
void microgl_hook(int,int,int);
void microgl_draw_before();
void microgl_swapbuffers();
void microgl_close();
void microgl_init();
Expand All @@ -130,6 +139,7 @@ void microgl_pollevents();
void microgl_refresh();
int microgl_screenwidth();
int microgl_screenheight();
unsigned int microgl_redraw_period(unsigned int);

#endif // STANDALONE

Expand Down
4 changes: 4 additions & 0 deletions languages/scm.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,17 @@ void lambdanative_payload_setup()
setup_params.debug_settings = debug_settings;
lambdanative_exit_call_count = 0;
___setup(&setup_params);
/* Runing from a single thread should fix the race conditions, which
lead to the following mitigation. Should be ready to be removed.

#if defined(ANDROID)
#if (___VERSION < 409002)
___disable_heartbeat_interrupts();
#else
___cleanup_heartbeat_interrupt_handling();
#endif
#endif
*/
}

void lambdanative_payload_cleanup()
Expand Down
2 changes: 1 addition & 1 deletion languages/scm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ compile_payload_scm()
(
# exported list of "well known" build parameters
export SYS_PREFIX SYS_ROOT SYS_PATH SYS_ANDROIDAPI SYS_ANDROID_ABI
veval "$SYS_GSC -:~~tgt=${SYS_PREFIX} -prelude \"$scm_opts\" -c -o $scm_ctgt $gsc_processing $scm_hdr $scm_src"
veval "$SYS_GSC -:~~tgt=${SYS_PREFIX},~~bld=${SYS_HOSTPREFIX} -prelude \"$scm_opts\" -c -o $scm_ctgt $gsc_processing $scm_hdr $scm_src"
)
if [ $veval_result != "0" ]; then rmifexists "$scm_ctgt"; fi
assertfile "$scm_ctgt"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
From e529b1d6d5b7bae2fcc3e9cd8e7f3e11a1318193 Mon Sep 17 00:00:00 2001
From: Marc Feeley <[email protected]>
Date: Sun, 28 Mar 2021 19:29:54 -0400
Subject: [PATCH] Fix incorrect space allocation report by time special form

---
lib/_kernel.scm | 6 ++++--
lib/mem.c | 3 ++-
2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/lib/_kernel.scm b/lib/_kernel.scm
index 59b9e41..2d827dd 100644
--- lib/_kernel.scm
+++ lib/_kernel.scm
@@ -4346,7 +4346,9 @@ end-of-code

if (!___FIXNUMP(result))
{
- n = ___bytes_allocated (___PSPNC) - n;
+ ___F64 ba = ___bytes_allocated (___PSPNC);
+
+ n = ba - n;

___process_times (&user, &sys, &real);
___vm_stats (&minflt, &majflt);
@@ -4358,7 +4360,7 @@ end-of-code
___F64VECTORSET(result,___FIX(4),___vms->mem.gc_sys_time_)
___F64VECTORSET(result,___FIX(5),___vms->mem.gc_real_time_)
___F64VECTORSET(result,___FIX(6),___vms->mem.nb_gcs_)
- ___F64VECTORSET(result,___FIX(7),___bytes_allocated (___PSPNC))
+ ___F64VECTORSET(result,___FIX(7),ba)
___F64VECTORSET(result,___FIX(8),(2*(1+2)<<___LWS))
___F64VECTORSET(result,___FIX(9),n)
___F64VECTORSET(result,___FIX(10),minflt)
diff --git a/lib/mem.c b/lib/mem.c
index 2c6cafd..9223da1 100755
--- lib/mem.c
+++ lib/mem.c
@@ -7080,7 +7080,8 @@ ___PSDKR)
alloc_stack_ptr = ___ps->fp;
alloc_heap_ptr = ___ps->hp;

- return bytes_allocated_minus_occupied + bytes_occupied(___ps);
+ return bytes_allocated_minus_occupied + bytes_occupied(___ps) +
+ ___CAST(___F64,occupied_words_still) * ___WS;
}


--
2.20.1
Loading