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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
07a6be99
Commit
07a6be99
authored
9 years ago
by
Vijay Pai
Browse files
Options
Downloads
Patches
Plain Diff
Stop upsetting valgrind with uninitialized shorts
parent
3ad28d0f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/core/support/stack_lockfree.c
+8
-0
8 additions, 0 deletions
src/core/support/stack_lockfree.c
with
8 additions
and
0 deletions
src/core/support/stack_lockfree.c
+
8
−
0
View file @
07a6be99
...
@@ -99,6 +99,10 @@ gpr_stack_lockfree *gpr_stack_lockfree_create(size_t entries) {
...
@@ -99,6 +99,10 @@ gpr_stack_lockfree *gpr_stack_lockfree_create(size_t entries) {
/* Point the head at reserved dummy entry */
/* Point the head at reserved dummy entry */
stack
->
head
.
contents
.
index
=
INVALID_ENTRY_INDEX
;
stack
->
head
.
contents
.
index
=
INVALID_ENTRY_INDEX
;
#ifdef GPR_ARCH_64
stack
->
head
.
contents
.
pad
=
0
;
#endif
stack
->
head
.
contents
.
aba_ctr
=
0
;
return
stack
;
return
stack
;
}
}
...
@@ -115,6 +119,10 @@ int gpr_stack_lockfree_push(gpr_stack_lockfree *stack, int entry) {
...
@@ -115,6 +119,10 @@ int gpr_stack_lockfree_push(gpr_stack_lockfree *stack, int entry) {
/* First fill in the entry's index and aba ctr for new head */
/* First fill in the entry's index and aba ctr for new head */
newhead
.
contents
.
index
=
(
uint16_t
)
entry
;
newhead
.
contents
.
index
=
(
uint16_t
)
entry
;
#ifdef GPR_ARCH_64
newhead
.
contents
.
pad
=
0
;
#endif
/* Also post-increment the aba_ctr */
/* Also post-increment the aba_ctr */
curent
.
atm
=
gpr_atm_no_barrier_load
(
&
stack
->
entries
[
entry
].
atm
);
curent
.
atm
=
gpr_atm_no_barrier_load
(
&
stack
->
entries
[
entry
].
atm
);
newhead
.
contents
.
aba_ctr
=
++
curent
.
contents
.
aba_ctr
;
newhead
.
contents
.
aba_ctr
=
++
curent
.
contents
.
aba_ctr
;
...
...
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
register
or
sign in
to comment