mirror of
https://github.com/janet-lang/janet
synced 2025-07-05 11:32:54 +00:00
Fix MSVC errors.
This commit is contained in:
parent
2f0570aad6
commit
b54d9725d8
@ -391,7 +391,7 @@ void janet_collect(void) {
|
|||||||
* and all of its children. If gcroot is called on a value n times, unroot
|
* and all of its children. If gcroot is called on a value n times, unroot
|
||||||
* must also be called n times to remove it as a gc root. */
|
* must also be called n times to remove it as a gc root. */
|
||||||
void janet_gcroot(Janet root) {
|
void janet_gcroot(Janet root) {
|
||||||
uint32_t newcount = janet_vm_root_count + 1;
|
size_t newcount = janet_vm_root_count + 1;
|
||||||
if (newcount > janet_vm_root_capacity) {
|
if (newcount > janet_vm_root_capacity) {
|
||||||
uint32_t newcap = 2 * newcount;
|
uint32_t newcap = 2 * newcount;
|
||||||
janet_vm_roots = realloc(janet_vm_roots, sizeof(Janet) * newcap);
|
janet_vm_roots = realloc(janet_vm_roots, sizeof(Janet) * newcap);
|
||||||
|
@ -76,10 +76,10 @@ void arc4random_buf(void *buf, size_t nbytes);
|
|||||||
static int env_lock_initialized = 0;
|
static int env_lock_initialized = 0;
|
||||||
static CRITICAL_SECTION env_lock;
|
static CRITICAL_SECTION env_lock;
|
||||||
static void janet_lock_environ(void) {
|
static void janet_lock_environ(void) {
|
||||||
EnterCriticalSection(env_lock);
|
EnterCriticalSection(&env_lock);
|
||||||
}
|
}
|
||||||
static void janet_unlock_environ(void) {
|
static void janet_unlock_environ(void) {
|
||||||
LeaveCriticalSection(env_lock);
|
LeaveCriticalSection(&env_lock);
|
||||||
}
|
}
|
||||||
# else
|
# else
|
||||||
static pthread_mutex_t env_lock = PTHREAD_MUTEX_INITIALIZER;
|
static pthread_mutex_t env_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||||
@ -1134,7 +1134,7 @@ void janet_lib_os(JanetTable *env) {
|
|||||||
/* During start up, the top-most abstract machine (thread)
|
/* During start up, the top-most abstract machine (thread)
|
||||||
* in the thread tree sets up the critical section. */
|
* in the thread tree sets up the critical section. */
|
||||||
if (!env_lock_initialized) {
|
if (!env_lock_initialized) {
|
||||||
InitializeCriticalSection(env_lock);
|
InitializeCriticalSection(&env_lock);
|
||||||
env_lock_initialized = 1;
|
env_lock_initialized = 1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user