[Asterisk-code-review] scheduler: Use stack for allocating sched IDs. (asterisk[certified/13.1])

Joshua Colp asteriskteam at digium.com
Fri Sep 11 11:42:03 CDT 2015


Joshua Colp has posted comments on this change.

Change subject: scheduler: Use stack for allocating sched IDs.
......................................................................


Patch Set 1: Code-Review-1

(4 comments)

https://gerrit.asterisk.org/#/c/1257/1/main/sched.c
File main/sched.c:

Line 81: 	int id;
Why the duplicate id?


Line 244: 	ast_free(task->sched_id);
You may want to add a comment about why this is possible.


Line 298: 		new_id = ast_calloc(1, sizeof(*new_id));
If this occurs the id_stack_size will be a lie, despite having additional ids potentially added.

I think as each new id is allocated id_stack_size should be incremented. At the end if the current size is the same as the starting size, it totally failed and no new ids.

If it's not then you've got at least 1 new id and things can attempt to go on.


Line 310: static int set_sched_id(struct ast_sched_context *con, struct sched *new_sched) {
Yo dawg can I have my { on the next line?


-- 
To view, visit https://gerrit.asterisk.org/1257
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I532708eef8f669d823457d7fefdad9a6078b99b2
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: certified/13.1
Gerrit-Owner: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list