Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
b58de723
Commit
b58de723
authored
Mar 29, 2017
by
Craig Tiller
Browse files
Options
Downloads
Patches
Plain Diff
Lazily allocate batch control objects
parent
18cf1575
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/core/lib/surface/call.c
+6
-2
6 additions, 2 deletions
src/core/lib/surface/call.c
with
6 additions
and
2 deletions
src/core/lib/surface/call.c
+
6
−
2
View file @
b58de723
...
@@ -163,7 +163,7 @@ struct grpc_call {
...
@@ -163,7 +163,7 @@ struct grpc_call {
/* have we received initial metadata */
/* have we received initial metadata */
bool
has_initial_md_been_received
;
bool
has_initial_md_been_received
;
batch_control
active_batches
[
MAX_CONCURRENT_BATCHES
];
batch_control
*
active_batches
[
MAX_CONCURRENT_BATCHES
];
grpc_transport_stream_op_payload
stream_op_payload
;
grpc_transport_stream_op_payload
stream_op_payload
;
/* first idx: is_receiving, second idx: is_trailing */
/* first idx: is_receiving, second idx: is_trailing */
...
@@ -1022,7 +1022,11 @@ static batch_control *allocate_batch_control(grpc_call *call,
...
@@ -1022,7 +1022,11 @@ static batch_control *allocate_batch_control(grpc_call *call,
const
grpc_op
*
ops
,
const
grpc_op
*
ops
,
size_t
num_ops
)
{
size_t
num_ops
)
{
int
slot
=
batch_slot_for_op
(
ops
[
0
].
op
);
int
slot
=
batch_slot_for_op
(
ops
[
0
].
op
);
batch_control
*
bctl
=
&
call
->
active_batches
[
slot
];
batch_control
**
pslot
=
&
call
->
active_batches
[
slot
];
if
(
*
pslot
==
NULL
)
{
*
pslot
=
gpr_arena_alloc
(
call
->
arena
,
sizeof
(
batch_control
));
}
batch_control
*
bctl
=
*
pslot
;
if
(
bctl
->
call
!=
NULL
)
{
if
(
bctl
->
call
!=
NULL
)
{
return
NULL
;
return
NULL
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment