ssb: sequence: Sequential 32-bit integer starting at 1.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 32m2s
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 32m2s
This commit is contained in:
@ -84,7 +84,7 @@ typedef struct _promise_stack_t
|
||||
uint32_t hash;
|
||||
int count;
|
||||
const char* stack;
|
||||
void* cstack[32];
|
||||
void* cstack[31];
|
||||
int cstack_count;
|
||||
} promise_stack_t;
|
||||
|
||||
@ -1220,6 +1220,7 @@ static void _add_promise_stack(tf_task_t* task, uint32_t hash, const char* stack
|
||||
{
|
||||
memmove(task->_promise_stacks + index + 1, task->_promise_stacks + index, sizeof(promise_stack_t) * (task->_promise_stack_count - index));
|
||||
}
|
||||
count = tf_min(count, tf_countof(task->_promise_stacks[index].cstack));
|
||||
task->_promise_stacks[index] = (promise_stack_t) { .hash = hash, .stack = tf_strdup(stack), .count = 1, .cstack_count = count };
|
||||
memcpy(task->_promise_stacks[index].cstack, buffer, sizeof(void*) * count);
|
||||
task->_promise_stack_count++;
|
||||
@ -1261,7 +1262,7 @@ JSValue tf_task_allocate_promise(tf_task_t* task, promiseid_t* out_promise)
|
||||
size_t length = 0;
|
||||
const char* stack = JS_ToCStringLen(task->_context, &length, stack_value);
|
||||
stack_hash = tf_util_fnv32a((const void*)stack, (int)length, 0);
|
||||
void* buffer[32];
|
||||
void* buffer[31];
|
||||
int count = tf_util_backtrace(buffer, sizeof(buffer) / sizeof(*buffer));
|
||||
stack_hash = tf_util_fnv32a((const void*)buffer, sizeof(void*) * count, stack_hash);
|
||||
_add_promise_stack(task, stack_hash, stack, buffer, count);
|
||||
|
Reference in New Issue
Block a user