// @todo consider looking at supporting externally allocated memory entries that can have cleanup callbacks associated, but the memory is not freed from the pool, only linked as an external allocation for auto cleanup
// which would allow calling something like ks_pool_set_cleanup(bs->properties, ...) and when the pool is destroyed, it can call a callback which handles calling cJSON_Delete, which is allocated externally
cJSON_Delete(bs->properties);
bs->properties=NULL;
// rwl has auto cleanup
//ks_rwl_destroy(&bs->properties_lock);
// connection id's are created as copies within the session's pool, and will be cleaned up with the pool automatically
// @todo review this code, it may end up blocking forever as the mutex for the session is locked and the connection thread will not be able to lock to remove the connection...
// isolate another mutex for the connection list, simclist is not intrinsicly thread safe like other containers
ks_size_treserved[2];// @todo use one of these to store the original pool address to validate that free_mem is not attempted against the wrong pool, which can corrupt the allocation linked list
memset(start,0,required);// @todo consider readding the NO_ZERO flag option, which would reduce this to only zero out PREFIX_SIZE instead of the entire allocation.
// @todo consider readding the NO_ZERO flag option, in which case must zero the user-space here based on expected calloc behaviour... memset(addr, 0, size);