Changes in kernel/generic/src/proc/task.c [7f11dc6:c46bfbc] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/proc/task.c
r7f11dc6 rc46bfbc 79 79 static task_id_t task_counter = 0; 80 80 81 static slab_cache_t *task_ cache;81 static slab_cache_t *task_slab; 82 82 83 83 /* Forward declarations. */ … … 93 93 TASK = NULL; 94 94 avltree_create(&tasks_tree); 95 task_ cache= slab_cache_create("task_t", sizeof(task_t), 0,95 task_slab = slab_cache_create("task_t", sizeof(task_t), 0, 96 96 tsk_constructor, tsk_destructor, 0); 97 97 } … … 185 185 #endif 186 186 187 return EOK;187 return 0; 188 188 } 189 189 … … 206 206 task_t *task_create(as_t *as, const char *name) 207 207 { 208 task_t *task = (task_t *) slab_alloc(task_cache, 0); 209 if (task == NULL) { 210 return NULL; 211 } 212 208 task_t *task = (task_t *) slab_alloc(task_slab, 0); 213 209 task_create_arch(task); 214 210 … … 245 241 if ((ipc_phone_0) && 246 242 (container_check(ipc_phone_0->task->container, task->container))) { 247 cap_handle_t phone_handle; 248 int rc = phone_alloc(task, &phone_handle); 249 if (rc != EOK) { 250 task->as = NULL; 251 task_destroy_arch(task); 252 slab_free(task_cache, task); 253 return NULL; 254 } 255 243 cap_handle_t phone_handle = phone_alloc(task); 256 244 kobject_t *phone_obj = kobject_get(task, phone_handle, 257 245 KOBJECT_TYPE_PHONE); … … 307 295 as_release(task->as); 308 296 309 slab_free(task_ cache, task);297 slab_free(task_slab, task); 310 298 } 311 299
Note:
See TracChangeset
for help on using the changeset viewer.