@@ -2495,7 +2495,7 @@ typedef uint32_t gs_slot_map_iter;
24952495#define gs_pqueue_child_right_idx (I ) ((I * 2) + 2)
24962496
24972497GS_API_DECL void * *
2498- gs_pqueue_init (void * * pq );
2498+ gs_pqueue_init (void * * pq , size_t sz );
24992499
25002500#define gs_pqueue_init_all (__PQ , __V )\
25012501 (gs_pqueue_init((void**)&(__PQ), sizeof(*(__PQ))), gs_dyn_array_init((void**)&((__PQ)->priority), sizeof(int32_t)),\
@@ -2514,7 +2514,7 @@ gs_pqueue_init(void** pq);
25142514 } while (0)
25152515
25162516#define gs_pqueue_empty (__PQ )\
2517- (!gs_pqueue_size(__PQ))
2517+ (!(__PQ) || ! gs_pqueue_size(__PQ))
25182518
25192519#define __gs_pqueue_swp (__PQ , __I0 , __I1 , __SZ )\
25202520 do {\
@@ -6707,7 +6707,8 @@ typedef struct gs_context_t
67076707 gs_audio_t * audio ;
67086708 gs_app_desc_t app ;
67096709 gs_os_api_t os ;
6710- } gs_context_t ;
6710+ gs_atomic_int_t lock ;
6711+ } gs_context_t ;
67116712
67126713typedef struct gs_t
67136714{
@@ -8844,6 +8845,7 @@ GS_API_DECL bool gs_token_compare_type(const gs_token_t* t, gs_token_type type)
88448845
88458846GS_API_DECL bool gs_token_compare_text (const gs_token_t * t , const char * match )
88468847{
8848+ if (t -> len != gs_string_length (match )) return false;
88478849 return (gs_string_compare_equal_n (t -> text , match , t -> len ));
88488850}
88498851
@@ -9336,6 +9338,8 @@ gs_create(gs_app_desc_t app_desc)
93369338 _gs_instance = (gs_t * )os .malloc (sizeof (gs_t ));
93379339 memset (_gs_instance , 0 , sizeof (gs_t ));
93389340
9341+ gs_instance ()-> ctx .lock = SCHED_PIPE_INVALID ;
9342+
93399343 // Set os api now allocated
93409344 gs_instance ()-> ctx .os = os ;
93419345
0 commit comments