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

Side by Side Diff: base/process/launch_posix.cc

Issue 2670873002: Remove base's ALIGNOF/ALIGNAS in favor of alignof/alignas. (Closed)
Patch Set: rebase Created 3 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
« no previous file with comments | « base/metrics/persistent_memory_allocator.h ('k') | cc/base/contiguous_container.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/process/launch.h" 5 #include "base/process/launch.h"
6 6
7 #include <dirent.h> 7 #include <dirent.h>
8 #include <errno.h> 8 #include <errno.h>
9 #include <fcntl.h> 9 #include <fcntl.h>
10 #include <sched.h> 10 #include <sched.h>
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
704 #endif 704 #endif
705 NOINLINE pid_t CloneAndLongjmpInChild(unsigned long flags, 705 NOINLINE pid_t CloneAndLongjmpInChild(unsigned long flags,
706 pid_t* ptid, 706 pid_t* ptid,
707 pid_t* ctid, 707 pid_t* ctid,
708 jmp_buf* env) { 708 jmp_buf* env) {
709 // We use the libc clone wrapper instead of making the syscall 709 // We use the libc clone wrapper instead of making the syscall
710 // directly because making the syscall may fail to update the libc's 710 // directly because making the syscall may fail to update the libc's
711 // internal pid cache. The libc interface unfortunately requires 711 // internal pid cache. The libc interface unfortunately requires
712 // specifying a new stack, so we use setjmp/longjmp to emulate 712 // specifying a new stack, so we use setjmp/longjmp to emulate
713 // fork-like behavior. 713 // fork-like behavior.
714 char stack_buf[PTHREAD_STACK_MIN] ALIGNAS(16); 714 alignas(16) char stack_buf[PTHREAD_STACK_MIN];
715 #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARM_FAMILY) || \ 715 #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARM_FAMILY) || \
716 defined(ARCH_CPU_MIPS_FAMILY) 716 defined(ARCH_CPU_MIPS_FAMILY)
717 // The stack grows downward. 717 // The stack grows downward.
718 void* stack = stack_buf + sizeof(stack_buf); 718 void* stack = stack_buf + sizeof(stack_buf);
719 #else 719 #else
720 #error "Unsupported architecture" 720 #error "Unsupported architecture"
721 #endif 721 #endif
722 return clone(&CloneHelper, stack, flags, env, ptid, nullptr, ctid); 722 return clone(&CloneHelper, stack, flags, env, ptid, nullptr, ctid);
723 } 723 }
724 724
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
758 jmp_buf env; 758 jmp_buf env;
759 if (setjmp(env) == 0) { 759 if (setjmp(env) == 0) {
760 return CloneAndLongjmpInChild(flags, ptid, ctid, &env); 760 return CloneAndLongjmpInChild(flags, ptid, ctid, &env);
761 } 761 }
762 762
763 return 0; 763 return 0;
764 } 764 }
765 #endif // defined(OS_LINUX) || defined(OS_NACL_NONSFI) 765 #endif // defined(OS_LINUX) || defined(OS_NACL_NONSFI)
766 766
767 } // namespace base 767 } // namespace base
OLDNEW
« no previous file with comments | « base/metrics/persistent_memory_allocator.h ('k') | cc/base/contiguous_container.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698