1
0
mirror of https://github.com/janet-lang/janet synced 2025-11-02 00:23:02 +00:00

Change some definitions and remove thoughts.md

This commit is contained in:
Calvin Rose
2018-06-02 19:16:13 -04:00
parent 3b30b98ec0
commit b5ed4a875f
8 changed files with 15 additions and 77 deletions

View File

@@ -385,5 +385,5 @@ void dst_clear_memory(void) {
}
/* Primitives for suspending GC. */
int dst_gclock() { return dst_vm_gc_suspend++; }
int dst_gclock(void) { return dst_vm_gc_suspend++; }
void dst_gcunlock(int handle) { dst_vm_gc_suspend = handle; }

View File

@@ -39,9 +39,6 @@
#define dst_gc_unmark(m) (dst_gc_header(m)->flags &= ~DST_MEM_COLOR)
#define dst_gc_reachable(m) (dst_gc_header(m)->flags & DST_MEM_REACHABLE)
// #define dst_gclock() (dst_vm_gc_suspend++)
// #define dst_gcunlock(lock) (dst_vm_gc_suspend = lock)
/* Memory header struct. Node of a linked list of memory blocks. */
typedef struct DstGCMemoryHeader DstGCMemoryHeader;
struct DstGCMemoryHeader {

View File

@@ -111,14 +111,14 @@ Dst dst_wrap_nil() {
return y;
}
Dst dst_wrap_true() {
Dst dst_wrap_true(void) {
Dst y;
y.type = DST_TRUE;
y.as.u64 = 0;
return y;
}
Dst dst_wrap_false() {
Dst dst_wrap_false(void) {
Dst y;
y.type = DST_FALSE;
y.as.u64 = 0;

View File

@@ -161,7 +161,7 @@ void dst_clear_memory(void);
void dst_gcroot(Dst root);
int dst_gcunroot(Dst root);
int dst_gcunrootall(Dst root);
int dst_gclock();
int dst_gclock(void);
void dst_gcunlock(int handle);
/* Functions */

View File

@@ -91,7 +91,10 @@ extern "C" {
#define DST_LITTLE_ENDIAN 1
#endif
/* Check compiler */
/* Define how global dst state is declared */
#ifdef DST_SINGLE_THREADED
#define DST_THREAD_LOCAL
#else
#if defined(__GNUC__)
#define DST_THREAD_LOCAL __thread
#elif defined(_MSC_BUILD)
@@ -99,6 +102,7 @@ extern "C" {
#else
#define DST_THREAD_LOCAL
#endif
#endif
/* Include default headers */
#include <stdint.h>
@@ -112,7 +116,7 @@ extern "C" {
__LINE__,\
__FILE__,\
(m));\
exit(-1);\
exit(1);\
} while (0)
#endif

View File

@@ -348,11 +348,11 @@ struct Dst {
#define dst_unwrap_integer(x) ((x).as.integer)
#define dst_unwrap_real(x) ((x).as.real)
Dst dst_wrap_nil();
Dst dst_wrap_nil(void);
Dst dst_wrap_real(double x);
Dst dst_wrap_integer(int32_t x);
Dst dst_wrap_true();
Dst dst_wrap_false();
Dst dst_wrap_true(void);
Dst dst_wrap_false(void);
Dst dst_wrap_boolean(int x);
Dst dst_wrap_string(const uint8_t *x);
Dst dst_wrap_symbol(const uint8_t *x);