Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(433)

Side by Side Diff: fusl/src/env/__reset_tls.c

Issue 1714623002: [fusl] clang-format fusl (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: headers too Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 #include <string.h> 1 #include <string.h>
2 #include "pthread_impl.h" 2 #include "pthread_impl.h"
3 #include "libc.h" 3 #include "libc.h"
4 4
5 void __reset_tls() 5 void __reset_tls() {
6 { 6 pthread_t self = __pthread_self();
7 » pthread_t self = __pthread_self(); 7 struct tls_module* p;
8 » struct tls_module *p; 8 size_t i, n = (size_t)self->dtv[0];
9 » size_t i, n = (size_t)self->dtv[0]; 9 if (n)
10 » if (n) for (p=libc.tls_head, i=1; i<=n; i++, p=p->next) { 10 for (p = libc.tls_head, i = 1; i <= n; i++, p = p->next) {
11 » » if (!self->dtv[i]) continue; 11 if (!self->dtv[i])
12 » » memcpy(self->dtv[i], p->image, p->len); 12 continue;
13 » » memset((char *)self->dtv[i]+p->len, 0, 13 memcpy(self->dtv[i], p->image, p->len);
14 » » » p->size - p->len); 14 memset((char*)self->dtv[i] + p->len, 0, p->size - p->len);
15 » } 15 }
16 } 16 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698