real_size = size;
}
+ while ((real_size & (sizeof(void *) - 1)) > 0) {
+ real_size++;
+ }
+
/*
* We use a specific free bits calculation here because if we are
* freeing 10 bytes then we will be putting it into the 8-byte free
fence = FENCE_SIZE;
/* now we free the pointer */
- ret = free_pointer(mp_p, addr, old_size + fence);
+ ret = free_pointer(mp_p, addr, old_size + fence + PREFIX_SIZE);
if (ret != KS_STATUS_SUCCESS) {
return ret;
}
break;
case KS_MPCL_DESTROY:
#ifdef WIN32
- if (!(thread->flags & KS_THREAD_FLAG_DETATCHED)) {
+ //if (!(thread->flags & KS_THREAD_FLAG_DETATCHED)) {
CloseHandle(thread->handle);
- }
+ //}
#endif
break;
}
KS_DECLARE(uint8_t) ks_thread_priority(ks_thread_t *thread) {
uint8_t priority = 0;
#ifdef WIN32
- DWORD pri = GetThreadPriority(thread->handle);
+ int pri = GetThreadPriority(thread->handle);
if (pri >= THREAD_PRIORITY_TIME_CRITICAL) {
priority = 99;
}
if (flags & KS_THREAD_FLAG_DETATCHED) {
- CloseHandle(thread->handle);
+ //CloseHandle(thread->handle);
}
status = KS_STATUS_SUCCESS;
int main(int argc, char **argv)
{
ks_init();
- cpu_count = ks_cpu_count() * 4;
+ //cpu_count = ks_cpu_count() * 4;
+ //cpu_count = ks_cpu_count();
+ cpu_count = 1;
plan(21 + cpu_count * 6);
- diag("Starting testing for %d tests\n", 44);
+ diag("Starting testing for %d tests\n", 21 + cpu_count * 6);
create_pool();
create_mutex();