diff
stringlengths
41
2.03M
msg
stringlengths
1
1.5k
repo
stringlengths
5
40
sha
stringlengths
40
40
time
stringlengths
20
20
new file mode 100644 <nl> index 00000000000 . . 94226dabb4c <nl> mmm / dev / null <nl> ppp b / dbms / tests / queries / 0_stateless / 01101_prewhere_after_alter . reference <nl> @ @ - 0 , 0 + 1 @ @ <nl> + 2a <nl> new file mode 100644 <nl> index 00000000000 . . 11ebac7448d <nl> mmm / dev / null <nl> ppp b / dbms / tests / queries / 0_stateless / 01101_prewhere_after_alter . sql <nl> <nl> + DROP TABLE IF EXISTS test_a ; <nl> + DROP TABLE IF EXISTS test_b ; <nl> + <nl> + CREATE TABLE test_a <nl> + ( <nl> + OldColumn String DEFAULT ' ' , <nl> + EventDate Date DEFAULT toDate ( EventTime ) , <nl> + EventTime DateTime <nl> + ) ENGINE = MergeTree ( EventDate , EventTime , 8192 ) ; <nl> + <nl> + CREATE TABLE test_b <nl> + ( <nl> + OldColumn String DEFAULT ' ' , <nl> + NewColumn String DEFAULT ' ' , <nl> + EventDate Date DEFAULT toDate ( EventTime ) , <nl> + EventTime DateTime <nl> + ) ENGINE = MergeTree ( EventDate , EventTime , 8192 ) ; <nl> + <nl> + INSERT INTO test_a ( OldColumn , EventTime ) VALUES ( ' 1 ' , now ( ) ) ; <nl> + <nl> + INSERT INTO test_b ( OldColumn , NewColumn , EventTime ) VALUES ( ' 1 ' , ' 1a ' , now ( ) ) ; <nl> + INSERT INTO test_b ( OldColumn , NewColumn , EventTime ) VALUES ( ' 2 ' , ' 2a ' , now ( ) ) ; <nl> + <nl> + ALTER TABLE test_a ADD COLUMN NewColumn String DEFAULT ' ' AFTER OldColumn ; <nl> + <nl> + INSERT INTO test_a ( OldColumn , NewColumn , EventTime ) VALUES ( ' 2 ' , ' 2a ' , now ( ) ) ; <nl> + <nl> + SELECT NewColumn <nl> + FROM test_a <nl> + INNER JOIN <nl> + ( SELECT OldColumn , NewColumn FROM test_b ) s <nl> + Using OldColumn <nl> + PREWHERE NewColumn ! = ' ' ; <nl> + <nl> + DROP TABLE test_a ; <nl> + DROP TABLE test_b ; <nl>
Test for fixed bug ( )
ClickHouse/ClickHouse
5b6a6b9b019a0456f94f2c384172a9bae9d9c02c
2020-03-26T09:32:54Z
mmm a / BUILD <nl> ppp b / BUILD <nl> cc_library ( <nl> " include / grpc / support / tls_msvc . h " , <nl> " include / grpc / support / tls_pthread . h " , <nl> " include / grpc / support / useful . h " , <nl> + " include / grpc / impl / codegen / atm . h " , <nl> + " include / grpc / impl / codegen / atm_gcc_atomic . h " , <nl> + " include / grpc / impl / codegen / atm_gcc_sync . h " , <nl> + " include / grpc / impl / codegen / atm_win32 . h " , <nl> + " include / grpc / impl / codegen / byte_buffer . h " , <nl> + " include / grpc / impl / codegen / compression_types . h " , <nl> " include / grpc / impl / codegen / connectivity_state . h " , <nl> + " include / grpc / impl / codegen / grpc_types . h " , <nl> + " include / grpc / impl / codegen / log . h " , <nl> " include / grpc / impl / codegen / port_platform . h " , <nl> + " include / grpc / impl / codegen / propagation_bits . h " , <nl> + " include / grpc / impl / codegen / slice . h " , <nl> + " include / grpc / impl / codegen / slice_buffer . h " , <nl> + " include / grpc / impl / codegen / status . h " , <nl> + " include / grpc / impl / codegen / sync . h " , <nl> + " include / grpc / impl / codegen / sync_generic . h " , <nl> + " include / grpc / impl / codegen / sync_posix . h " , <nl> + " include / grpc / impl / codegen / sync_win32 . h " , <nl> " include / grpc / impl / codegen / time . h " , <nl> ] , <nl> includes = [ <nl> cc_library ( <nl> " include / grpc + + / impl / codegen / channel_interface . h " , <nl> " include / grpc + + / impl / codegen / completion_queue_tag . h " , <nl> " include / grpc + + / impl / codegen / config . h " , <nl> + " include / grpc + + / impl / codegen / security / auth_context . h " , <nl> " include / grpc + + / impl / codegen / server_interface . h " , <nl> " include / grpc + + / impl / codegen / status . h " , <nl> " include / grpc + + / impl / codegen / status_code_enum . h " , <nl> + " include / grpc + + / impl / codegen / string_ref . h " , <nl> + " include / grpc + + / impl / codegen / sync . h " , <nl> + " include / grpc + + / impl / codegen / sync_cxx11 . h " , <nl> + " include / grpc + + / impl / codegen / sync_no_cxx11 . h " , <nl> " include / grpc + + / impl / codegen / time . h " , <nl> ] , <nl> includes = [ <nl> cc_library ( <nl> " include / grpc + + / impl / codegen / channel_interface . h " , <nl> " include / grpc + + / impl / codegen / completion_queue_tag . h " , <nl> " include / grpc + + / impl / codegen / config . h " , <nl> + " include / grpc + + / impl / codegen / security / auth_context . h " , <nl> " include / grpc + + / impl / codegen / server_interface . h " , <nl> " include / grpc + + / impl / codegen / status . h " , <nl> " include / grpc + + / impl / codegen / status_code_enum . h " , <nl> + " include / grpc + + / impl / codegen / string_ref . h " , <nl> + " include / grpc + + / impl / codegen / sync . h " , <nl> + " include / grpc + + / impl / codegen / sync_cxx11 . h " , <nl> + " include / grpc + + / impl / codegen / sync_no_cxx11 . h " , <nl> " include / grpc + + / impl / codegen / time . h " , <nl> ] , <nl> includes = [ <nl> cc_library ( <nl> " include / grpc + + / impl / codegen / channel_interface . h " , <nl> " include / grpc + + / impl / codegen / completion_queue_tag . h " , <nl> " include / grpc + + / impl / codegen / config . h " , <nl> + " include / grpc + + / impl / codegen / security / auth_context . h " , <nl> " include / grpc + + / impl / codegen / server_interface . h " , <nl> " include / grpc + + / impl / codegen / status . h " , <nl> " include / grpc + + / impl / codegen / status_code_enum . h " , <nl> + " include / grpc + + / impl / codegen / string_ref . h " , <nl> + " include / grpc + + / impl / codegen / sync . h " , <nl> + " include / grpc + + / impl / codegen / sync_cxx11 . h " , <nl> + " include / grpc + + / impl / codegen / sync_no_cxx11 . h " , <nl> " include / grpc + + / impl / codegen / time . h " , <nl> + " include / grpc / impl / codegen / atm . h " , <nl> + " include / grpc / impl / codegen / atm_gcc_atomic . h " , <nl> + " include / grpc / impl / codegen / atm_gcc_sync . h " , <nl> + " include / grpc / impl / codegen / atm_win32 . h " , <nl> + " include / grpc / impl / codegen / byte_buffer . h " , <nl> + " include / grpc / impl / codegen / compression_types . h " , <nl> " include / grpc / impl / codegen / connectivity_state . h " , <nl> + " include / grpc / impl / codegen / grpc_types . h " , <nl> + " include / grpc / impl / codegen / log . h " , <nl> " include / grpc / impl / codegen / port_platform . h " , <nl> + " include / grpc / impl / codegen / propagation_bits . h " , <nl> + " include / grpc / impl / codegen / slice . h " , <nl> + " include / grpc / impl / codegen / slice_buffer . h " , <nl> + " include / grpc / impl / codegen / status . h " , <nl> + " include / grpc / impl / codegen / sync . h " , <nl> + " include / grpc / impl / codegen / sync_generic . h " , <nl> + " include / grpc / impl / codegen / sync_posix . h " , <nl> + " include / grpc / impl / codegen / sync_win32 . h " , <nl> " include / grpc / impl / codegen / time . h " , <nl> ] , <nl> includes = [ <nl> objc_library ( <nl> " include / grpc / support / tls_msvc . h " , <nl> " include / grpc / support / tls_pthread . h " , <nl> " include / grpc / support / useful . h " , <nl> + " include / grpc / impl / codegen / atm . h " , <nl> + " include / grpc / impl / codegen / atm_gcc_atomic . h " , <nl> + " include / grpc / impl / codegen / atm_gcc_sync . h " , <nl> + " include / grpc / impl / codegen / atm_win32 . h " , <nl> + " include / grpc / impl / codegen / byte_buffer . h " , <nl> + " include / grpc / impl / codegen / compression_types . h " , <nl> " include / grpc / impl / codegen / connectivity_state . h " , <nl> + " include / grpc / impl / codegen / grpc_types . h " , <nl> + " include / grpc / impl / codegen / log . h " , <nl> " include / grpc / impl / codegen / port_platform . h " , <nl> + " include / grpc / impl / codegen / propagation_bits . h " , <nl> + " include / grpc / impl / codegen / slice . h " , <nl> + " include / grpc / impl / codegen / slice_buffer . h " , <nl> + " include / grpc / impl / codegen / status . h " , <nl> + " include / grpc / impl / codegen / sync . h " , <nl> + " include / grpc / impl / codegen / sync_generic . h " , <nl> + " include / grpc / impl / codegen / sync_posix . h " , <nl> + " include / grpc / impl / codegen / sync_win32 . h " , <nl> " include / grpc / impl / codegen / time . h " , <nl> " src / core / profiling / timers . h " , <nl> " src / core / support / block_annotate . h " , <nl> mmm a / Makefile <nl> ppp b / Makefile <nl> PUBLIC_HEADERS_C + = \ <nl> include / grpc / support / tls_msvc . h \ <nl> include / grpc / support / tls_pthread . h \ <nl> include / grpc / support / useful . h \ <nl> + include / grpc / impl / codegen / atm . h \ <nl> + include / grpc / impl / codegen / atm_gcc_atomic . h \ <nl> + include / grpc / impl / codegen / atm_gcc_sync . h \ <nl> + include / grpc / impl / codegen / atm_win32 . h \ <nl> + include / grpc / impl / codegen / byte_buffer . h \ <nl> + include / grpc / impl / codegen / compression_types . h \ <nl> include / grpc / impl / codegen / connectivity_state . h \ <nl> + include / grpc / impl / codegen / grpc_types . h \ <nl> + include / grpc / impl / codegen / log . h \ <nl> include / grpc / impl / codegen / port_platform . h \ <nl> + include / grpc / impl / codegen / propagation_bits . h \ <nl> + include / grpc / impl / codegen / slice . h \ <nl> + include / grpc / impl / codegen / slice_buffer . h \ <nl> + include / grpc / impl / codegen / status . h \ <nl> + include / grpc / impl / codegen / sync . h \ <nl> + include / grpc / impl / codegen / sync_generic . h \ <nl> + include / grpc / impl / codegen / sync_posix . h \ <nl> + include / grpc / impl / codegen / sync_win32 . h \ <nl> include / grpc / impl / codegen / time . h \ <nl> <nl> LIBGPR_OBJS = $ ( addprefix $ ( OBJDIR ) / $ ( CONFIG ) / , $ ( addsuffix . o , $ ( basename $ ( LIBGPR_SRC ) ) ) ) <nl> PUBLIC_HEADERS_CXX + = \ <nl> include / grpc + + / impl / codegen / channel_interface . h \ <nl> include / grpc + + / impl / codegen / completion_queue_tag . h \ <nl> include / grpc + + / impl / codegen / config . h \ <nl> + include / grpc + + / impl / codegen / security / auth_context . h \ <nl> include / grpc + + / impl / codegen / server_interface . h \ <nl> include / grpc + + / impl / codegen / status . h \ <nl> include / grpc + + / impl / codegen / status_code_enum . h \ <nl> + include / grpc + + / impl / codegen / string_ref . h \ <nl> + include / grpc + + / impl / codegen / sync . h \ <nl> + include / grpc + + / impl / codegen / sync_cxx11 . h \ <nl> + include / grpc + + / impl / codegen / sync_no_cxx11 . h \ <nl> include / grpc + + / impl / codegen / time . h \ <nl> <nl> LIBGRPC + + _OBJS = $ ( addprefix $ ( OBJDIR ) / $ ( CONFIG ) / , $ ( addsuffix . o , $ ( basename $ ( LIBGRPC + + _SRC ) ) ) ) <nl> PUBLIC_HEADERS_CXX + = \ <nl> include / grpc + + / impl / codegen / channel_interface . h \ <nl> include / grpc + + / impl / codegen / completion_queue_tag . h \ <nl> include / grpc + + / impl / codegen / config . h \ <nl> + include / grpc + + / impl / codegen / security / auth_context . h \ <nl> include / grpc + + / impl / codegen / server_interface . h \ <nl> include / grpc + + / impl / codegen / status . h \ <nl> include / grpc + + / impl / codegen / status_code_enum . h \ <nl> + include / grpc + + / impl / codegen / string_ref . h \ <nl> + include / grpc + + / impl / codegen / sync . h \ <nl> + include / grpc + + / impl / codegen / sync_cxx11 . h \ <nl> + include / grpc + + / impl / codegen / sync_no_cxx11 . h \ <nl> include / grpc + + / impl / codegen / time . h \ <nl> <nl> LIBGRPC + + _UNSECURE_OBJS = $ ( addprefix $ ( OBJDIR ) / $ ( CONFIG ) / , $ ( addsuffix . o , $ ( basename $ ( LIBGRPC + + _UNSECURE_SRC ) ) ) ) <nl> PUBLIC_HEADERS_CXX + = \ <nl> include / grpc + + / impl / codegen / channel_interface . h \ <nl> include / grpc + + / impl / codegen / completion_queue_tag . h \ <nl> include / grpc + + / impl / codegen / config . h \ <nl> + include / grpc + + / impl / codegen / security / auth_context . h \ <nl> include / grpc + + / impl / codegen / server_interface . h \ <nl> include / grpc + + / impl / codegen / status . h \ <nl> include / grpc + + / impl / codegen / status_code_enum . h \ <nl> + include / grpc + + / impl / codegen / string_ref . h \ <nl> + include / grpc + + / impl / codegen / sync . h \ <nl> + include / grpc + + / impl / codegen / sync_cxx11 . h \ <nl> + include / grpc + + / impl / codegen / sync_no_cxx11 . h \ <nl> include / grpc + + / impl / codegen / time . h \ <nl> + include / grpc / impl / codegen / atm . h \ <nl> + include / grpc / impl / codegen / atm_gcc_atomic . h \ <nl> + include / grpc / impl / codegen / atm_gcc_sync . h \ <nl> + include / grpc / impl / codegen / atm_win32 . h \ <nl> + include / grpc / impl / codegen / byte_buffer . h \ <nl> + include / grpc / impl / codegen / compression_types . h \ <nl> include / grpc / impl / codegen / connectivity_state . h \ <nl> + include / grpc / impl / codegen / grpc_types . h \ <nl> + include / grpc / impl / codegen / log . h \ <nl> include / grpc / impl / codegen / port_platform . h \ <nl> + include / grpc / impl / codegen / propagation_bits . h \ <nl> + include / grpc / impl / codegen / slice . h \ <nl> + include / grpc / impl / codegen / slice_buffer . h \ <nl> + include / grpc / impl / codegen / status . h \ <nl> + include / grpc / impl / codegen / sync . h \ <nl> + include / grpc / impl / codegen / sync_generic . h \ <nl> + include / grpc / impl / codegen / sync_posix . h \ <nl> + include / grpc / impl / codegen / sync_win32 . h \ <nl> include / grpc / impl / codegen / time . h \ <nl> <nl> LIBGRPC_PLUGIN_SUPPORT_OBJS = $ ( addprefix $ ( OBJDIR ) / $ ( CONFIG ) / , $ ( addsuffix . o , $ ( basename $ ( LIBGRPC_PLUGIN_SUPPORT_SRC ) ) ) ) <nl> mmm a / build . yaml <nl> ppp b / build . yaml <nl> filegroups : <nl> - include / grpc + + / impl / codegen / channel_interface . h <nl> - include / grpc + + / impl / codegen / completion_queue_tag . h <nl> - include / grpc + + / impl / codegen / config . h <nl> + - include / grpc + + / impl / codegen / security / auth_context . h <nl> - include / grpc + + / impl / codegen / server_interface . h <nl> - include / grpc + + / impl / codegen / status . h <nl> - include / grpc + + / impl / codegen / status_code_enum . h <nl> + - include / grpc + + / impl / codegen / string_ref . h <nl> + - include / grpc + + / impl / codegen / sync . h <nl> + - include / grpc + + / impl / codegen / sync_cxx11 . h <nl> + - include / grpc + + / impl / codegen / sync_no_cxx11 . h <nl> - include / grpc + + / impl / codegen / time . h <nl> - name : grpc_base <nl> public_headers : <nl> filegroups : <nl> - src / core / transport / static_metadata . c <nl> - src / core / transport / transport . c <nl> - src / core / transport / transport_op_string . c <nl> - - name : grpc_base_codegen <nl> - public_headers : <nl> - - include / grpc / impl / codegen / connectivity_state . h <nl> - - include / grpc / impl / codegen / port_platform . h <nl> - - include / grpc / impl / codegen / time . h <nl> - name : grpc_codegen <nl> public_headers : <nl> + - include / grpc / impl / codegen / atm . h <nl> + - include / grpc / impl / codegen / atm_gcc_atomic . h <nl> + - include / grpc / impl / codegen / atm_gcc_sync . h <nl> + - include / grpc / impl / codegen / atm_win32 . h <nl> + - include / grpc / impl / codegen / byte_buffer . h <nl> + - include / grpc / impl / codegen / compression_types . h <nl> - include / grpc / impl / codegen / connectivity_state . h <nl> + - include / grpc / impl / codegen / grpc_types . h <nl> + - include / grpc / impl / codegen / log . h <nl> - include / grpc / impl / codegen / port_platform . h <nl> + - include / grpc / impl / codegen / propagation_bits . h <nl> + - include / grpc / impl / codegen / slice . h <nl> + - include / grpc / impl / codegen / slice_buffer . h <nl> + - include / grpc / impl / codegen / status . h <nl> + - include / grpc / impl / codegen / sync . h <nl> + - include / grpc / impl / codegen / sync_generic . h <nl> + - include / grpc / impl / codegen / sync_posix . h <nl> + - include / grpc / impl / codegen / sync_win32 . h <nl> - include / grpc / impl / codegen / time . h <nl> - name : grpc_test_util_base <nl> headers : <nl> mmm a / gRPC . podspec <nl> ppp b / gRPC . podspec <nl> Pod : : Spec . new do | s | <nl> ' include / grpc / support / tls_msvc . h ' , <nl> ' include / grpc / support / tls_pthread . h ' , <nl> ' include / grpc / support / useful . h ' , <nl> + ' include / grpc / impl / codegen / atm . h ' , <nl> + ' include / grpc / impl / codegen / atm_gcc_atomic . h ' , <nl> + ' include / grpc / impl / codegen / atm_gcc_sync . h ' , <nl> + ' include / grpc / impl / codegen / atm_win32 . h ' , <nl> + ' include / grpc / impl / codegen / byte_buffer . h ' , <nl> + ' include / grpc / impl / codegen / compression_types . h ' , <nl> ' include / grpc / impl / codegen / connectivity_state . h ' , <nl> + ' include / grpc / impl / codegen / grpc_types . h ' , <nl> + ' include / grpc / impl / codegen / log . h ' , <nl> ' include / grpc / impl / codegen / port_platform . h ' , <nl> + ' include / grpc / impl / codegen / propagation_bits . h ' , <nl> + ' include / grpc / impl / codegen / slice . h ' , <nl> + ' include / grpc / impl / codegen / slice_buffer . h ' , <nl> + ' include / grpc / impl / codegen / status . h ' , <nl> + ' include / grpc / impl / codegen / sync . h ' , <nl> + ' include / grpc / impl / codegen / sync_generic . h ' , <nl> + ' include / grpc / impl / codegen / sync_posix . h ' , <nl> + ' include / grpc / impl / codegen / sync_win32 . h ' , <nl> ' include / grpc / impl / codegen / time . h ' , <nl> ' src / core / profiling / basic_timers . c ' , <nl> ' src / core / profiling / stap_timers . c ' , <nl> mmm a / grpc . gemspec <nl> ppp b / grpc . gemspec <nl> Gem : : Specification . new do | s | <nl> s . files + = % w ( include / grpc / support / tls_msvc . h ) <nl> s . files + = % w ( include / grpc / support / tls_pthread . h ) <nl> s . files + = % w ( include / grpc / support / useful . h ) <nl> + s . files + = % w ( include / grpc / impl / codegen / atm . h ) <nl> + s . files + = % w ( include / grpc / impl / codegen / atm_gcc_atomic . h ) <nl> + s . files + = % w ( include / grpc / impl / codegen / atm_gcc_sync . h ) <nl> + s . files + = % w ( include / grpc / impl / codegen / atm_win32 . h ) <nl> + s . files + = % w ( include / grpc / impl / codegen / byte_buffer . h ) <nl> + s . files + = % w ( include / grpc / impl / codegen / compression_types . h ) <nl> s . files + = % w ( include / grpc / impl / codegen / connectivity_state . h ) <nl> + s . files + = % w ( include / grpc / impl / codegen / grpc_types . h ) <nl> + s . files + = % w ( include / grpc / impl / codegen / log . h ) <nl> s . files + = % w ( include / grpc / impl / codegen / port_platform . h ) <nl> + s . files + = % w ( include / grpc / impl / codegen / propagation_bits . h ) <nl> + s . files + = % w ( include / grpc / impl / codegen / slice . h ) <nl> + s . files + = % w ( include / grpc / impl / codegen / slice_buffer . h ) <nl> + s . files + = % w ( include / grpc / impl / codegen / status . h ) <nl> + s . files + = % w ( include / grpc / impl / codegen / sync . h ) <nl> + s . files + = % w ( include / grpc / impl / codegen / sync_generic . h ) <nl> + s . files + = % w ( include / grpc / impl / codegen / sync_posix . h ) <nl> + s . files + = % w ( include / grpc / impl / codegen / sync_win32 . h ) <nl> s . files + = % w ( include / grpc / impl / codegen / time . h ) <nl> s . files + = % w ( src / core / profiling / timers . h ) <nl> s . files + = % w ( src / core / support / block_annotate . h ) <nl> mmm a / include / grpc + + / client_context . h <nl> ppp b / include / grpc + + / client_context . h <nl> <nl> # include < memory > <nl> # include < string > <nl> <nl> - # include < grpc + + / impl / sync . h > <nl> - # include < grpc + + / security / auth_context . h > <nl> - # include < grpc + + / support / config . h > <nl> - # include < grpc + + / support / status . h > <nl> - # include < grpc + + / support / string_ref . h > <nl> - # include < grpc + + / support / time . h > <nl> - # include < grpc / compression . h > <nl> - # include < grpc / grpc . h > <nl> - # include < grpc / support / log . h > <nl> - # include < grpc / support / time . h > <nl> + # include < grpc + + / impl / codegen / sync . h > <nl> + # include < grpc + + / impl / codegen / security / auth_context . h > <nl> + # include < grpc + + / impl / codegen / config . h > <nl> + # include < grpc + + / impl / codegen / status . h > <nl> + # include < grpc + + / impl / codegen / string_ref . h > <nl> + # include < grpc + + / impl / codegen / time . h > <nl> + # include < grpc / impl / codegen / compression_types . h > <nl> + # include < grpc / impl / codegen / propagation_bits . h > <nl> + # include < grpc / impl / codegen / log . h > <nl> + # include < grpc / impl / codegen / time . h > <nl> <nl> struct census_context ; <nl> + struct grpc_call ; <nl> <nl> namespace grpc { <nl> <nl> mmm a / include / grpc + + / impl / call . h <nl> ppp b / include / grpc + + / impl / call . h <nl> <nl> # include < cstring > <nl> <nl> # include < grpc / support / alloc . h > <nl> + # include < grpc / impl / codegen / grpc_types . h > <nl> # include < grpc + + / client_context . h > <nl> - # include < grpc + + / completion_queue . h > <nl> # include < grpc + + / impl / codegen / call_hook . h > <nl> # include < grpc + + / impl / codegen / completion_queue_tag . h > <nl> # include < grpc + + / impl / serialization_traits . h > <nl> - # include < grpc + + / support / config . h > <nl> - # include < grpc + + / support / status . h > <nl> + # include < grpc + + / impl / codegen / config . h > <nl> + # include < grpc + + / impl / codegen / status . h > <nl> <nl> - struct grpc_call ; <nl> - struct grpc_op ; <nl> + struct grpc_byte_buffer ; <nl> <nl> namespace grpc { <nl> <nl> class ByteBuffer ; <nl> class Call ; <nl> class CallHook ; <nl> + class CompletionQueue ; <nl> <nl> void FillMetadataMap ( <nl> grpc_metadata_array * arr , <nl> new file mode 100644 <nl> index 00000000000 . . 75f24823467 <nl> mmm / dev / null <nl> ppp b / include / grpc + + / impl / codegen / security / auth_context . h <nl> <nl> + / * <nl> + * <nl> + * Copyright 2015 , Google Inc . <nl> + * All rights reserved . <nl> + * <nl> + * Redistribution and use in source and binary forms , with or without <nl> + * modification , are permitted provided that the following conditions are <nl> + * met : <nl> + * <nl> + * * Redistributions of source code must retain the above copyright <nl> + * notice , this list of conditions and the following disclaimer . <nl> + * * Redistributions in binary form must reproduce the above <nl> + * copyright notice , this list of conditions and the following disclaimer <nl> + * in the documentation and / or other materials provided with the <nl> + * distribution . <nl> + * * Neither the name of Google Inc . nor the names of its <nl> + * contributors may be used to endorse or promote products derived from <nl> + * this software without specific prior written permission . <nl> + * <nl> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> + * " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> + * LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> + * A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> + * SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> + * LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> + * DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> + * THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> + * ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> + * OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> + * <nl> + * / <nl> + <nl> + # ifndef GRPCXX_IMPL_CODEGEN_SECURITY_AUTH_CONTEXT_H <nl> + # define GRPCXX_IMPL_CODEGEN_SECURITY_AUTH_CONTEXT_H <nl> + <nl> + # include < iterator > <nl> + # include < vector > <nl> + <nl> + # include < grpc + + / impl / codegen / config . h > <nl> + # include < grpc + + / impl / codegen / string_ref . h > <nl> + <nl> + struct grpc_auth_context ; <nl> + struct grpc_auth_property ; <nl> + struct grpc_auth_property_iterator ; <nl> + <nl> + namespace grpc { <nl> + class SecureAuthContext ; <nl> + <nl> + typedef std : : pair < grpc : : string_ref , grpc : : string_ref > AuthProperty ; <nl> + <nl> + class AuthPropertyIterator <nl> + : public std : : iterator < std : : input_iterator_tag , const AuthProperty > { <nl> + public : <nl> + ~ AuthPropertyIterator ( ) ; <nl> + AuthPropertyIterator & operator + + ( ) ; <nl> + AuthPropertyIterator operator + + ( int ) ; <nl> + bool operator = = ( const AuthPropertyIterator & rhs ) const ; <nl> + bool operator ! = ( const AuthPropertyIterator & rhs ) const ; <nl> + const AuthProperty operator * ( ) ; <nl> + <nl> + protected : <nl> + AuthPropertyIterator ( ) ; <nl> + AuthPropertyIterator ( const grpc_auth_property * property , <nl> + const grpc_auth_property_iterator * iter ) ; <nl> + <nl> + private : <nl> + friend class SecureAuthContext ; <nl> + const grpc_auth_property * property_ ; <nl> + / / The following items form a grpc_auth_property_iterator . <nl> + const grpc_auth_context * ctx_ ; <nl> + size_t index_ ; <nl> + const char * name_ ; <nl> + } ; <nl> + <nl> + / / / Class encapsulating the Authentication Information . <nl> + / / / <nl> + / / / It includes the secure identity of the peer , the type of secure transport <nl> + / / / used as well as any other properties required by the authorization layer . <nl> + class AuthContext { <nl> + public : <nl> + virtual ~ AuthContext ( ) { } <nl> + <nl> + / / / Returns true if the peer is authenticated . <nl> + virtual bool IsPeerAuthenticated ( ) const = 0 ; <nl> + <nl> + / / / A peer identity . <nl> + / / / <nl> + / / / It is , in general , comprised of one or more properties ( in which case they <nl> + / / / have the same name ) . <nl> + virtual std : : vector < grpc : : string_ref > GetPeerIdentity ( ) const = 0 ; <nl> + virtual grpc : : string GetPeerIdentityPropertyName ( ) const = 0 ; <nl> + <nl> + / / / Returns all the property values with the given name . <nl> + virtual std : : vector < grpc : : string_ref > FindPropertyValues ( <nl> + const grpc : : string & name ) const = 0 ; <nl> + <nl> + / / / Iteration over all the properties . <nl> + virtual AuthPropertyIterator begin ( ) const = 0 ; <nl> + virtual AuthPropertyIterator end ( ) const = 0 ; <nl> + <nl> + / / Mutation functions : should only be used by an AuthMetadataProcessor . <nl> + virtual void AddProperty ( const grpc : : string & key , <nl> + const grpc : : string_ref & value ) = 0 ; <nl> + virtual bool SetPeerIdentityPropertyName ( const grpc : : string & name ) = 0 ; <nl> + } ; <nl> + <nl> + } / / namespace grpc <nl> + <nl> + # endif / / GRPCXX_IMPL_CODEGEN_SECURITY_AUTH_CONTEXT_H <nl> mmm a / include / grpc + + / impl / codegen / server_interface . h <nl> ppp b / include / grpc + + / impl / codegen / server_interface . h <nl> class GenericServerContext ; <nl> class RpcService ; <nl> class RpcServiceMethod ; <nl> class ServerAsyncStreamingInterface ; <nl> + class ServerCompletionQueue ; <nl> class ServerContext ; <nl> class ServerCredentials ; <nl> class Service ; <nl> new file mode 100644 <nl> index 00000000000 . . bb5363fa3e6 <nl> mmm / dev / null <nl> ppp b / include / grpc + + / impl / codegen / string_ref . h <nl> <nl> + / * <nl> + * <nl> + * Copyright 2015 , Google Inc . <nl> + * All rights reserved . <nl> + * <nl> + * Redistribution and use in source and binary forms , with or without <nl> + * modification , are permitted provided that the following conditions are <nl> + * met : <nl> + * <nl> + * * Redistributions of source code must retain the above copyright <nl> + * notice , this list of conditions and the following disclaimer . <nl> + * * Redistributions in binary form must reproduce the above <nl> + * copyright notice , this list of conditions and the following disclaimer <nl> + * in the documentation and / or other materials provided with the <nl> + * distribution . <nl> + * * Neither the name of Google Inc . nor the names of its <nl> + * contributors may be used to endorse or promote products derived from <nl> + * this software without specific prior written permission . <nl> + * <nl> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> + * " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> + * LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> + * A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> + * SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> + * LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> + * DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> + * THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> + * ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> + * OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> + * <nl> + * / <nl> + <nl> + # ifndef GRPCXX_IMPL_CODEGEN_STRING_REF_H <nl> + # define GRPCXX_IMPL_CODEGEN_STRING_REF_H <nl> + <nl> + # include < iterator > <nl> + # include < iosfwd > <nl> + <nl> + # include < grpc + + / impl / codegen / config . h > <nl> + <nl> + namespace grpc { <nl> + <nl> + / / / This class is a non owning reference to a string . <nl> + / / / <nl> + / / / It should be a strict subset of the upcoming std : : string_ref . <nl> + / / / <nl> + / / / \ see http : / / www . open - std . org / jtc1 / sc22 / wg21 / docs / papers / 2012 / n3442 . html <nl> + / / / <nl> + / / / The constexpr is dropped or replaced with const for legacy compiler <nl> + / / / compatibility . <nl> + class string_ref { <nl> + public : <nl> + / / types <nl> + typedef const char * const_iterator ; <nl> + typedef std : : reverse_iterator < const_iterator > const_reverse_iterator ; <nl> + <nl> + / / constants <nl> + const static size_t npos ; <nl> + <nl> + / / construct / copy . <nl> + string_ref ( ) : data_ ( nullptr ) , length_ ( 0 ) { } <nl> + string_ref ( const string_ref & other ) <nl> + : data_ ( other . data_ ) , length_ ( other . length_ ) { } <nl> + string_ref & operator = ( const string_ref & rhs ) ; <nl> + string_ref ( const char * s ) ; <nl> + string_ref ( const char * s , size_t l ) : data_ ( s ) , length_ ( l ) { } <nl> + string_ref ( const grpc : : string & s ) : data_ ( s . data ( ) ) , length_ ( s . length ( ) ) { } <nl> + <nl> + / / iterators <nl> + const_iterator begin ( ) const { return data_ ; } <nl> + const_iterator end ( ) const { return data_ + length_ ; } <nl> + const_iterator cbegin ( ) const { return data_ ; } <nl> + const_iterator cend ( ) const { return data_ + length_ ; } <nl> + const_reverse_iterator rbegin ( ) const { <nl> + return const_reverse_iterator ( end ( ) ) ; <nl> + } <nl> + const_reverse_iterator rend ( ) const { <nl> + return const_reverse_iterator ( begin ( ) ) ; <nl> + } <nl> + const_reverse_iterator crbegin ( ) const { <nl> + return const_reverse_iterator ( end ( ) ) ; <nl> + } <nl> + const_reverse_iterator crend ( ) const { <nl> + return const_reverse_iterator ( begin ( ) ) ; <nl> + } <nl> + <nl> + / / capacity <nl> + size_t size ( ) const { return length_ ; } <nl> + size_t length ( ) const { return length_ ; } <nl> + size_t max_size ( ) const { return length_ ; } <nl> + bool empty ( ) const { return length_ = = 0 ; } <nl> + <nl> + / / element access <nl> + const char * data ( ) const { return data_ ; } <nl> + <nl> + / / string operations <nl> + int compare ( string_ref x ) const ; <nl> + bool starts_with ( string_ref x ) const ; <nl> + bool ends_with ( string_ref x ) const ; <nl> + size_t find ( string_ref s ) const ; <nl> + size_t find ( char c ) const ; <nl> + <nl> + string_ref substr ( size_t pos , size_t n = npos ) const ; <nl> + <nl> + private : <nl> + const char * data_ ; <nl> + size_t length_ ; <nl> + } ; <nl> + <nl> + / / Comparison operators <nl> + bool operator = = ( string_ref x , string_ref y ) ; <nl> + bool operator ! = ( string_ref x , string_ref y ) ; <nl> + bool operator < ( string_ref x , string_ref y ) ; <nl> + bool operator > ( string_ref x , string_ref y ) ; <nl> + bool operator < = ( string_ref x , string_ref y ) ; <nl> + bool operator > = ( string_ref x , string_ref y ) ; <nl> + <nl> + std : : ostream & operator < < ( std : : ostream & stream , const string_ref & string ) ; <nl> + <nl> + } / / namespace grpc <nl> + <nl> + # endif / / GRPCXX_IMPL_CODEGEN_STRING_REF_H <nl> new file mode 100644 <nl> index 00000000000 . . 62194c77081 <nl> mmm / dev / null <nl> ppp b / include / grpc + + / impl / codegen / sync . h <nl> <nl> + / * <nl> + * <nl> + * Copyright 2015 , Google Inc . <nl> + * All rights reserved . <nl> + * <nl> + * Redistribution and use in source and binary forms , with or without <nl> + * modification , are permitted provided that the following conditions are <nl> + * met : <nl> + * <nl> + * * Redistributions of source code must retain the above copyright <nl> + * notice , this list of conditions and the following disclaimer . <nl> + * * Redistributions in binary form must reproduce the above <nl> + * copyright notice , this list of conditions and the following disclaimer <nl> + * in the documentation and / or other materials provided with the <nl> + * distribution . <nl> + * * Neither the name of Google Inc . nor the names of its <nl> + * contributors may be used to endorse or promote products derived from <nl> + * this software without specific prior written permission . <nl> + * <nl> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> + * " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> + * LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> + * A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> + * SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> + * LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> + * DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> + * THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> + * ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> + * OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> + * <nl> + * / <nl> + <nl> + # ifndef GRPCXX_IMPL_CODEGEN_SYNC_H <nl> + # define GRPCXX_IMPL_CODEGEN_SYNC_H <nl> + <nl> + # include < grpc + + / impl / codegen / config . h > <nl> + <nl> + # ifdef GRPC_CXX0X_NO_THREAD <nl> + # include < grpc + + / impl / codegen / sync_no_cxx11 . h > <nl> + # else <nl> + # include < grpc + + / impl / codegen / sync_cxx11 . h > <nl> + # endif <nl> + <nl> + # endif / / GRPCXX_IMPL_CODEGEN_SYNC_H <nl> new file mode 100644 <nl> index 00000000000 . . 6626ca1f94c <nl> mmm / dev / null <nl> ppp b / include / grpc + + / impl / codegen / sync_cxx11 . h <nl> <nl> + / * <nl> + * <nl> + * Copyright 2015 , Google Inc . <nl> + * All rights reserved . <nl> + * <nl> + * Redistribution and use in source and binary forms , with or without <nl> + * modification , are permitted provided that the following conditions are <nl> + * met : <nl> + * <nl> + * * Redistributions of source code must retain the above copyright <nl> + * notice , this list of conditions and the following disclaimer . <nl> + * * Redistributions in binary form must reproduce the above <nl> + * copyright notice , this list of conditions and the following disclaimer <nl> + * in the documentation and / or other materials provided with the <nl> + * distribution . <nl> + * * Neither the name of Google Inc . nor the names of its <nl> + * contributors may be used to endorse or promote products derived from <nl> + * this software without specific prior written permission . <nl> + * <nl> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> + * " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> + * LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> + * A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> + * SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> + * LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> + * DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> + * THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> + * ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> + * OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> + * <nl> + * / <nl> + <nl> + # ifndef GRPCXX_IMPL_CODEGEN_SYNC_CXX11_H <nl> + # define GRPCXX_IMPL_CODEGEN_SYNC_CXX11_H <nl> + <nl> + # include < condition_variable > <nl> + # include < mutex > <nl> + <nl> + namespace grpc { <nl> + <nl> + using std : : condition_variable ; <nl> + using std : : mutex ; <nl> + using std : : lock_guard ; <nl> + using std : : unique_lock ; <nl> + <nl> + } / / namespace grpc <nl> + <nl> + # endif / / GRPCXX_IMPL_CODEGEN_SYNC_CXX11_H <nl> new file mode 100644 <nl> index 00000000000 . . 55c059ede77 <nl> mmm / dev / null <nl> ppp b / include / grpc + + / impl / codegen / sync_no_cxx11 . h <nl> <nl> + / * <nl> + * <nl> + * Copyright 2015 , Google Inc . <nl> + * All rights reserved . <nl> + * <nl> + * Redistribution and use in source and binary forms , with or without <nl> + * modification , are permitted provided that the following conditions are <nl> + * met : <nl> + * <nl> + * * Redistributions of source code must retain the above copyright <nl> + * notice , this list of conditions and the following disclaimer . <nl> + * * Redistributions in binary form must reproduce the above <nl> + * copyright notice , this list of conditions and the following disclaimer <nl> + * in the documentation and / or other materials provided with the <nl> + * distribution . <nl> + * * Neither the name of Google Inc . nor the names of its <nl> + * contributors may be used to endorse or promote products derived from <nl> + * this software without specific prior written permission . <nl> + * <nl> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> + * " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> + * LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> + * A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> + * SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> + * LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> + * DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> + * THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> + * ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> + * OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> + * <nl> + * / <nl> + <nl> + # ifndef GRPCXX_IMPL_CODEGEN_SYNC_NO_CXX11_H <nl> + # define GRPCXX_IMPL_CODEGEN_SYNC_NO_CXX11_H <nl> + <nl> + # include < grpc / impl / codegen / sync . h > <nl> + <nl> + namespace grpc { <nl> + <nl> + template < class mutex > <nl> + class lock_guard ; <nl> + class condition_variable ; <nl> + <nl> + class mutex { <nl> + public : <nl> + mutex ( ) { gpr_mu_init ( & mu_ ) ; } <nl> + ~ mutex ( ) { gpr_mu_destroy ( & mu_ ) ; } <nl> + <nl> + private : <nl> + : : gpr_mu mu_ ; <nl> + template < class mutex > <nl> + friend class lock_guard ; <nl> + friend class condition_variable ; <nl> + } ; <nl> + <nl> + template < class mutex > <nl> + class lock_guard { <nl> + public : <nl> + lock_guard ( mutex & mu ) : mu_ ( mu ) , locked ( true ) { gpr_mu_lock ( & mu . mu_ ) ; } <nl> + ~ lock_guard ( ) { unlock_internal ( ) ; } <nl> + <nl> + protected : <nl> + void lock_internal ( ) { <nl> + if ( ! locked ) gpr_mu_lock ( & mu_ . mu_ ) ; <nl> + locked = true ; <nl> + } <nl> + void unlock_internal ( ) { <nl> + if ( locked ) gpr_mu_unlock ( & mu_ . mu_ ) ; <nl> + locked = false ; <nl> + } <nl> + <nl> + private : <nl> + mutex & mu_ ; <nl> + bool locked ; <nl> + friend class condition_variable ; <nl> + } ; <nl> + <nl> + template < class mutex > <nl> + class unique_lock : public lock_guard < mutex > { <nl> + public : <nl> + unique_lock ( mutex & mu ) : lock_guard < mutex > ( mu ) { } <nl> + void lock ( ) { this - > lock_internal ( ) ; } <nl> + void unlock ( ) { this - > unlock_internal ( ) ; } <nl> + } ; <nl> + <nl> + class condition_variable { <nl> + public : <nl> + condition_variable ( ) { gpr_cv_init ( & cv_ ) ; } <nl> + ~ condition_variable ( ) { gpr_cv_destroy ( & cv_ ) ; } <nl> + void wait ( lock_guard < mutex > & mu ) { <nl> + mu . locked = false ; <nl> + gpr_cv_wait ( & cv_ , & mu . mu_ . mu_ , gpr_inf_future ( GPR_CLOCK_REALTIME ) ) ; <nl> + mu . locked = true ; <nl> + } <nl> + void notify_one ( ) { gpr_cv_signal ( & cv_ ) ; } <nl> + void notify_all ( ) { gpr_cv_broadcast ( & cv_ ) ; } <nl> + <nl> + private : <nl> + gpr_cv cv_ ; <nl> + } ; <nl> + <nl> + } / / namespace grpc <nl> + <nl> + # endif / / GRPCXX_IMPL_CODEGEN_SYNC_NO_CXX11_H <nl> mmm a / include / grpc + + / impl / sync . h <nl> ppp b / include / grpc + + / impl / sync . h <nl> <nl> # ifndef GRPCXX_IMPL_SYNC_H <nl> # define GRPCXX_IMPL_SYNC_H <nl> <nl> - # include < grpc + + / support / config . h > <nl> - <nl> - # ifdef GRPC_CXX0X_NO_THREAD <nl> - # include < grpc + + / impl / sync_no_cxx11 . h > <nl> - # else <nl> - # include < grpc + + / impl / sync_cxx11 . h > <nl> - # endif <nl> + # include < grpc + + / impl / codegen / sync . h > <nl> <nl> # endif / / GRPCXX_IMPL_SYNC_H <nl> mmm a / include / grpc + + / impl / sync_cxx11 . h <nl> ppp b / include / grpc + + / impl / sync_cxx11 . h <nl> <nl> # ifndef GRPCXX_IMPL_SYNC_CXX11_H <nl> # define GRPCXX_IMPL_SYNC_CXX11_H <nl> <nl> - # include < condition_variable > <nl> - # include < mutex > <nl> - <nl> - namespace grpc { <nl> - <nl> - using std : : condition_variable ; <nl> - using std : : mutex ; <nl> - using std : : lock_guard ; <nl> - using std : : unique_lock ; <nl> - <nl> - } / / namespace grpc <nl> + # include < grpc + + / impl / codegen / sync_cxx11 . h > <nl> <nl> # endif / / GRPCXX_IMPL_SYNC_CXX11_H <nl> mmm a / include / grpc + + / impl / sync_no_cxx11 . h <nl> ppp b / include / grpc + + / impl / sync_no_cxx11 . h <nl> <nl> # ifndef GRPCXX_IMPL_SYNC_NO_CXX11_H <nl> # define GRPCXX_IMPL_SYNC_NO_CXX11_H <nl> <nl> - # include < grpc / support / sync . h > <nl> - <nl> - namespace grpc { <nl> - <nl> - template < class mutex > <nl> - class lock_guard ; <nl> - class condition_variable ; <nl> - <nl> - class mutex { <nl> - public : <nl> - mutex ( ) { gpr_mu_init ( & mu_ ) ; } <nl> - ~ mutex ( ) { gpr_mu_destroy ( & mu_ ) ; } <nl> - <nl> - private : <nl> - : : gpr_mu mu_ ; <nl> - template < class mutex > <nl> - friend class lock_guard ; <nl> - friend class condition_variable ; <nl> - } ; <nl> - <nl> - template < class mutex > <nl> - class lock_guard { <nl> - public : <nl> - lock_guard ( mutex & mu ) : mu_ ( mu ) , locked ( true ) { gpr_mu_lock ( & mu . mu_ ) ; } <nl> - ~ lock_guard ( ) { unlock_internal ( ) ; } <nl> - <nl> - protected : <nl> - void lock_internal ( ) { <nl> - if ( ! locked ) gpr_mu_lock ( & mu_ . mu_ ) ; <nl> - locked = true ; <nl> - } <nl> - void unlock_internal ( ) { <nl> - if ( locked ) gpr_mu_unlock ( & mu_ . mu_ ) ; <nl> - locked = false ; <nl> - } <nl> - <nl> - private : <nl> - mutex & mu_ ; <nl> - bool locked ; <nl> - friend class condition_variable ; <nl> - } ; <nl> - <nl> - template < class mutex > <nl> - class unique_lock : public lock_guard < mutex > { <nl> - public : <nl> - unique_lock ( mutex & mu ) : lock_guard < mutex > ( mu ) { } <nl> - void lock ( ) { this - > lock_internal ( ) ; } <nl> - void unlock ( ) { this - > unlock_internal ( ) ; } <nl> - } ; <nl> - <nl> - class condition_variable { <nl> - public : <nl> - condition_variable ( ) { gpr_cv_init ( & cv_ ) ; } <nl> - ~ condition_variable ( ) { gpr_cv_destroy ( & cv_ ) ; } <nl> - void wait ( lock_guard < mutex > & mu ) { <nl> - mu . locked = false ; <nl> - gpr_cv_wait ( & cv_ , & mu . mu_ . mu_ , gpr_inf_future ( GPR_CLOCK_REALTIME ) ) ; <nl> - mu . locked = true ; <nl> - } <nl> - void notify_one ( ) { gpr_cv_signal ( & cv_ ) ; } <nl> - void notify_all ( ) { gpr_cv_broadcast ( & cv_ ) ; } <nl> - <nl> - private : <nl> - gpr_cv cv_ ; <nl> - } ; <nl> - <nl> - } / / namespace grpc <nl> + # include < grpc + + / impl / codegen / sync_no_cxx11 . h > <nl> <nl> # endif / / GRPCXX_IMPL_SYNC_NO_CXX11_H <nl> mmm a / include / grpc + + / security / auth_context . h <nl> ppp b / include / grpc + + / security / auth_context . h <nl> <nl> # ifndef GRPCXX_SUPPORT_AUTH_CONTEXT_H <nl> # define GRPCXX_SUPPORT_AUTH_CONTEXT_H <nl> <nl> - # include < iterator > <nl> - # include < vector > <nl> - <nl> - # include < grpc + + / support / config . h > <nl> - # include < grpc + + / support / string_ref . h > <nl> - <nl> - struct grpc_auth_context ; <nl> - struct grpc_auth_property ; <nl> - struct grpc_auth_property_iterator ; <nl> - <nl> - namespace grpc { <nl> - class SecureAuthContext ; <nl> - <nl> - typedef std : : pair < grpc : : string_ref , grpc : : string_ref > AuthProperty ; <nl> - <nl> - class AuthPropertyIterator <nl> - : public std : : iterator < std : : input_iterator_tag , const AuthProperty > { <nl> - public : <nl> - ~ AuthPropertyIterator ( ) ; <nl> - AuthPropertyIterator & operator + + ( ) ; <nl> - AuthPropertyIterator operator + + ( int ) ; <nl> - bool operator = = ( const AuthPropertyIterator & rhs ) const ; <nl> - bool operator ! = ( const AuthPropertyIterator & rhs ) const ; <nl> - const AuthProperty operator * ( ) ; <nl> - <nl> - protected : <nl> - AuthPropertyIterator ( ) ; <nl> - AuthPropertyIterator ( const grpc_auth_property * property , <nl> - const grpc_auth_property_iterator * iter ) ; <nl> - <nl> - private : <nl> - friend class SecureAuthContext ; <nl> - const grpc_auth_property * property_ ; <nl> - / / The following items form a grpc_auth_property_iterator . <nl> - const grpc_auth_context * ctx_ ; <nl> - size_t index_ ; <nl> - const char * name_ ; <nl> - } ; <nl> - <nl> - / / / Class encapsulating the Authentication Information . <nl> - / / / <nl> - / / / It includes the secure identity of the peer , the type of secure transport <nl> - / / / used as well as any other properties required by the authorization layer . <nl> - class AuthContext { <nl> - public : <nl> - virtual ~ AuthContext ( ) { } <nl> - <nl> - / / / Returns true if the peer is authenticated . <nl> - virtual bool IsPeerAuthenticated ( ) const = 0 ; <nl> - <nl> - / / / A peer identity . <nl> - / / / <nl> - / / / It is , in general , comprised of one or more properties ( in which case they <nl> - / / / have the same name ) . <nl> - virtual std : : vector < grpc : : string_ref > GetPeerIdentity ( ) const = 0 ; <nl> - virtual grpc : : string GetPeerIdentityPropertyName ( ) const = 0 ; <nl> - <nl> - / / / Returns all the property values with the given name . <nl> - virtual std : : vector < grpc : : string_ref > FindPropertyValues ( <nl> - const grpc : : string & name ) const = 0 ; <nl> - <nl> - / / / Iteration over all the properties . <nl> - virtual AuthPropertyIterator begin ( ) const = 0 ; <nl> - virtual AuthPropertyIterator end ( ) const = 0 ; <nl> - <nl> - / / Mutation functions : should only be used by an AuthMetadataProcessor . <nl> - virtual void AddProperty ( const grpc : : string & key , <nl> - const grpc : : string_ref & value ) = 0 ; <nl> - virtual bool SetPeerIdentityPropertyName ( const grpc : : string & name ) = 0 ; <nl> - } ; <nl> - <nl> - } / / namespace grpc <nl> + # include < grpc + + / impl / codegen / security / auth_context . h > <nl> <nl> # endif / / GRPCXX_SUPPORT_AUTH_CONTEXT_H <nl> mmm a / include / grpc + + / support / async_stream . h <nl> ppp b / include / grpc + + / support / async_stream . h <nl> <nl> # ifndef GRPCXX_SUPPORT_ASYNC_STREAM_H <nl> # define GRPCXX_SUPPORT_ASYNC_STREAM_H <nl> <nl> - # include < grpc / support / log . h > <nl> # include < grpc + + / impl / codegen / channel_interface . h > <nl> - # include < grpc + + / client_context . h > <nl> - # include < grpc + + / completion_queue . h > <nl> # include < grpc + + / impl / call . h > <nl> # include < grpc + + / impl / service_type . h > <nl> # include < grpc + + / server_context . h > <nl> - # include < grpc + + / support / status . h > <nl> + # include < grpc + + / impl / codegen / status . h > <nl> <nl> namespace grpc { <nl> <nl> + class CompletionQueue ; <nl> + <nl> / / / Common interface for all client side asynchronous streaming . <nl> class ClientAsyncStreamingInterface { <nl> public : <nl> mmm a / include / grpc + + / support / string_ref . h <nl> ppp b / include / grpc + + / support / string_ref . h <nl> <nl> # ifndef GRPCXX_SUPPORT_STRING_REF_H <nl> # define GRPCXX_SUPPORT_STRING_REF_H <nl> <nl> - # include < iterator > <nl> - # include < iosfwd > <nl> - <nl> - # include < grpc + + / support / config . h > <nl> - <nl> - namespace grpc { <nl> - <nl> - / / / This class is a non owning reference to a string . <nl> - / / / <nl> - / / / It should be a strict subset of the upcoming std : : string_ref . <nl> - / / / <nl> - / / / \ see http : / / www . open - std . org / jtc1 / sc22 / wg21 / docs / papers / 2012 / n3442 . html <nl> - / / / <nl> - / / / The constexpr is dropped or replaced with const for legacy compiler <nl> - / / / compatibility . <nl> - class string_ref { <nl> - public : <nl> - / / types <nl> - typedef const char * const_iterator ; <nl> - typedef std : : reverse_iterator < const_iterator > const_reverse_iterator ; <nl> - <nl> - / / constants <nl> - const static size_t npos ; <nl> - <nl> - / / construct / copy . <nl> - string_ref ( ) : data_ ( nullptr ) , length_ ( 0 ) { } <nl> - string_ref ( const string_ref & other ) <nl> - : data_ ( other . data_ ) , length_ ( other . length_ ) { } <nl> - string_ref & operator = ( const string_ref & rhs ) ; <nl> - string_ref ( const char * s ) ; <nl> - string_ref ( const char * s , size_t l ) : data_ ( s ) , length_ ( l ) { } <nl> - string_ref ( const grpc : : string & s ) : data_ ( s . data ( ) ) , length_ ( s . length ( ) ) { } <nl> - <nl> - / / iterators <nl> - const_iterator begin ( ) const { return data_ ; } <nl> - const_iterator end ( ) const { return data_ + length_ ; } <nl> - const_iterator cbegin ( ) const { return data_ ; } <nl> - const_iterator cend ( ) const { return data_ + length_ ; } <nl> - const_reverse_iterator rbegin ( ) const { <nl> - return const_reverse_iterator ( end ( ) ) ; <nl> - } <nl> - const_reverse_iterator rend ( ) const { <nl> - return const_reverse_iterator ( begin ( ) ) ; <nl> - } <nl> - const_reverse_iterator crbegin ( ) const { <nl> - return const_reverse_iterator ( end ( ) ) ; <nl> - } <nl> - const_reverse_iterator crend ( ) const { <nl> - return const_reverse_iterator ( begin ( ) ) ; <nl> - } <nl> - <nl> - / / capacity <nl> - size_t size ( ) const { return length_ ; } <nl> - size_t length ( ) const { return length_ ; } <nl> - size_t max_size ( ) const { return length_ ; } <nl> - bool empty ( ) const { return length_ = = 0 ; } <nl> - <nl> - / / element access <nl> - const char * data ( ) const { return data_ ; } <nl> - <nl> - / / string operations <nl> - int compare ( string_ref x ) const ; <nl> - bool starts_with ( string_ref x ) const ; <nl> - bool ends_with ( string_ref x ) const ; <nl> - size_t find ( string_ref s ) const ; <nl> - size_t find ( char c ) const ; <nl> - <nl> - string_ref substr ( size_t pos , size_t n = npos ) const ; <nl> - <nl> - private : <nl> - const char * data_ ; <nl> - size_t length_ ; <nl> - } ; <nl> - <nl> - / / Comparison operators <nl> - bool operator = = ( string_ref x , string_ref y ) ; <nl> - bool operator ! = ( string_ref x , string_ref y ) ; <nl> - bool operator < ( string_ref x , string_ref y ) ; <nl> - bool operator > ( string_ref x , string_ref y ) ; <nl> - bool operator < = ( string_ref x , string_ref y ) ; <nl> - bool operator > = ( string_ref x , string_ref y ) ; <nl> - <nl> - std : : ostream & operator < < ( std : : ostream & stream , const string_ref & string ) ; <nl> - <nl> - } / / namespace grpc <nl> + # include < grpc + + / impl / codegen / string_ref . h > <nl> <nl> # endif / / GRPCXX_SUPPORT_STRING_REF_H <nl> mmm a / include / grpc / byte_buffer . h <nl> ppp b / include / grpc / byte_buffer . h <nl> <nl> # ifndef GRPC_BYTE_BUFFER_H <nl> # define GRPC_BYTE_BUFFER_H <nl> <nl> - # include < grpc / compression . h > <nl> - # include < grpc / support / slice_buffer . h > <nl> - <nl> - # ifdef __cplusplus <nl> - extern " C " { <nl> - # endif <nl> - <nl> - typedef enum { <nl> - GRPC_BB_RAW <nl> - / * Future types may include GRPC_BB_PROTOBUF , etc . * / <nl> - } grpc_byte_buffer_type ; <nl> - <nl> - struct grpc_byte_buffer { <nl> - void * reserved ; <nl> - grpc_byte_buffer_type type ; <nl> - union { <nl> - struct { <nl> - void * reserved [ 8 ] ; <nl> - } reserved ; <nl> - struct { <nl> - grpc_compression_algorithm compression ; <nl> - gpr_slice_buffer slice_buffer ; <nl> - } raw ; <nl> - } data ; <nl> - } ; <nl> - typedef struct grpc_byte_buffer grpc_byte_buffer ; <nl> - <nl> - / * * Returns a RAW byte buffer instance over the given slices ( up to \ a nslices ) . <nl> - * <nl> - * Increases the reference count for all \ a slices processed . The user is <nl> - * responsible for invoking grpc_byte_buffer_destroy on the returned instance . * / <nl> - grpc_byte_buffer * grpc_raw_byte_buffer_create ( gpr_slice * slices , <nl> - size_t nslices ) ; <nl> - <nl> - / * * Returns a * compressed * RAW byte buffer instance over the given slices ( up to <nl> - * \ a nslices ) . The \ a compression argument defines the compression algorithm <nl> - * used to generate the data in \ a slices . <nl> - * <nl> - * Increases the reference count for all \ a slices processed . The user is <nl> - * responsible for invoking grpc_byte_buffer_destroy on the returned instance . * / <nl> - grpc_byte_buffer * grpc_raw_compressed_byte_buffer_create ( <nl> - gpr_slice * slices , size_t nslices , grpc_compression_algorithm compression ) ; <nl> - <nl> - / * * Copies input byte buffer \ a bb . <nl> - * <nl> - * Increases the reference count of all the source slices . The user is <nl> - * responsible for calling grpc_byte_buffer_destroy over the returned copy . * / <nl> - grpc_byte_buffer * grpc_byte_buffer_copy ( grpc_byte_buffer * bb ) ; <nl> - <nl> - / * * Returns the size of the given byte buffer , in bytes . * / <nl> - size_t grpc_byte_buffer_length ( grpc_byte_buffer * bb ) ; <nl> - <nl> - / * * Destroys \ a byte_buffer deallocating all its memory . * / <nl> - void grpc_byte_buffer_destroy ( grpc_byte_buffer * byte_buffer ) ; <nl> - <nl> - / * * Reader for byte buffers . Iterates over slices in the byte buffer * / <nl> - struct grpc_byte_buffer_reader ; <nl> - typedef struct grpc_byte_buffer_reader grpc_byte_buffer_reader ; <nl> - <nl> - / * * Initialize \ a reader to read over \ a buffer * / <nl> - void grpc_byte_buffer_reader_init ( grpc_byte_buffer_reader * reader , <nl> - grpc_byte_buffer * buffer ) ; <nl> - <nl> - / * * Cleanup and destroy \ a reader * / <nl> - void grpc_byte_buffer_reader_destroy ( grpc_byte_buffer_reader * reader ) ; <nl> - <nl> - / * * Updates \ a slice with the next piece of data from from \ a reader and returns <nl> - * 1 . Returns 0 at the end of the stream . Caller is responsible for calling <nl> - * gpr_slice_unref on the result . * / <nl> - int grpc_byte_buffer_reader_next ( grpc_byte_buffer_reader * reader , <nl> - gpr_slice * slice ) ; <nl> - <nl> - / * * Merge all data from \ a reader into single slice * / <nl> - gpr_slice grpc_byte_buffer_reader_readall ( grpc_byte_buffer_reader * reader ) ; <nl> - <nl> - / * * Returns a RAW byte buffer instance from the output of \ a reader . * / <nl> - grpc_byte_buffer * grpc_raw_byte_buffer_from_reader ( <nl> - grpc_byte_buffer_reader * reader ) ; <nl> - <nl> - # ifdef __cplusplus <nl> - } <nl> - # endif <nl> + # include < grpc / impl / codegen / byte_buffer . h > <nl> <nl> # endif / * GRPC_BYTE_BUFFER_H * / <nl> mmm a / include / grpc / compression . h <nl> ppp b / include / grpc / compression . h <nl> <nl> <nl> # include < stdlib . h > <nl> <nl> - # include < grpc / support / port_platform . h > <nl> + # include < grpc / impl / codegen / port_platform . h > <nl> + # include < grpc / impl / codegen / compression_types . h > <nl> <nl> # ifdef __cplusplus <nl> extern " C " { <nl> # endif <nl> <nl> - / * * To be used in channel arguments * / <nl> - # define GRPC_COMPRESSION_ALGORITHM_ARG " grpc . compression_algorithm " <nl> - # define GRPC_COMPRESSION_ALGORITHM_STATE_ARG " grpc . compression_algorithm_state " <nl> - <nl> - / * The various compression algorithms supported by GRPC * / <nl> - typedef enum { <nl> - GRPC_COMPRESS_NONE = 0 , <nl> - GRPC_COMPRESS_DEFLATE , <nl> - GRPC_COMPRESS_GZIP , <nl> - / * TODO ( ctiller ) : snappy * / <nl> - GRPC_COMPRESS_ALGORITHMS_COUNT <nl> - } grpc_compression_algorithm ; <nl> - <nl> - typedef enum { <nl> - GRPC_COMPRESS_LEVEL_NONE = 0 , <nl> - GRPC_COMPRESS_LEVEL_LOW , <nl> - GRPC_COMPRESS_LEVEL_MED , <nl> - GRPC_COMPRESS_LEVEL_HIGH , <nl> - GRPC_COMPRESS_LEVEL_COUNT <nl> - } grpc_compression_level ; <nl> - <nl> - typedef struct grpc_compression_options { <nl> - uint32_t enabled_algorithms_bitset ; / * * < All algs are enabled by default * / <nl> - grpc_compression_algorithm default_compression_algorithm ; / * * < for channel * / <nl> - } grpc_compression_options ; <nl> - <nl> / * * Parses the first \ a name_length bytes of \ a name as a <nl> * grpc_compression_algorithm instance , updating \ a algorithm . Returns 1 upon <nl> * success , 0 otherwise . * / <nl> mmm a / include / grpc / grpc . h <nl> ppp b / include / grpc / grpc . h <nl> <nl> # include < grpc / support / slice . h > <nl> # include < grpc / support / time . h > <nl> # include < grpc / impl / codegen / connectivity_state . h > <nl> + # include < grpc / impl / codegen / propagation_bits . h > <nl> + # include < grpc / impl / codegen / grpc_types . h > <nl> <nl> # ifdef __cplusplus <nl> extern " C " { <nl> extern " C " { <nl> * functionality lives in grpc_security . h . <nl> * / <nl> <nl> - / * * Completion Queues enable notification of the completion of asynchronous <nl> - actions . * / <nl> - typedef struct grpc_completion_queue grpc_completion_queue ; <nl> - <nl> - / * * An alarm associated with a completion queue . * / <nl> - typedef struct grpc_alarm grpc_alarm ; <nl> - <nl> - / * * The Channel interface allows creation of Call objects . * / <nl> - typedef struct grpc_channel grpc_channel ; <nl> - <nl> - / * * A server listens to some port and responds to request calls * / <nl> - typedef struct grpc_server grpc_server ; <nl> - <nl> - / * * A Call represents an RPC . When created , it is in a configuration state <nl> - allowing properties to be set until it is invoked . After invoke , the Call <nl> - can have messages written to it and read from it . * / <nl> - typedef struct grpc_call grpc_call ; <nl> - <nl> - / * * Type specifier for grpc_arg * / <nl> - typedef enum { <nl> - GRPC_ARG_STRING , <nl> - GRPC_ARG_INTEGER , <nl> - GRPC_ARG_POINTER <nl> - } grpc_arg_type ; <nl> - <nl> - / * * A single argument . . . each argument has a key and a value <nl> - <nl> - A note on naming keys : <nl> - Keys are namespaced into groups , usually grouped by library , and are <nl> - keys for module XYZ are named XYZ . key1 , XYZ . key2 , etc . Module names must <nl> - be restricted to the regex [ A - Za - z ] [ _A - Za - z0 - 9 ] { , 15 } . <nl> - Key names must be restricted to the regex [ A - Za - z ] [ _A - Za - z0 - 9 ] { , 47 } . <nl> - <nl> - GRPC core library keys are prefixed by grpc . <nl> - <nl> - Library authors are strongly encouraged to \ # define symbolic constants for <nl> - their keys so that it ' s possible to change them in the future . * / <nl> - typedef struct { <nl> - grpc_arg_type type ; <nl> - char * key ; <nl> - union { <nl> - char * string ; <nl> - int integer ; <nl> - struct { <nl> - void * p ; <nl> - void * ( * copy ) ( void * p ) ; <nl> - void ( * destroy ) ( void * p ) ; <nl> - } pointer ; <nl> - } value ; <nl> - } grpc_arg ; <nl> - <nl> - / * * An array of arguments that can be passed around . <nl> - <nl> - Used to set optional channel - level configuration . <nl> - These configuration options are modelled as key - value pairs as defined <nl> - by grpc_arg ; keys are strings to allow easy backwards - compatible extension <nl> - by arbitrary parties . <nl> - All evaluation is performed at channel creation time ( i . e . the values in <nl> - this structure need only live through the creation invocation ) . * / <nl> - typedef struct { <nl> - size_t num_args ; <nl> - grpc_arg * args ; <nl> - } grpc_channel_args ; <nl> - <nl> - / * Channel argument keys : * / <nl> - / * * Enable census for tracing and stats collection * / <nl> - # define GRPC_ARG_ENABLE_CENSUS " grpc . census " <nl> - / * * Maximum number of concurrent incoming streams to allow on a http2 <nl> - connection * / <nl> - # define GRPC_ARG_MAX_CONCURRENT_STREAMS " grpc . max_concurrent_streams " <nl> - / * * Maximum message length that the channel can receive * / <nl> - # define GRPC_ARG_MAX_MESSAGE_LENGTH " grpc . max_message_length " <nl> - / * * Initial sequence number for http2 transports * / <nl> - # define GRPC_ARG_HTTP2_INITIAL_SEQUENCE_NUMBER \ <nl> - " grpc . http2 . initial_sequence_number " <nl> - / * * Amount to read ahead on individual streams . Defaults to 64kb , larger <nl> - values can help throughput on high - latency connections . <nl> - NOTE : at some point we ' d like to auto - tune this , and this parameter <nl> - will become a no - op . * / <nl> - # define GRPC_ARG_HTTP2_STREAM_LOOKAHEAD_BYTES " grpc . http2 . lookahead_bytes " <nl> - / * * How much memory to use for hpack decoding * / <nl> - # define GRPC_ARG_HTTP2_HPACK_TABLE_SIZE_DECODER \ <nl> - " grpc . http2 . hpack_table_size . decoder " <nl> - / * * How much memory to use for hpack encoding * / <nl> - # define GRPC_ARG_HTTP2_HPACK_TABLE_SIZE_ENCODER \ <nl> - " grpc . http2 . hpack_table_size . encoder " <nl> - / * * Default authority to pass if none specified on call construction * / <nl> - # define GRPC_ARG_DEFAULT_AUTHORITY " grpc . default_authority " <nl> - / * * Primary user agent : goes at the start of the user - agent metadata <nl> - sent on each request * / <nl> - # define GRPC_ARG_PRIMARY_USER_AGENT_STRING " grpc . primary_user_agent " <nl> - / * * Secondary user agent : goes at the end of the user - agent metadata <nl> - sent on each request * / <nl> - # define GRPC_ARG_SECONDARY_USER_AGENT_STRING " grpc . secondary_user_agent " <nl> - / * The caller of the secure_channel_create functions may override the target <nl> - name used for SSL host name checking using this channel argument which is of <nl> - type GRPC_ARG_STRING . This * should * be used for testing only . <nl> - If this argument is not specified , the name used for SSL host name checking <nl> - will be the target parameter ( assuming that the secure channel is an SSL <nl> - channel ) . If this parameter is specified and the underlying is not an SSL <nl> - channel , it will just be ignored . * / <nl> - # define GRPC_SSL_TARGET_NAME_OVERRIDE_ARG " grpc . ssl_target_name_override " <nl> - <nl> - / * * Result of a grpc call . If the caller satisfies the prerequisites of a <nl> - particular operation , the grpc_call_error returned will be GRPC_CALL_OK . <nl> - Receiving any other value listed here is an indication of a bug in the <nl> - caller . * / <nl> - typedef enum grpc_call_error { <nl> - / * * everything went ok * / <nl> - GRPC_CALL_OK = 0 , <nl> - / * * something failed , we don ' t know what * / <nl> - GRPC_CALL_ERROR , <nl> - / * * this method is not available on the server * / <nl> - GRPC_CALL_ERROR_NOT_ON_SERVER , <nl> - / * * this method is not available on the client * / <nl> - GRPC_CALL_ERROR_NOT_ON_CLIENT , <nl> - / * * this method must be called before server_accept * / <nl> - GRPC_CALL_ERROR_ALREADY_ACCEPTED , <nl> - / * * this method must be called before invoke * / <nl> - GRPC_CALL_ERROR_ALREADY_INVOKED , <nl> - / * * this method must be called after invoke * / <nl> - GRPC_CALL_ERROR_NOT_INVOKED , <nl> - / * * this call is already finished <nl> - ( writes_done or write_status has already been called ) * / <nl> - GRPC_CALL_ERROR_ALREADY_FINISHED , <nl> - / * * there is already an outstanding read / write operation on the call * / <nl> - GRPC_CALL_ERROR_TOO_MANY_OPERATIONS , <nl> - / * * the flags value was illegal for this call * / <nl> - GRPC_CALL_ERROR_INVALID_FLAGS , <nl> - / * * invalid metadata was passed to this call * / <nl> - GRPC_CALL_ERROR_INVALID_METADATA , <nl> - / * * invalid message was passed to this call * / <nl> - GRPC_CALL_ERROR_INVALID_MESSAGE , <nl> - / * * completion queue for notification has not been registered with the <nl> - server * / <nl> - GRPC_CALL_ERROR_NOT_SERVER_COMPLETION_QUEUE , <nl> - / * * this batch of operations leads to more operations than allowed * / <nl> - GRPC_CALL_ERROR_BATCH_TOO_BIG <nl> - } grpc_call_error ; <nl> - <nl> - / * Write Flags : * / <nl> - / * * Hint that the write may be buffered and need not go out on the wire <nl> - immediately . GRPC is free to buffer the message until the next non - buffered <nl> - write , or until writes_done , but it need not buffer completely or at all . * / <nl> - # define GRPC_WRITE_BUFFER_HINT ( 0x00000001u ) <nl> - / * * Force compression to be disabled for a particular write <nl> - ( start_write / add_metadata ) . Illegal on invoke / accept . * / <nl> - # define GRPC_WRITE_NO_COMPRESS ( 0x00000002u ) <nl> - / * * Mask of all valid flags . * / <nl> - # define GRPC_WRITE_USED_MASK ( GRPC_WRITE_BUFFER_HINT | GRPC_WRITE_NO_COMPRESS ) <nl> - <nl> - / * * A single metadata element * / <nl> - typedef struct grpc_metadata { <nl> - const char * key ; <nl> - const char * value ; <nl> - size_t value_length ; <nl> - uint32_t flags ; <nl> - <nl> - / * * The following fields are reserved for grpc internal use . <nl> - There is no need to initialize them , and they will be set to garbage <nl> - during calls to grpc . * / <nl> - struct { <nl> - void * obfuscated [ 4 ] ; <nl> - } internal_data ; <nl> - } grpc_metadata ; <nl> - <nl> - / * * The type of completion ( for grpc_event ) * / <nl> - typedef enum grpc_completion_type { <nl> - / * * Shutting down * / <nl> - GRPC_QUEUE_SHUTDOWN , <nl> - / * * No event before timeout * / <nl> - GRPC_QUEUE_TIMEOUT , <nl> - / * * Operation completion * / <nl> - GRPC_OP_COMPLETE <nl> - } grpc_completion_type ; <nl> - <nl> - / * * The result of an operation . <nl> - <nl> - Returned by a completion queue when the operation started with tag . * / <nl> - typedef struct grpc_event { <nl> - / * * The type of the completion . * / <nl> - grpc_completion_type type ; <nl> - / * * non - zero if the operation was successful , 0 upon failure . <nl> - Only GRPC_OP_COMPLETE can succeed or fail . * / <nl> - int success ; <nl> - / * * The tag passed to grpc_call_start_batch etc to start this operation . <nl> - Only GRPC_OP_COMPLETE has a tag . * / <nl> - void * tag ; <nl> - } grpc_event ; <nl> - <nl> - typedef struct { <nl> - size_t count ; <nl> - size_t capacity ; <nl> - grpc_metadata * metadata ; <nl> - } grpc_metadata_array ; <nl> - <nl> void grpc_metadata_array_init ( grpc_metadata_array * array ) ; <nl> void grpc_metadata_array_destroy ( grpc_metadata_array * array ) ; <nl> <nl> - typedef struct { <nl> - char * method ; <nl> - size_t method_capacity ; <nl> - char * host ; <nl> - size_t host_capacity ; <nl> - gpr_timespec deadline ; <nl> - void * reserved ; <nl> - } grpc_call_details ; <nl> - <nl> void grpc_call_details_init ( grpc_call_details * details ) ; <nl> void grpc_call_details_destroy ( grpc_call_details * details ) ; <nl> <nl> - typedef enum { <nl> - / * * Send initial metadata : one and only one instance MUST be sent for each <nl> - call , unless the call was cancelled - in which case this can be skipped . <nl> - This op completes after all bytes of metadata have been accepted by <nl> - outgoing flow control . * / <nl> - GRPC_OP_SEND_INITIAL_METADATA = 0 , <nl> - / * * Send a message : 0 or more of these operations can occur for each call . <nl> - This op completes after all bytes for the message have been accepted by <nl> - outgoing flow control . * / <nl> - GRPC_OP_SEND_MESSAGE , <nl> - / * * Send a close from the client : one and only one instance MUST be sent from <nl> - the client , unless the call was cancelled - in which case this can be <nl> - skipped . <nl> - This op completes after all bytes for the call ( including the close ) <nl> - have passed outgoing flow control . * / <nl> - GRPC_OP_SEND_CLOSE_FROM_CLIENT , <nl> - / * * Send status from the server : one and only one instance MUST be sent from <nl> - the server unless the call was cancelled - in which case this can be <nl> - skipped . <nl> - This op completes after all bytes for the call ( including the status ) <nl> - have passed outgoing flow control . * / <nl> - GRPC_OP_SEND_STATUS_FROM_SERVER , <nl> - / * * Receive initial metadata : one and only one MUST be made on the client , <nl> - must not be made on the server . <nl> - This op completes after all initial metadata has been read from the <nl> - peer . * / <nl> - GRPC_OP_RECV_INITIAL_METADATA , <nl> - / * * Receive a message : 0 or more of these operations can occur for each call . <nl> - This op completes after all bytes of the received message have been <nl> - read , or after a half - close has been received on this call . * / <nl> - GRPC_OP_RECV_MESSAGE , <nl> - / * * Receive status on the client : one and only one must be made on the client . <nl> - This operation always succeeds , meaning ops paired with this operation <nl> - will also appear to succeed , even though they may not have . In that case <nl> - the status will indicate some failure . <nl> - This op completes after all activity on the call has completed . * / <nl> - GRPC_OP_RECV_STATUS_ON_CLIENT , <nl> - / * * Receive close on the server : one and only one must be made on the <nl> - server . <nl> - This op completes after the close has been received by the server . * / <nl> - GRPC_OP_RECV_CLOSE_ON_SERVER <nl> - } grpc_op_type ; <nl> - <nl> - / * * Operation data : one field for each op type ( except SEND_CLOSE_FROM_CLIENT <nl> - which has no arguments ) * / <nl> - typedef struct grpc_op { <nl> - / * * Operation type , as defined by grpc_op_type * / <nl> - grpc_op_type op ; <nl> - / * * Write flags bitset for grpc_begin_messages * / <nl> - uint32_t flags ; <nl> - / * * Reserved for future usage * / <nl> - void * reserved ; <nl> - union { <nl> - / * * Reserved for future usage * / <nl> - struct { <nl> - void * reserved [ 8 ] ; <nl> - } reserved ; <nl> - struct { <nl> - size_t count ; <nl> - grpc_metadata * metadata ; <nl> - } send_initial_metadata ; <nl> - grpc_byte_buffer * send_message ; <nl> - struct { <nl> - size_t trailing_metadata_count ; <nl> - grpc_metadata * trailing_metadata ; <nl> - grpc_status_code status ; <nl> - const char * status_details ; <nl> - } send_status_from_server ; <nl> - / * * ownership of the array is with the caller , but ownership of the elements <nl> - stays with the call object ( ie key , value members are owned by the call <nl> - object , recv_initial_metadata - > array is owned by the caller ) . <nl> - After the operation completes , call grpc_metadata_array_destroy on this <nl> - value , or reuse it in a future op . * / <nl> - grpc_metadata_array * recv_initial_metadata ; <nl> - / * * ownership of the byte buffer is moved to the caller ; the caller must <nl> - call grpc_byte_buffer_destroy on this value , or reuse it in a future op . <nl> - * / <nl> - grpc_byte_buffer * * recv_message ; <nl> - struct { <nl> - / * * ownership of the array is with the caller , but ownership of the <nl> - elements stays with the call object ( ie key , value members are owned <nl> - by the call object , trailing_metadata - > array is owned by the caller ) . <nl> - After the operation completes , call grpc_metadata_array_destroy on <nl> - this <nl> - value , or reuse it in a future op . * / <nl> - grpc_metadata_array * trailing_metadata ; <nl> - grpc_status_code * status ; <nl> - / * * status_details is a buffer owned by the application before the op <nl> - completes and after the op has completed . During the operation <nl> - status_details may be reallocated to a size larger than <nl> - * status_details_capacity , in which case * status_details_capacity will <nl> - be updated with the new array capacity . <nl> - <nl> - Pre - allocating space : <nl> - size_t my_capacity = 8 ; <nl> - char * my_details = gpr_malloc ( my_capacity ) ; <nl> - x . status_details = & my_details ; <nl> - x . status_details_capacity = & my_capacity ; <nl> - <nl> - Not pre - allocating space : <nl> - size_t my_capacity = 0 ; <nl> - char * my_details = NULL ; <nl> - x . status_details = & my_details ; <nl> - x . status_details_capacity = & my_capacity ; <nl> - <nl> - After the call : <nl> - gpr_free ( my_details ) ; * / <nl> - char * * status_details ; <nl> - size_t * status_details_capacity ; <nl> - } recv_status_on_client ; <nl> - struct { <nl> - / * * out argument , set to 1 if the call failed in any way ( seen as a <nl> - cancellation on the server ) , or 0 if the call succeeded * / <nl> - int * cancelled ; <nl> - } recv_close_on_server ; <nl> - } data ; <nl> - } grpc_op ; <nl> - <nl> / * * Registers a plugin to be initialized and destroyed with the library . <nl> <nl> The \ a init and \ a destroy functions will be invoked as part of <nl> typedef struct grpc_op { <nl> the reverse order they were initialized . * / <nl> void grpc_register_plugin ( void ( * init ) ( void ) , void ( * destroy ) ( void ) ) ; <nl> <nl> - / * Propagation bits : this can be bitwise or - ed to form propagation_mask for <nl> - * grpc_call * / <nl> - / * * Propagate deadline * / <nl> - # define GRPC_PROPAGATE_DEADLINE ( ( uint32_t ) 1 ) <nl> - / * * Propagate census context * / <nl> - # define GRPC_PROPAGATE_CENSUS_STATS_CONTEXT ( ( uint32_t ) 2 ) <nl> - # define GRPC_PROPAGATE_CENSUS_TRACING_CONTEXT ( ( uint32_t ) 4 ) <nl> - / * * Propagate cancellation * / <nl> - # define GRPC_PROPAGATE_CANCELLATION ( ( uint32_t ) 8 ) <nl> - <nl> - / * Default propagation mask : clients of the core API are encouraged to encode <nl> - deltas from this in their implementations . . . ie write : <nl> - GRPC_PROPAGATE_DEFAULTS & ~ GRPC_PROPAGATE_DEADLINE to disable deadline <nl> - propagation . Doing so gives flexibility in the future to define new <nl> - propagation types that are default inherited or not . * / <nl> - # define GRPC_PROPAGATE_DEFAULTS \ <nl> - ( ( uint32_t ) ( ( \ <nl> - 0xffff | GRPC_PROPAGATE_DEADLINE | GRPC_PROPAGATE_CENSUS_STATS_CONTEXT | \ <nl> - GRPC_PROPAGATE_CENSUS_TRACING_CONTEXT | GRPC_PROPAGATE_CANCELLATION ) ) ) <nl> - <nl> / * * Initialize the grpc library . <nl> <nl> It is not safe to call any other grpc functions before calling this . <nl> new file mode 100644 <nl> index 00000000000 . . 5376026dde2 <nl> mmm / dev / null <nl> ppp b / include / grpc / impl / codegen / atm . h <nl> <nl> + / * <nl> + * <nl> + * Copyright 2015 , Google Inc . <nl> + * All rights reserved . <nl> + * <nl> + * Redistribution and use in source and binary forms , with or without <nl> + * modification , are permitted provided that the following conditions are <nl> + * met : <nl> + * <nl> + * * Redistributions of source code must retain the above copyright <nl> + * notice , this list of conditions and the following disclaimer . <nl> + * * Redistributions in binary form must reproduce the above <nl> + * copyright notice , this list of conditions and the following disclaimer <nl> + * in the documentation and / or other materials provided with the <nl> + * distribution . <nl> + * * Neither the name of Google Inc . nor the names of its <nl> + * contributors may be used to endorse or promote products derived from <nl> + * this software without specific prior written permission . <nl> + * <nl> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> + * " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> + * LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> + * A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> + * SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> + * LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> + * DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> + * THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> + * ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> + * OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> + * <nl> + * / <nl> + <nl> + # ifndef GRPC_IMPL_CODEGEN_ATM_H <nl> + # define GRPC_IMPL_CODEGEN_ATM_H <nl> + <nl> + / * This interface provides atomic operations and barriers . <nl> + It is internal to gpr support code and should not be used outside it . <nl> + <nl> + If an operation with acquire semantics precedes another memory access by the <nl> + same thread , the operation will precede that other access as seen by other <nl> + threads . <nl> + <nl> + If an operation with release semantics follows another memory access by the <nl> + same thread , the operation will follow that other access as seen by other <nl> + threads . <nl> + <nl> + Routines with " acq " or " full " in the name have acquire semantics . Routines <nl> + with " rel " or " full " in the name have release semantics . Routines with <nl> + " no_barrier " in the name have neither acquire not release semantics . <nl> + <nl> + The routines may be implemented as macros . <nl> + <nl> + / / Atomic operations act on an intergral_type gpr_atm that is guaranteed to <nl> + / / be the same size as a pointer . <nl> + typedef intptr_t gpr_atm ; <nl> + <nl> + / / A memory barrier , providing both acquire and release semantics , but not <nl> + / / otherwise acting on memory . <nl> + void gpr_atm_full_barrier ( void ) ; <nl> + <nl> + / / Atomically return * p , with acquire semantics . <nl> + gpr_atm gpr_atm_acq_load ( gpr_atm * p ) ; <nl> + <nl> + / / Atomically set * p = value , with release semantics . <nl> + void gpr_atm_rel_store ( gpr_atm * p , gpr_atm value ) ; <nl> + <nl> + / / Atomically add delta to * p , and return the old value of * p , with <nl> + / / the barriers specified . <nl> + gpr_atm gpr_atm_no_barrier_fetch_add ( gpr_atm * p , gpr_atm delta ) ; <nl> + gpr_atm gpr_atm_full_fetch_add ( gpr_atm * p , gpr_atm delta ) ; <nl> + <nl> + / / Atomically , if * p = = o , set * p = n and return non - zero otherwise return 0 , <nl> + / / with the barriers specified if the operation succeeds . <nl> + int gpr_atm_no_barrier_cas ( gpr_atm * p , gpr_atm o , gpr_atm n ) ; <nl> + int gpr_atm_acq_cas ( gpr_atm * p , gpr_atm o , gpr_atm n ) ; <nl> + int gpr_atm_rel_cas ( gpr_atm * p , gpr_atm o , gpr_atm n ) ; <nl> + * / <nl> + <nl> + # include < grpc / impl / codegen / port_platform . h > <nl> + <nl> + # if defined ( GPR_GCC_ATOMIC ) <nl> + # include < grpc / impl / codegen / atm_gcc_atomic . h > <nl> + # elif defined ( GPR_GCC_SYNC ) <nl> + # include < grpc / impl / codegen / atm_gcc_sync . h > <nl> + # elif defined ( GPR_WIN32_ATOMIC ) <nl> + # include < grpc / impl / codegen / atm_win32 . h > <nl> + # else <nl> + # error could not determine platform for atm <nl> + # endif <nl> + <nl> + # endif / * GRPC_IMPL_CODEGEN_ATM_H * / <nl> new file mode 100644 <nl> index 00000000000 . . 8caf7edbdec <nl> mmm / dev / null <nl> ppp b / include / grpc / impl / codegen / atm_gcc_atomic . h <nl> <nl> + / * <nl> + * <nl> + * Copyright 2015 , Google Inc . <nl> + * All rights reserved . <nl> + * <nl> + * Redistribution and use in source and binary forms , with or without <nl> + * modification , are permitted provided that the following conditions are <nl> + * met : <nl> + * <nl> + * * Redistributions of source code must retain the above copyright <nl> + * notice , this list of conditions and the following disclaimer . <nl> + * * Redistributions in binary form must reproduce the above <nl> + * copyright notice , this list of conditions and the following disclaimer <nl> + * in the documentation and / or other materials provided with the <nl> + * distribution . <nl> + * * Neither the name of Google Inc . nor the names of its <nl> + * contributors may be used to endorse or promote products derived from <nl> + * this software without specific prior written permission . <nl> + * <nl> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> + * " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> + * LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> + * A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> + * SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> + * LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> + * DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> + * THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> + * ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> + * OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> + * <nl> + * / <nl> + <nl> + # ifndef GRPC_IMPL_CODEGEN_ATM_GCC_ATOMIC_H <nl> + # define GRPC_IMPL_CODEGEN_ATM_GCC_ATOMIC_H <nl> + <nl> + / * atm_platform . h for gcc and gcc - like compilers with the <nl> + __atomic_ * interface . * / <nl> + # include < grpc / impl / codegen / port_platform . h > <nl> + <nl> + typedef intptr_t gpr_atm ; <nl> + <nl> + # define gpr_atm_full_barrier ( ) ( __atomic_thread_fence ( __ATOMIC_SEQ_CST ) ) <nl> + <nl> + # define gpr_atm_acq_load ( p ) ( __atomic_load_n ( ( p ) , __ATOMIC_ACQUIRE ) ) <nl> + # define gpr_atm_no_barrier_load ( p ) ( __atomic_load_n ( ( p ) , __ATOMIC_RELAXED ) ) <nl> + # define gpr_atm_rel_store ( p , value ) \ <nl> + ( __atomic_store_n ( ( p ) , ( intptr_t ) ( value ) , __ATOMIC_RELEASE ) ) <nl> + # define gpr_atm_no_barrier_store ( p , value ) \ <nl> + ( __atomic_store_n ( ( p ) , ( intptr_t ) ( value ) , __ATOMIC_RELAXED ) ) <nl> + <nl> + # define gpr_atm_no_barrier_fetch_add ( p , delta ) \ <nl> + ( __atomic_fetch_add ( ( p ) , ( intptr_t ) ( delta ) , __ATOMIC_RELAXED ) ) <nl> + # define gpr_atm_full_fetch_add ( p , delta ) \ <nl> + ( __atomic_fetch_add ( ( p ) , ( intptr_t ) ( delta ) , __ATOMIC_ACQ_REL ) ) <nl> + <nl> + static __inline int gpr_atm_no_barrier_cas ( gpr_atm * p , gpr_atm o , gpr_atm n ) { <nl> + return __atomic_compare_exchange_n ( p , & o , n , 0 , __ATOMIC_RELAXED , <nl> + __ATOMIC_RELAXED ) ; <nl> + } <nl> + <nl> + static __inline int gpr_atm_acq_cas ( gpr_atm * p , gpr_atm o , gpr_atm n ) { <nl> + return __atomic_compare_exchange_n ( p , & o , n , 0 , __ATOMIC_ACQUIRE , <nl> + __ATOMIC_RELAXED ) ; <nl> + } <nl> + <nl> + static __inline int gpr_atm_rel_cas ( gpr_atm * p , gpr_atm o , gpr_atm n ) { <nl> + return __atomic_compare_exchange_n ( p , & o , n , 0 , __ATOMIC_RELEASE , <nl> + __ATOMIC_RELAXED ) ; <nl> + } <nl> + <nl> + # endif / * GRPC_IMPL_CODEGEN_ATM_GCC_ATOMIC_H * / <nl> new file mode 100644 <nl> index 00000000000 . . 915b09fb0c3 <nl> mmm / dev / null <nl> ppp b / include / grpc / impl / codegen / atm_gcc_sync . h <nl> <nl> + / * <nl> + * <nl> + * Copyright 2015 , Google Inc . <nl> + * All rights reserved . <nl> + * <nl> + * Redistribution and use in source and binary forms , with or without <nl> + * modification , are permitted provided that the following conditions are <nl> + * met : <nl> + * <nl> + * * Redistributions of source code must retain the above copyright <nl> + * notice , this list of conditions and the following disclaimer . <nl> + * * Redistributions in binary form must reproduce the above <nl> + * copyright notice , this list of conditions and the following disclaimer <nl> + * in the documentation and / or other materials provided with the <nl> + * distribution . <nl> + * * Neither the name of Google Inc . nor the names of its <nl> + * contributors may be used to endorse or promote products derived from <nl> + * this software without specific prior written permission . <nl> + * <nl> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> + * " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> + * LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> + * A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> + * SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> + * LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> + * DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> + * THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> + * ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> + * OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> + * <nl> + * / <nl> + <nl> + # ifndef GRPC_IMPL_CODEGEN_ATM_GCC_SYNC_H <nl> + # define GRPC_IMPL_CODEGEN_ATM_GCC_SYNC_H <nl> + <nl> + / * variant of atm_platform . h for gcc and gcc - like compiers with __sync_ * <nl> + interface * / <nl> + # include < grpc / impl / codegen / port_platform . h > <nl> + <nl> + typedef intptr_t gpr_atm ; <nl> + <nl> + # define GPR_ATM_COMPILE_BARRIER_ ( ) __asm__ __volatile__ ( " " : : : " memory " ) <nl> + <nl> + # if defined ( __i386 ) | | defined ( __x86_64__ ) <nl> + / * All loads are acquire loads and all stores are release stores . * / <nl> + # define GPR_ATM_LS_BARRIER_ ( ) GPR_ATM_COMPILE_BARRIER_ ( ) <nl> + # else <nl> + # define GPR_ATM_LS_BARRIER_ ( ) gpr_atm_full_barrier ( ) <nl> + # endif <nl> + <nl> + # define gpr_atm_full_barrier ( ) ( __sync_synchronize ( ) ) <nl> + <nl> + static __inline gpr_atm gpr_atm_acq_load ( const gpr_atm * p ) { <nl> + gpr_atm value = * p ; <nl> + GPR_ATM_LS_BARRIER_ ( ) ; <nl> + return value ; <nl> + } <nl> + <nl> + static __inline gpr_atm gpr_atm_no_barrier_load ( const gpr_atm * p ) { <nl> + gpr_atm value = * p ; <nl> + GPR_ATM_COMPILE_BARRIER_ ( ) ; <nl> + return value ; <nl> + } <nl> + <nl> + static __inline void gpr_atm_rel_store ( gpr_atm * p , gpr_atm value ) { <nl> + GPR_ATM_LS_BARRIER_ ( ) ; <nl> + * p = value ; <nl> + } <nl> + <nl> + static __inline void gpr_atm_no_barrier_store ( gpr_atm * p , gpr_atm value ) { <nl> + GPR_ATM_COMPILE_BARRIER_ ( ) ; <nl> + * p = value ; <nl> + } <nl> + <nl> + # undef GPR_ATM_LS_BARRIER_ <nl> + # undef GPR_ATM_COMPILE_BARRIER_ <nl> + <nl> + # define gpr_atm_no_barrier_fetch_add ( p , delta ) \ <nl> + gpr_atm_full_fetch_add ( ( p ) , ( delta ) ) <nl> + # define gpr_atm_full_fetch_add ( p , delta ) ( __sync_fetch_and_add ( ( p ) , ( delta ) ) ) <nl> + <nl> + # define gpr_atm_no_barrier_cas ( p , o , n ) gpr_atm_acq_cas ( ( p ) , ( o ) , ( n ) ) <nl> + # define gpr_atm_acq_cas ( p , o , n ) ( __sync_bool_compare_and_swap ( ( p ) , ( o ) , ( n ) ) ) <nl> + # define gpr_atm_rel_cas ( p , o , n ) gpr_atm_acq_cas ( ( p ) , ( o ) , ( n ) ) <nl> + <nl> + # endif / * GRPC_IMPL_CODEGEN_ATM_GCC_SYNC_H * / <nl> new file mode 100644 <nl> index 00000000000 . . 7c1ccaf8e20 <nl> mmm / dev / null <nl> ppp b / include / grpc / impl / codegen / atm_win32 . h <nl> <nl> + / * <nl> + * <nl> + * Copyright 2015 , Google Inc . <nl> + * All rights reserved . <nl> + * <nl> + * Redistribution and use in source and binary forms , with or without <nl> + * modification , are permitted provided that the following conditions are <nl> + * met : <nl> + * <nl> + * * Redistributions of source code must retain the above copyright <nl> + * notice , this list of conditions and the following disclaimer . <nl> + * * Redistributions in binary form must reproduce the above <nl> + * copyright notice , this list of conditions and the following disclaimer <nl> + * in the documentation and / or other materials provided with the <nl> + * distribution . <nl> + * * Neither the name of Google Inc . nor the names of its <nl> + * contributors may be used to endorse or promote products derived from <nl> + * this software without specific prior written permission . <nl> + * <nl> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> + * " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> + * LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> + * A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> + * SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> + * LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> + * DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> + * THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> + * ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> + * OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> + * <nl> + * / <nl> + <nl> + # ifndef GRPC_IMPL_CODEGEN_ATM_WIN32_H <nl> + # define GRPC_IMPL_CODEGEN_ATM_WIN32_H <nl> + <nl> + / * Win32 variant of atm_platform . h * / <nl> + # include < grpc / impl / codegen / port_platform . h > <nl> + <nl> + typedef intptr_t gpr_atm ; <nl> + <nl> + # define gpr_atm_full_barrier MemoryBarrier <nl> + <nl> + static __inline gpr_atm gpr_atm_acq_load ( const gpr_atm * p ) { <nl> + gpr_atm result = * p ; <nl> + gpr_atm_full_barrier ( ) ; <nl> + return result ; <nl> + } <nl> + <nl> + static __inline gpr_atm gpr_atm_no_barrier_load ( const gpr_atm * p ) { <nl> + / * TODO ( dklempner ) : Can we implement something better here ? * / <nl> + return gpr_atm_acq_load ( p ) ; <nl> + } <nl> + <nl> + static __inline void gpr_atm_rel_store ( gpr_atm * p , gpr_atm value ) { <nl> + gpr_atm_full_barrier ( ) ; <nl> + * p = value ; <nl> + } <nl> + <nl> + static __inline void gpr_atm_no_barrier_store ( gpr_atm * p , gpr_atm value ) { <nl> + / * TODO ( ctiller ) : Can we implement something better here ? * / <nl> + gpr_atm_rel_store ( p , value ) ; <nl> + } <nl> + <nl> + static __inline int gpr_atm_no_barrier_cas ( gpr_atm * p , gpr_atm o , gpr_atm n ) { <nl> + / * InterlockedCompareExchangePointerNoFence ( ) not available on vista or <nl> + windows7 * / <nl> + # ifdef GPR_ARCH_64 <nl> + return o = = ( gpr_atm ) InterlockedCompareExchangeAcquire64 ( <nl> + ( volatile LONGLONG * ) p , ( LONGLONG ) n , ( LONGLONG ) o ) ; <nl> + # else <nl> + return o = = ( gpr_atm ) InterlockedCompareExchangeAcquire ( ( volatile LONG * ) p , <nl> + ( LONG ) n , ( LONG ) o ) ; <nl> + # endif <nl> + } <nl> + <nl> + static __inline int gpr_atm_acq_cas ( gpr_atm * p , gpr_atm o , gpr_atm n ) { <nl> + # ifdef GPR_ARCH_64 <nl> + return o = = ( gpr_atm ) InterlockedCompareExchangeAcquire64 ( <nl> + ( volatile LONGLONG * ) p , ( LONGLONG ) n , ( LONGLONG ) o ) ; <nl> + # else <nl> + return o = = ( gpr_atm ) InterlockedCompareExchangeAcquire ( ( volatile LONG * ) p , <nl> + ( LONG ) n , ( LONG ) o ) ; <nl> + # endif <nl> + } <nl> + <nl> + static __inline int gpr_atm_rel_cas ( gpr_atm * p , gpr_atm o , gpr_atm n ) { <nl> + # ifdef GPR_ARCH_64 <nl> + return o = = ( gpr_atm ) InterlockedCompareExchangeRelease64 ( <nl> + ( volatile LONGLONG * ) p , ( LONGLONG ) n , ( LONGLONG ) o ) ; <nl> + # else <nl> + return o = = ( gpr_atm ) InterlockedCompareExchangeRelease ( ( volatile LONG * ) p , <nl> + ( LONG ) n , ( LONG ) o ) ; <nl> + # endif <nl> + } <nl> + <nl> + static __inline gpr_atm gpr_atm_no_barrier_fetch_add ( gpr_atm * p , <nl> + gpr_atm delta ) { <nl> + / * Use the CAS operation to get pointer - sized fetch and add * / <nl> + gpr_atm old ; <nl> + do { <nl> + old = * p ; <nl> + } while ( ! gpr_atm_no_barrier_cas ( p , old , old + delta ) ) ; <nl> + return old ; <nl> + } <nl> + <nl> + static __inline gpr_atm gpr_atm_full_fetch_add ( gpr_atm * p , gpr_atm delta ) { <nl> + / * Use a CAS operation to get pointer - sized fetch and add * / <nl> + gpr_atm old ; <nl> + # ifdef GPR_ARCH_64 <nl> + do { <nl> + old = * p ; <nl> + } while ( old ! = ( gpr_atm ) InterlockedCompareExchange64 ( ( volatile LONGLONG * ) p , <nl> + ( LONGLONG ) old + delta , <nl> + ( LONGLONG ) old ) ) ; <nl> + # else <nl> + do { <nl> + old = * p ; <nl> + } while ( old ! = ( gpr_atm ) InterlockedCompareExchange ( <nl> + ( volatile LONG * ) p , ( LONG ) old + delta , ( LONG ) old ) ) ; <nl> + # endif <nl> + return old ; <nl> + } <nl> + <nl> + # endif / * GRPC_IMPL_CODEGEN_ATM_WIN32_H * / <nl> new file mode 100644 <nl> index 00000000000 . . 35f3c6e7ca5 <nl> mmm / dev / null <nl> ppp b / include / grpc / impl / codegen / byte_buffer . h <nl> <nl> + / * <nl> + * <nl> + * Copyright 2015 , Google Inc . <nl> + * All rights reserved . <nl> + * <nl> + * Redistribution and use in source and binary forms , with or without <nl> + * modification , are permitted provided that the following conditions are <nl> + * met : <nl> + * <nl> + * * Redistributions of source code must retain the above copyright <nl> + * notice , this list of conditions and the following disclaimer . <nl> + * * Redistributions in binary form must reproduce the above <nl> + * copyright notice , this list of conditions and the following disclaimer <nl> + * in the documentation and / or other materials provided with the <nl> + * distribution . <nl> + * * Neither the name of Google Inc . nor the names of its <nl> + * contributors may be used to endorse or promote products derived from <nl> + * this software without specific prior written permission . <nl> + * <nl> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> + * " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> + * LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> + * A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> + * SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> + * LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> + * DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> + * THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> + * ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> + * OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> + * <nl> + * / <nl> + <nl> + # ifndef GRPC_IMPL_CODEGEN_BYTE_BUFFER_H <nl> + # define GRPC_IMPL_CODEGEN_BYTE_BUFFER_H <nl> + <nl> + # include < grpc / impl / codegen / compression_types . h > <nl> + # include < grpc / impl / codegen / slice_buffer . h > <nl> + <nl> + # ifdef __cplusplus <nl> + extern " C " { <nl> + # endif <nl> + <nl> + typedef enum { <nl> + GRPC_BB_RAW <nl> + / * Future types may include GRPC_BB_PROTOBUF , etc . * / <nl> + } grpc_byte_buffer_type ; <nl> + <nl> + struct grpc_byte_buffer { <nl> + void * reserved ; <nl> + grpc_byte_buffer_type type ; <nl> + union { <nl> + struct { <nl> + void * reserved [ 8 ] ; <nl> + } reserved ; <nl> + struct { <nl> + grpc_compression_algorithm compression ; <nl> + gpr_slice_buffer slice_buffer ; <nl> + } raw ; <nl> + } data ; <nl> + } ; <nl> + typedef struct grpc_byte_buffer grpc_byte_buffer ; <nl> + <nl> + / * * Returns a RAW byte buffer instance over the given slices ( up to \ a nslices ) . <nl> + * <nl> + * Increases the reference count for all \ a slices processed . The user is <nl> + * responsible for invoking grpc_byte_buffer_destroy on the returned instance . * / <nl> + grpc_byte_buffer * grpc_raw_byte_buffer_create ( gpr_slice * slices , <nl> + size_t nslices ) ; <nl> + <nl> + / * * Returns a * compressed * RAW byte buffer instance over the given slices ( up to <nl> + * \ a nslices ) . The \ a compression argument defines the compression algorithm <nl> + * used to generate the data in \ a slices . <nl> + * <nl> + * Increases the reference count for all \ a slices processed . The user is <nl> + * responsible for invoking grpc_byte_buffer_destroy on the returned instance . * / <nl> + grpc_byte_buffer * grpc_raw_compressed_byte_buffer_create ( <nl> + gpr_slice * slices , size_t nslices , grpc_compression_algorithm compression ) ; <nl> + <nl> + / * * Copies input byte buffer \ a bb . <nl> + * <nl> + * Increases the reference count of all the source slices . The user is <nl> + * responsible for calling grpc_byte_buffer_destroy over the returned copy . * / <nl> + grpc_byte_buffer * grpc_byte_buffer_copy ( grpc_byte_buffer * bb ) ; <nl> + <nl> + / * * Returns the size of the given byte buffer , in bytes . * / <nl> + size_t grpc_byte_buffer_length ( grpc_byte_buffer * bb ) ; <nl> + <nl> + / * * Destroys \ a byte_buffer deallocating all its memory . * / <nl> + void grpc_byte_buffer_destroy ( grpc_byte_buffer * byte_buffer ) ; <nl> + <nl> + / * * Reader for byte buffers . Iterates over slices in the byte buffer * / <nl> + struct grpc_byte_buffer_reader ; <nl> + typedef struct grpc_byte_buffer_reader grpc_byte_buffer_reader ; <nl> + <nl> + / * * Initialize \ a reader to read over \ a buffer * / <nl> + void grpc_byte_buffer_reader_init ( grpc_byte_buffer_reader * reader , <nl> + grpc_byte_buffer * buffer ) ; <nl> + <nl> + / * * Cleanup and destroy \ a reader * / <nl> + void grpc_byte_buffer_reader_destroy ( grpc_byte_buffer_reader * reader ) ; <nl> + <nl> + / * * Updates \ a slice with the next piece of data from from \ a reader and returns <nl> + * 1 . Returns 0 at the end of the stream . Caller is responsible for calling <nl> + * gpr_slice_unref on the result . * / <nl> + int grpc_byte_buffer_reader_next ( grpc_byte_buffer_reader * reader , <nl> + gpr_slice * slice ) ; <nl> + <nl> + / * * Merge all data from \ a reader into single slice * / <nl> + gpr_slice grpc_byte_buffer_reader_readall ( grpc_byte_buffer_reader * reader ) ; <nl> + <nl> + / * * Returns a RAW byte buffer instance from the output of \ a reader . * / <nl> + grpc_byte_buffer * grpc_raw_byte_buffer_from_reader ( <nl> + grpc_byte_buffer_reader * reader ) ; <nl> + <nl> + # ifdef __cplusplus <nl> + } <nl> + # endif <nl> + <nl> + # endif / * GRPC_IMPL_CODEGEN_BYTE_BUFFER_H * / <nl> new file mode 100644 <nl> index 00000000000 . . f552d3c8a28 <nl> mmm / dev / null <nl> ppp b / include / grpc / impl / codegen / compression_types . h <nl> <nl> + / * <nl> + * <nl> + * Copyright 2016 , Google Inc . <nl> + * All rights reserved . <nl> + * <nl> + * Redistribution and use in source and binary forms , with or without <nl> + * modification , are permitted provided that the following conditions are <nl> + * met : <nl> + * <nl> + * * Redistributions of source code must retain the above copyright <nl> + * notice , this list of conditions and the following disclaimer . <nl> + * * Redistributions in binary form must reproduce the above <nl> + * copyright notice , this list of conditions and the following disclaimer <nl> + * in the documentation and / or other materials provided with the <nl> + * distribution . <nl> + * * Neither the name of Google Inc . nor the names of its <nl> + * contributors may be used to endorse or promote products derived from <nl> + * this software without specific prior written permission . <nl> + * <nl> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> + * " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> + * LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> + * A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> + * SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> + * LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> + * DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> + * THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> + * ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> + * OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> + * <nl> + * / <nl> + <nl> + # ifndef GRPC_IMPL_CODEGEN_COMPRESSION_TYPES_H <nl> + # define GRPC_IMPL_CODEGEN_COMPRESSION_TYPES_H <nl> + <nl> + # include < stdint . h > <nl> + <nl> + # ifdef __cplusplus <nl> + extern " C " { <nl> + # endif <nl> + <nl> + / * * To be used in channel arguments * / <nl> + # define GRPC_COMPRESSION_ALGORITHM_ARG " grpc . compression_algorithm " <nl> + # define GRPC_COMPRESSION_ALGORITHM_STATE_ARG " grpc . compression_algorithm_state " <nl> + <nl> + / * The various compression algorithms supported by GRPC * / <nl> + typedef enum { <nl> + GRPC_COMPRESS_NONE = 0 , <nl> + GRPC_COMPRESS_DEFLATE , <nl> + GRPC_COMPRESS_GZIP , <nl> + / * TODO ( ctiller ) : snappy * / <nl> + GRPC_COMPRESS_ALGORITHMS_COUNT <nl> + } grpc_compression_algorithm ; <nl> + <nl> + typedef enum { <nl> + GRPC_COMPRESS_LEVEL_NONE = 0 , <nl> + GRPC_COMPRESS_LEVEL_LOW , <nl> + GRPC_COMPRESS_LEVEL_MED , <nl> + GRPC_COMPRESS_LEVEL_HIGH , <nl> + GRPC_COMPRESS_LEVEL_COUNT <nl> + } grpc_compression_level ; <nl> + <nl> + typedef struct grpc_compression_options { <nl> + uint32_t enabled_algorithms_bitset ; / * * < All algs are enabled by default * / <nl> + grpc_compression_algorithm default_compression_algorithm ; / * * < for channel * / <nl> + } grpc_compression_options ; <nl> + <nl> + # ifdef __cplusplus <nl> + } <nl> + # endif <nl> + <nl> + # endif / * GRPC_IMPL_CODEGEN_COMPRESSION_TYPES_H * / <nl> new file mode 100644 <nl> index 00000000000 . . ea1e96cf1d5 <nl> mmm / dev / null <nl> ppp b / include / grpc / impl / codegen / grpc_types . h <nl> <nl> + / * <nl> + * <nl> + * Copyright 2015 - 2016 , Google Inc . <nl> + * All rights reserved . <nl> + * <nl> + * Redistribution and use in source and binary forms , with or without <nl> + * modification , are permitted provided that the following conditions are <nl> + * met : <nl> + * <nl> + * * Redistributions of source code must retain the above copyright <nl> + * notice , this list of conditions and the following disclaimer . <nl> + * * Redistributions in binary form must reproduce the above <nl> + * copyright notice , this list of conditions and the following disclaimer <nl> + * in the documentation and / or other materials provided with the <nl> + * distribution . <nl> + * * Neither the name of Google Inc . nor the names of its <nl> + * contributors may be used to endorse or promote products derived from <nl> + * this software without specific prior written permission . <nl> + * <nl> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> + * " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> + * LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> + * A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> + * SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> + * LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> + * DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> + * THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> + * ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> + * OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> + * <nl> + * / <nl> + <nl> + # ifndef GRPC_IMPL_CODEGEN_GRPC_TYPES_H <nl> + # define GRPC_IMPL_CODEGEN_GRPC_TYPES_H <nl> + <nl> + # include < grpc / impl / codegen / byte_buffer . h > <nl> + # include < grpc / impl / codegen / status . h > <nl> + <nl> + # include < stddef . h > <nl> + <nl> + # ifdef __cplusplus <nl> + extern " C " { <nl> + # endif <nl> + <nl> + / * * Completion Queues enable notification of the completion of asynchronous <nl> + actions . * / <nl> + typedef struct grpc_completion_queue grpc_completion_queue ; <nl> + <nl> + / * * An alarm associated with a completion queue . * / <nl> + typedef struct grpc_alarm grpc_alarm ; <nl> + <nl> + / * * The Channel interface allows creation of Call objects . * / <nl> + typedef struct grpc_channel grpc_channel ; <nl> + <nl> + / * * A server listens to some port and responds to request calls * / <nl> + typedef struct grpc_server grpc_server ; <nl> + <nl> + / * * A Call represents an RPC . When created , it is in a configuration state <nl> + allowing properties to be set until it is invoked . After invoke , the Call <nl> + can have messages written to it and read from it . * / <nl> + typedef struct grpc_call grpc_call ; <nl> + <nl> + / * * Type specifier for grpc_arg * / <nl> + typedef enum { <nl> + GRPC_ARG_STRING , <nl> + GRPC_ARG_INTEGER , <nl> + GRPC_ARG_POINTER <nl> + } grpc_arg_type ; <nl> + <nl> + / * * A single argument . . . each argument has a key and a value <nl> + <nl> + A note on naming keys : <nl> + Keys are namespaced into groups , usually grouped by library , and are <nl> + keys for module XYZ are named XYZ . key1 , XYZ . key2 , etc . Module names must <nl> + be restricted to the regex [ A - Za - z ] [ _A - Za - z0 - 9 ] { , 15 } . <nl> + Key names must be restricted to the regex [ A - Za - z ] [ _A - Za - z0 - 9 ] { , 47 } . <nl> + <nl> + GRPC core library keys are prefixed by grpc . <nl> + <nl> + Library authors are strongly encouraged to \ # define symbolic constants for <nl> + their keys so that it ' s possible to change them in the future . * / <nl> + typedef struct { <nl> + grpc_arg_type type ; <nl> + char * key ; <nl> + union { <nl> + char * string ; <nl> + int integer ; <nl> + struct { <nl> + void * p ; <nl> + void * ( * copy ) ( void * p ) ; <nl> + void ( * destroy ) ( void * p ) ; <nl> + } pointer ; <nl> + } value ; <nl> + } grpc_arg ; <nl> + <nl> + / * * An array of arguments that can be passed around . <nl> + <nl> + Used to set optional channel - level configuration . <nl> + These configuration options are modelled as key - value pairs as defined <nl> + by grpc_arg ; keys are strings to allow easy backwards - compatible extension <nl> + by arbitrary parties . <nl> + All evaluation is performed at channel creation time ( i . e . the values in <nl> + this structure need only live through the creation invocation ) . * / <nl> + typedef struct { <nl> + size_t num_args ; <nl> + grpc_arg * args ; <nl> + } grpc_channel_args ; <nl> + <nl> + / * Channel argument keys : * / <nl> + / * * Enable census for tracing and stats collection * / <nl> + # define GRPC_ARG_ENABLE_CENSUS " grpc . census " <nl> + / * * Maximum number of concurrent incoming streams to allow on a http2 <nl> + connection * / <nl> + # define GRPC_ARG_MAX_CONCURRENT_STREAMS " grpc . max_concurrent_streams " <nl> + / * * Maximum message length that the channel can receive * / <nl> + # define GRPC_ARG_MAX_MESSAGE_LENGTH " grpc . max_message_length " <nl> + / * * Initial sequence number for http2 transports * / <nl> + # define GRPC_ARG_HTTP2_INITIAL_SEQUENCE_NUMBER \ <nl> + " grpc . http2 . initial_sequence_number " <nl> + / * * Amount to read ahead on individual streams . Defaults to 64kb , larger <nl> + values can help throughput on high - latency connections . <nl> + NOTE : at some point we ' d like to auto - tune this , and this parameter <nl> + will become a no - op . * / <nl> + # define GRPC_ARG_HTTP2_STREAM_LOOKAHEAD_BYTES " grpc . http2 . lookahead_bytes " <nl> + / * * How much memory to use for hpack decoding * / <nl> + # define GRPC_ARG_HTTP2_HPACK_TABLE_SIZE_DECODER \ <nl> + " grpc . http2 . hpack_table_size . decoder " <nl> + / * * How much memory to use for hpack encoding * / <nl> + # define GRPC_ARG_HTTP2_HPACK_TABLE_SIZE_ENCODER \ <nl> + " grpc . http2 . hpack_table_size . encoder " <nl> + / * * Default authority to pass if none specified on call construction * / <nl> + # define GRPC_ARG_DEFAULT_AUTHORITY " grpc . default_authority " <nl> + / * * Primary user agent : goes at the start of the user - agent metadata <nl> + sent on each request * / <nl> + # define GRPC_ARG_PRIMARY_USER_AGENT_STRING " grpc . primary_user_agent " <nl> + / * * Secondary user agent : goes at the end of the user - agent metadata <nl> + sent on each request * / <nl> + # define GRPC_ARG_SECONDARY_USER_AGENT_STRING " grpc . secondary_user_agent " <nl> + / * The caller of the secure_channel_create functions may override the target <nl> + name used for SSL host name checking using this channel argument which is of <nl> + type GRPC_ARG_STRING . This * should * be used for testing only . <nl> + If this argument is not specified , the name used for SSL host name checking <nl> + will be the target parameter ( assuming that the secure channel is an SSL <nl> + channel ) . If this parameter is specified and the underlying is not an SSL <nl> + channel , it will just be ignored . * / <nl> + # define GRPC_SSL_TARGET_NAME_OVERRIDE_ARG " grpc . ssl_target_name_override " <nl> + <nl> + / * * Result of a grpc call . If the caller satisfies the prerequisites of a <nl> + particular operation , the grpc_call_error returned will be GRPC_CALL_OK . <nl> + Receiving any other value listed here is an indication of a bug in the <nl> + caller . * / <nl> + typedef enum grpc_call_error { <nl> + / * * everything went ok * / <nl> + GRPC_CALL_OK = 0 , <nl> + / * * something failed , we don ' t know what * / <nl> + GRPC_CALL_ERROR , <nl> + / * * this method is not available on the server * / <nl> + GRPC_CALL_ERROR_NOT_ON_SERVER , <nl> + / * * this method is not available on the client * / <nl> + GRPC_CALL_ERROR_NOT_ON_CLIENT , <nl> + / * * this method must be called before server_accept * / <nl> + GRPC_CALL_ERROR_ALREADY_ACCEPTED , <nl> + / * * this method must be called before invoke * / <nl> + GRPC_CALL_ERROR_ALREADY_INVOKED , <nl> + / * * this method must be called after invoke * / <nl> + GRPC_CALL_ERROR_NOT_INVOKED , <nl> + / * * this call is already finished <nl> + ( writes_done or write_status has already been called ) * / <nl> + GRPC_CALL_ERROR_ALREADY_FINISHED , <nl> + / * * there is already an outstanding read / write operation on the call * / <nl> + GRPC_CALL_ERROR_TOO_MANY_OPERATIONS , <nl> + / * * the flags value was illegal for this call * / <nl> + GRPC_CALL_ERROR_INVALID_FLAGS , <nl> + / * * invalid metadata was passed to this call * / <nl> + GRPC_CALL_ERROR_INVALID_METADATA , <nl> + / * * invalid message was passed to this call * / <nl> + GRPC_CALL_ERROR_INVALID_MESSAGE , <nl> + / * * completion queue for notification has not been registered with the <nl> + server * / <nl> + GRPC_CALL_ERROR_NOT_SERVER_COMPLETION_QUEUE , <nl> + / * * this batch of operations leads to more operations than allowed * / <nl> + GRPC_CALL_ERROR_BATCH_TOO_BIG <nl> + } grpc_call_error ; <nl> + <nl> + / * Write Flags : * / <nl> + / * * Hint that the write may be buffered and need not go out on the wire <nl> + immediately . GRPC is free to buffer the message until the next non - buffered <nl> + write , or until writes_done , but it need not buffer completely or at all . * / <nl> + # define GRPC_WRITE_BUFFER_HINT ( 0x00000001u ) <nl> + / * * Force compression to be disabled for a particular write <nl> + ( start_write / add_metadata ) . Illegal on invoke / accept . * / <nl> + # define GRPC_WRITE_NO_COMPRESS ( 0x00000002u ) <nl> + / * * Mask of all valid flags . * / <nl> + # define GRPC_WRITE_USED_MASK ( GRPC_WRITE_BUFFER_HINT | GRPC_WRITE_NO_COMPRESS ) <nl> + <nl> + / * * A single metadata element * / <nl> + typedef struct grpc_metadata { <nl> + const char * key ; <nl> + const char * value ; <nl> + size_t value_length ; <nl> + uint32_t flags ; <nl> + <nl> + / * * The following fields are reserved for grpc internal use . <nl> + There is no need to initialize them , and they will be set to garbage <nl> + during calls to grpc . * / <nl> + struct { <nl> + void * obfuscated [ 4 ] ; <nl> + } internal_data ; <nl> + } grpc_metadata ; <nl> + <nl> + / * * The type of completion ( for grpc_event ) * / <nl> + typedef enum grpc_completion_type { <nl> + / * * Shutting down * / <nl> + GRPC_QUEUE_SHUTDOWN , <nl> + / * * No event before timeout * / <nl> + GRPC_QUEUE_TIMEOUT , <nl> + / * * Operation completion * / <nl> + GRPC_OP_COMPLETE <nl> + } grpc_completion_type ; <nl> + <nl> + / * * The result of an operation . <nl> + <nl> + Returned by a completion queue when the operation started with tag . * / <nl> + typedef struct grpc_event { <nl> + / * * The type of the completion . * / <nl> + grpc_completion_type type ; <nl> + / * * non - zero if the operation was successful , 0 upon failure . <nl> + Only GRPC_OP_COMPLETE can succeed or fail . * / <nl> + int success ; <nl> + / * * The tag passed to grpc_call_start_batch etc to start this operation . <nl> + Only GRPC_OP_COMPLETE has a tag . * / <nl> + void * tag ; <nl> + } grpc_event ; <nl> + <nl> + typedef struct { <nl> + size_t count ; <nl> + size_t capacity ; <nl> + grpc_metadata * metadata ; <nl> + } grpc_metadata_array ; <nl> + <nl> + typedef struct { <nl> + char * method ; <nl> + size_t method_capacity ; <nl> + char * host ; <nl> + size_t host_capacity ; <nl> + gpr_timespec deadline ; <nl> + void * reserved ; <nl> + } grpc_call_details ; <nl> + <nl> + typedef enum { <nl> + / * * Send initial metadata : one and only one instance MUST be sent for each <nl> + call , unless the call was cancelled - in which case this can be skipped . <nl> + This op completes after all bytes of metadata have been accepted by <nl> + outgoing flow control . * / <nl> + GRPC_OP_SEND_INITIAL_METADATA = 0 , <nl> + / * * Send a message : 0 or more of these operations can occur for each call . <nl> + This op completes after all bytes for the message have been accepted by <nl> + outgoing flow control . * / <nl> + GRPC_OP_SEND_MESSAGE , <nl> + / * * Send a close from the client : one and only one instance MUST be sent from <nl> + the client , unless the call was cancelled - in which case this can be <nl> + skipped . <nl> + This op completes after all bytes for the call ( including the close ) <nl> + have passed outgoing flow control . * / <nl> + GRPC_OP_SEND_CLOSE_FROM_CLIENT , <nl> + / * * Send status from the server : one and only one instance MUST be sent from <nl> + the server unless the call was cancelled - in which case this can be <nl> + skipped . <nl> + This op completes after all bytes for the call ( including the status ) <nl> + have passed outgoing flow control . * / <nl> + GRPC_OP_SEND_STATUS_FROM_SERVER , <nl> + / * * Receive initial metadata : one and only one MUST be made on the client , <nl> + must not be made on the server . <nl> + This op completes after all initial metadata has been read from the <nl> + peer . * / <nl> + GRPC_OP_RECV_INITIAL_METADATA , <nl> + / * * Receive a message : 0 or more of these operations can occur for each call . <nl> + This op completes after all bytes of the received message have been <nl> + read , or after a half - close has been received on this call . * / <nl> + GRPC_OP_RECV_MESSAGE , <nl> + / * * Receive status on the client : one and only one must be made on the client . <nl> + This operation always succeeds , meaning ops paired with this operation <nl> + will also appear to succeed , even though they may not have . In that case <nl> + the status will indicate some failure . <nl> + This op completes after all activity on the call has completed . * / <nl> + GRPC_OP_RECV_STATUS_ON_CLIENT , <nl> + / * * Receive close on the server : one and only one must be made on the <nl> + server . <nl> + This op completes after the close has been received by the server . * / <nl> + GRPC_OP_RECV_CLOSE_ON_SERVER <nl> + } grpc_op_type ; <nl> + <nl> + / * * Operation data : one field for each op type ( except SEND_CLOSE_FROM_CLIENT <nl> + which has no arguments ) * / <nl> + typedef struct grpc_op { <nl> + / * * Operation type , as defined by grpc_op_type * / <nl> + grpc_op_type op ; <nl> + / * * Write flags bitset for grpc_begin_messages * / <nl> + uint32_t flags ; <nl> + / * * Reserved for future usage * / <nl> + void * reserved ; <nl> + union { <nl> + / * * Reserved for future usage * / <nl> + struct { <nl> + void * reserved [ 8 ] ; <nl> + } reserved ; <nl> + struct { <nl> + size_t count ; <nl> + grpc_metadata * metadata ; <nl> + } send_initial_metadata ; <nl> + grpc_byte_buffer * send_message ; <nl> + struct { <nl> + size_t trailing_metadata_count ; <nl> + grpc_metadata * trailing_metadata ; <nl> + grpc_status_code status ; <nl> + const char * status_details ; <nl> + } send_status_from_server ; <nl> + / * * ownership of the array is with the caller , but ownership of the elements <nl> + stays with the call object ( ie key , value members are owned by the call <nl> + object , recv_initial_metadata - > array is owned by the caller ) . <nl> + After the operation completes , call grpc_metadata_array_destroy on this <nl> + value , or reuse it in a future op . * / <nl> + grpc_metadata_array * recv_initial_metadata ; <nl> + / * * ownership of the byte buffer is moved to the caller ; the caller must <nl> + call grpc_byte_buffer_destroy on this value , or reuse it in a future op . <nl> + * / <nl> + grpc_byte_buffer * * recv_message ; <nl> + struct { <nl> + / * * ownership of the array is with the caller , but ownership of the <nl> + elements stays with the call object ( ie key , value members are owned <nl> + by the call object , trailing_metadata - > array is owned by the caller ) . <nl> + After the operation completes , call grpc_metadata_array_destroy on <nl> + this <nl> + value , or reuse it in a future op . * / <nl> + grpc_metadata_array * trailing_metadata ; <nl> + grpc_status_code * status ; <nl> + / * * status_details is a buffer owned by the application before the op <nl> + completes and after the op has completed . During the operation <nl> + status_details may be reallocated to a size larger than <nl> + * status_details_capacity , in which case * status_details_capacity will <nl> + be updated with the new array capacity . <nl> + <nl> + Pre - allocating space : <nl> + size_t my_capacity = 8 ; <nl> + char * my_details = gpr_malloc ( my_capacity ) ; <nl> + x . status_details = & my_details ; <nl> + x . status_details_capacity = & my_capacity ; <nl> + <nl> + Not pre - allocating space : <nl> + size_t my_capacity = 0 ; <nl> + char * my_details = NULL ; <nl> + x . status_details = & my_details ; <nl> + x . status_details_capacity = & my_capacity ; <nl> + <nl> + After the call : <nl> + gpr_free ( my_details ) ; * / <nl> + char * * status_details ; <nl> + size_t * status_details_capacity ; <nl> + } recv_status_on_client ; <nl> + struct { <nl> + / * * out argument , set to 1 if the call failed in any way ( seen as a <nl> + cancellation on the server ) , or 0 if the call succeeded * / <nl> + int * cancelled ; <nl> + } recv_close_on_server ; <nl> + } data ; <nl> + } grpc_op ; <nl> + <nl> + # ifdef __cplusplus <nl> + } <nl> + # endif <nl> + <nl> + # endif / * GRPC_IMPL_CODEGEN_GRPC_TYPES_H * / <nl> new file mode 100644 <nl> index 00000000000 . . 30f6a5dcc56 <nl> mmm / dev / null <nl> ppp b / include / grpc / impl / codegen / log . h <nl> <nl> + / * <nl> + * <nl> + * Copyright 2015 , Google Inc . <nl> + * All rights reserved . <nl> + * <nl> + * Redistribution and use in source and binary forms , with or without <nl> + * modification , are permitted provided that the following conditions are <nl> + * met : <nl> + * <nl> + * * Redistributions of source code must retain the above copyright <nl> + * notice , this list of conditions and the following disclaimer . <nl> + * * Redistributions in binary form must reproduce the above <nl> + * copyright notice , this list of conditions and the following disclaimer <nl> + * in the documentation and / or other materials provided with the <nl> + * distribution . <nl> + * * Neither the name of Google Inc . nor the names of its <nl> + * contributors may be used to endorse or promote products derived from <nl> + * this software without specific prior written permission . <nl> + * <nl> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> + * " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> + * LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> + * A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> + * SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> + * LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> + * DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> + * THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> + * ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> + * OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> + * <nl> + * / <nl> + <nl> + # ifndef GRPC_IMPL_CODEGEN_LOG_H <nl> + # define GRPC_IMPL_CODEGEN_LOG_H <nl> + <nl> + # include < stdlib . h > / * for abort ( ) * / <nl> + # include < stdarg . h > <nl> + <nl> + # ifdef __cplusplus <nl> + extern " C " { <nl> + # endif <nl> + <nl> + / * GPR log API . <nl> + <nl> + Usage ( within grpc ) : <nl> + <nl> + int argument1 = 3 ; <nl> + char * argument2 = " hello " ; <nl> + gpr_log ( GPR_DEBUG , " format string % d " , argument1 ) ; <nl> + gpr_log ( GPR_INFO , " hello world " ) ; <nl> + gpr_log ( GPR_ERROR , " % d % s ! ! " , argument1 , argument2 ) ; * / <nl> + <nl> + / * The severity of a log message - use the # defines below when calling into <nl> + gpr_log to additionally supply file and line data * / <nl> + typedef enum gpr_log_severity { <nl> + GPR_LOG_SEVERITY_DEBUG , <nl> + GPR_LOG_SEVERITY_INFO , <nl> + GPR_LOG_SEVERITY_ERROR <nl> + } gpr_log_severity ; <nl> + <nl> + / * Returns a string representation of the log severity * / <nl> + const char * gpr_log_severity_string ( gpr_log_severity severity ) ; <nl> + <nl> + / * Macros to build log contexts at various severity levels * / <nl> + # define GPR_DEBUG __FILE__ , __LINE__ , GPR_LOG_SEVERITY_DEBUG <nl> + # define GPR_INFO __FILE__ , __LINE__ , GPR_LOG_SEVERITY_INFO <nl> + # define GPR_ERROR __FILE__ , __LINE__ , GPR_LOG_SEVERITY_ERROR <nl> + <nl> + / * Log a message . It ' s advised to use GPR_xxx above to generate the context <nl> + * for each message * / <nl> + void gpr_log ( const char * file , int line , gpr_log_severity severity , <nl> + const char * format , . . . ) ; <nl> + <nl> + void gpr_log_message ( const char * file , int line , gpr_log_severity severity , <nl> + const char * message ) ; <nl> + <nl> + / * Log overrides : applications can use this API to intercept logging calls <nl> + and use their own implementations * / <nl> + <nl> + typedef struct { <nl> + const char * file ; <nl> + int line ; <nl> + gpr_log_severity severity ; <nl> + const char * message ; <nl> + } gpr_log_func_args ; <nl> + <nl> + typedef void ( * gpr_log_func ) ( gpr_log_func_args * args ) ; <nl> + void gpr_set_log_function ( gpr_log_func func ) ; <nl> + <nl> + / * abort ( ) the process if x is zero , having written a line to the log . <nl> + <nl> + Intended for internal invariants . If the error can be recovered from , <nl> + without the possibility of corruption , or might best be reflected via <nl> + an exception in a higher - level language , consider returning error code . * / <nl> + # define GPR_ASSERT ( x ) \ <nl> + do { \ <nl> + if ( ! ( x ) ) { \ <nl> + gpr_log ( GPR_ERROR , " assertion failed : % s " , # x ) ; \ <nl> + abort ( ) ; \ <nl> + } \ <nl> + } while ( 0 ) <nl> + <nl> + # ifdef __cplusplus <nl> + } <nl> + # endif <nl> + <nl> + # endif / * GRPC_IMPL_CODEGEN_LOG_H * / <nl> new file mode 100644 <nl> index 00000000000 . . 9cb8788e2b6 <nl> mmm / dev / null <nl> ppp b / include / grpc / impl / codegen / propagation_bits . h <nl> <nl> + / * <nl> + * <nl> + * Copyright 2016 , Google Inc . <nl> + * All rights reserved . <nl> + * <nl> + * Redistribution and use in source and binary forms , with or without <nl> + * modification , are permitted provided that the following conditions are <nl> + * met : <nl> + * <nl> + * * Redistributions of source code must retain the above copyright <nl> + * notice , this list of conditions and the following disclaimer . <nl> + * * Redistributions in binary form must reproduce the above <nl> + * copyright notice , this list of conditions and the following disclaimer <nl> + * in the documentation and / or other materials provided with the <nl> + * distribution . <nl> + * * Neither the name of Google Inc . nor the names of its <nl> + * contributors may be used to endorse or promote products derived from <nl> + * this software without specific prior written permission . <nl> + * <nl> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> + * " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> + * LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> + * A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> + * SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> + * LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> + * DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> + * THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> + * ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> + * OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> + * <nl> + * / <nl> + <nl> + # ifndef GRPC_IMPL_CODEGEN_H <nl> + # define GRPC_IMPL_CODEGEN_H <nl> + <nl> + # include < stdint . h > <nl> + <nl> + # ifdef __cplusplus <nl> + extern " C " { <nl> + # endif <nl> + <nl> + / * Propagation bits : this can be bitwise or - ed to form propagation_mask for <nl> + * grpc_call * / <nl> + / * * Propagate deadline * / <nl> + # define GRPC_PROPAGATE_DEADLINE ( ( uint32_t ) 1 ) <nl> + / * * Propagate census context * / <nl> + # define GRPC_PROPAGATE_CENSUS_STATS_CONTEXT ( ( uint32_t ) 2 ) <nl> + # define GRPC_PROPAGATE_CENSUS_TRACING_CONTEXT ( ( uint32_t ) 4 ) <nl> + / * * Propagate cancellation * / <nl> + # define GRPC_PROPAGATE_CANCELLATION ( ( uint32_t ) 8 ) <nl> + <nl> + / * Default propagation mask : clients of the core API are encouraged to encode <nl> + deltas from this in their implementations . . . ie write : <nl> + GRPC_PROPAGATE_DEFAULTS & ~ GRPC_PROPAGATE_DEADLINE to disable deadline <nl> + propagation . Doing so gives flexibility in the future to define new <nl> + propagation types that are default inherited or not . * / <nl> + # define GRPC_PROPAGATE_DEFAULTS \ <nl> + ( ( uint32_t ) ( ( \ <nl> + 0xffff | GRPC_PROPAGATE_DEADLINE | GRPC_PROPAGATE_CENSUS_STATS_CONTEXT | \ <nl> + GRPC_PROPAGATE_CENSUS_TRACING_CONTEXT | GRPC_PROPAGATE_CANCELLATION ) ) ) <nl> + <nl> + # ifdef __cplusplus <nl> + } <nl> + # endif <nl> + <nl> + <nl> + # endif / * GRPC_IMPL_CODEGEN_H * / <nl> new file mode 100644 <nl> index 00000000000 . . 296ef998410 <nl> mmm / dev / null <nl> ppp b / include / grpc / impl / codegen / slice . h <nl> <nl> + / * <nl> + * <nl> + * Copyright 2015 , Google Inc . <nl> + * All rights reserved . <nl> + * <nl> + * Redistribution and use in source and binary forms , with or without <nl> + * modification , are permitted provided that the following conditions are <nl> + * met : <nl> + * <nl> + * * Redistributions of source code must retain the above copyright <nl> + * notice , this list of conditions and the following disclaimer . <nl> + * * Redistributions in binary form must reproduce the above <nl> + * copyright notice , this list of conditions and the following disclaimer <nl> + * in the documentation and / or other materials provided with the <nl> + * distribution . <nl> + * * Neither the name of Google Inc . nor the names of its <nl> + * contributors may be used to endorse or promote products derived from <nl> + * this software without specific prior written permission . <nl> + * <nl> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> + * " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> + * LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> + * A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> + * SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> + * LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> + * DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> + * THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> + * ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> + * OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> + * <nl> + * / <nl> + <nl> + # ifndef GRPC_IMPL_CODEGEN_SLICE_H <nl> + # define GRPC_IMPL_CODEGEN_SLICE_H <nl> + <nl> + # include < grpc / impl / codegen / sync . h > <nl> + <nl> + # include < stddef . h > <nl> + <nl> + # ifdef __cplusplus <nl> + extern " C " { <nl> + # endif <nl> + <nl> + / * Slice API <nl> + <nl> + A slice represents a contiguous reference counted array of bytes . <nl> + It is cheap to take references to a slice , and it is cheap to create a <nl> + slice pointing to a subset of another slice . <nl> + <nl> + The data - structure for slices is exposed here to allow non - gpr code to <nl> + build slices from whatever data they have available . <nl> + <nl> + When defining interfaces that handle slices , care should be taken to define <nl> + reference ownership semantics ( who should call unref ? ) and mutability <nl> + constraints ( is the callee allowed to modify the slice ? ) * / <nl> + <nl> + / * Reference count container for gpr_slice . Contains function pointers to <nl> + increment and decrement reference counts . Implementations should cleanup <nl> + when the reference count drops to zero . <nl> + Typically client code should not touch this , and use gpr_slice_malloc , <nl> + gpr_slice_new , or gpr_slice_new_with_len instead . * / <nl> + typedef struct gpr_slice_refcount { <nl> + void ( * ref ) ( void * ) ; <nl> + void ( * unref ) ( void * ) ; <nl> + } gpr_slice_refcount ; <nl> + <nl> + # define GPR_SLICE_INLINED_SIZE ( sizeof ( size_t ) + sizeof ( uint8_t * ) - 1 ) <nl> + <nl> + / * A gpr_slice s , if initialized , represents the byte range <nl> + s . bytes [ 0 . . s . length - 1 ] . <nl> + <nl> + It can have an associated ref count which has a destruction routine to be run <nl> + when the ref count reaches zero ( see gpr_slice_new ( ) and grp_slice_unref ( ) ) . <nl> + Multiple gpr_slice values may share a ref count . <nl> + <nl> + If the slice does not have a refcount , it represents an inlined small piece <nl> + of data that is copied by value . * / <nl> + typedef struct gpr_slice { <nl> + struct gpr_slice_refcount * refcount ; <nl> + union { <nl> + struct { <nl> + uint8_t * bytes ; <nl> + size_t length ; <nl> + } refcounted ; <nl> + struct { <nl> + uint8_t length ; <nl> + uint8_t bytes [ GPR_SLICE_INLINED_SIZE ] ; <nl> + } inlined ; <nl> + } data ; <nl> + } gpr_slice ; <nl> + <nl> + # define GPR_SLICE_START_PTR ( slice ) \ <nl> + ( ( slice ) . refcount ? ( slice ) . data . refcounted . bytes \ <nl> + : ( slice ) . data . inlined . bytes ) <nl> + # define GPR_SLICE_LENGTH ( slice ) \ <nl> + ( ( slice ) . refcount ? ( slice ) . data . refcounted . length \ <nl> + : ( slice ) . data . inlined . length ) <nl> + # define GPR_SLICE_SET_LENGTH ( slice , newlen ) \ <nl> + ( ( slice ) . refcount ? ( ( slice ) . data . refcounted . length = ( size_t ) ( newlen ) ) \ <nl> + : ( ( slice ) . data . inlined . length = ( uint8_t ) ( newlen ) ) ) <nl> + # define GPR_SLICE_END_PTR ( slice ) \ <nl> + GPR_SLICE_START_PTR ( slice ) + GPR_SLICE_LENGTH ( slice ) <nl> + # define GPR_SLICE_IS_EMPTY ( slice ) ( GPR_SLICE_LENGTH ( slice ) = = 0 ) <nl> + <nl> + / * Increment the refcount of s . Requires slice is initialized . <nl> + Returns s . * / <nl> + gpr_slice gpr_slice_ref ( gpr_slice s ) ; <nl> + <nl> + / * Decrement the ref count of s . If the ref count of s reaches zero , all <nl> + slices sharing the ref count are destroyed , and considered no longer <nl> + initialized . If s is ultimately derived from a call to gpr_slice_new ( start , <nl> + len , dest ) where dest ! = NULL , then ( * dest ) ( start ) is called , else if s is <nl> + ultimately derived from a call to gpr_slice_new_with_len ( start , len , dest ) <nl> + where dest ! = NULL , then ( * dest ) ( start , len ) . Requires s initialized . * / <nl> + void gpr_slice_unref ( gpr_slice s ) ; <nl> + <nl> + / * Create a slice pointing at some data . Calls malloc to allocate a refcount <nl> + for the object , and arranges that destroy will be called with the pointer <nl> + passed in at destruction . * / <nl> + gpr_slice gpr_slice_new ( void * p , size_t len , void ( * destroy ) ( void * ) ) ; <nl> + <nl> + / * Equivalent to gpr_slice_new , but with a two argument destroy function that <nl> + also takes the slice length . * / <nl> + gpr_slice gpr_slice_new_with_len ( void * p , size_t len , <nl> + void ( * destroy ) ( void * , size_t ) ) ; <nl> + <nl> + / * Equivalent to gpr_slice_new ( malloc ( len ) , len , free ) , but saves one malloc ( ) <nl> + call . <nl> + Aborts if malloc ( ) fails . * / <nl> + gpr_slice gpr_slice_malloc ( size_t length ) ; <nl> + <nl> + / * Create a slice by copying a string . <nl> + Does not preserve null terminators . <nl> + Equivalent to : <nl> + size_t len = strlen ( source ) ; <nl> + gpr_slice slice = gpr_slice_malloc ( len ) ; <nl> + memcpy ( slice - > data , source , len ) ; * / <nl> + gpr_slice gpr_slice_from_copied_string ( const char * source ) ; <nl> + <nl> + / * Create a slice by copying a buffer . <nl> + Equivalent to : <nl> + gpr_slice slice = gpr_slice_malloc ( len ) ; <nl> + memcpy ( slice - > data , source , len ) ; * / <nl> + gpr_slice gpr_slice_from_copied_buffer ( const char * source , size_t len ) ; <nl> + <nl> + / * Create a slice pointing to constant memory * / <nl> + gpr_slice gpr_slice_from_static_string ( const char * source ) ; <nl> + <nl> + / * Return a result slice derived from s , which shares a ref count with s , where <nl> + result . data = = s . data + begin , and result . length = = end - begin . <nl> + The ref count of s is increased by one . <nl> + Requires s initialized , begin < = end , begin < = s . length , and <nl> + end < = source - > length . * / <nl> + gpr_slice gpr_slice_sub ( gpr_slice s , size_t begin , size_t end ) ; <nl> + <nl> + / * The same as gpr_slice_sub , but without altering the ref count * / <nl> + gpr_slice gpr_slice_sub_no_ref ( gpr_slice s , size_t begin , size_t end ) ; <nl> + <nl> + / * Splits s into two : modifies s to be s [ 0 : split ] , and returns a new slice , <nl> + sharing a refcount with s , that contains s [ split : s . length ] . <nl> + Requires s intialized , split < = s . length * / <nl> + gpr_slice gpr_slice_split_tail ( gpr_slice * s , size_t split ) ; <nl> + <nl> + / * Splits s into two : modifies s to be s [ split : s . length ] , and returns a new <nl> + slice , sharing a refcount with s , that contains s [ 0 : split ] . <nl> + Requires s intialized , split < = s . length * / <nl> + gpr_slice gpr_slice_split_head ( gpr_slice * s , size_t split ) ; <nl> + <nl> + gpr_slice gpr_empty_slice ( void ) ; <nl> + <nl> + / * Returns < 0 if a < b , = = 0 if a = = b , > 0 if a > b <nl> + The order is arbitrary , and is not guaranteed to be stable across different <nl> + versions of the API . * / <nl> + int gpr_slice_cmp ( gpr_slice a , gpr_slice b ) ; <nl> + int gpr_slice_str_cmp ( gpr_slice a , const char * b ) ; <nl> + <nl> + # ifdef __cplusplus <nl> + } <nl> + # endif <nl> + <nl> + # endif / * GRPC_IMPL_CODEGEN_SLICE_H * / <nl> new file mode 100644 <nl> index 00000000000 . . b8d6a11d8b6 <nl> mmm / dev / null <nl> ppp b / include / grpc / impl / codegen / slice_buffer . h <nl> <nl> + / * <nl> + * <nl> + * Copyright 2015 , Google Inc . <nl> + * All rights reserved . <nl> + * <nl> + * Redistribution and use in source and binary forms , with or without <nl> + * modification , are permitted provided that the following conditions are <nl> + * met : <nl> + * <nl> + * * Redistributions of source code must retain the above copyright <nl> + * notice , this list of conditions and the following disclaimer . <nl> + * * Redistributions in binary form must reproduce the above <nl> + * copyright notice , this list of conditions and the following disclaimer <nl> + * in the documentation and / or other materials provided with the <nl> + * distribution . <nl> + * * Neither the name of Google Inc . nor the names of its <nl> + * contributors may be used to endorse or promote products derived from <nl> + * this software without specific prior written permission . <nl> + * <nl> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> + * " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> + * LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> + * A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> + * SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> + * LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> + * DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> + * THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> + * ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> + * OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> + * <nl> + * / <nl> + <nl> + # ifndef GRPC_IMPL_CODEGEN_SLICE_BUFFER_H <nl> + # define GRPC_IMPL_CODEGEN_SLICE_BUFFER_H <nl> + <nl> + # include < grpc / impl / codegen / slice . h > <nl> + <nl> + # ifdef __cplusplus <nl> + extern " C " { <nl> + # endif <nl> + <nl> + # define GRPC_SLICE_BUFFER_INLINE_ELEMENTS 8 <nl> + <nl> + / * Represents an expandable array of slices , to be interpreted as a single item <nl> + TODO ( ctiller ) : inline some small number of elements into the struct , to <nl> + avoid per - call allocations * / <nl> + typedef struct { <nl> + / * slices in the array * / <nl> + gpr_slice * slices ; <nl> + / * the number of slices in the array * / <nl> + size_t count ; <nl> + / * the number of slices allocated in the array * / <nl> + size_t capacity ; <nl> + / * the combined length of all slices in the array * / <nl> + size_t length ; <nl> + / * inlined elements to avoid allocations * / <nl> + gpr_slice inlined [ GRPC_SLICE_BUFFER_INLINE_ELEMENTS ] ; <nl> + } gpr_slice_buffer ; <nl> + <nl> + / * initialize a slice buffer * / <nl> + void gpr_slice_buffer_init ( gpr_slice_buffer * sb ) ; <nl> + / * destroy a slice buffer - unrefs any held elements * / <nl> + void gpr_slice_buffer_destroy ( gpr_slice_buffer * sb ) ; <nl> + / * Add an element to a slice buffer - takes ownership of the slice . <nl> + This function is allowed to concatenate the passed in slice to the end of <nl> + some other slice if desired by the slice buffer . * / <nl> + void gpr_slice_buffer_add ( gpr_slice_buffer * sb , gpr_slice slice ) ; <nl> + / * add an element to a slice buffer - takes ownership of the slice and returns <nl> + the index of the slice . <nl> + Guarantees that the slice will not be concatenated at the end of another <nl> + slice ( i . e . the data for this slice will begin at the first byte of the <nl> + slice at the returned index in sb - > slices ) <nl> + The implementation MAY decide to concatenate data at the end of a small <nl> + slice added in this fashion . * / <nl> + size_t gpr_slice_buffer_add_indexed ( gpr_slice_buffer * sb , gpr_slice slice ) ; <nl> + void gpr_slice_buffer_addn ( gpr_slice_buffer * sb , gpr_slice * slices , size_t n ) ; <nl> + / * add a very small ( less than 8 bytes ) amount of data to the end of a slice <nl> + buffer : returns a pointer into which to add the data * / <nl> + uint8_t * gpr_slice_buffer_tiny_add ( gpr_slice_buffer * sb , size_t len ) ; <nl> + / * pop the last buffer , but don ' t unref it * / <nl> + void gpr_slice_buffer_pop ( gpr_slice_buffer * sb ) ; <nl> + / * clear a slice buffer , unref all elements * / <nl> + void gpr_slice_buffer_reset_and_unref ( gpr_slice_buffer * sb ) ; <nl> + / * swap the contents of two slice buffers * / <nl> + void gpr_slice_buffer_swap ( gpr_slice_buffer * a , gpr_slice_buffer * b ) ; <nl> + / * move all of the elements of src into dst * / <nl> + void gpr_slice_buffer_move_into ( gpr_slice_buffer * src , gpr_slice_buffer * dst ) ; <nl> + / * remove n bytes from the end of a slice buffer * / <nl> + void gpr_slice_buffer_trim_end ( gpr_slice_buffer * src , size_t n , <nl> + gpr_slice_buffer * garbage ) ; <nl> + / * move the first n bytes of src into dst * / <nl> + void gpr_slice_buffer_move_first ( gpr_slice_buffer * src , size_t n , <nl> + gpr_slice_buffer * dst ) ; <nl> + / * take the first slice in the slice buffer * / <nl> + gpr_slice gpr_slice_buffer_take_first ( gpr_slice_buffer * src ) ; <nl> + <nl> + # ifdef __cplusplus <nl> + } <nl> + # endif <nl> + <nl> + # endif / * GRPC_IMPL_CODEGEN_SLICE_BUFFER_H * / <nl> new file mode 100644 <nl> index 00000000000 . . 29e4570f7ce <nl> mmm / dev / null <nl> ppp b / include / grpc / impl / codegen / status . h <nl> <nl> + / * <nl> + * <nl> + * Copyright 2015 , Google Inc . <nl> + * All rights reserved . <nl> + * <nl> + * Redistribution and use in source and binary forms , with or without <nl> + * modification , are permitted provided that the following conditions are <nl> + * met : <nl> + * <nl> + * * Redistributions of source code must retain the above copyright <nl> + * notice , this list of conditions and the following disclaimer . <nl> + * * Redistributions in binary form must reproduce the above <nl> + * copyright notice , this list of conditions and the following disclaimer <nl> + * in the documentation and / or other materials provided with the <nl> + * distribution . <nl> + * * Neither the name of Google Inc . nor the names of its <nl> + * contributors may be used to endorse or promote products derived from <nl> + * this software without specific prior written permission . <nl> + * <nl> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> + * " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> + * LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> + * A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> + * SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> + * LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> + * DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> + * THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> + * ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> + * OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> + * <nl> + * / <nl> + <nl> + # ifndef GRPC_IMPL_CODEGEN_STATUS_H <nl> + # define GRPC_IMPL_CODEGEN_STATUS_H <nl> + <nl> + # ifdef __cplusplus <nl> + extern " C " { <nl> + # endif <nl> + <nl> + typedef enum { <nl> + / * Not an error ; returned on success * / <nl> + GRPC_STATUS_OK = 0 , <nl> + <nl> + / * The operation was cancelled ( typically by the caller ) . * / <nl> + GRPC_STATUS_CANCELLED = 1 , <nl> + <nl> + / * Unknown error . An example of where this error may be returned is <nl> + if a Status value received from another address space belongs to <nl> + an error - space that is not known in this address space . Also <nl> + errors raised by APIs that do not return enough error information <nl> + may be converted to this error . * / <nl> + GRPC_STATUS_UNKNOWN = 2 , <nl> + <nl> + / * Client specified an invalid argument . Note that this differs <nl> + from FAILED_PRECONDITION . INVALID_ARGUMENT indicates arguments <nl> + that are problematic regardless of the state of the system <nl> + ( e . g . , a malformed file name ) . * / <nl> + GRPC_STATUS_INVALID_ARGUMENT = 3 , <nl> + <nl> + / * Deadline expired before operation could complete . For operations <nl> + that change the state of the system , this error may be returned <nl> + even if the operation has completed successfully . For example , a <nl> + successful response from a server could have been delayed long <nl> + enough for the deadline to expire . * / <nl> + GRPC_STATUS_DEADLINE_EXCEEDED = 4 , <nl> + <nl> + / * Some requested entity ( e . g . , file or directory ) was not found . * / <nl> + GRPC_STATUS_NOT_FOUND = 5 , <nl> + <nl> + / * Some entity that we attempted to create ( e . g . , file or directory ) <nl> + already exists . * / <nl> + GRPC_STATUS_ALREADY_EXISTS = 6 , <nl> + <nl> + / * The caller does not have permission to execute the specified <nl> + operation . PERMISSION_DENIED must not be used for rejections <nl> + caused by exhausting some resource ( use RESOURCE_EXHAUSTED <nl> + instead for those errors ) . PERMISSION_DENIED must not be <nl> + used if the caller can not be identified ( use UNAUTHENTICATED <nl> + instead for those errors ) . * / <nl> + GRPC_STATUS_PERMISSION_DENIED = 7 , <nl> + <nl> + / * The request does not have valid authentication credentials for the <nl> + operation . * / <nl> + GRPC_STATUS_UNAUTHENTICATED = 16 , <nl> + <nl> + / * Some resource has been exhausted , perhaps a per - user quota , or <nl> + perhaps the entire file system is out of space . * / <nl> + GRPC_STATUS_RESOURCE_EXHAUSTED = 8 , <nl> + <nl> + / * Operation was rejected because the system is not in a state <nl> + required for the operation ' s execution . For example , directory <nl> + to be deleted may be non - empty , an rmdir operation is applied to <nl> + a non - directory , etc . <nl> + <nl> + A litmus test that may help a service implementor in deciding <nl> + between FAILED_PRECONDITION , ABORTED , and UNAVAILABLE : <nl> + ( a ) Use UNAVAILABLE if the client can retry just the failing call . <nl> + ( b ) Use ABORTED if the client should retry at a higher - level <nl> + ( e . g . , restarting a read - modify - write sequence ) . <nl> + ( c ) Use FAILED_PRECONDITION if the client should not retry until <nl> + the system state has been explicitly fixed . E . g . , if an " rmdir " <nl> + fails because the directory is non - empty , FAILED_PRECONDITION <nl> + should be returned since the client should not retry unless <nl> + they have first fixed up the directory by deleting files from it . <nl> + ( d ) Use FAILED_PRECONDITION if the client performs conditional <nl> + REST Get / Update / Delete on a resource and the resource on the <nl> + server does not match the condition . E . g . , conflicting <nl> + read - modify - write on the same resource . * / <nl> + GRPC_STATUS_FAILED_PRECONDITION = 9 , <nl> + <nl> + / * The operation was aborted , typically due to a concurrency issue <nl> + like sequencer check failures , transaction aborts , etc . <nl> + <nl> + See litmus test above for deciding between FAILED_PRECONDITION , <nl> + ABORTED , and UNAVAILABLE . * / <nl> + GRPC_STATUS_ABORTED = 10 , <nl> + <nl> + / * Operation was attempted past the valid range . E . g . , seeking or <nl> + reading past end of file . <nl> + <nl> + Unlike INVALID_ARGUMENT , this error indicates a problem that may <nl> + be fixed if the system state changes . For example , a 32 - bit file <nl> + system will generate INVALID_ARGUMENT if asked to read at an <nl> + offset that is not in the range [ 0 , 2 ^ 32 - 1 ] , but it will generate <nl> + OUT_OF_RANGE if asked to read from an offset past the current <nl> + file size . <nl> + <nl> + There is a fair bit of overlap between FAILED_PRECONDITION and <nl> + OUT_OF_RANGE . We recommend using OUT_OF_RANGE ( the more specific <nl> + error ) when it applies so that callers who are iterating through <nl> + a space can easily look for an OUT_OF_RANGE error to detect when <nl> + they are done . * / <nl> + GRPC_STATUS_OUT_OF_RANGE = 11 , <nl> + <nl> + / * Operation is not implemented or not supported / enabled in this service . * / <nl> + GRPC_STATUS_UNIMPLEMENTED = 12 , <nl> + <nl> + / * Internal errors . Means some invariants expected by underlying <nl> + system has been broken . If you see one of these errors , <nl> + something is very broken . * / <nl> + GRPC_STATUS_INTERNAL = 13 , <nl> + <nl> + / * The service is currently unavailable . This is a most likely a <nl> + transient condition and may be corrected by retrying with <nl> + a backoff . <nl> + <nl> + See litmus test above for deciding between FAILED_PRECONDITION , <nl> + ABORTED , and UNAVAILABLE . * / <nl> + GRPC_STATUS_UNAVAILABLE = 14 , <nl> + <nl> + / * Unrecoverable data loss or corruption . * / <nl> + GRPC_STATUS_DATA_LOSS = 15 , <nl> + <nl> + / * Force users to include a default branch : * / <nl> + GRPC_STATUS__DO_NOT_USE = - 1 <nl> + } grpc_status_code ; <nl> + <nl> + # ifdef __cplusplus <nl> + } <nl> + # endif <nl> + <nl> + # endif / * GRPC_IMPL_CODEGEN_STATUS_H * / <nl> new file mode 100644 <nl> index 00000000000 . . 052e39d8a09 <nl> mmm / dev / null <nl> ppp b / include / grpc / impl / codegen / sync . h <nl> <nl> + / * <nl> + * <nl> + * Copyright 2016 , Google Inc . <nl> + * All rights reserved . <nl> + * <nl> + * Redistribution and use in source and binary forms , with or without <nl> + * modification , are permitted provided that the following conditions are <nl> + * met : <nl> + * <nl> + * * Redistributions of source code must retain the above copyright <nl> + * notice , this list of conditions and the following disclaimer . <nl> + * * Redistributions in binary form must reproduce the above <nl> + * copyright notice , this list of conditions and the following disclaimer <nl> + * in the documentation and / or other materials provided with the <nl> + * distribution . <nl> + * * Neither the name of Google Inc . nor the names of its <nl> + * contributors may be used to endorse or promote products derived from <nl> + * this software without specific prior written permission . <nl> + * <nl> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> + * " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> + * LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> + * A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> + * SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> + * LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> + * DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> + * THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> + * ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> + * OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> + * <nl> + * / <nl> + <nl> + # ifndef GRPC_IMPL_CODEGEN_SYNC_H <nl> + # define GRPC_IMPL_CODEGEN_SYNC_H <nl> + / * Synchronization primitives for GPR . <nl> + <nl> + The type gpr_mu provides a non - reentrant mutex ( lock ) . <nl> + <nl> + The type gpr_cv provides a condition variable . <nl> + <nl> + The type gpr_once provides for one - time initialization . <nl> + <nl> + The type gpr_event provides one - time - setting , reading , and <nl> + waiting of a void * , with memory barriers . <nl> + <nl> + The type gpr_refcount provides an object reference counter , <nl> + with memory barriers suitable to control <nl> + object lifetimes . <nl> + <nl> + The type gpr_stats_counter provides an atomic statistics counter . It <nl> + provides no memory barriers . <nl> + * / <nl> + <nl> + / * Platform - specific type declarations of gpr_mu and gpr_cv . * / <nl> + # include < grpc / impl / codegen / port_platform . h > <nl> + # include < grpc / impl / codegen / sync_generic . h > <nl> + <nl> + # if defined ( GPR_POSIX_SYNC ) <nl> + # include < grpc / impl / codegen / sync_posix . h > <nl> + # elif defined ( GPR_WIN32 ) <nl> + # include < grpc / impl / codegen / sync_win32 . h > <nl> + # elif ! defined ( GPR_CUSTOM_SYNC ) <nl> + # error Unable to determine platform for sync <nl> + # endif <nl> + <nl> + # include < grpc / impl / codegen / time . h > / * for gpr_timespec * / <nl> + <nl> + # ifdef __cplusplus <nl> + extern " C " { <nl> + # endif <nl> + <nl> + / * mmm Mutex interface mmm <nl> + <nl> + At most one thread may hold an exclusive lock on a mutex at any given time . <nl> + Actions taken by a thread that holds a mutex exclusively happen after <nl> + actions taken by all previous holders of the mutex . Variables of type <nl> + gpr_mu are uninitialized when first declared . * / <nl> + <nl> + / * Initialize * mu . Requires : * mu uninitialized . * / <nl> + void gpr_mu_init ( gpr_mu * mu ) ; <nl> + <nl> + / * Cause * mu no longer to be initialized , freeing any memory in use . Requires : <nl> + * mu initialized ; no other concurrent operation on * mu . * / <nl> + void gpr_mu_destroy ( gpr_mu * mu ) ; <nl> + <nl> + / * Wait until no thread has a lock on * mu , cause the calling thread to own an <nl> + exclusive lock on * mu , then return . May block indefinitely or crash if the <nl> + calling thread has a lock on * mu . Requires : * mu initialized . * / <nl> + void gpr_mu_lock ( gpr_mu * mu ) ; <nl> + <nl> + / * Release an exclusive lock on * mu held by the calling thread . Requires : * mu <nl> + initialized ; the calling thread holds an exclusive lock on * mu . * / <nl> + void gpr_mu_unlock ( gpr_mu * mu ) ; <nl> + <nl> + / * Without blocking , attempt to acquire an exclusive lock on * mu for the <nl> + calling thread , then return non - zero iff success . Fail , if any thread holds <nl> + the lock ; succeeds with high probability if no thread holds the lock . <nl> + Requires : * mu initialized . * / <nl> + int gpr_mu_trylock ( gpr_mu * mu ) ; <nl> + <nl> + / * mmm Condition variable interface mmm <nl> + <nl> + A while - loop should be used with gpr_cv_wait ( ) when waiting for conditions <nl> + to become true . See the example below . Variables of type gpr_cv are <nl> + uninitialized when first declared . * / <nl> + <nl> + / * Initialize * cv . Requires : * cv uninitialized . * / <nl> + void gpr_cv_init ( gpr_cv * cv ) ; <nl> + <nl> + / * Cause * cv no longer to be initialized , freeing any memory in use . Requires : <nl> + * cv initialized ; no other concurrent operation on * cv . * / <nl> + void gpr_cv_destroy ( gpr_cv * cv ) ; <nl> + <nl> + / * Atomically release * mu and wait on * cv . When the calling thread is woken <nl> + from * cv or the deadline abs_deadline is exceeded , execute gpr_mu_lock ( mu ) <nl> + and return whether the deadline was exceeded . Use <nl> + abs_deadline = = gpr_inf_future for no deadline . May return even when not <nl> + woken explicitly . Requires : * mu and * cv initialized ; the calling thread <nl> + holds an exclusive lock on * mu . * / <nl> + int gpr_cv_wait ( gpr_cv * cv , gpr_mu * mu , gpr_timespec abs_deadline ) ; <nl> + <nl> + / * If any threads are waiting on * cv , wake at least one . <nl> + Clients may treat this as an optimization of gpr_cv_broadcast ( ) <nl> + for use in the case where waking more than one waiter is not useful . <nl> + Requires : * cv initialized . * / <nl> + void gpr_cv_signal ( gpr_cv * cv ) ; <nl> + <nl> + / * Wake all threads waiting on * cv . Requires : * cv initialized . * / <nl> + void gpr_cv_broadcast ( gpr_cv * cv ) ; <nl> + <nl> + / * mmm One - time initialization mmm <nl> + <nl> + gpr_once must be declared with static storage class , and initialized with <nl> + GPR_ONCE_INIT . e . g . , <nl> + static gpr_once once_var = GPR_ONCE_INIT ; * / <nl> + <nl> + / * Ensure that ( * init_routine ) ( ) has been called exactly once ( for the <nl> + specified gpr_once instance ) and then return . <nl> + If multiple threads call gpr_once ( ) on the same gpr_once instance , one of <nl> + them will call ( * init_routine ) ( ) , and the others will block until that call <nl> + finishes . * / <nl> + void gpr_once_init ( gpr_once * once , void ( * init_routine ) ( void ) ) ; <nl> + <nl> + / * mmm One - time event notification mmm <nl> + <nl> + These operations act on a gpr_event , which should be initialized with <nl> + gpr_ev_init ( ) , or with GPR_EVENT_INIT if static , e . g . , <nl> + static gpr_event event_var = GPR_EVENT_INIT ; <nl> + It requires no destruction . * / <nl> + <nl> + / * Initialize * ev . * / <nl> + void gpr_event_init ( gpr_event * ev ) ; <nl> + <nl> + / * Set * ev so that gpr_event_get ( ) and gpr_event_wait ( ) will return value . <nl> + Requires : * ev initialized ; value ! = NULL ; no prior or concurrent calls to <nl> + gpr_event_set ( ev , . . . ) since initialization . * / <nl> + void gpr_event_set ( gpr_event * ev , void * value ) ; <nl> + <nl> + / * Return the value set by gpr_event_set ( ev , . . . ) , or NULL if no such call has <nl> + completed . If the result is non - NULL , all operations that occurred prior to <nl> + the gpr_event_set ( ev , . . . ) set will be visible after this call returns . <nl> + Requires : * ev initialized . This operation is faster than acquiring a mutex <nl> + on most platforms . * / <nl> + void * gpr_event_get ( gpr_event * ev ) ; <nl> + <nl> + / * Wait until * ev is set by gpr_event_set ( ev , . . . ) , or abs_deadline is <nl> + exceeded , then return gpr_event_get ( ev ) . Requires : * ev initialized . Use <nl> + abs_deadline = = gpr_inf_future for no deadline . When the event has been <nl> + signalled before the call , this operation is faster than acquiring a mutex <nl> + on most platforms . * / <nl> + void * gpr_event_wait ( gpr_event * ev , gpr_timespec abs_deadline ) ; <nl> + <nl> + / * mmm Reference counting mmm <nl> + <nl> + These calls act on the type gpr_refcount . It requires no destruction . * / <nl> + <nl> + / * Initialize * r to value n . * / <nl> + void gpr_ref_init ( gpr_refcount * r , int n ) ; <nl> + <nl> + / * Increment the reference count * r . Requires * r initialized . * / <nl> + void gpr_ref ( gpr_refcount * r ) ; <nl> + <nl> + / * Increment the reference count * r by n . Requires * r initialized , n > 0 . * / <nl> + void gpr_refn ( gpr_refcount * r , int n ) ; <nl> + <nl> + / * Decrement the reference count * r and return non - zero iff it has reached <nl> + zero . . Requires * r initialized . * / <nl> + int gpr_unref ( gpr_refcount * r ) ; <nl> + <nl> + / * mmm Stats counters mmm <nl> + <nl> + These calls act on the integral type gpr_stats_counter . It requires no <nl> + destruction . Static instances may be initialized with <nl> + gpr_stats_counter c = GPR_STATS_INIT ; <nl> + Beware : These operations do not imply memory barriers . Do not use them to <nl> + synchronize other events . * / <nl> + <nl> + / * Initialize * c to the value n . * / <nl> + void gpr_stats_init ( gpr_stats_counter * c , intptr_t n ) ; <nl> + <nl> + / * * c + = inc . Requires : * c initialized . * / <nl> + void gpr_stats_inc ( gpr_stats_counter * c , intptr_t inc ) ; <nl> + <nl> + / * Return * c . Requires : * c initialized . * / <nl> + intptr_t gpr_stats_read ( const gpr_stats_counter * c ) ; <nl> + <nl> + / * = = = = = = = = = = = = = = = = = = Example use of interface = = = = = = = = = = = = = = = = = = = <nl> + A producer - consumer queue of up to N integers , <nl> + illustrating the use of the calls in this interface . * / <nl> + # if 0 <nl> + <nl> + # define N 4 <nl> + <nl> + typedef struct queue { <nl> + gpr_cv non_empty ; / * Signalled when length becomes non - zero . * / <nl> + gpr_cv non_full ; / * Signalled when length becomes non - N . * / <nl> + gpr_mu mu ; / * Protects all fields below . <nl> + ( That is , except during initialization or <nl> + destruction , the fields below should be accessed <nl> + only by a thread that holds mu . ) * / <nl> + int head ; / * Index of head of queue 0 . . N - 1 . * / <nl> + int length ; / * Number of valid elements in queue 0 . . N . * / <nl> + int elem [ N ] ; / * elem [ head . . head + length - 1 ] are queue elements . * / <nl> + } queue ; <nl> + <nl> + / * Initialize * q . * / <nl> + void queue_init ( queue * q ) { <nl> + gpr_mu_init ( & q - > mu ) ; <nl> + gpr_cv_init ( & q - > non_empty ) ; <nl> + gpr_cv_init ( & q - > non_full ) ; <nl> + q - > head = 0 ; <nl> + q - > length = 0 ; <nl> + } <nl> + <nl> + / * Free storage associated with * q . * / <nl> + void queue_destroy ( queue * q ) { <nl> + gpr_mu_destroy ( & q - > mu ) ; <nl> + gpr_cv_destroy ( & q - > non_empty ) ; <nl> + gpr_cv_destroy ( & q - > non_full ) ; <nl> + } <nl> + <nl> + / * Wait until there is room in * q , then append x to * q . * / <nl> + void queue_append ( queue * q , int x ) { <nl> + gpr_mu_lock ( & q - > mu ) ; <nl> + / * To wait for a predicate without a deadline , loop on the negation of the <nl> + predicate , and use gpr_cv_wait ( . . . , gpr_inf_future ) inside the loop <nl> + to release the lock , wait , and reacquire on each iteration . Code that <nl> + makes the condition true should use gpr_cv_broadcast ( ) on the <nl> + corresponding condition variable . The predicate must be on state <nl> + protected by the lock . * / <nl> + while ( q - > length = = N ) { <nl> + gpr_cv_wait ( & q - > non_full , & q - > mu , gpr_inf_future ) ; <nl> + } <nl> + if ( q - > length = = 0 ) { / * Wake threads blocked in queue_remove ( ) . * / <nl> + / * It ' s normal to use gpr_cv_broadcast ( ) or gpr_signal ( ) while <nl> + holding the lock . * / <nl> + gpr_cv_broadcast ( & q - > non_empty ) ; <nl> + } <nl> + q - > elem [ ( q - > head + q - > length ) % N ] = x ; <nl> + q - > length + + ; <nl> + gpr_mu_unlock ( & q - > mu ) ; <nl> + } <nl> + <nl> + / * If it can be done without blocking , append x to * q and return non - zero . <nl> + Otherwise return 0 . * / <nl> + int queue_try_append ( queue * q , int x ) { <nl> + int result = 0 ; <nl> + if ( gpr_mu_trylock ( & q - > mu ) ) { <nl> + if ( q - > length ! = N ) { <nl> + if ( q - > length = = 0 ) { / * Wake threads blocked in queue_remove ( ) . * / <nl> + gpr_cv_broadcast ( & q - > non_empty ) ; <nl> + } <nl> + q - > elem [ ( q - > head + q - > length ) % N ] = x ; <nl> + q - > length + + ; <nl> + result = 1 ; <nl> + } <nl> + gpr_mu_unlock ( & q - > mu ) ; <nl> + } <nl> + return result ; <nl> + } <nl> + <nl> + / * Wait until the * q is non - empty or deadline abs_deadline passes . If the <nl> + queue is non - empty , remove its head entry , place it in * head , and return <nl> + non - zero . Otherwise return 0 . * / <nl> + int queue_remove ( queue * q , int * head , gpr_timespec abs_deadline ) { <nl> + int result = 0 ; <nl> + gpr_mu_lock ( & q - > mu ) ; <nl> + / * To wait for a predicate with a deadline , loop on the negation of the <nl> + predicate or until gpr_cv_wait ( ) returns true . Code that makes <nl> + the condition true should use gpr_cv_broadcast ( ) on the corresponding <nl> + condition variable . The predicate must be on state protected by the <nl> + lock . * / <nl> + while ( q - > length = = 0 & & <nl> + ! gpr_cv_wait ( & q - > non_empty , & q - > mu , abs_deadline ) ) { <nl> + } <nl> + if ( q - > length ! = 0 ) { / * Queue is non - empty . * / <nl> + result = 1 ; <nl> + if ( q - > length = = N ) { / * Wake threads blocked in queue_append ( ) . * / <nl> + gpr_cv_broadcast ( & q - > non_full ) ; <nl> + } <nl> + * head = q - > elem [ q - > head ] ; <nl> + q - > head = ( q - > head + 1 ) % N ; <nl> + q - > length - - ; <nl> + } / * else deadline exceeded * / <nl> + gpr_mu_unlock ( & q - > mu ) ; <nl> + return result ; <nl> + } <nl> + # endif / * 0 * / <nl> + <nl> + # ifdef __cplusplus <nl> + } <nl> + # endif <nl> + <nl> + # endif / * GRPC_IMPL_CODEGEN_SYNC_H * / <nl> new file mode 100644 <nl> index 00000000000 . . 75e85ae736c <nl> mmm / dev / null <nl> ppp b / include / grpc / impl / codegen / sync_generic . h <nl> <nl> + / * <nl> + * <nl> + * Copyright 2015 , Google Inc . <nl> + * All rights reserved . <nl> + * <nl> + * Redistribution and use in source and binary forms , with or without <nl> + * modification , are permitted provided that the following conditions are <nl> + * met : <nl> + * <nl> + * * Redistributions of source code must retain the above copyright <nl> + * notice , this list of conditions and the following disclaimer . <nl> + * * Redistributions in binary form must reproduce the above <nl> + * copyright notice , this list of conditions and the following disclaimer <nl> + * in the documentation and / or other materials provided with the <nl> + * distribution . <nl> + * * Neither the name of Google Inc . nor the names of its <nl> + * contributors may be used to endorse or promote products derived from <nl> + * this software without specific prior written permission . <nl> + * <nl> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> + * " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> + * LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> + * A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> + * SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> + * LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> + * DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> + * THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> + * ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> + * OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> + * <nl> + * / <nl> + <nl> + # ifndef GRPC_IMPL_CODEGEN_SYNC_GENERIC_H <nl> + # define GRPC_IMPL_CODEGEN_SYNC_GENERIC_H <nl> + / * Generic type defintions for gpr_sync . * / <nl> + <nl> + # include < grpc / impl / codegen / atm . h > <nl> + <nl> + / * gpr_event * / <nl> + typedef struct { gpr_atm state ; } gpr_event ; <nl> + <nl> + # define GPR_EVENT_INIT \ <nl> + { 0 } <nl> + <nl> + / * gpr_refcount * / <nl> + typedef struct { gpr_atm count ; } gpr_refcount ; <nl> + <nl> + / * gpr_stats_counter * / <nl> + typedef struct { gpr_atm value ; } gpr_stats_counter ; <nl> + <nl> + # define GPR_STATS_INIT \ <nl> + { 0 } <nl> + <nl> + # endif / * GRPC_IMPL_CODEGEN_SYNC_GENERIC_H * / <nl> new file mode 100644 <nl> index 00000000000 . . 3d08cc35e8d <nl> mmm / dev / null <nl> ppp b / include / grpc / impl / codegen / sync_posix . h <nl> <nl> + / * <nl> + * <nl> + * Copyright 2015 , Google Inc . <nl> + * All rights reserved . <nl> + * <nl> + * Redistribution and use in source and binary forms , with or without <nl> + * modification , are permitted provided that the following conditions are <nl> + * met : <nl> + * <nl> + * * Redistributions of source code must retain the above copyright <nl> + * notice , this list of conditions and the following disclaimer . <nl> + * * Redistributions in binary form must reproduce the above <nl> + * copyright notice , this list of conditions and the following disclaimer <nl> + * in the documentation and / or other materials provided with the <nl> + * distribution . <nl> + * * Neither the name of Google Inc . nor the names of its <nl> + * contributors may be used to endorse or promote products derived from <nl> + * this software without specific prior written permission . <nl> + * <nl> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> + * " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> + * LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> + * A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> + * SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> + * LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> + * DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> + * THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> + * ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> + * OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> + * <nl> + * / <nl> + <nl> + # ifndef GRPC_IMPL_CODEGEN_SYNC_POSIX_H <nl> + # define GRPC_IMPL_CODEGEN_SYNC_POSIX_H <nl> + <nl> + # include < grpc / impl / codegen / sync_generic . h > <nl> + <nl> + # include < pthread . h > <nl> + <nl> + typedef pthread_mutex_t gpr_mu ; <nl> + typedef pthread_cond_t gpr_cv ; <nl> + typedef pthread_once_t gpr_once ; <nl> + <nl> + # define GPR_ONCE_INIT PTHREAD_ONCE_INIT <nl> + <nl> + # endif / * GRPC_IMPL_CODEGEN_SYNC_POSIX_H * / <nl> new file mode 100644 <nl> index 00000000000 . . bdc43dd99a3 <nl> mmm / dev / null <nl> ppp b / include / grpc / impl / codegen / sync_win32 . h <nl> <nl> + / * <nl> + * <nl> + * Copyright 2015 , Google Inc . <nl> + * All rights reserved . <nl> + * <nl> + * Redistribution and use in source and binary forms , with or without <nl> + * modification , are permitted provided that the following conditions are <nl> + * met : <nl> + * <nl> + * * Redistributions of source code must retain the above copyright <nl> + * notice , this list of conditions and the following disclaimer . <nl> + * * Redistributions in binary form must reproduce the above <nl> + * copyright notice , this list of conditions and the following disclaimer <nl> + * in the documentation and / or other materials provided with the <nl> + * distribution . <nl> + * * Neither the name of Google Inc . nor the names of its <nl> + * contributors may be used to endorse or promote products derived from <nl> + * this software without specific prior written permission . <nl> + * <nl> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> + * " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> + * LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> + * A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> + * SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> + * LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> + * DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> + * THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> + * ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> + * OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> + * <nl> + * / <nl> + <nl> + # ifndef GRPC_IMPL_CODEGEN_SYNC_WIN32_H <nl> + # define GRPC_IMPL_CODEGEN_SYNC_WIN32_H <nl> + <nl> + # include < grpc / impl / codegen / sync_generic . h > <nl> + <nl> + typedef struct { <nl> + CRITICAL_SECTION cs ; / * Not an SRWLock until Vista is unsupported * / <nl> + int locked ; <nl> + } gpr_mu ; <nl> + <nl> + typedef CONDITION_VARIABLE gpr_cv ; <nl> + <nl> + typedef INIT_ONCE gpr_once ; <nl> + # define GPR_ONCE_INIT INIT_ONCE_STATIC_INIT <nl> + <nl> + # endif / * GRPC_IMPL_CODEGEN_SYNC_WIN32_H * / <nl> mmm a / include / grpc / status . h <nl> ppp b / include / grpc / status . h <nl> <nl> # ifndef GRPC_STATUS_H <nl> # define GRPC_STATUS_H <nl> <nl> - # ifdef __cplusplus <nl> - extern " C " { <nl> - # endif <nl> - <nl> - typedef enum { <nl> - / * Not an error ; returned on success * / <nl> - GRPC_STATUS_OK = 0 , <nl> - <nl> - / * The operation was cancelled ( typically by the caller ) . * / <nl> - GRPC_STATUS_CANCELLED = 1 , <nl> - <nl> - / * Unknown error . An example of where this error may be returned is <nl> - if a Status value received from another address space belongs to <nl> - an error - space that is not known in this address space . Also <nl> - errors raised by APIs that do not return enough error information <nl> - may be converted to this error . * / <nl> - GRPC_STATUS_UNKNOWN = 2 , <nl> - <nl> - / * Client specified an invalid argument . Note that this differs <nl> - from FAILED_PRECONDITION . INVALID_ARGUMENT indicates arguments <nl> - that are problematic regardless of the state of the system <nl> - ( e . g . , a malformed file name ) . * / <nl> - GRPC_STATUS_INVALID_ARGUMENT = 3 , <nl> - <nl> - / * Deadline expired before operation could complete . For operations <nl> - that change the state of the system , this error may be returned <nl> - even if the operation has completed successfully . For example , a <nl> - successful response from a server could have been delayed long <nl> - enough for the deadline to expire . * / <nl> - GRPC_STATUS_DEADLINE_EXCEEDED = 4 , <nl> - <nl> - / * Some requested entity ( e . g . , file or directory ) was not found . * / <nl> - GRPC_STATUS_NOT_FOUND = 5 , <nl> - <nl> - / * Some entity that we attempted to create ( e . g . , file or directory ) <nl> - already exists . * / <nl> - GRPC_STATUS_ALREADY_EXISTS = 6 , <nl> - <nl> - / * The caller does not have permission to execute the specified <nl> - operation . PERMISSION_DENIED must not be used for rejections <nl> - caused by exhausting some resource ( use RESOURCE_EXHAUSTED <nl> - instead for those errors ) . PERMISSION_DENIED must not be <nl> - used if the caller can not be identified ( use UNAUTHENTICATED <nl> - instead for those errors ) . * / <nl> - GRPC_STATUS_PERMISSION_DENIED = 7 , <nl> - <nl> - / * The request does not have valid authentication credentials for the <nl> - operation . * / <nl> - GRPC_STATUS_UNAUTHENTICATED = 16 , <nl> - <nl> - / * Some resource has been exhausted , perhaps a per - user quota , or <nl> - perhaps the entire file system is out of space . * / <nl> - GRPC_STATUS_RESOURCE_EXHAUSTED = 8 , <nl> - <nl> - / * Operation was rejected because the system is not in a state <nl> - required for the operation ' s execution . For example , directory <nl> - to be deleted may be non - empty , an rmdir operation is applied to <nl> - a non - directory , etc . <nl> - <nl> - A litmus test that may help a service implementor in deciding <nl> - between FAILED_PRECONDITION , ABORTED , and UNAVAILABLE : <nl> - ( a ) Use UNAVAILABLE if the client can retry just the failing call . <nl> - ( b ) Use ABORTED if the client should retry at a higher - level <nl> - ( e . g . , restarting a read - modify - write sequence ) . <nl> - ( c ) Use FAILED_PRECONDITION if the client should not retry until <nl> - the system state has been explicitly fixed . E . g . , if an " rmdir " <nl> - fails because the directory is non - empty , FAILED_PRECONDITION <nl> - should be returned since the client should not retry unless <nl> - they have first fixed up the directory by deleting files from it . <nl> - ( d ) Use FAILED_PRECONDITION if the client performs conditional <nl> - REST Get / Update / Delete on a resource and the resource on the <nl> - server does not match the condition . E . g . , conflicting <nl> - read - modify - write on the same resource . * / <nl> - GRPC_STATUS_FAILED_PRECONDITION = 9 , <nl> - <nl> - / * The operation was aborted , typically due to a concurrency issue <nl> - like sequencer check failures , transaction aborts , etc . <nl> - <nl> - See litmus test above for deciding between FAILED_PRECONDITION , <nl> - ABORTED , and UNAVAILABLE . * / <nl> - GRPC_STATUS_ABORTED = 10 , <nl> - <nl> - / * Operation was attempted past the valid range . E . g . , seeking or <nl> - reading past end of file . <nl> - <nl> - Unlike INVALID_ARGUMENT , this error indicates a problem that may <nl> - be fixed if the system state changes . For example , a 32 - bit file <nl> - system will generate INVALID_ARGUMENT if asked to read at an <nl> - offset that is not in the range [ 0 , 2 ^ 32 - 1 ] , but it will generate <nl> - OUT_OF_RANGE if asked to read from an offset past the current <nl> - file size . <nl> - <nl> - There is a fair bit of overlap between FAILED_PRECONDITION and <nl> - OUT_OF_RANGE . We recommend using OUT_OF_RANGE ( the more specific <nl> - error ) when it applies so that callers who are iterating through <nl> - a space can easily look for an OUT_OF_RANGE error to detect when <nl> - they are done . * / <nl> - GRPC_STATUS_OUT_OF_RANGE = 11 , <nl> - <nl> - / * Operation is not implemented or not supported / enabled in this service . * / <nl> - GRPC_STATUS_UNIMPLEMENTED = 12 , <nl> - <nl> - / * Internal errors . Means some invariants expected by underlying <nl> - system has been broken . If you see one of these errors , <nl> - something is very broken . * / <nl> - GRPC_STATUS_INTERNAL = 13 , <nl> - <nl> - / * The service is currently unavailable . This is a most likely a <nl> - transient condition and may be corrected by retrying with <nl> - a backoff . <nl> - <nl> - See litmus test above for deciding between FAILED_PRECONDITION , <nl> - ABORTED , and UNAVAILABLE . * / <nl> - GRPC_STATUS_UNAVAILABLE = 14 , <nl> - <nl> - / * Unrecoverable data loss or corruption . * / <nl> - GRPC_STATUS_DATA_LOSS = 15 , <nl> - <nl> - / * Force users to include a default branch : * / <nl> - GRPC_STATUS__DO_NOT_USE = - 1 <nl> - } grpc_status_code ; <nl> - <nl> - # ifdef __cplusplus <nl> - } <nl> - # endif <nl> + # include < grpc / impl / codegen / status . h > <nl> <nl> # endif / * GRPC_STATUS_H * / <nl> mmm a / include / grpc / support / atm . h <nl> ppp b / include / grpc / support / atm . h <nl> <nl> # ifndef GRPC_SUPPORT_ATM_H <nl> # define GRPC_SUPPORT_ATM_H <nl> <nl> - / * This interface provides atomic operations and barriers . <nl> - It is internal to gpr support code and should not be used outside it . <nl> - <nl> - If an operation with acquire semantics precedes another memory access by the <nl> - same thread , the operation will precede that other access as seen by other <nl> - threads . <nl> - <nl> - If an operation with release semantics follows another memory access by the <nl> - same thread , the operation will follow that other access as seen by other <nl> - threads . <nl> - <nl> - Routines with " acq " or " full " in the name have acquire semantics . Routines <nl> - with " rel " or " full " in the name have release semantics . Routines with <nl> - " no_barrier " in the name have neither acquire not release semantics . <nl> - <nl> - The routines may be implemented as macros . <nl> - <nl> - / / Atomic operations act on an intergral_type gpr_atm that is guaranteed to <nl> - / / be the same size as a pointer . <nl> - typedef intptr_t gpr_atm ; <nl> - <nl> - / / A memory barrier , providing both acquire and release semantics , but not <nl> - / / otherwise acting on memory . <nl> - void gpr_atm_full_barrier ( void ) ; <nl> - <nl> - / / Atomically return * p , with acquire semantics . <nl> - gpr_atm gpr_atm_acq_load ( gpr_atm * p ) ; <nl> - <nl> - / / Atomically set * p = value , with release semantics . <nl> - void gpr_atm_rel_store ( gpr_atm * p , gpr_atm value ) ; <nl> - <nl> - / / Atomically add delta to * p , and return the old value of * p , with <nl> - / / the barriers specified . <nl> - gpr_atm gpr_atm_no_barrier_fetch_add ( gpr_atm * p , gpr_atm delta ) ; <nl> - gpr_atm gpr_atm_full_fetch_add ( gpr_atm * p , gpr_atm delta ) ; <nl> - <nl> - / / Atomically , if * p = = o , set * p = n and return non - zero otherwise return 0 , <nl> - / / with the barriers specified if the operation succeeds . <nl> - int gpr_atm_no_barrier_cas ( gpr_atm * p , gpr_atm o , gpr_atm n ) ; <nl> - int gpr_atm_acq_cas ( gpr_atm * p , gpr_atm o , gpr_atm n ) ; <nl> - int gpr_atm_rel_cas ( gpr_atm * p , gpr_atm o , gpr_atm n ) ; <nl> - * / <nl> - <nl> - # include < grpc / support / port_platform . h > <nl> - <nl> - # if defined ( GPR_GCC_ATOMIC ) <nl> - # include < grpc / support / atm_gcc_atomic . h > <nl> - # elif defined ( GPR_GCC_SYNC ) <nl> - # include < grpc / support / atm_gcc_sync . h > <nl> - # elif defined ( GPR_WIN32_ATOMIC ) <nl> - # include < grpc / support / atm_win32 . h > <nl> - # else <nl> - # error could not determine platform for atm <nl> - # endif <nl> + # include < grpc / impl / codegen / atm . h > <nl> <nl> # endif / * GRPC_SUPPORT_ATM_H * / <nl> mmm a / include / grpc / support / atm_gcc_atomic . h <nl> ppp b / include / grpc / support / atm_gcc_atomic . h <nl> <nl> * <nl> * / <nl> <nl> - # ifndef GRPC_SUPPORT_ATM_GCC_ATOMIC_H <nl> - # define GRPC_SUPPORT_ATM_GCC_ATOMIC_H <nl> + # ifndef GRPC_IMPL_CODEGEN_ATM_GCC_ATOMIC_H <nl> + # define GRPC_IMPL_CODEGEN_ATM_GCC_ATOMIC_H <nl> <nl> - / * atm_platform . h for gcc and gcc - like compilers with the <nl> - __atomic_ * interface . * / <nl> - # include < grpc / support / port_platform . h > <nl> + # include < grpc / impl / codegen / atm_gcc_atomic . h > <nl> <nl> - typedef intptr_t gpr_atm ; <nl> - <nl> - # define gpr_atm_full_barrier ( ) ( __atomic_thread_fence ( __ATOMIC_SEQ_CST ) ) <nl> - <nl> - # define gpr_atm_acq_load ( p ) ( __atomic_load_n ( ( p ) , __ATOMIC_ACQUIRE ) ) <nl> - # define gpr_atm_no_barrier_load ( p ) ( __atomic_load_n ( ( p ) , __ATOMIC_RELAXED ) ) <nl> - # define gpr_atm_rel_store ( p , value ) \ <nl> - ( __atomic_store_n ( ( p ) , ( intptr_t ) ( value ) , __ATOMIC_RELEASE ) ) <nl> - # define gpr_atm_no_barrier_store ( p , value ) \ <nl> - ( __atomic_store_n ( ( p ) , ( intptr_t ) ( value ) , __ATOMIC_RELAXED ) ) <nl> - <nl> - # define gpr_atm_no_barrier_fetch_add ( p , delta ) \ <nl> - ( __atomic_fetch_add ( ( p ) , ( intptr_t ) ( delta ) , __ATOMIC_RELAXED ) ) <nl> - # define gpr_atm_full_fetch_add ( p , delta ) \ <nl> - ( __atomic_fetch_add ( ( p ) , ( intptr_t ) ( delta ) , __ATOMIC_ACQ_REL ) ) <nl> - <nl> - static __inline int gpr_atm_no_barrier_cas ( gpr_atm * p , gpr_atm o , gpr_atm n ) { <nl> - return __atomic_compare_exchange_n ( p , & o , n , 0 , __ATOMIC_RELAXED , <nl> - __ATOMIC_RELAXED ) ; <nl> - } <nl> - <nl> - static __inline int gpr_atm_acq_cas ( gpr_atm * p , gpr_atm o , gpr_atm n ) { <nl> - return __atomic_compare_exchange_n ( p , & o , n , 0 , __ATOMIC_ACQUIRE , <nl> - __ATOMIC_RELAXED ) ; <nl> - } <nl> - <nl> - static __inline int gpr_atm_rel_cas ( gpr_atm * p , gpr_atm o , gpr_atm n ) { <nl> - return __atomic_compare_exchange_n ( p , & o , n , 0 , __ATOMIC_RELEASE , <nl> - __ATOMIC_RELAXED ) ; <nl> - } <nl> - <nl> - # endif / * GRPC_SUPPORT_ATM_GCC_ATOMIC_H * / <nl> + # endif / * GRPC_IMPL_CODEGEN_ATM_GCC_ATOMIC_H * / <nl> mmm a / include / grpc / support / atm_gcc_sync . h <nl> ppp b / include / grpc / support / atm_gcc_sync . h <nl> <nl> # ifndef GRPC_SUPPORT_ATM_GCC_SYNC_H <nl> # define GRPC_SUPPORT_ATM_GCC_SYNC_H <nl> <nl> - / * variant of atm_platform . h for gcc and gcc - like compiers with __sync_ * <nl> - interface * / <nl> - # include < grpc / support / port_platform . h > <nl> - <nl> - typedef intptr_t gpr_atm ; <nl> - <nl> - # define GPR_ATM_COMPILE_BARRIER_ ( ) __asm__ __volatile__ ( " " : : : " memory " ) <nl> - <nl> - # if defined ( __i386 ) | | defined ( __x86_64__ ) <nl> - / * All loads are acquire loads and all stores are release stores . * / <nl> - # define GPR_ATM_LS_BARRIER_ ( ) GPR_ATM_COMPILE_BARRIER_ ( ) <nl> - # else <nl> - # define GPR_ATM_LS_BARRIER_ ( ) gpr_atm_full_barrier ( ) <nl> - # endif <nl> - <nl> - # define gpr_atm_full_barrier ( ) ( __sync_synchronize ( ) ) <nl> - <nl> - static __inline gpr_atm gpr_atm_acq_load ( const gpr_atm * p ) { <nl> - gpr_atm value = * p ; <nl> - GPR_ATM_LS_BARRIER_ ( ) ; <nl> - return value ; <nl> - } <nl> - <nl> - static __inline gpr_atm gpr_atm_no_barrier_load ( const gpr_atm * p ) { <nl> - gpr_atm value = * p ; <nl> - GPR_ATM_COMPILE_BARRIER_ ( ) ; <nl> - return value ; <nl> - } <nl> - <nl> - static __inline void gpr_atm_rel_store ( gpr_atm * p , gpr_atm value ) { <nl> - GPR_ATM_LS_BARRIER_ ( ) ; <nl> - * p = value ; <nl> - } <nl> - <nl> - static __inline void gpr_atm_no_barrier_store ( gpr_atm * p , gpr_atm value ) { <nl> - GPR_ATM_COMPILE_BARRIER_ ( ) ; <nl> - * p = value ; <nl> - } <nl> - <nl> - # undef GPR_ATM_LS_BARRIER_ <nl> - # undef GPR_ATM_COMPILE_BARRIER_ <nl> - <nl> - # define gpr_atm_no_barrier_fetch_add ( p , delta ) \ <nl> - gpr_atm_full_fetch_add ( ( p ) , ( delta ) ) <nl> - # define gpr_atm_full_fetch_add ( p , delta ) ( __sync_fetch_and_add ( ( p ) , ( delta ) ) ) <nl> - <nl> - # define gpr_atm_no_barrier_cas ( p , o , n ) gpr_atm_acq_cas ( ( p ) , ( o ) , ( n ) ) <nl> - # define gpr_atm_acq_cas ( p , o , n ) ( __sync_bool_compare_and_swap ( ( p ) , ( o ) , ( n ) ) ) <nl> - # define gpr_atm_rel_cas ( p , o , n ) gpr_atm_acq_cas ( ( p ) , ( o ) , ( n ) ) <nl> + # include < grpc / impl / codegen / atm_gcc_sync . h > <nl> <nl> # endif / * GRPC_SUPPORT_ATM_GCC_SYNC_H * / <nl> mmm a / include / grpc / support / atm_win32 . h <nl> ppp b / include / grpc / support / atm_win32 . h <nl> <nl> # ifndef GRPC_SUPPORT_ATM_WIN32_H <nl> # define GRPC_SUPPORT_ATM_WIN32_H <nl> <nl> - / * Win32 variant of atm_platform . h * / <nl> - # include < grpc / support / port_platform . h > <nl> - <nl> - typedef intptr_t gpr_atm ; <nl> - <nl> - # define gpr_atm_full_barrier MemoryBarrier <nl> - <nl> - static __inline gpr_atm gpr_atm_acq_load ( const gpr_atm * p ) { <nl> - gpr_atm result = * p ; <nl> - gpr_atm_full_barrier ( ) ; <nl> - return result ; <nl> - } <nl> - <nl> - static __inline gpr_atm gpr_atm_no_barrier_load ( const gpr_atm * p ) { <nl> - / * TODO ( dklempner ) : Can we implement something better here ? * / <nl> - return gpr_atm_acq_load ( p ) ; <nl> - } <nl> - <nl> - static __inline void gpr_atm_rel_store ( gpr_atm * p , gpr_atm value ) { <nl> - gpr_atm_full_barrier ( ) ; <nl> - * p = value ; <nl> - } <nl> - <nl> - static __inline void gpr_atm_no_barrier_store ( gpr_atm * p , gpr_atm value ) { <nl> - / * TODO ( ctiller ) : Can we implement something better here ? * / <nl> - gpr_atm_rel_store ( p , value ) ; <nl> - } <nl> - <nl> - static __inline int gpr_atm_no_barrier_cas ( gpr_atm * p , gpr_atm o , gpr_atm n ) { <nl> - / * InterlockedCompareExchangePointerNoFence ( ) not available on vista or <nl> - windows7 * / <nl> - # ifdef GPR_ARCH_64 <nl> - return o = = ( gpr_atm ) InterlockedCompareExchangeAcquire64 ( <nl> - ( volatile LONGLONG * ) p , ( LONGLONG ) n , ( LONGLONG ) o ) ; <nl> - # else <nl> - return o = = ( gpr_atm ) InterlockedCompareExchangeAcquire ( ( volatile LONG * ) p , <nl> - ( LONG ) n , ( LONG ) o ) ; <nl> - # endif <nl> - } <nl> - <nl> - static __inline int gpr_atm_acq_cas ( gpr_atm * p , gpr_atm o , gpr_atm n ) { <nl> - # ifdef GPR_ARCH_64 <nl> - return o = = ( gpr_atm ) InterlockedCompareExchangeAcquire64 ( <nl> - ( volatile LONGLONG * ) p , ( LONGLONG ) n , ( LONGLONG ) o ) ; <nl> - # else <nl> - return o = = ( gpr_atm ) InterlockedCompareExchangeAcquire ( ( volatile LONG * ) p , <nl> - ( LONG ) n , ( LONG ) o ) ; <nl> - # endif <nl> - } <nl> - <nl> - static __inline int gpr_atm_rel_cas ( gpr_atm * p , gpr_atm o , gpr_atm n ) { <nl> - # ifdef GPR_ARCH_64 <nl> - return o = = ( gpr_atm ) InterlockedCompareExchangeRelease64 ( <nl> - ( volatile LONGLONG * ) p , ( LONGLONG ) n , ( LONGLONG ) o ) ; <nl> - # else <nl> - return o = = ( gpr_atm ) InterlockedCompareExchangeRelease ( ( volatile LONG * ) p , <nl> - ( LONG ) n , ( LONG ) o ) ; <nl> - # endif <nl> - } <nl> - <nl> - static __inline gpr_atm gpr_atm_no_barrier_fetch_add ( gpr_atm * p , <nl> - gpr_atm delta ) { <nl> - / * Use the CAS operation to get pointer - sized fetch and add * / <nl> - gpr_atm old ; <nl> - do { <nl> - old = * p ; <nl> - } while ( ! gpr_atm_no_barrier_cas ( p , old , old + delta ) ) ; <nl> - return old ; <nl> - } <nl> - <nl> - static __inline gpr_atm gpr_atm_full_fetch_add ( gpr_atm * p , gpr_atm delta ) { <nl> - / * Use a CAS operation to get pointer - sized fetch and add * / <nl> - gpr_atm old ; <nl> - # ifdef GPR_ARCH_64 <nl> - do { <nl> - old = * p ; <nl> - } while ( old ! = ( gpr_atm ) InterlockedCompareExchange64 ( ( volatile LONGLONG * ) p , <nl> - ( LONGLONG ) old + delta , <nl> - ( LONGLONG ) old ) ) ; <nl> - # else <nl> - do { <nl> - old = * p ; <nl> - } while ( old ! = ( gpr_atm ) InterlockedCompareExchange ( <nl> - ( volatile LONG * ) p , ( LONG ) old + delta , ( LONG ) old ) ) ; <nl> - # endif <nl> - return old ; <nl> - } <nl> + # include < grpc / impl / codegen / atm_win32 . h > <nl> <nl> # endif / * GRPC_SUPPORT_ATM_WIN32_H * / <nl> mmm a / include / grpc / support / log . h <nl> ppp b / include / grpc / support / log . h <nl> <nl> # ifndef GRPC_SUPPORT_LOG_H <nl> # define GRPC_SUPPORT_LOG_H <nl> <nl> - # include < stdlib . h > / * for abort ( ) * / <nl> - # include < stdarg . h > <nl> - <nl> - # ifdef __cplusplus <nl> - extern " C " { <nl> - # endif <nl> - <nl> - / * GPR log API . <nl> - <nl> - Usage ( within grpc ) : <nl> - <nl> - int argument1 = 3 ; <nl> - char * argument2 = " hello " ; <nl> - gpr_log ( GPR_DEBUG , " format string % d " , argument1 ) ; <nl> - gpr_log ( GPR_INFO , " hello world " ) ; <nl> - gpr_log ( GPR_ERROR , " % d % s ! ! " , argument1 , argument2 ) ; * / <nl> - <nl> - / * The severity of a log message - use the # defines below when calling into <nl> - gpr_log to additionally supply file and line data * / <nl> - typedef enum gpr_log_severity { <nl> - GPR_LOG_SEVERITY_DEBUG , <nl> - GPR_LOG_SEVERITY_INFO , <nl> - GPR_LOG_SEVERITY_ERROR <nl> - } gpr_log_severity ; <nl> - <nl> - / * Returns a string representation of the log severity * / <nl> - const char * gpr_log_severity_string ( gpr_log_severity severity ) ; <nl> - <nl> - / * Macros to build log contexts at various severity levels * / <nl> - # define GPR_DEBUG __FILE__ , __LINE__ , GPR_LOG_SEVERITY_DEBUG <nl> - # define GPR_INFO __FILE__ , __LINE__ , GPR_LOG_SEVERITY_INFO <nl> - # define GPR_ERROR __FILE__ , __LINE__ , GPR_LOG_SEVERITY_ERROR <nl> - <nl> - / * Log a message . It ' s advised to use GPR_xxx above to generate the context <nl> - * for each message * / <nl> - void gpr_log ( const char * file , int line , gpr_log_severity severity , <nl> - const char * format , . . . ) ; <nl> - <nl> - void gpr_log_message ( const char * file , int line , gpr_log_severity severity , <nl> - const char * message ) ; <nl> - <nl> - / * Log overrides : applications can use this API to intercept logging calls <nl> - and use their own implementations * / <nl> - <nl> - typedef struct { <nl> - const char * file ; <nl> - int line ; <nl> - gpr_log_severity severity ; <nl> - const char * message ; <nl> - } gpr_log_func_args ; <nl> - <nl> - typedef void ( * gpr_log_func ) ( gpr_log_func_args * args ) ; <nl> - void gpr_set_log_function ( gpr_log_func func ) ; <nl> - <nl> - / * abort ( ) the process if x is zero , having written a line to the log . <nl> - <nl> - Intended for internal invariants . If the error can be recovered from , <nl> - without the possibility of corruption , or might best be reflected via <nl> - an exception in a higher - level language , consider returning error code . * / <nl> - # define GPR_ASSERT ( x ) \ <nl> - do { \ <nl> - if ( ! ( x ) ) { \ <nl> - gpr_log ( GPR_ERROR , " assertion failed : % s " , # x ) ; \ <nl> - abort ( ) ; \ <nl> - } \ <nl> - } while ( 0 ) <nl> - <nl> - # ifdef __cplusplus <nl> - } <nl> - # endif <nl> + # include < grpc / impl / codegen / log . h > <nl> <nl> # endif / * GRPC_SUPPORT_LOG_H * / <nl> mmm a / include / grpc / support / slice . h <nl> ppp b / include / grpc / support / slice . h <nl> <nl> # ifndef GRPC_SUPPORT_SLICE_H <nl> # define GRPC_SUPPORT_SLICE_H <nl> <nl> - # include < grpc / support / sync . h > <nl> - <nl> - # include < stddef . h > <nl> - <nl> - # ifdef __cplusplus <nl> - extern " C " { <nl> - # endif <nl> - <nl> - / * Slice API <nl> - <nl> - A slice represents a contiguous reference counted array of bytes . <nl> - It is cheap to take references to a slice , and it is cheap to create a <nl> - slice pointing to a subset of another slice . <nl> - <nl> - The data - structure for slices is exposed here to allow non - gpr code to <nl> - build slices from whatever data they have available . <nl> - <nl> - When defining interfaces that handle slices , care should be taken to define <nl> - reference ownership semantics ( who should call unref ? ) and mutability <nl> - constraints ( is the callee allowed to modify the slice ? ) * / <nl> - <nl> - / * Reference count container for gpr_slice . Contains function pointers to <nl> - increment and decrement reference counts . Implementations should cleanup <nl> - when the reference count drops to zero . <nl> - Typically client code should not touch this , and use gpr_slice_malloc , <nl> - gpr_slice_new , or gpr_slice_new_with_len instead . * / <nl> - typedef struct gpr_slice_refcount { <nl> - void ( * ref ) ( void * ) ; <nl> - void ( * unref ) ( void * ) ; <nl> - } gpr_slice_refcount ; <nl> - <nl> - # define GPR_SLICE_INLINED_SIZE ( sizeof ( size_t ) + sizeof ( uint8_t * ) - 1 ) <nl> - <nl> - / * A gpr_slice s , if initialized , represents the byte range <nl> - s . bytes [ 0 . . s . length - 1 ] . <nl> - <nl> - It can have an associated ref count which has a destruction routine to be run <nl> - when the ref count reaches zero ( see gpr_slice_new ( ) and grp_slice_unref ( ) ) . <nl> - Multiple gpr_slice values may share a ref count . <nl> - <nl> - If the slice does not have a refcount , it represents an inlined small piece <nl> - of data that is copied by value . * / <nl> - typedef struct gpr_slice { <nl> - struct gpr_slice_refcount * refcount ; <nl> - union { <nl> - struct { <nl> - uint8_t * bytes ; <nl> - size_t length ; <nl> - } refcounted ; <nl> - struct { <nl> - uint8_t length ; <nl> - uint8_t bytes [ GPR_SLICE_INLINED_SIZE ] ; <nl> - } inlined ; <nl> - } data ; <nl> - } gpr_slice ; <nl> - <nl> - # define GPR_SLICE_START_PTR ( slice ) \ <nl> - ( ( slice ) . refcount ? ( slice ) . data . refcounted . bytes \ <nl> - : ( slice ) . data . inlined . bytes ) <nl> - # define GPR_SLICE_LENGTH ( slice ) \ <nl> - ( ( slice ) . refcount ? ( slice ) . data . refcounted . length \ <nl> - : ( slice ) . data . inlined . length ) <nl> - # define GPR_SLICE_SET_LENGTH ( slice , newlen ) \ <nl> - ( ( slice ) . refcount ? ( ( slice ) . data . refcounted . length = ( size_t ) ( newlen ) ) \ <nl> - : ( ( slice ) . data . inlined . length = ( uint8_t ) ( newlen ) ) ) <nl> - # define GPR_SLICE_END_PTR ( slice ) \ <nl> - GPR_SLICE_START_PTR ( slice ) + GPR_SLICE_LENGTH ( slice ) <nl> - # define GPR_SLICE_IS_EMPTY ( slice ) ( GPR_SLICE_LENGTH ( slice ) = = 0 ) <nl> - <nl> - / * Increment the refcount of s . Requires slice is initialized . <nl> - Returns s . * / <nl> - gpr_slice gpr_slice_ref ( gpr_slice s ) ; <nl> - <nl> - / * Decrement the ref count of s . If the ref count of s reaches zero , all <nl> - slices sharing the ref count are destroyed , and considered no longer <nl> - initialized . If s is ultimately derived from a call to gpr_slice_new ( start , <nl> - len , dest ) where dest ! = NULL , then ( * dest ) ( start ) is called , else if s is <nl> - ultimately derived from a call to gpr_slice_new_with_len ( start , len , dest ) <nl> - where dest ! = NULL , then ( * dest ) ( start , len ) . Requires s initialized . * / <nl> - void gpr_slice_unref ( gpr_slice s ) ; <nl> - <nl> - / * Create a slice pointing at some data . Calls malloc to allocate a refcount <nl> - for the object , and arranges that destroy will be called with the pointer <nl> - passed in at destruction . * / <nl> - gpr_slice gpr_slice_new ( void * p , size_t len , void ( * destroy ) ( void * ) ) ; <nl> - <nl> - / * Equivalent to gpr_slice_new , but with a two argument destroy function that <nl> - also takes the slice length . * / <nl> - gpr_slice gpr_slice_new_with_len ( void * p , size_t len , <nl> - void ( * destroy ) ( void * , size_t ) ) ; <nl> - <nl> - / * Equivalent to gpr_slice_new ( malloc ( len ) , len , free ) , but saves one malloc ( ) <nl> - call . <nl> - Aborts if malloc ( ) fails . * / <nl> - gpr_slice gpr_slice_malloc ( size_t length ) ; <nl> - <nl> - / * Create a slice by copying a string . <nl> - Does not preserve null terminators . <nl> - Equivalent to : <nl> - size_t len = strlen ( source ) ; <nl> - gpr_slice slice = gpr_slice_malloc ( len ) ; <nl> - memcpy ( slice - > data , source , len ) ; * / <nl> - gpr_slice gpr_slice_from_copied_string ( const char * source ) ; <nl> - <nl> - / * Create a slice by copying a buffer . <nl> - Equivalent to : <nl> - gpr_slice slice = gpr_slice_malloc ( len ) ; <nl> - memcpy ( slice - > data , source , len ) ; * / <nl> - gpr_slice gpr_slice_from_copied_buffer ( const char * source , size_t len ) ; <nl> - <nl> - / * Create a slice pointing to constant memory * / <nl> - gpr_slice gpr_slice_from_static_string ( const char * source ) ; <nl> - <nl> - / * Return a result slice derived from s , which shares a ref count with s , where <nl> - result . data = = s . data + begin , and result . length = = end - begin . <nl> - The ref count of s is increased by one . <nl> - Requires s initialized , begin < = end , begin < = s . length , and <nl> - end < = source - > length . * / <nl> - gpr_slice gpr_slice_sub ( gpr_slice s , size_t begin , size_t end ) ; <nl> - <nl> - / * The same as gpr_slice_sub , but without altering the ref count * / <nl> - gpr_slice gpr_slice_sub_no_ref ( gpr_slice s , size_t begin , size_t end ) ; <nl> - <nl> - / * Splits s into two : modifies s to be s [ 0 : split ] , and returns a new slice , <nl> - sharing a refcount with s , that contains s [ split : s . length ] . <nl> - Requires s intialized , split < = s . length * / <nl> - gpr_slice gpr_slice_split_tail ( gpr_slice * s , size_t split ) ; <nl> - <nl> - / * Splits s into two : modifies s to be s [ split : s . length ] , and returns a new <nl> - slice , sharing a refcount with s , that contains s [ 0 : split ] . <nl> - Requires s intialized , split < = s . length * / <nl> - gpr_slice gpr_slice_split_head ( gpr_slice * s , size_t split ) ; <nl> - <nl> - gpr_slice gpr_empty_slice ( void ) ; <nl> - <nl> - / * Returns < 0 if a < b , = = 0 if a = = b , > 0 if a > b <nl> - The order is arbitrary , and is not guaranteed to be stable across different <nl> - versions of the API . * / <nl> - int gpr_slice_cmp ( gpr_slice a , gpr_slice b ) ; <nl> - int gpr_slice_str_cmp ( gpr_slice a , const char * b ) ; <nl> - <nl> - # ifdef __cplusplus <nl> - } <nl> - # endif <nl> + # include < grpc / impl / codegen / slice . h > <nl> <nl> # endif / * GRPC_SUPPORT_SLICE_H * / <nl> mmm a / include / grpc / support / slice_buffer . h <nl> ppp b / include / grpc / support / slice_buffer . h <nl> <nl> # ifndef GRPC_SUPPORT_SLICE_BUFFER_H <nl> # define GRPC_SUPPORT_SLICE_BUFFER_H <nl> <nl> - # include < grpc / support / slice . h > <nl> - <nl> - # ifdef __cplusplus <nl> - extern " C " { <nl> - # endif <nl> - <nl> - # define GRPC_SLICE_BUFFER_INLINE_ELEMENTS 8 <nl> - <nl> - / * Represents an expandable array of slices , to be interpreted as a single item <nl> - TODO ( ctiller ) : inline some small number of elements into the struct , to <nl> - avoid per - call allocations * / <nl> - typedef struct { <nl> - / * slices in the array * / <nl> - gpr_slice * slices ; <nl> - / * the number of slices in the array * / <nl> - size_t count ; <nl> - / * the number of slices allocated in the array * / <nl> - size_t capacity ; <nl> - / * the combined length of all slices in the array * / <nl> - size_t length ; <nl> - / * inlined elements to avoid allocations * / <nl> - gpr_slice inlined [ GRPC_SLICE_BUFFER_INLINE_ELEMENTS ] ; <nl> - } gpr_slice_buffer ; <nl> - <nl> - / * initialize a slice buffer * / <nl> - void gpr_slice_buffer_init ( gpr_slice_buffer * sb ) ; <nl> - / * destroy a slice buffer - unrefs any held elements * / <nl> - void gpr_slice_buffer_destroy ( gpr_slice_buffer * sb ) ; <nl> - / * Add an element to a slice buffer - takes ownership of the slice . <nl> - This function is allowed to concatenate the passed in slice to the end of <nl> - some other slice if desired by the slice buffer . * / <nl> - void gpr_slice_buffer_add ( gpr_slice_buffer * sb , gpr_slice slice ) ; <nl> - / * add an element to a slice buffer - takes ownership of the slice and returns <nl> - the index of the slice . <nl> - Guarantees that the slice will not be concatenated at the end of another <nl> - slice ( i . e . the data for this slice will begin at the first byte of the <nl> - slice at the returned index in sb - > slices ) <nl> - The implementation MAY decide to concatenate data at the end of a small <nl> - slice added in this fashion . * / <nl> - size_t gpr_slice_buffer_add_indexed ( gpr_slice_buffer * sb , gpr_slice slice ) ; <nl> - void gpr_slice_buffer_addn ( gpr_slice_buffer * sb , gpr_slice * slices , size_t n ) ; <nl> - / * add a very small ( less than 8 bytes ) amount of data to the end of a slice <nl> - buffer : returns a pointer into which to add the data * / <nl> - uint8_t * gpr_slice_buffer_tiny_add ( gpr_slice_buffer * sb , size_t len ) ; <nl> - / * pop the last buffer , but don ' t unref it * / <nl> - void gpr_slice_buffer_pop ( gpr_slice_buffer * sb ) ; <nl> - / * clear a slice buffer , unref all elements * / <nl> - void gpr_slice_buffer_reset_and_unref ( gpr_slice_buffer * sb ) ; <nl> - / * swap the contents of two slice buffers * / <nl> - void gpr_slice_buffer_swap ( gpr_slice_buffer * a , gpr_slice_buffer * b ) ; <nl> - / * move all of the elements of src into dst * / <nl> - void gpr_slice_buffer_move_into ( gpr_slice_buffer * src , gpr_slice_buffer * dst ) ; <nl> - / * remove n bytes from the end of a slice buffer * / <nl> - void gpr_slice_buffer_trim_end ( gpr_slice_buffer * src , size_t n , <nl> - gpr_slice_buffer * garbage ) ; <nl> - / * move the first n bytes of src into dst * / <nl> - void gpr_slice_buffer_move_first ( gpr_slice_buffer * src , size_t n , <nl> - gpr_slice_buffer * dst ) ; <nl> - / * take the first slice in the slice buffer * / <nl> - gpr_slice gpr_slice_buffer_take_first ( gpr_slice_buffer * src ) ; <nl> - <nl> - # ifdef __cplusplus <nl> - } <nl> - # endif <nl> + # include < grpc / impl / codegen / slice_buffer . h > <nl> <nl> # endif / * GRPC_SUPPORT_SLICE_BUFFER_H * / <nl> mmm a / include / grpc / support / sync . h <nl> ppp b / include / grpc / support / sync . h <nl> <nl> <nl> # ifndef GRPC_SUPPORT_SYNC_H <nl> # define GRPC_SUPPORT_SYNC_H <nl> - / * Synchronization primitives for GPR . <nl> <nl> - The type gpr_mu provides a non - reentrant mutex ( lock ) . <nl> - <nl> - The type gpr_cv provides a condition variable . <nl> - <nl> - The type gpr_once provides for one - time initialization . <nl> - <nl> - The type gpr_event provides one - time - setting , reading , and <nl> - waiting of a void * , with memory barriers . <nl> - <nl> - The type gpr_refcount provides an object reference counter , <nl> - with memory barriers suitable to control <nl> - object lifetimes . <nl> - <nl> - The type gpr_stats_counter provides an atomic statistics counter . It <nl> - provides no memory barriers . <nl> - * / <nl> - <nl> - / * Platform - specific type declarations of gpr_mu and gpr_cv . * / <nl> - # include < grpc / support / port_platform . h > <nl> - # include < grpc / support / sync_generic . h > <nl> - <nl> - # if defined ( GPR_POSIX_SYNC ) <nl> - # include < grpc / support / sync_posix . h > <nl> - # elif defined ( GPR_WIN32 ) <nl> - # include < grpc / support / sync_win32 . h > <nl> - # elif ! defined ( GPR_CUSTOM_SYNC ) <nl> - # error Unable to determine platform for sync <nl> - # endif <nl> - <nl> - # include < grpc / support / time . h > / * for gpr_timespec * / <nl> - <nl> - # ifdef __cplusplus <nl> - extern " C " { <nl> - # endif <nl> - <nl> - / * mmm Mutex interface mmm <nl> - <nl> - At most one thread may hold an exclusive lock on a mutex at any given time . <nl> - Actions taken by a thread that holds a mutex exclusively happen after <nl> - actions taken by all previous holders of the mutex . Variables of type <nl> - gpr_mu are uninitialized when first declared . * / <nl> - <nl> - / * Initialize * mu . Requires : * mu uninitialized . * / <nl> - void gpr_mu_init ( gpr_mu * mu ) ; <nl> - <nl> - / * Cause * mu no longer to be initialized , freeing any memory in use . Requires : <nl> - * mu initialized ; no other concurrent operation on * mu . * / <nl> - void gpr_mu_destroy ( gpr_mu * mu ) ; <nl> - <nl> - / * Wait until no thread has a lock on * mu , cause the calling thread to own an <nl> - exclusive lock on * mu , then return . May block indefinitely or crash if the <nl> - calling thread has a lock on * mu . Requires : * mu initialized . * / <nl> - void gpr_mu_lock ( gpr_mu * mu ) ; <nl> - <nl> - / * Release an exclusive lock on * mu held by the calling thread . Requires : * mu <nl> - initialized ; the calling thread holds an exclusive lock on * mu . * / <nl> - void gpr_mu_unlock ( gpr_mu * mu ) ; <nl> - <nl> - / * Without blocking , attempt to acquire an exclusive lock on * mu for the <nl> - calling thread , then return non - zero iff success . Fail , if any thread holds <nl> - the lock ; succeeds with high probability if no thread holds the lock . <nl> - Requires : * mu initialized . * / <nl> - int gpr_mu_trylock ( gpr_mu * mu ) ; <nl> - <nl> - / * mmm Condition variable interface mmm <nl> - <nl> - A while - loop should be used with gpr_cv_wait ( ) when waiting for conditions <nl> - to become true . See the example below . Variables of type gpr_cv are <nl> - uninitialized when first declared . * / <nl> - <nl> - / * Initialize * cv . Requires : * cv uninitialized . * / <nl> - void gpr_cv_init ( gpr_cv * cv ) ; <nl> - <nl> - / * Cause * cv no longer to be initialized , freeing any memory in use . Requires : <nl> - * cv initialized ; no other concurrent operation on * cv . * / <nl> - void gpr_cv_destroy ( gpr_cv * cv ) ; <nl> - <nl> - / * Atomically release * mu and wait on * cv . When the calling thread is woken <nl> - from * cv or the deadline abs_deadline is exceeded , execute gpr_mu_lock ( mu ) <nl> - and return whether the deadline was exceeded . Use <nl> - abs_deadline = = gpr_inf_future for no deadline . May return even when not <nl> - woken explicitly . Requires : * mu and * cv initialized ; the calling thread <nl> - holds an exclusive lock on * mu . * / <nl> - int gpr_cv_wait ( gpr_cv * cv , gpr_mu * mu , gpr_timespec abs_deadline ) ; <nl> - <nl> - / * If any threads are waiting on * cv , wake at least one . <nl> - Clients may treat this as an optimization of gpr_cv_broadcast ( ) <nl> - for use in the case where waking more than one waiter is not useful . <nl> - Requires : * cv initialized . * / <nl> - void gpr_cv_signal ( gpr_cv * cv ) ; <nl> - <nl> - / * Wake all threads waiting on * cv . Requires : * cv initialized . * / <nl> - void gpr_cv_broadcast ( gpr_cv * cv ) ; <nl> - <nl> - / * mmm One - time initialization mmm <nl> - <nl> - gpr_once must be declared with static storage class , and initialized with <nl> - GPR_ONCE_INIT . e . g . , <nl> - static gpr_once once_var = GPR_ONCE_INIT ; * / <nl> - <nl> - / * Ensure that ( * init_routine ) ( ) has been called exactly once ( for the <nl> - specified gpr_once instance ) and then return . <nl> - If multiple threads call gpr_once ( ) on the same gpr_once instance , one of <nl> - them will call ( * init_routine ) ( ) , and the others will block until that call <nl> - finishes . * / <nl> - void gpr_once_init ( gpr_once * once , void ( * init_routine ) ( void ) ) ; <nl> - <nl> - / * mmm One - time event notification mmm <nl> - <nl> - These operations act on a gpr_event , which should be initialized with <nl> - gpr_ev_init ( ) , or with GPR_EVENT_INIT if static , e . g . , <nl> - static gpr_event event_var = GPR_EVENT_INIT ; <nl> - It requires no destruction . * / <nl> - <nl> - / * Initialize * ev . * / <nl> - void gpr_event_init ( gpr_event * ev ) ; <nl> - <nl> - / * Set * ev so that gpr_event_get ( ) and gpr_event_wait ( ) will return value . <nl> - Requires : * ev initialized ; value ! = NULL ; no prior or concurrent calls to <nl> - gpr_event_set ( ev , . . . ) since initialization . * / <nl> - void gpr_event_set ( gpr_event * ev , void * value ) ; <nl> - <nl> - / * Return the value set by gpr_event_set ( ev , . . . ) , or NULL if no such call has <nl> - completed . If the result is non - NULL , all operations that occurred prior to <nl> - the gpr_event_set ( ev , . . . ) set will be visible after this call returns . <nl> - Requires : * ev initialized . This operation is faster than acquiring a mutex <nl> - on most platforms . * / <nl> - void * gpr_event_get ( gpr_event * ev ) ; <nl> - <nl> - / * Wait until * ev is set by gpr_event_set ( ev , . . . ) , or abs_deadline is <nl> - exceeded , then return gpr_event_get ( ev ) . Requires : * ev initialized . Use <nl> - abs_deadline = = gpr_inf_future for no deadline . When the event has been <nl> - signalled before the call , this operation is faster than acquiring a mutex <nl> - on most platforms . * / <nl> - void * gpr_event_wait ( gpr_event * ev , gpr_timespec abs_deadline ) ; <nl> - <nl> - / * mmm Reference counting mmm <nl> - <nl> - These calls act on the type gpr_refcount . It requires no destruction . * / <nl> - <nl> - / * Initialize * r to value n . * / <nl> - void gpr_ref_init ( gpr_refcount * r , int n ) ; <nl> - <nl> - / * Increment the reference count * r . Requires * r initialized . * / <nl> - void gpr_ref ( gpr_refcount * r ) ; <nl> - <nl> - / * Increment the reference count * r by n . Requires * r initialized , n > 0 . * / <nl> - void gpr_refn ( gpr_refcount * r , int n ) ; <nl> - <nl> - / * Decrement the reference count * r and return non - zero iff it has reached <nl> - zero . . Requires * r initialized . * / <nl> - int gpr_unref ( gpr_refcount * r ) ; <nl> - <nl> - / * mmm Stats counters mmm <nl> - <nl> - These calls act on the integral type gpr_stats_counter . It requires no <nl> - destruction . Static instances may be initialized with <nl> - gpr_stats_counter c = GPR_STATS_INIT ; <nl> - Beware : These operations do not imply memory barriers . Do not use them to <nl> - synchronize other events . * / <nl> - <nl> - / * Initialize * c to the value n . * / <nl> - void gpr_stats_init ( gpr_stats_counter * c , intptr_t n ) ; <nl> - <nl> - / * * c + = inc . Requires : * c initialized . * / <nl> - void gpr_stats_inc ( gpr_stats_counter * c , intptr_t inc ) ; <nl> - <nl> - / * Return * c . Requires : * c initialized . * / <nl> - intptr_t gpr_stats_read ( const gpr_stats_counter * c ) ; <nl> - <nl> - / * = = = = = = = = = = = = = = = = = = Example use of interface = = = = = = = = = = = = = = = = = = = <nl> - A producer - consumer queue of up to N integers , <nl> - illustrating the use of the calls in this interface . * / <nl> - # if 0 <nl> - <nl> - # define N 4 <nl> - <nl> - typedef struct queue { <nl> - gpr_cv non_empty ; / * Signalled when length becomes non - zero . * / <nl> - gpr_cv non_full ; / * Signalled when length becomes non - N . * / <nl> - gpr_mu mu ; / * Protects all fields below . <nl> - ( That is , except during initialization or <nl> - destruction , the fields below should be accessed <nl> - only by a thread that holds mu . ) * / <nl> - int head ; / * Index of head of queue 0 . . N - 1 . * / <nl> - int length ; / * Number of valid elements in queue 0 . . N . * / <nl> - int elem [ N ] ; / * elem [ head . . head + length - 1 ] are queue elements . * / <nl> - } queue ; <nl> - <nl> - / * Initialize * q . * / <nl> - void queue_init ( queue * q ) { <nl> - gpr_mu_init ( & q - > mu ) ; <nl> - gpr_cv_init ( & q - > non_empty ) ; <nl> - gpr_cv_init ( & q - > non_full ) ; <nl> - q - > head = 0 ; <nl> - q - > length = 0 ; <nl> - } <nl> - <nl> - / * Free storage associated with * q . * / <nl> - void queue_destroy ( queue * q ) { <nl> - gpr_mu_destroy ( & q - > mu ) ; <nl> - gpr_cv_destroy ( & q - > non_empty ) ; <nl> - gpr_cv_destroy ( & q - > non_full ) ; <nl> - } <nl> - <nl> - / * Wait until there is room in * q , then append x to * q . * / <nl> - void queue_append ( queue * q , int x ) { <nl> - gpr_mu_lock ( & q - > mu ) ; <nl> - / * To wait for a predicate without a deadline , loop on the negation of the <nl> - predicate , and use gpr_cv_wait ( . . . , gpr_inf_future ) inside the loop <nl> - to release the lock , wait , and reacquire on each iteration . Code that <nl> - makes the condition true should use gpr_cv_broadcast ( ) on the <nl> - corresponding condition variable . The predicate must be on state <nl> - protected by the lock . * / <nl> - while ( q - > length = = N ) { <nl> - gpr_cv_wait ( & q - > non_full , & q - > mu , gpr_inf_future ) ; <nl> - } <nl> - if ( q - > length = = 0 ) { / * Wake threads blocked in queue_remove ( ) . * / <nl> - / * It ' s normal to use gpr_cv_broadcast ( ) or gpr_signal ( ) while <nl> - holding the lock . * / <nl> - gpr_cv_broadcast ( & q - > non_empty ) ; <nl> - } <nl> - q - > elem [ ( q - > head + q - > length ) % N ] = x ; <nl> - q - > length + + ; <nl> - gpr_mu_unlock ( & q - > mu ) ; <nl> - } <nl> - <nl> - / * If it can be done without blocking , append x to * q and return non - zero . <nl> - Otherwise return 0 . * / <nl> - int queue_try_append ( queue * q , int x ) { <nl> - int result = 0 ; <nl> - if ( gpr_mu_trylock ( & q - > mu ) ) { <nl> - if ( q - > length ! = N ) { <nl> - if ( q - > length = = 0 ) { / * Wake threads blocked in queue_remove ( ) . * / <nl> - gpr_cv_broadcast ( & q - > non_empty ) ; <nl> - } <nl> - q - > elem [ ( q - > head + q - > length ) % N ] = x ; <nl> - q - > length + + ; <nl> - result = 1 ; <nl> - } <nl> - gpr_mu_unlock ( & q - > mu ) ; <nl> - } <nl> - return result ; <nl> - } <nl> - <nl> - / * Wait until the * q is non - empty or deadline abs_deadline passes . If the <nl> - queue is non - empty , remove its head entry , place it in * head , and return <nl> - non - zero . Otherwise return 0 . * / <nl> - int queue_remove ( queue * q , int * head , gpr_timespec abs_deadline ) { <nl> - int result = 0 ; <nl> - gpr_mu_lock ( & q - > mu ) ; <nl> - / * To wait for a predicate with a deadline , loop on the negation of the <nl> - predicate or until gpr_cv_wait ( ) returns true . Code that makes <nl> - the condition true should use gpr_cv_broadcast ( ) on the corresponding <nl> - condition variable . The predicate must be on state protected by the <nl> - lock . * / <nl> - while ( q - > length = = 0 & & <nl> - ! gpr_cv_wait ( & q - > non_empty , & q - > mu , abs_deadline ) ) { <nl> - } <nl> - if ( q - > length ! = 0 ) { / * Queue is non - empty . * / <nl> - result = 1 ; <nl> - if ( q - > length = = N ) { / * Wake threads blocked in queue_append ( ) . * / <nl> - gpr_cv_broadcast ( & q - > non_full ) ; <nl> - } <nl> - * head = q - > elem [ q - > head ] ; <nl> - q - > head = ( q - > head + 1 ) % N ; <nl> - q - > length - - ; <nl> - } / * else deadline exceeded * / <nl> - gpr_mu_unlock ( & q - > mu ) ; <nl> - return result ; <nl> - } <nl> - # endif / * 0 * / <nl> - <nl> - # ifdef __cplusplus <nl> - } <nl> - # endif <nl> + # include < grpc / impl / codegen / sync . h > <nl> <nl> # endif / * GRPC_SUPPORT_SYNC_H * / <nl> mmm a / include / grpc / support / sync_generic . h <nl> ppp b / include / grpc / support / sync_generic . h <nl> <nl> <nl> # ifndef GRPC_SUPPORT_SYNC_GENERIC_H <nl> # define GRPC_SUPPORT_SYNC_GENERIC_H <nl> - / * Generic type defintions for gpr_sync . * / <nl> <nl> - # include < grpc / support / atm . h > <nl> - <nl> - / * gpr_event * / <nl> - typedef struct { gpr_atm state ; } gpr_event ; <nl> - <nl> - # define GPR_EVENT_INIT \ <nl> - { 0 } <nl> - <nl> - / * gpr_refcount * / <nl> - typedef struct { gpr_atm count ; } gpr_refcount ; <nl> - <nl> - / * gpr_stats_counter * / <nl> - typedef struct { gpr_atm value ; } gpr_stats_counter ; <nl> - <nl> - # define GPR_STATS_INIT \ <nl> - { 0 } <nl> + # include < grpc / impl / codegen / sync_generic . h > <nl> <nl> # endif / * GRPC_SUPPORT_SYNC_GENERIC_H * / <nl> mmm a / include / grpc / support / sync_posix . h <nl> ppp b / include / grpc / support / sync_posix . h <nl> <nl> # ifndef GRPC_SUPPORT_SYNC_POSIX_H <nl> # define GRPC_SUPPORT_SYNC_POSIX_H <nl> <nl> - # include < grpc / support / sync_generic . h > <nl> - <nl> - # include < pthread . h > <nl> - <nl> - typedef pthread_mutex_t gpr_mu ; <nl> - typedef pthread_cond_t gpr_cv ; <nl> - typedef pthread_once_t gpr_once ; <nl> - <nl> - # define GPR_ONCE_INIT PTHREAD_ONCE_INIT <nl> + # include < grpc / impl / codegen / sync_posix . h > <nl> <nl> # endif / * GRPC_SUPPORT_SYNC_POSIX_H * / <nl> mmm a / include / grpc / support / sync_win32 . h <nl> ppp b / include / grpc / support / sync_win32 . h <nl> <nl> # ifndef GRPC_SUPPORT_SYNC_WIN32_H <nl> # define GRPC_SUPPORT_SYNC_WIN32_H <nl> <nl> - # include < grpc / support / sync_generic . h > <nl> - <nl> - typedef struct { <nl> - CRITICAL_SECTION cs ; / * Not an SRWLock until Vista is unsupported * / <nl> - int locked ; <nl> - } gpr_mu ; <nl> - <nl> - typedef CONDITION_VARIABLE gpr_cv ; <nl> - <nl> - typedef INIT_ONCE gpr_once ; <nl> - # define GPR_ONCE_INIT INIT_ONCE_STATIC_INIT <nl> + # include < grpc / impl / codegen / sync_win32 . h > <nl> <nl> # endif / * GRPC_SUPPORT_SYNC_WIN32_H * / <nl> mmm a / package . json <nl> ppp b / package . json <nl> <nl> " include / grpc / support / tls_msvc . h " , <nl> " include / grpc / support / tls_pthread . h " , <nl> " include / grpc / support / useful . h " , <nl> + " include / grpc / impl / codegen / atm . h " , <nl> + " include / grpc / impl / codegen / atm_gcc_atomic . h " , <nl> + " include / grpc / impl / codegen / atm_gcc_sync . h " , <nl> + " include / grpc / impl / codegen / atm_win32 . h " , <nl> + " include / grpc / impl / codegen / byte_buffer . h " , <nl> + " include / grpc / impl / codegen / compression_types . h " , <nl> " include / grpc / impl / codegen / connectivity_state . h " , <nl> + " include / grpc / impl / codegen / grpc_types . h " , <nl> + " include / grpc / impl / codegen / log . h " , <nl> " include / grpc / impl / codegen / port_platform . h " , <nl> + " include / grpc / impl / codegen / propagation_bits . h " , <nl> + " include / grpc / impl / codegen / slice . h " , <nl> + " include / grpc / impl / codegen / slice_buffer . h " , <nl> + " include / grpc / impl / codegen / status . h " , <nl> + " include / grpc / impl / codegen / sync . h " , <nl> + " include / grpc / impl / codegen / sync_generic . h " , <nl> + " include / grpc / impl / codegen / sync_posix . h " , <nl> + " include / grpc / impl / codegen / sync_win32 . h " , <nl> " include / grpc / impl / codegen / time . h " , <nl> " src / core / profiling / timers . h " , <nl> " src / core / support / block_annotate . h " , <nl> mmm a / src / cpp / server / server_context . cc <nl> ppp b / src / cpp / server / server_context . cc <nl> <nl> # include < grpc / grpc . h > <nl> # include < grpc / support / alloc . h > <nl> # include < grpc / support / log . h > <nl> + # include < grpc + + / completion_queue . h > <nl> # include < grpc + + / impl / call . h > <nl> # include < grpc + + / impl / sync . h > <nl> # include < grpc + + / support / time . h > <nl> mmm a / test / core / surface / public_headers_must_be_c89 . c <nl> ppp b / test / core / surface / public_headers_must_be_c89 . c <nl> <nl> # include < grpc / compression . h > <nl> # include < grpc / grpc . h > <nl> # include < grpc / grpc_security . h > <nl> + # include < grpc / impl / codegen / atm . h > <nl> + # include < grpc / impl / codegen / byte_buffer . h > <nl> + # include < grpc / impl / codegen / compression_types . h > <nl> # include < grpc / impl / codegen / connectivity_state . h > <nl> + # include < grpc / impl / codegen / grpc_types . h > <nl> + # include < grpc / impl / codegen / log . h > <nl> # include < grpc / impl / codegen / port_platform . h > <nl> + # include < grpc / impl / codegen / propagation_bits . h > <nl> + # include < grpc / impl / codegen / slice . h > <nl> + # include < grpc / impl / codegen / slice_buffer . h > <nl> + # include < grpc / impl / codegen / status . h > <nl> + # include < grpc / impl / codegen / sync . h > <nl> + # include < grpc / impl / codegen / sync_generic . h > <nl> # include < grpc / impl / codegen / time . h > <nl> # include < grpc / status . h > <nl> # include < grpc / support / alloc . h > <nl> mmm a / test / cpp / util / cli_call . cc <nl> ppp b / test / cpp / util / cli_call . cc <nl> <nl> <nl> # include < grpc + + / channel . h > <nl> # include < grpc + + / client_context . h > <nl> + # include < grpc + + / completion_queue . h > <nl> # include < grpc + + / generic / generic_stub . h > <nl> # include < grpc + + / support / byte_buffer . h > <nl> # include < grpc / grpc . h > <nl> mmm a / tools / doxygen / Doxyfile . c + + <nl> ppp b / tools / doxygen / Doxyfile . c + + <nl> include / grpc + + / impl / codegen / call_hook . h \ <nl> include / grpc + + / impl / codegen / channel_interface . h \ <nl> include / grpc + + / impl / codegen / completion_queue_tag . h \ <nl> include / grpc + + / impl / codegen / config . h \ <nl> + include / grpc + + / impl / codegen / security / auth_context . h \ <nl> include / grpc + + / impl / codegen / server_interface . h \ <nl> include / grpc + + / impl / codegen / status . h \ <nl> include / grpc + + / impl / codegen / status_code_enum . h \ <nl> + include / grpc + + / impl / codegen / string_ref . h \ <nl> + include / grpc + + / impl / codegen / sync . h \ <nl> + include / grpc + + / impl / codegen / sync_cxx11 . h \ <nl> + include / grpc + + / impl / codegen / sync_no_cxx11 . h \ <nl> include / grpc + + / impl / codegen / time . h <nl> <nl> # This tag can be used to specify the character encoding of the source files <nl> mmm a / tools / doxygen / Doxyfile . c + + . internal <nl> ppp b / tools / doxygen / Doxyfile . c + + . internal <nl> include / grpc + + / impl / codegen / call_hook . h \ <nl> include / grpc + + / impl / codegen / channel_interface . h \ <nl> include / grpc + + / impl / codegen / completion_queue_tag . h \ <nl> include / grpc + + / impl / codegen / config . h \ <nl> + include / grpc + + / impl / codegen / security / auth_context . h \ <nl> include / grpc + + / impl / codegen / server_interface . h \ <nl> include / grpc + + / impl / codegen / status . h \ <nl> include / grpc + + / impl / codegen / status_code_enum . h \ <nl> + include / grpc + + / impl / codegen / string_ref . h \ <nl> + include / grpc + + / impl / codegen / sync . h \ <nl> + include / grpc + + / impl / codegen / sync_cxx11 . h \ <nl> + include / grpc + + / impl / codegen / sync_no_cxx11 . h \ <nl> include / grpc + + / impl / codegen / time . h \ <nl> src / cpp / client / secure_credentials . h \ <nl> src / cpp / common / secure_auth_context . h \ <nl> mmm a / tools / doxygen / Doxyfile . core <nl> ppp b / tools / doxygen / Doxyfile . core <nl> include / grpc / support / tls_gcc . h \ <nl> include / grpc / support / tls_msvc . h \ <nl> include / grpc / support / tls_pthread . h \ <nl> include / grpc / support / useful . h \ <nl> + include / grpc / impl / codegen / atm . h \ <nl> + include / grpc / impl / codegen / atm_gcc_atomic . h \ <nl> + include / grpc / impl / codegen / atm_gcc_sync . h \ <nl> + include / grpc / impl / codegen / atm_win32 . h \ <nl> + include / grpc / impl / codegen / byte_buffer . h \ <nl> + include / grpc / impl / codegen / compression_types . h \ <nl> include / grpc / impl / codegen / connectivity_state . h \ <nl> + include / grpc / impl / codegen / grpc_types . h \ <nl> + include / grpc / impl / codegen / log . h \ <nl> include / grpc / impl / codegen / port_platform . h \ <nl> + include / grpc / impl / codegen / propagation_bits . h \ <nl> + include / grpc / impl / codegen / slice . h \ <nl> + include / grpc / impl / codegen / slice_buffer . h \ <nl> + include / grpc / impl / codegen / status . h \ <nl> + include / grpc / impl / codegen / sync . h \ <nl> + include / grpc / impl / codegen / sync_generic . h \ <nl> + include / grpc / impl / codegen / sync_posix . h \ <nl> + include / grpc / impl / codegen / sync_win32 . h \ <nl> include / grpc / impl / codegen / time . h <nl> <nl> # This tag can be used to specify the character encoding of the source files <nl> mmm a / tools / doxygen / Doxyfile . core . internal <nl> ppp b / tools / doxygen / Doxyfile . core . internal <nl> include / grpc / support / tls_gcc . h \ <nl> include / grpc / support / tls_msvc . h \ <nl> include / grpc / support / tls_pthread . h \ <nl> include / grpc / support / useful . h \ <nl> + include / grpc / impl / codegen / atm . h \ <nl> + include / grpc / impl / codegen / atm_gcc_atomic . h \ <nl> + include / grpc / impl / codegen / atm_gcc_sync . h \ <nl> + include / grpc / impl / codegen / atm_win32 . h \ <nl> + include / grpc / impl / codegen / byte_buffer . h \ <nl> + include / grpc / impl / codegen / compression_types . h \ <nl> include / grpc / impl / codegen / connectivity_state . h \ <nl> + include / grpc / impl / codegen / grpc_types . h \ <nl> + include / grpc / impl / codegen / log . h \ <nl> include / grpc / impl / codegen / port_platform . h \ <nl> + include / grpc / impl / codegen / propagation_bits . h \ <nl> + include / grpc / impl / codegen / slice . h \ <nl> + include / grpc / impl / codegen / slice_buffer . h \ <nl> + include / grpc / impl / codegen / status . h \ <nl> + include / grpc / impl / codegen / sync . h \ <nl> + include / grpc / impl / codegen / sync_generic . h \ <nl> + include / grpc / impl / codegen / sync_posix . h \ <nl> + include / grpc / impl / codegen / sync_win32 . h \ <nl> include / grpc / impl / codegen / time . h \ <nl> src / core / profiling / timers . h \ <nl> src / core / support / block_annotate . h \ <nl> mmm a / tools / run_tests / sources_and_headers . json <nl> ppp b / tools / run_tests / sources_and_headers . json <nl> <nl> { <nl> " deps " : [ ] , <nl> " headers " : [ <nl> + " include / grpc / impl / codegen / atm . h " , <nl> + " include / grpc / impl / codegen / atm_gcc_atomic . h " , <nl> + " include / grpc / impl / codegen / atm_gcc_sync . h " , <nl> + " include / grpc / impl / codegen / atm_win32 . h " , <nl> + " include / grpc / impl / codegen / byte_buffer . h " , <nl> + " include / grpc / impl / codegen / compression_types . h " , <nl> " include / grpc / impl / codegen / connectivity_state . h " , <nl> + " include / grpc / impl / codegen / grpc_types . h " , <nl> + " include / grpc / impl / codegen / log . h " , <nl> " include / grpc / impl / codegen / port_platform . h " , <nl> + " include / grpc / impl / codegen / propagation_bits . h " , <nl> + " include / grpc / impl / codegen / slice . h " , <nl> + " include / grpc / impl / codegen / slice_buffer . h " , <nl> + " include / grpc / impl / codegen / status . h " , <nl> + " include / grpc / impl / codegen / sync . h " , <nl> + " include / grpc / impl / codegen / sync_generic . h " , <nl> + " include / grpc / impl / codegen / sync_posix . h " , <nl> + " include / grpc / impl / codegen / sync_win32 . h " , <nl> " include / grpc / impl / codegen / time . h " , <nl> " include / grpc / support / alloc . h " , <nl> " include / grpc / support / atm . h " , <nl> <nl> " language " : " c " , <nl> " name " : " gpr " , <nl> " src " : [ <nl> + " include / grpc / impl / codegen / atm . h " , <nl> + " include / grpc / impl / codegen / atm_gcc_atomic . h " , <nl> + " include / grpc / impl / codegen / atm_gcc_sync . h " , <nl> + " include / grpc / impl / codegen / atm_win32 . h " , <nl> + " include / grpc / impl / codegen / byte_buffer . h " , <nl> + " include / grpc / impl / codegen / compression_types . h " , <nl> " include / grpc / impl / codegen / connectivity_state . h " , <nl> + " include / grpc / impl / codegen / grpc_types . h " , <nl> + " include / grpc / impl / codegen / log . h " , <nl> " include / grpc / impl / codegen / port_platform . h " , <nl> + " include / grpc / impl / codegen / propagation_bits . h " , <nl> + " include / grpc / impl / codegen / slice . h " , <nl> + " include / grpc / impl / codegen / slice_buffer . h " , <nl> + " include / grpc / impl / codegen / status . h " , <nl> + " include / grpc / impl / codegen / sync . h " , <nl> + " include / grpc / impl / codegen / sync_generic . h " , <nl> + " include / grpc / impl / codegen / sync_posix . h " , <nl> + " include / grpc / impl / codegen / sync_win32 . h " , <nl> " include / grpc / impl / codegen / time . h " , <nl> " include / grpc / support / alloc . h " , <nl> " include / grpc / support / atm . h " , <nl> <nl> " include / grpc + + / impl / codegen / channel_interface . h " , <nl> " include / grpc + + / impl / codegen / completion_queue_tag . h " , <nl> " include / grpc + + / impl / codegen / config . h " , <nl> + " include / grpc + + / impl / codegen / security / auth_context . h " , <nl> " include / grpc + + / impl / codegen / server_interface . h " , <nl> " include / grpc + + / impl / codegen / status . h " , <nl> " include / grpc + + / impl / codegen / status_code_enum . h " , <nl> + " include / grpc + + / impl / codegen / string_ref . h " , <nl> + " include / grpc + + / impl / codegen / sync . h " , <nl> + " include / grpc + + / impl / codegen / sync_cxx11 . h " , <nl> + " include / grpc + + / impl / codegen / sync_no_cxx11 . h " , <nl> " include / grpc + + / impl / codegen / time . h " , <nl> " include / grpc + + / impl / grpc_library . h " , <nl> " include / grpc + + / impl / method_handler_impl . h " , <nl> <nl> " include / grpc + + / impl / codegen / channel_interface . h " , <nl> " include / grpc + + / impl / codegen / completion_queue_tag . h " , <nl> " include / grpc + + / impl / codegen / config . h " , <nl> + " include / grpc + + / impl / codegen / security / auth_context . h " , <nl> " include / grpc + + / impl / codegen / server_interface . h " , <nl> " include / grpc + + / impl / codegen / status . h " , <nl> " include / grpc + + / impl / codegen / status_code_enum . h " , <nl> + " include / grpc + + / impl / codegen / string_ref . h " , <nl> + " include / grpc + + / impl / codegen / sync . h " , <nl> + " include / grpc + + / impl / codegen / sync_cxx11 . h " , <nl> + " include / grpc + + / impl / codegen / sync_no_cxx11 . h " , <nl> " include / grpc + + / impl / codegen / time . h " , <nl> " include / grpc + + / impl / grpc_library . h " , <nl> " include / grpc + + / impl / method_handler_impl . h " , <nl> <nl> " include / grpc + + / impl / codegen / channel_interface . h " , <nl> " include / grpc + + / impl / codegen / completion_queue_tag . h " , <nl> " include / grpc + + / impl / codegen / config . h " , <nl> + " include / grpc + + / impl / codegen / security / auth_context . h " , <nl> " include / grpc + + / impl / codegen / server_interface . h " , <nl> " include / grpc + + / impl / codegen / status . h " , <nl> " include / grpc + + / impl / codegen / status_code_enum . h " , <nl> + " include / grpc + + / impl / codegen / string_ref . h " , <nl> + " include / grpc + + / impl / codegen / sync . h " , <nl> + " include / grpc + + / impl / codegen / sync_cxx11 . h " , <nl> + " include / grpc + + / impl / codegen / sync_no_cxx11 . h " , <nl> " include / grpc + + / impl / codegen / time . h " , <nl> " include / grpc + + / impl / grpc_library . h " , <nl> " include / grpc + + / impl / method_handler_impl . h " , <nl> <nl> " include / grpc + + / impl / codegen / channel_interface . h " , <nl> " include / grpc + + / impl / codegen / completion_queue_tag . h " , <nl> " include / grpc + + / impl / codegen / config . h " , <nl> + " include / grpc + + / impl / codegen / security / auth_context . h " , <nl> " include / grpc + + / impl / codegen / server_interface . h " , <nl> " include / grpc + + / impl / codegen / status . h " , <nl> " include / grpc + + / impl / codegen / status_code_enum . h " , <nl> + " include / grpc + + / impl / codegen / string_ref . h " , <nl> + " include / grpc + + / impl / codegen / sync . h " , <nl> + " include / grpc + + / impl / codegen / sync_cxx11 . h " , <nl> + " include / grpc + + / impl / codegen / sync_no_cxx11 . h " , <nl> " include / grpc + + / impl / codegen / time . h " , <nl> " include / grpc + + / impl / grpc_library . h " , <nl> " include / grpc + + / impl / method_handler_impl . h " , <nl> <nl> " include / grpc + + / impl / codegen / channel_interface . h " , <nl> " include / grpc + + / impl / codegen / completion_queue_tag . h " , <nl> " include / grpc + + / impl / codegen / config . h " , <nl> + " include / grpc + + / impl / codegen / security / auth_context . h " , <nl> " include / grpc + + / impl / codegen / server_interface . h " , <nl> " include / grpc + + / impl / codegen / status . h " , <nl> " include / grpc + + / impl / codegen / status_code_enum . h " , <nl> + " include / grpc + + / impl / codegen / string_ref . h " , <nl> + " include / grpc + + / impl / codegen / sync . h " , <nl> + " include / grpc + + / impl / codegen / sync_cxx11 . h " , <nl> + " include / grpc + + / impl / codegen / sync_no_cxx11 . h " , <nl> " include / grpc + + / impl / codegen / time . h " , <nl> " include / grpc + + / support / config . h " , <nl> " include / grpc + + / support / config_protobuf . h " , <nl> + " include / grpc / impl / codegen / atm . h " , <nl> + " include / grpc / impl / codegen / atm_gcc_atomic . h " , <nl> + " include / grpc / impl / codegen / atm_gcc_sync . h " , <nl> + " include / grpc / impl / codegen / atm_win32 . h " , <nl> + " include / grpc / impl / codegen / byte_buffer . h " , <nl> + " include / grpc / impl / codegen / compression_types . h " , <nl> " include / grpc / impl / codegen / connectivity_state . h " , <nl> + " include / grpc / impl / codegen / grpc_types . h " , <nl> + " include / grpc / impl / codegen / log . h " , <nl> " include / grpc / impl / codegen / port_platform . h " , <nl> + " include / grpc / impl / codegen / propagation_bits . h " , <nl> + " include / grpc / impl / codegen / slice . h " , <nl> + " include / grpc / impl / codegen / slice_buffer . h " , <nl> + " include / grpc / impl / codegen / status . h " , <nl> + " include / grpc / impl / codegen / sync . h " , <nl> + " include / grpc / impl / codegen / sync_generic . h " , <nl> + " include / grpc / impl / codegen / sync_posix . h " , <nl> + " include / grpc / impl / codegen / sync_win32 . h " , <nl> " include / grpc / impl / codegen / time . h " , <nl> " src / compiler / config . h " , <nl> " src / compiler / cpp_generator . h " , <nl> <nl> " include / grpc + + / impl / codegen / channel_interface . h " , <nl> " include / grpc + + / impl / codegen / completion_queue_tag . h " , <nl> " include / grpc + + / impl / codegen / config . h " , <nl> + " include / grpc + + / impl / codegen / security / auth_context . h " , <nl> " include / grpc + + / impl / codegen / server_interface . h " , <nl> " include / grpc + + / impl / codegen / status . h " , <nl> " include / grpc + + / impl / codegen / status_code_enum . h " , <nl> + " include / grpc + + / impl / codegen / string_ref . h " , <nl> + " include / grpc + + / impl / codegen / sync . h " , <nl> + " include / grpc + + / impl / codegen / sync_cxx11 . h " , <nl> + " include / grpc + + / impl / codegen / sync_no_cxx11 . h " , <nl> " include / grpc + + / impl / codegen / time . h " , <nl> " include / grpc + + / support / config . h " , <nl> " include / grpc + + / support / config_protobuf . h " , <nl> + " include / grpc / impl / codegen / atm . h " , <nl> + " include / grpc / impl / codegen / atm_gcc_atomic . h " , <nl> + " include / grpc / impl / codegen / atm_gcc_sync . h " , <nl> + " include / grpc / impl / codegen / atm_win32 . h " , <nl> + " include / grpc / impl / codegen / byte_buffer . h " , <nl> + " include / grpc / impl / codegen / compression_types . h " , <nl> " include / grpc / impl / codegen / connectivity_state . h " , <nl> + " include / grpc / impl / codegen / grpc_types . h " , <nl> + " include / grpc / impl / codegen / log . h " , <nl> " include / grpc / impl / codegen / port_platform . h " , <nl> + " include / grpc / impl / codegen / propagation_bits . h " , <nl> + " include / grpc / impl / codegen / slice . h " , <nl> + " include / grpc / impl / codegen / slice_buffer . h " , <nl> + " include / grpc / impl / codegen / status . h " , <nl> + " include / grpc / impl / codegen / sync . h " , <nl> + " include / grpc / impl / codegen / sync_generic . h " , <nl> + " include / grpc / impl / codegen / sync_posix . h " , <nl> + " include / grpc / impl / codegen / sync_win32 . h " , <nl> " include / grpc / impl / codegen / time . h " , <nl> " src / compiler / config . h " , <nl> " src / compiler / cpp_generator . cc " , <nl> mmm a / vsprojects / vcxproj / gpr / gpr . vcxproj <nl> ppp b / vsprojects / vcxproj / gpr / gpr . vcxproj <nl> <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ support \ tls_msvc . h " / > <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ support \ tls_pthread . h " / > <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ support \ useful . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ atm . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ atm_gcc_atomic . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ atm_gcc_sync . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ atm_win32 . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ byte_buffer . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ compression_types . h " / > <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ connectivity_state . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ grpc_types . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ log . h " / > <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ port_platform . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ propagation_bits . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ slice . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ slice_buffer . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ status . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ sync . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ sync_generic . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ sync_posix . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ sync_win32 . h " / > <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ time . h " / > <nl> < / ItemGroup > <nl> < ItemGroup > <nl> mmm a / vsprojects / vcxproj / gpr / gpr . vcxproj . filters <nl> ppp b / vsprojects / vcxproj / gpr / gpr . vcxproj . filters <nl> <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ support \ useful . h " > <nl> < Filter > include \ grpc \ support < / Filter > <nl> < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ atm . h " > <nl> + < Filter > include \ grpc \ impl \ codegen < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ atm_gcc_atomic . h " > <nl> + < Filter > include \ grpc \ impl \ codegen < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ atm_gcc_sync . h " > <nl> + < Filter > include \ grpc \ impl \ codegen < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ atm_win32 . h " > <nl> + < Filter > include \ grpc \ impl \ codegen < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ byte_buffer . h " > <nl> + < Filter > include \ grpc \ impl \ codegen < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ compression_types . h " > <nl> + < Filter > include \ grpc \ impl \ codegen < / Filter > <nl> + < / ClInclude > <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ connectivity_state . h " > <nl> < Filter > include \ grpc \ impl \ codegen < / Filter > <nl> < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ grpc_types . h " > <nl> + < Filter > include \ grpc \ impl \ codegen < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ log . h " > <nl> + < Filter > include \ grpc \ impl \ codegen < / Filter > <nl> + < / ClInclude > <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ port_platform . h " > <nl> < Filter > include \ grpc \ impl \ codegen < / Filter > <nl> < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ propagation_bits . h " > <nl> + < Filter > include \ grpc \ impl \ codegen < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ slice . h " > <nl> + < Filter > include \ grpc \ impl \ codegen < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ slice_buffer . h " > <nl> + < Filter > include \ grpc \ impl \ codegen < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ status . h " > <nl> + < Filter > include \ grpc \ impl \ codegen < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ sync . h " > <nl> + < Filter > include \ grpc \ impl \ codegen < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ sync_generic . h " > <nl> + < Filter > include \ grpc \ impl \ codegen < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ sync_posix . h " > <nl> + < Filter > include \ grpc \ impl \ codegen < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ sync_win32 . h " > <nl> + < Filter > include \ grpc \ impl \ codegen < / Filter > <nl> + < / ClInclude > <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ time . h " > <nl> < Filter > include \ grpc \ impl \ codegen < / Filter > <nl> < / ClInclude > <nl> mmm a / vsprojects / vcxproj / grpc + + / grpc + + . vcxproj <nl> ppp b / vsprojects / vcxproj / grpc + + / grpc + + . vcxproj <nl> <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ channel_interface . h " / > <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ completion_queue_tag . h " / > <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ config . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ security \ auth_context . h " / > <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ server_interface . h " / > <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ status . h " / > <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ status_code_enum . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ string_ref . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ sync . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ sync_cxx11 . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ sync_no_cxx11 . h " / > <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ time . h " / > <nl> < / ItemGroup > <nl> < ItemGroup > <nl> mmm a / vsprojects / vcxproj / grpc + + / grpc + + . vcxproj . filters <nl> ppp b / vsprojects / vcxproj / grpc + + / grpc + + . vcxproj . filters <nl> <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ config . h " > <nl> < Filter > include \ grpc + + \ impl \ codegen < / Filter > <nl> < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ security \ auth_context . h " > <nl> + < Filter > include \ grpc + + \ impl \ codegen \ security < / Filter > <nl> + < / ClInclude > <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ server_interface . h " > <nl> < Filter > include \ grpc + + \ impl \ codegen < / Filter > <nl> < / ClInclude > <nl> <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ status_code_enum . h " > <nl> < Filter > include \ grpc + + \ impl \ codegen < / Filter > <nl> < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ string_ref . h " > <nl> + < Filter > include \ grpc + + \ impl \ codegen < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ sync . h " > <nl> + < Filter > include \ grpc + + \ impl \ codegen < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ sync_cxx11 . h " > <nl> + < Filter > include \ grpc + + \ impl \ codegen < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ sync_no_cxx11 . h " > <nl> + < Filter > include \ grpc + + \ impl \ codegen < / Filter > <nl> + < / ClInclude > <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ time . h " > <nl> < Filter > include \ grpc + + \ impl \ codegen < / Filter > <nl> < / ClInclude > <nl> <nl> < Filter Include = " include \ grpc + + \ impl \ codegen " > <nl> < UniqueIdentifier > { a3e7f28b - a7c7 - 7364 - d402 - edb1bfa414a4 } < / UniqueIdentifier > <nl> < / Filter > <nl> + < Filter Include = " include \ grpc + + \ impl \ codegen \ security " > <nl> + < UniqueIdentifier > { 20cbcf00 - 994a - 300a - 5184 - bda96c6f45e4 } < / UniqueIdentifier > <nl> + < / Filter > <nl> < Filter Include = " include \ grpc + + \ security " > <nl> < UniqueIdentifier > { a80eb32b - 1be9 - 1187 - 5f40 - 30d92accecc8 } < / UniqueIdentifier > <nl> < / Filter > <nl> mmm a / vsprojects / vcxproj / grpc + + _unsecure / grpc + + _unsecure . vcxproj <nl> ppp b / vsprojects / vcxproj / grpc + + _unsecure / grpc + + _unsecure . vcxproj <nl> <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ channel_interface . h " / > <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ completion_queue_tag . h " / > <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ config . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ security \ auth_context . h " / > <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ server_interface . h " / > <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ status . h " / > <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ status_code_enum . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ string_ref . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ sync . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ sync_cxx11 . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ sync_no_cxx11 . h " / > <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ time . h " / > <nl> < / ItemGroup > <nl> < ItemGroup > <nl> mmm a / vsprojects / vcxproj / grpc + + _unsecure / grpc + + _unsecure . vcxproj . filters <nl> ppp b / vsprojects / vcxproj / grpc + + _unsecure / grpc + + _unsecure . vcxproj . filters <nl> <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ config . h " > <nl> < Filter > include \ grpc + + \ impl \ codegen < / Filter > <nl> < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ security \ auth_context . h " > <nl> + < Filter > include \ grpc + + \ impl \ codegen \ security < / Filter > <nl> + < / ClInclude > <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ server_interface . h " > <nl> < Filter > include \ grpc + + \ impl \ codegen < / Filter > <nl> < / ClInclude > <nl> <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ status_code_enum . h " > <nl> < Filter > include \ grpc + + \ impl \ codegen < / Filter > <nl> < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ string_ref . h " > <nl> + < Filter > include \ grpc + + \ impl \ codegen < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ sync . h " > <nl> + < Filter > include \ grpc + + \ impl \ codegen < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ sync_cxx11 . h " > <nl> + < Filter > include \ grpc + + \ impl \ codegen < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ sync_no_cxx11 . h " > <nl> + < Filter > include \ grpc + + \ impl \ codegen < / Filter > <nl> + < / ClInclude > <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ time . h " > <nl> < Filter > include \ grpc + + \ impl \ codegen < / Filter > <nl> < / ClInclude > <nl> <nl> < Filter Include = " include \ grpc + + \ impl \ codegen " > <nl> < UniqueIdentifier > { ccc364e2 - 3f28 - 8bfc - c26e - 800dd6f9a9af } < / UniqueIdentifier > <nl> < / Filter > <nl> + < Filter Include = " include \ grpc + + \ impl \ codegen \ security " > <nl> + < UniqueIdentifier > { 87cae06e - f40c - 8fb6 - 73d6 - 26c7482ed9da } < / UniqueIdentifier > <nl> + < / Filter > <nl> < Filter Include = " include \ grpc + + \ security " > <nl> < UniqueIdentifier > { 64bf60ff - 9192 - bb59 - dcc8 - 8a0021e1d016 } < / UniqueIdentifier > <nl> < / Filter > <nl> mmm a / vsprojects / vcxproj / grpc_plugin_support / grpc_plugin_support . vcxproj <nl> ppp b / vsprojects / vcxproj / grpc_plugin_support / grpc_plugin_support . vcxproj <nl> <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ channel_interface . h " / > <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ completion_queue_tag . h " / > <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ config . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ security \ auth_context . h " / > <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ server_interface . h " / > <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ status . h " / > <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ status_code_enum . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ string_ref . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ sync . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ sync_cxx11 . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ sync_no_cxx11 . h " / > <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ time . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ atm . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ atm_gcc_atomic . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ atm_gcc_sync . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ atm_win32 . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ byte_buffer . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ compression_types . h " / > <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ connectivity_state . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ grpc_types . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ log . h " / > <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ port_platform . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ propagation_bits . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ slice . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ slice_buffer . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ status . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ sync . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ sync_generic . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ sync_posix . h " / > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ sync_win32 . h " / > <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ time . h " / > <nl> < / ItemGroup > <nl> < ItemGroup > <nl> mmm a / vsprojects / vcxproj / grpc_plugin_support / grpc_plugin_support . vcxproj . filters <nl> ppp b / vsprojects / vcxproj / grpc_plugin_support / grpc_plugin_support . vcxproj . filters <nl> <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ config . h " > <nl> < Filter > include \ grpc + + \ impl \ codegen < / Filter > <nl> < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ security \ auth_context . h " > <nl> + < Filter > include \ grpc + + \ impl \ codegen \ security < / Filter > <nl> + < / ClInclude > <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ server_interface . h " > <nl> < Filter > include \ grpc + + \ impl \ codegen < / Filter > <nl> < / ClInclude > <nl> <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ status_code_enum . h " > <nl> < Filter > include \ grpc + + \ impl \ codegen < / Filter > <nl> < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ string_ref . h " > <nl> + < Filter > include \ grpc + + \ impl \ codegen < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ sync . h " > <nl> + < Filter > include \ grpc + + \ impl \ codegen < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ sync_cxx11 . h " > <nl> + < Filter > include \ grpc + + \ impl \ codegen < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ sync_no_cxx11 . h " > <nl> + < Filter > include \ grpc + + \ impl \ codegen < / Filter > <nl> + < / ClInclude > <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc + + \ impl \ codegen \ time . h " > <nl> < Filter > include \ grpc + + \ impl \ codegen < / Filter > <nl> < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ atm . h " > <nl> + < Filter > include \ grpc \ impl \ codegen < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ atm_gcc_atomic . h " > <nl> + < Filter > include \ grpc \ impl \ codegen < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ atm_gcc_sync . h " > <nl> + < Filter > include \ grpc \ impl \ codegen < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ atm_win32 . h " > <nl> + < Filter > include \ grpc \ impl \ codegen < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ byte_buffer . h " > <nl> + < Filter > include \ grpc \ impl \ codegen < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ compression_types . h " > <nl> + < Filter > include \ grpc \ impl \ codegen < / Filter > <nl> + < / ClInclude > <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ connectivity_state . h " > <nl> < Filter > include \ grpc \ impl \ codegen < / Filter > <nl> < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ grpc_types . h " > <nl> + < Filter > include \ grpc \ impl \ codegen < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ log . h " > <nl> + < Filter > include \ grpc \ impl \ codegen < / Filter > <nl> + < / ClInclude > <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ port_platform . h " > <nl> < Filter > include \ grpc \ impl \ codegen < / Filter > <nl> < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ propagation_bits . h " > <nl> + < Filter > include \ grpc \ impl \ codegen < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ slice . h " > <nl> + < Filter > include \ grpc \ impl \ codegen < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ slice_buffer . h " > <nl> + < Filter > include \ grpc \ impl \ codegen < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ status . h " > <nl> + < Filter > include \ grpc \ impl \ codegen < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ sync . h " > <nl> + < Filter > include \ grpc \ impl \ codegen < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ sync_generic . h " > <nl> + < Filter > include \ grpc \ impl \ codegen < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ sync_posix . h " > <nl> + < Filter > include \ grpc \ impl \ codegen < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ sync_win32 . h " > <nl> + < Filter > include \ grpc \ impl \ codegen < / Filter > <nl> + < / ClInclude > <nl> < ClInclude Include = " $ ( SolutionDir ) \ . . \ include \ grpc \ impl \ codegen \ time . h " > <nl> < Filter > include \ grpc \ impl \ codegen < / Filter > <nl> < / ClInclude > <nl> <nl> < Filter Include = " include \ grpc + + \ impl \ codegen " > <nl> < UniqueIdentifier > { ec2a6e26 - 915b - ba1b - 4f59 - f361dc01105c } < / UniqueIdentifier > <nl> < / Filter > <nl> + < Filter Include = " include \ grpc + + \ impl \ codegen \ security " > <nl> + < UniqueIdentifier > { c1593bf9 - 5ef8 - cb28 - e46b - 543153918a3f } < / UniqueIdentifier > <nl> + < / Filter > <nl> < Filter Include = " include \ grpc + + \ support " > <nl> < UniqueIdentifier > { 1c34d005 - 1ffb - 8a31 - 881a - c6bb431cda69 } < / UniqueIdentifier > <nl> < / Filter > <nl>
Further work . Compiles . WIP
grpc/grpc
2425bbbc5587665112bc372c14f6b5483c902370
2016-01-26T01:32:48Z
mmm a / test / mjsunit / mjsunit . status <nl> ppp b / test / mjsunit / mjsunit . status <nl> <nl> ' array - natives - elements ' : [ SKIP ] , <nl> ' ignition / regress - 599001 - verifyheap ' : [ SKIP ] , <nl> ' unicode - test ' : [ SKIP ] , <nl> + <nl> + # Slow tests . <nl> + ' regress / regress - 2185 - 2 ' : [ SKIP ] , <nl> } ] , # variant = = stress <nl> <nl> + # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> + [ ' variant = = noturbofan_stress ' , { <nl> + # Slow tests . <nl> + ' ignition / regress - 599001 - verifyheap ' : [ SKIP ] , <nl> + ' regress / regress - 2185 - 2 ' : [ SKIP ] , <nl> + } ] , # variant = = noturbofan_stress <nl> + <nl> + # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> + [ ' variant = = nooptimization ' , { <nl> + # Slow tests . <nl> + ' regress / regress - 2185 - 2 ' : [ SKIP ] , <nl> + } ] , # variant = = nooptimization <nl> + <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> [ ' variant = = turbofan_opt ' , { <nl> ' es6 / array - iterator - turbo ' : [ SKIP ] , <nl>
[ test ] Skip slow tests
v8/v8
a0077f222bf563c1468d63bae2a5d8c5ab835fed
2017-03-14T11:43:01Z
new file mode 100644 <nl> index 000000000000 . . 3d63183094dc <nl> mmm / dev / null <nl> ppp b / test / ClangImporter / enum - anon - sized . swift <nl> <nl> + / / RUN : % target - swift - frontend - emit - ir % s - enable - objc - interop - import - objc - header % S / Inputs / enum - anon . h | % FileCheck - check - prefix = CHECK - check - prefix = CHECK - % target - runtime % s <nl> + <nl> + func verifyIsInt ( _ : inout Int ) { } <nl> + func verifyIsInt32 ( _ : inout Int32 ) { } <nl> + func verifyIsUInt32 ( _ : inout UInt32 ) { } <nl> + <nl> + var a = Constant2 <nl> + var b = VarConstant2 <nl> + var c = SR2511 ( ) . y <nl> + <nl> + verifyIsInt ( & a ) <nl> + # if ! os ( Windows ) <nl> + verifyIsUInt32 ( & b ) <nl> + verifyIsUInt32 ( & c ) <nl> + # else <nl> + verifyIsInt32 ( & b ) <nl> + verifyIsInt32 ( & c ) <nl> + # endif <nl> + <nl> + / / CHECK : % TSo6SR2511V = type < { % Ts5Int32V , [ [ ENUM_TYPE : % Ts5Int32V | % Ts6UInt32V ] ] , % Ts5Int32V } > <nl> + / / CHECK - LABEL : define { { . * } } i32 @ " $ s4main6testIR1xs5Int32VSPySo6SR2511VG_tF " ( <nl> + public func testIR ( x : UnsafePointer < SR2511 > ) - > CInt { <nl> + / / CHECK : store i32 1 , i32 * getelementptr inbounds ( [ [ ENUM_TYPE ] ] , [ [ ENUM_TYPE ] ] * bitcast ( i32 * @ global to [ [ ENUM_TYPE ] ] * ) , i32 0 , i32 0 ) , align 4 <nl> + global = VarConstant2 <nl> + <nl> + # if _runtime ( _ObjC ) <nl> + / / CHECK - objc : store i16 1 , i16 * getelementptr inbounds ( % Ts6UInt16V , % Ts6UInt16V * bitcast ( i16 * @ usGlobal to % Ts6UInt16V * ) , i32 0 , i32 0 ) , align 2 <nl> + usGlobal = USVarConstant2 <nl> + # endif <nl> + <nl> + / / Force the definition of the type above . <nl> + / / CHECK : ret <nl> + return x . pointee . z <nl> + } / / CHECK - NEXT : { { ^ } $ } } <nl> + <nl> mmm a / test / ClangImporter / enum - anon . swift <nl> ppp b / test / ClangImporter / enum - anon . swift <nl> <nl> / / RUN : % target - swift - frontend - typecheck % s - enable - objc - interop - import - objc - header % S / Inputs / enum - anon . h - DDIAGS - verify <nl> - / / RUN : % target - swift - frontend - emit - ir % s - enable - objc - interop - import - objc - header % S / Inputs / enum - anon . h | % FileCheck - check - prefix = CHECK - check - prefix = CHECK - % target - runtime % s <nl> <nl> - # if DIAGS <nl> func testDiags ( ) { <nl> - let _ : String = Constant2 / / expected - error { { cannot convert value of type ' Int ' to specified type ' String ' } } <nl> - let _ : String = VarConstant2 / / expected - error { { cannot convert value of type ' UInt32 ' to specified type ' String ' } } <nl> - <nl> # if _runtime ( _ObjC ) <nl> let us2 = USConstant2 <nl> # else <nl> func testDiags ( ) { <nl> # endif <nl> let _ : String = usVar2 / / expected - error { { cannot convert value of type ' UInt16 ' to specified type ' String ' } } <nl> <nl> - let _ : String = SR2511 ( ) . y / / expected - error { { cannot convert value of type ' UInt32 ' to specified type ' String ' } } <nl> - <nl> / / The nested anonymous enum value should still have top - level scope , because <nl> / / that ' s how C works . It should also have the same type as the field ( above ) . <nl> - let _ : String = SR2511B / / expected - error { { cannot convert value of type ' UInt32 ' to specified type ' String ' } } <nl> let _ : String = SR2511 . SR2511B / / expected - error { { type ' SR2511 ' has no member ' SR2511B ' } } <nl> } <nl> - # endif <nl> - <nl> - / / CHECK - LABEL : % TSo6SR2511V = type < { % Ts5Int32V , % Ts6UInt32V , % Ts5Int32V } > <nl> - / / CHECK - LABEL : define { { . * } } i32 @ " $ s4main6testIR1xs5Int32VSPySo6SR2511VG_tF " ( <nl> - public func testIR ( x : UnsafePointer < SR2511 > ) - > CInt { <nl> - / / CHECK : store i32 1 , i32 * getelementptr inbounds ( % Ts6UInt32V , % Ts6UInt32V * bitcast ( i32 * @ global to % Ts6UInt32V * ) , i32 0 , i32 0 ) , align 4 <nl> - global = VarConstant2 <nl> - <nl> - # if _runtime ( _ObjC ) <nl> - / / CHECK - objc : store i16 1 , i16 * getelementptr inbounds ( % Ts6UInt16V , % Ts6UInt16V * bitcast ( i16 * @ usGlobal to % Ts6UInt16V * ) , i32 0 , i32 0 ) , align 2 <nl> - usGlobal = USVarConstant2 <nl> - # endif <nl> <nl> - / / Force the definition of the type above . <nl> - / / CHECK : ret <nl> - return x . pointee . z <nl> - } / / CHECK - NEXT : { { ^ } $ } } <nl>
test : split up ClangImporter . enum - anon
apple/swift
a54f57aad262fb1d9d511c12bf5d7edca8d733f0
2019-03-29T17:08:40Z
mmm a / toolsrc / include / vcpkg_Graphs . h <nl> ppp b / toolsrc / include / vcpkg_Graphs . h <nl> namespace vcpkg : : Graphs <nl> } ; <nl> <nl> template < class V , class Func > <nl> - static void topological_sort_internal ( V vertex , <nl> + static void topological_sort_internal ( const V & vertex , <nl> ExplorationStatus & status , <nl> const Func adjacency_list_provider , <nl> std : : unordered_map < V , ExplorationStatus > & exploration_status , <nl>
Parameter by const &
microsoft/vcpkg
24ba9f94ea346e3ce79441a4752a4f635d410088
2017-04-13T05:05:03Z
mmm a / Engine / Shaders / HWScripts / CryFX / PostAA . cfx <nl> ppp b / Engine / Shaders / HWScripts / CryFX / PostAA . cfx <nl> pixout LumaEdgeDetectionSMAA_PS ( vtxOut IN ) <nl> # if SMAA_MAX_SEARCH_STEPS_DIAG | | SMAA_FORCE_DIAGONAL_DETECTION <nl> <nl> / / These functions allows to perform diagonal pattern searches . <nl> - float SMAASearchDiag1 ( Texture2D < float4 > edgesTex , SamplerState sampSt , float2 texcoord , float2 dir , float c ) <nl> + float SMAASearchDiag1 ( Texture2D < float4 > edgesTex , SamplerState sampSt , float4 ScreenSize , float2 texcoord , float2 dir , float c ) <nl> { <nl> - texcoord + = dir * PS_ScreenSize . zw ; <nl> + texcoord + = dir * ScreenSize . zw ; <nl> float2 e = 0 ; <nl> float i = 0 ; <nl> for ( i = 0 ; i < SMAA_MAX_SEARCH_STEPS_DIAG ; i + + ) <nl> { <nl> e . rg = GetTexture2DLod ( edgesTex , sampSt , float4 ( texcoord , 0 , 0 ) ) . rg ; <nl> [ flatten ] if ( dot ( e , 1 . 0 ) < 1 . 9 ) break ; <nl> - texcoord + = dir * PS_ScreenSize . zw ; <nl> + texcoord + = dir * ScreenSize . zw ; <nl> } <nl> return i + float ( e . g > 0 . 9 ) * c ; <nl> } <nl> <nl> - float SMAASearchDiag2 ( Texture2D < float4 > edgesTex , SamplerState sampSt , float2 texcoord , float2 dir , float c ) <nl> + float SMAASearchDiag2 ( Texture2D < float4 > edgesTex , SamplerState sampSt , float4 ScreenSize , float2 texcoord , float2 dir , float c ) <nl> { <nl> - texcoord + = dir * PS_ScreenSize . zw ; <nl> + texcoord + = dir * ScreenSize . zw ; <nl> float2 e = 0 ; <nl> float i = 0 ; <nl> for ( i = 0 ; i < SMAA_MAX_SEARCH_STEPS_DIAG ; i + + ) <nl> { <nl> e . g = GetTexture2DLod ( edgesTex , sampSt , float4 ( texcoord , 0 , 0 ) ) . g ; <nl> - e . r = GetTexture2DLod ( edgesTex , sampSt , float4 ( texcoord + float2 ( 1 , 0 ) * PS_ScreenSize . zw , 0 , 0 ) ) . r ; <nl> + e . r = GetTexture2DLod ( edgesTex , sampSt , float4 ( texcoord + float2 ( 1 , 0 ) * ScreenSize . zw , 0 , 0 ) ) . r ; <nl> [ flatten ] if ( dot ( e , 1 . 0 ) < 1 . 9 ) break ; <nl> - texcoord + = dir * PS_ScreenSize . zw ; <nl> + texcoord + = dir * ScreenSize . zw ; <nl> } <nl> return i + float ( e . g > 0 . 9 ) * c ; <nl> } <nl> float2 SMAAAreaDiag ( Texture2D < float4 > areaTex , SamplerState sampSt , float2 dista <nl> } <nl> <nl> / / This searches for diagonal patterns and returns the corresponding weights . <nl> - float2 SMAACalculateDiagWeights ( Texture2D < float4 > edgesTex , SamplerState sampStE , Texture2D < float4 > areaTex , SamplerState sampStA , float2 texcoord , float2 e , half4 subsampleIndices ) <nl> + float2 SMAACalculateDiagWeights ( Texture2D < float4 > edgesTex , SamplerState sampStE , Texture2D < float4 > areaTex , SamplerState sampStA , float4 ScreenSize , float2 texcoord , float2 e , half4 subsampleIndices ) <nl> { <nl> float2 weights = 0 . 0 ; <nl> <nl> float2 d ; <nl> - d . x = e . r ? SMAASearchDiag1 ( edgesTex , sampStE , texcoord , float2 ( - 1 . 0 , 1 . 0 ) , 1 . 0 ) : 0 . 0 ; <nl> - d . y = SMAASearchDiag1 ( edgesTex , sampStE , texcoord , float2 ( 1 . 0 , - 1 . 0 ) , 0 . 0 ) ; <nl> + d . x = e . r ? SMAASearchDiag1 ( edgesTex , sampStE , ScreenSize , texcoord , float2 ( - 1 . 0 , 1 . 0 ) , 1 . 0 ) : 0 . 0 ; <nl> + d . y = SMAASearchDiag1 ( edgesTex , sampStE , ScreenSize , texcoord , float2 ( 1 . 0 , - 1 . 0 ) , 0 . 0 ) ; <nl> <nl> [ branch ] <nl> if ( d . r + d . g > 2 ) / / d . r + d . g + 1 > 3 <nl> { <nl> - float4 coords = mad ( float4 ( - d . r , d . r , d . g , - d . g ) , PS_ScreenSize . zwzw , texcoord . xyxy ) ; <nl> + float4 coords = mad ( float4 ( - d . r , d . r , d . g , - d . g ) , ScreenSize . zwzw , texcoord . xyxy ) ; <nl> <nl> float4 c ; <nl> - c . x = GetTexture2DLod ( edgesTex , sampStE , float4 ( coords . xy + float2 ( - 1 , 0 ) * PS_ScreenSize . zw , 0 , 0 ) ) . g ; <nl> - c . y = GetTexture2DLod ( edgesTex , sampStE , float4 ( coords . xy + float2 ( 0 , 0 ) * PS_ScreenSize . zw , 0 , 0 ) ) . r ; <nl> - c . z = GetTexture2DLod ( edgesTex , sampStE , float4 ( coords . zw + float2 ( 1 , 0 ) * PS_ScreenSize . zw , 0 , 0 ) ) . g ; <nl> - c . w = GetTexture2DLod ( edgesTex , sampStE , float4 ( coords . zw + float2 ( 1 , - 1 ) * PS_ScreenSize . zw , 0 , 0 ) ) . r ; <nl> + c . x = GetTexture2DLod ( edgesTex , sampStE , float4 ( coords . xy + float2 ( - 1 , 0 ) * ScreenSize . zw , 0 , 0 ) ) . g ; <nl> + c . y = GetTexture2DLod ( edgesTex , sampStE , float4 ( coords . xy + float2 ( 0 , 0 ) * ScreenSize . zw , 0 , 0 ) ) . r ; <nl> + c . z = GetTexture2DLod ( edgesTex , sampStE , float4 ( coords . zw + float2 ( 1 , 0 ) * ScreenSize . zw , 0 , 0 ) ) . g ; <nl> + c . w = GetTexture2DLod ( edgesTex , sampStE , float4 ( coords . zw + float2 ( 1 , - 1 ) * ScreenSize . zw , 0 , 0 ) ) . r ; <nl> float2 e = 2 . 0 * c . xz + c . yw ; <nl> e * = step ( d . rg , SMAA_MAX_SEARCH_STEPS_DIAG - 1 ) ; <nl> <nl> weights + = SMAAAreaDiag ( areaTex , sampStA , d , e , subsampleIndices . z ) ; <nl> } <nl> <nl> - d . x = SMAASearchDiag2 ( edgesTex , sampStE , texcoord , float2 ( - 1 . 0 , - 1 . 0 ) , 0 . 0 ) ; <nl> - float right = GetTexture2DLod ( edgesTex , sampStE , float4 ( texcoord + float2 ( 1 , 0 ) * PS_ScreenSize . zw , 0 , 0 ) ) . r ; <nl> - d . y = right ? SMAASearchDiag2 ( edgesTex , sampStE , texcoord , float2 ( 1 . 0 , 1 . 0 ) , 1 . 0 ) : 0 . 0 ; <nl> + d . x = SMAASearchDiag2 ( edgesTex , sampStE , ScreenSize , texcoord , float2 ( - 1 . 0 , - 1 . 0 ) , 0 . 0 ) ; <nl> + float right = GetTexture2DLod ( edgesTex , sampStE , float4 ( texcoord + float2 ( 1 , 0 ) * ScreenSize . zw , 0 , 0 ) ) . r ; <nl> + d . y = right ? SMAASearchDiag2 ( edgesTex , sampStE , ScreenSize , texcoord , float2 ( 1 . 0 , 1 . 0 ) , 1 . 0 ) : 0 . 0 ; <nl> <nl> [ branch ] <nl> if ( d . r + d . g > 2 ) / / d . r + d . g + 1 > 3 <nl> { <nl> - float4 coords = mad ( float4 ( - d . r , - d . r , d . g , d . g ) , PS_ScreenSize . zwzw , texcoord . xyxy ) ; <nl> + float4 coords = mad ( float4 ( - d . r , - d . r , d . g , d . g ) , ScreenSize . zwzw , texcoord . xyxy ) ; <nl> <nl> float4 c ; <nl> - c . x = GetTexture2DLod ( edgesTex , sampStE , float4 ( coords . xy + float2 ( - 1 , 0 ) * PS_ScreenSize . zw , 0 , 0 ) ) . g ; <nl> - c . y = GetTexture2DLod ( edgesTex , sampStE , float4 ( coords . xy + float2 ( 0 , - 1 ) * PS_ScreenSize . zw , 0 , 0 ) ) . r ; <nl> - c . zw = GetTexture2DLod ( edgesTex , sampStE , float4 ( coords . zw + float2 ( 1 , 0 ) * PS_ScreenSize . zw , 0 , 0 ) ) . gr ; <nl> + c . x = GetTexture2DLod ( edgesTex , sampStE , float4 ( coords . xy + float2 ( - 1 , 0 ) * ScreenSize . zw , 0 , 0 ) ) . g ; <nl> + c . y = GetTexture2DLod ( edgesTex , sampStE , float4 ( coords . xy + float2 ( 0 , - 1 ) * ScreenSize . zw , 0 , 0 ) ) . r ; <nl> + c . zw = GetTexture2DLod ( edgesTex , sampStE , float4 ( coords . zw + float2 ( 1 , 0 ) * ScreenSize . zw , 0 , 0 ) ) . gr ; <nl> float2 e = 2 . 0 * c . xz + c . yw ; <nl> e * = step ( d . rg , SMAA_MAX_SEARCH_STEPS_DIAG - 1 ) ; <nl> <nl> float SMAASearchLength ( Texture2D < float4 > searchTex , SamplerState sampStS , float2 <nl> return 255 . 0 * GetTexture2DLod ( searchTex , sampStS , float4 ( e , 0 , 0 ) ) . r ; / / r ; <nl> } <nl> <nl> - float SMAASearchXLeft ( Texture2D < float4 > edgesTex , SamplerState sampStE , Texture2D < float4 > searchTex , SamplerState sampStS , float2 texcoord , float end ) <nl> + float SMAASearchXLeft ( Texture2D < float4 > edgesTex , SamplerState sampStE , Texture2D < float4 > searchTex , SamplerState sampStS , float4 ScreenSize , float2 texcoord , float end ) <nl> { <nl> float2 e = float2 ( 0 . 0 , 1 . 0 ) ; <nl> while ( texcoord . x > end & & <nl> e . g > 0 . 8281 & & / / Is there some edge not activated ? <nl> e . r = = 0 . 0 ) { / / Or is there a crossing edge that breaks the line ? <nl> e = GetTexture2DLod ( edgesTex , sampStE , float4 ( texcoord , 0 , 0 ) ) . rg ; <nl> - texcoord - = float2 ( 2 . 0 , 0 . 0 ) * PS_ScreenSize . zw ; <nl> + texcoord - = float2 ( 2 . 0 , 0 . 0 ) * ScreenSize . zw ; <nl> } <nl> <nl> / / We correct the previous ( - 0 . 25 , - 0 . 125 ) offset we applied : <nl> - texcoord . x + = 0 . 25 * PS_ScreenSize . z ; <nl> + texcoord . x + = 0 . 25 * ScreenSize . z ; <nl> <nl> / / The searches are bias by 1 , so adjust the coords accordingly : <nl> - texcoord . x + = PS_ScreenSize . z ; <nl> + texcoord . x + = ScreenSize . z ; <nl> <nl> / / Disambiguate the length added by the last step : <nl> - texcoord . x + = 2 . 0 * PS_ScreenSize . z ; / / Undo last step <nl> - texcoord . x - = PS_ScreenSize . z * SMAASearchLength ( searchTex , sampStS , e , 0 . 0 , 0 . 5 ) ; <nl> + texcoord . x + = 2 . 0 * ScreenSize . z ; / / Undo last step <nl> + texcoord . x - = ScreenSize . z * SMAASearchLength ( searchTex , sampStS , e , 0 . 0 , 0 . 5 ) ; <nl> <nl> return texcoord . x ; <nl> } <nl> <nl> - float SMAASearchXRight ( Texture2D < float4 > edgesTex , SamplerState sampStE , Texture2D < float4 > searchTex , SamplerState sampStS , float2 texcoord , float end ) <nl> + float SMAASearchXRight ( Texture2D < float4 > edgesTex , SamplerState sampStE , Texture2D < float4 > searchTex , SamplerState sampStS , float4 ScreenSize , float2 texcoord , float end ) <nl> { <nl> / / PS_ScreenSize . zw * = SCALE_PIXELSIZE ; <nl> <nl> float SMAASearchXRight ( Texture2D < float4 > edgesTex , SamplerState sampStE , Textur <nl> e . g > 0 . 8281 & & / / Is there some edge not activated ? <nl> e . r = = 0 . 0 ) { / / Or is there a crossing edge that breaks the line ? <nl> e = GetTexture2DLod ( edgesTex , sampStE , float4 ( texcoord , 0 , 0 ) ) . rg ; <nl> - texcoord + = float2 ( 2 . 0 , 0 . 0 ) * PS_ScreenSize . zw ; <nl> + texcoord + = float2 ( 2 . 0 , 0 . 0 ) * ScreenSize . zw ; <nl> } <nl> <nl> - texcoord . x - = 0 . 25 * PS_ScreenSize . z ; <nl> - texcoord . x - = PS_ScreenSize . z ; <nl> - texcoord . x - = 2 . 0 * PS_ScreenSize . z ; <nl> - texcoord . x + = PS_ScreenSize . z * SMAASearchLength ( searchTex , sampStS , e , 0 . 5 , 0 . 5 ) ; <nl> + texcoord . x - = 0 . 25 * ScreenSize . z ; <nl> + texcoord . x - = ScreenSize . z ; <nl> + texcoord . x - = 2 . 0 * ScreenSize . z ; <nl> + texcoord . x + = ScreenSize . z * SMAASearchLength ( searchTex , sampStS , e , 0 . 5 , 0 . 5 ) ; <nl> return texcoord . x ; <nl> } <nl> <nl> - float SMAASearchYUp ( Texture2D < float4 > edgesTex , SamplerState sampStE , Texture2D < float4 > searchTex , SamplerState sampStS , float2 texcoord , float end ) <nl> + float SMAASearchYUp ( Texture2D < float4 > edgesTex , SamplerState sampStE , Texture2D < float4 > searchTex , SamplerState sampStS , float4 ScreenSize , float2 texcoord , float end ) <nl> { <nl> float2 e = float2 ( 1 . 0 , 0 . 0 ) ; <nl> while ( texcoord . y > end & & <nl> e . r > 0 . 8281 & & / / Is there some edge not activated ? <nl> e . g = = 0 . 0 ) { / / Or is there a crossing edge that breaks the line ? <nl> e = GetTexture2DLod ( edgesTex , sampStE , float4 ( texcoord , 0 , 0 ) ) . rg ; <nl> - texcoord - = float2 ( 0 . 0 , 2 . 0 ) * PS_ScreenSize . zw ; <nl> + texcoord - = float2 ( 0 . 0 , 2 . 0 ) * ScreenSize . zw ; <nl> } <nl> <nl> - texcoord . y + = 0 . 25 * PS_ScreenSize . w ; <nl> - texcoord . y + = PS_ScreenSize . w ; <nl> - texcoord . y + = 2 . 0 * PS_ScreenSize . w ; <nl> - texcoord . y - = PS_ScreenSize . w * SMAASearchLength ( searchTex , sampStS , e . gr , 0 . 0 , 0 . 5 ) ; <nl> + texcoord . y + = 0 . 25 * ScreenSize . w ; <nl> + texcoord . y + = ScreenSize . w ; <nl> + texcoord . y + = 2 . 0 * ScreenSize . w ; <nl> + texcoord . y - = ScreenSize . w * SMAASearchLength ( searchTex , sampStS , e . gr , 0 . 0 , 0 . 5 ) ; <nl> return texcoord . y ; <nl> } <nl> <nl> - float SMAASearchYDown ( Texture2D < float4 > edgesTex , SamplerState sampStE , Texture2D < float4 > searchTex , SamplerState sampStS , float2 texcoord , float end ) <nl> + float SMAASearchYDown ( Texture2D < float4 > edgesTex , SamplerState sampStE , Texture2D < float4 > searchTex , SamplerState sampStS , float4 ScreenSize , float2 texcoord , float end ) <nl> { <nl> float2 e = float2 ( 1 . 0 , 0 . 0 ) ; <nl> while ( texcoord . y < end & & <nl> e . r > 0 . 8281 & & / / Is there some edge not activated ? <nl> e . g = = 0 . 0 ) { / / Or is there a crossing edge that breaks the line ? <nl> e = GetTexture2DLod ( edgesTex , sampStE , float4 ( texcoord , 0 , 0 ) ) . rg ; <nl> - texcoord + = float2 ( 0 . 0 , 2 . 0 ) * PS_ScreenSize . zw ; <nl> + texcoord + = float2 ( 0 . 0 , 2 . 0 ) * ScreenSize . zw ; <nl> } <nl> <nl> - texcoord . y - = 0 . 25 * PS_ScreenSize . w ; <nl> - texcoord . y - = PS_ScreenSize . w ; <nl> - texcoord . y - = 2 . 0 * PS_ScreenSize . w ; <nl> - texcoord . y + = PS_ScreenSize . w * SMAASearchLength ( searchTex , sampStS , e . gr , 0 . 5 , 0 . 5 ) ; <nl> + texcoord . y - = 0 . 25 * ScreenSize . w ; <nl> + texcoord . y - = ScreenSize . w ; <nl> + texcoord . y - = 2 . 0 * ScreenSize . w ; <nl> + texcoord . y + = ScreenSize . w * SMAASearchLength ( searchTex , sampStS , e . gr , 0 . 5 , 0 . 5 ) ; <nl> return texcoord . y ; <nl> } <nl> <nl> float2 SMAAArea ( Texture2D < float4 > areaTex , SamplerState sampStA , float2 distance <nl> } <nl> <nl> / / Corner Detection Functions <nl> - void SMAADetectHorizontalCornerPattern ( Texture2D < float4 > edgesTex , SamplerState sampStE , inout float2 weights , float2 texcoord , float2 d ) <nl> + void SMAADetectHorizontalCornerPattern ( Texture2D < float4 > edgesTex , SamplerState sampStE , inout float2 weights , float4 ScreenSize , float2 texcoord , float2 d ) <nl> { <nl> # if SMAA_CORNER_ROUNDING | | SMAA_FORCE_CORNER_DETECTION <nl> <nl> float4 coords = mad ( float4 ( d . x , 0 . 0 , d . y , 0 . 0 ) , <nl> - PS_ScreenSize . zwzw , texcoord . xyxy ) ; <nl> + ScreenSize . zwzw , texcoord . xyxy ) ; <nl> float2 e ; <nl> - e . r = GetTexture2DLod ( edgesTex , sampStE , float4 ( coords . xy + float2 ( 0 . 0 , 1 . 0 ) * PS_ScreenSize . zw , 0 , 0 ) ) . r ; <nl> + e . r = GetTexture2DLod ( edgesTex , sampStE , float4 ( coords . xy + float2 ( 0 . 0 , 1 . 0 ) * ScreenSize . zw , 0 , 0 ) ) . r ; <nl> bool left = abs ( d . x ) < abs ( d . y ) ; <nl> - e . g = GetTexture2DLod ( edgesTex , sampStE , float4 ( coords . xy + float2 ( 0 . 0 , - 2 . 0 ) * PS_ScreenSize . zw , 0 , 0 ) ) . r ; <nl> + e . g = GetTexture2DLod ( edgesTex , sampStE , float4 ( coords . xy + float2 ( 0 . 0 , - 2 . 0 ) * ScreenSize . zw , 0 , 0 ) ) . r ; <nl> if ( left ) <nl> weights * = saturate ( SMAA_CORNER_ROUNDING / 100 . 0 + 1 . 0 - e ) ; <nl> <nl> - e . r = GetTexture2DLod ( edgesTex , sampStE , float4 ( coords . zw + float2 ( 1 . 0 , 1 . 0 ) * PS_ScreenSize . zw , 0 , 0 ) ) . r ; <nl> - e . g = GetTexture2DLod ( edgesTex , sampStE , float4 ( coords . zw + float2 ( 1 . 0 , - 2 . 0 ) * PS_ScreenSize . zw , 0 , 0 ) ) . r ; <nl> + e . r = GetTexture2DLod ( edgesTex , sampStE , float4 ( coords . zw + float2 ( 1 . 0 , 1 . 0 ) * ScreenSize . zw , 0 , 0 ) ) . r ; <nl> + e . g = GetTexture2DLod ( edgesTex , sampStE , float4 ( coords . zw + float2 ( 1 . 0 , - 2 . 0 ) * ScreenSize . zw , 0 , 0 ) ) . r ; <nl> if ( ! left ) <nl> weights * = saturate ( SMAA_CORNER_ROUNDING / 100 . 0 + 1 . 0 - e ) ; <nl> <nl> # endif <nl> } <nl> <nl> - void SMAADetectVerticalCornerPattern ( Texture2D < float4 > edgesTex , SamplerState sampStE , inout float2 weights , float2 texcoord , float2 d ) <nl> + void SMAADetectVerticalCornerPattern ( Texture2D < float4 > edgesTex , SamplerState sampStE , inout float2 weights , float4 ScreenSize , float2 texcoord , float2 d ) <nl> { <nl> # if SMAA_CORNER_ROUNDING | | SMAA_FORCE_CORNER_DETECTION <nl> <nl> float4 coords = mad ( float4 ( 0 . 0 , d . x , 0 . 0 , d . y ) , <nl> - PS_ScreenSize . zwzw , texcoord . xyxy ) ; <nl> + ScreenSize . zwzw , texcoord . xyxy ) ; <nl> float2 e ; <nl> - e . r = GetTexture2DLod ( edgesTex , sampStE , float4 ( coords . xy + float2 ( 1 . 0 , 0 . 0 ) * PS_ScreenSize . zw , 0 , 0 ) ) . g ; <nl> + e . r = GetTexture2DLod ( edgesTex , sampStE , float4 ( coords . xy + float2 ( 1 . 0 , 0 . 0 ) * ScreenSize . zw , 0 , 0 ) ) . g ; <nl> bool left = abs ( d . x ) < abs ( d . y ) ; <nl> - e . g = GetTexture2DLod ( edgesTex , sampStE , float4 ( coords . xy + float2 ( - 2 . 0 , 0 . 0 ) * PS_ScreenSize . zw , 0 , 0 ) ) . g ; <nl> + e . g = GetTexture2DLod ( edgesTex , sampStE , float4 ( coords . xy + float2 ( - 2 . 0 , 0 . 0 ) * ScreenSize . zw , 0 , 0 ) ) . g ; <nl> if ( left ) <nl> weights * = saturate ( SMAA_CORNER_ROUNDING / 100 . 0 + 1 . 0 - e ) ; <nl> <nl> - e . r = GetTexture2DLod ( edgesTex , sampStE , float4 ( coords . zw + float2 ( 1 . 0 , 1 . 0 ) * PS_ScreenSize . zw , 0 , 0 ) ) . g ; <nl> - e . g = GetTexture2DLod ( edgesTex , sampStE , float4 ( coords . zw + float2 ( - 2 . 0 , 1 . 0 ) * PS_ScreenSize . zw , 0 , 0 ) ) . g ; <nl> + e . r = GetTexture2DLod ( edgesTex , sampStE , float4 ( coords . zw + float2 ( 1 . 0 , 1 . 0 ) * ScreenSize . zw , 0 , 0 ) ) . g ; <nl> + e . g = GetTexture2DLod ( edgesTex , sampStE , float4 ( coords . zw + float2 ( - 2 . 0 , 1 . 0 ) * ScreenSize . zw , 0 , 0 ) ) . g ; <nl> if ( ! left ) <nl> weights * = saturate ( SMAA_CORNER_ROUNDING / 100 . 0 + 1 . 0 - e ) ; <nl> <nl> pixout BlendWeightSMAA_PS ( vtxOut IN ) <nl> if ( e . g > 0 . 0h ) / / Edge at north <nl> { <nl> # if SMAA_MAX_SEARCH_STEPS_DIAG | | SMAA_FORCE_DIAGONAL_DETECTION <nl> - weights . rg = SMAACalculateDiagWeights ( BlndWgtSMAA_Edge , BlndWgtSMAA_EdSampler , BlndWgtSMAA_Area , BlndWgtSMAA_EdSampler , IN . baseTC . xy , e , vSubSampleIndices ) ; <nl> + weights . rg = SMAACalculateDiagWeights ( BlndWgtSMAA_Edge , BlndWgtSMAA_EdSampler , BlndWgtSMAA_Area , BlndWgtSMAA_EdSampler , ScreenSize , IN . baseTC . xy , e , vSubSampleIndices ) ; <nl> <nl> / / We give priority to diagonals , so if we find a diagonal we skip <nl> / / horizontal / vertical processing . <nl> pixout BlendWeightSMAA_PS ( vtxOut IN ) <nl> <nl> / / Find the distance to the left : <nl> float2 coords ; <nl> - coords . x = SMAASearchXLeft ( BlndWgtSMAA_Edge , BlndWgtSMAA_EdSampler , BlndWgtSMAA_Srch , BlndWgtSMAA_SrSampler , offset [ 0 ] . xy , offset [ 2 ] . x ) ; <nl> + coords . x = SMAASearchXLeft ( BlndWgtSMAA_Edge , BlndWgtSMAA_EdSampler , BlndWgtSMAA_Srch , BlndWgtSMAA_SrSampler , ScreenSize , offset [ 0 ] . xy , offset [ 2 ] . x ) ; <nl> coords . y = offset [ 1 ] . y ; <nl> d . x = coords . x ; <nl> <nl> pixout BlendWeightSMAA_PS ( vtxOut IN ) <nl> float e1 = GetTexture2DLod ( BlndWgtSMAA_Edge , BlndWgtSMAA_EdSampler , float4 ( coords , 0 , 0 ) ) . r ; / / IN . baseTC . xy <nl> <nl> / / Find the distance to the right : <nl> - coords . x = SMAASearchXRight ( BlndWgtSMAA_Edge , BlndWgtSMAA_EdSampler , BlndWgtSMAA_Srch , BlndWgtSMAA_SrSampler , offset [ 0 ] . zw , offset [ 2 ] . y ) ; <nl> + coords . x = SMAASearchXRight ( BlndWgtSMAA_Edge , BlndWgtSMAA_EdSampler , BlndWgtSMAA_Srch , BlndWgtSMAA_SrSampler , ScreenSize , offset [ 0 ] . zw , offset [ 2 ] . y ) ; <nl> d . y = coords . x ; / / IN . baseTC . x ; <nl> <nl> / / We want the distances to be in pixel units ( doing this here allow to <nl> pixout BlendWeightSMAA_PS ( vtxOut IN ) <nl> weights . rg = SMAAArea ( BlndWgtSMAA_Area , BlndWgtSMAA_EdSampler , sqrt_d , e1 , e2 , vSubSampleIndices . y ) ; <nl> <nl> / / Fix corners : <nl> - SMAADetectHorizontalCornerPattern ( BlndWgtSMAA_Edge , BlndWgtSMAA_EdSampler , weights . rg , IN . baseTC . xy , d ) ; / / texcoord <nl> + SMAADetectHorizontalCornerPattern ( BlndWgtSMAA_Edge , BlndWgtSMAA_EdSampler , weights . rg , ScreenSize , IN . baseTC . xy , d ) ; / / texcoord <nl> <nl> # if SMAA_MAX_SEARCH_STEPS_DIAG | | SMAA_FORCE_DIAGONAL_DETECTION <nl> <nl> pixout BlendWeightSMAA_PS ( vtxOut IN ) <nl> <nl> / / Find the distance to the top : <nl> float2 coords ; <nl> - coords . y = SMAASearchYUp ( BlndWgtSMAA_Edge , BlndWgtSMAA_EdSampler , BlndWgtSMAA_Srch , BlndWgtSMAA_SrSampler , offset [ 1 ] . xy , offset [ 2 ] . z ) ; <nl> + coords . y = SMAASearchYUp ( BlndWgtSMAA_Edge , BlndWgtSMAA_EdSampler , BlndWgtSMAA_Srch , BlndWgtSMAA_SrSampler , ScreenSize , offset [ 1 ] . xy , offset [ 2 ] . z ) ; <nl> coords . x = offset [ 0 ] . x ; <nl> d . x = coords . y ; <nl> <nl> pixout BlendWeightSMAA_PS ( vtxOut IN ) <nl> float e1 = GetTexture2DLod ( BlndWgtSMAA_Edge , BlndWgtSMAA_EdSampler , float4 ( coords , 0 , 0 ) ) . g ; <nl> <nl> / / Find the distance to the bottom : <nl> - coords . y = SMAASearchYDown ( BlndWgtSMAA_Edge , BlndWgtSMAA_EdSampler , BlndWgtSMAA_Srch , BlndWgtSMAA_SrSampler , offset [ 1 ] . zw , offset [ 2 ] . w ) ; <nl> + coords . y = SMAASearchYDown ( BlndWgtSMAA_Edge , BlndWgtSMAA_EdSampler , BlndWgtSMAA_Srch , BlndWgtSMAA_SrSampler , ScreenSize , offset [ 1 ] . zw , offset [ 2 ] . w ) ; <nl> d . y = coords . y ; <nl> <nl> / / We want the distances to be in pixel units : <nl> pixout BlendWeightSMAA_PS ( vtxOut IN ) <nl> weights . ba = SMAAArea ( BlndWgtSMAA_Area , BlndWgtSMAA_EdSampler , sqrt_d , e1 , e2 , vSubSampleIndices . x ) ; <nl> <nl> / / Fix corners : <nl> - SMAADetectVerticalCornerPattern ( BlndWgtSMAA_Edge , BlndWgtSMAA_EdSampler , weights . ba , IN . baseTC . xy , d ) ; <nl> + SMAADetectVerticalCornerPattern ( BlndWgtSMAA_Edge , BlndWgtSMAA_EdSampler , weights . ba , ScreenSize , IN . baseTC . xy , d ) ; <nl> } <nl> <nl> OUT . Color = weights ; / / * 10 ; <nl>
! B ( CE - 15456 ) Pass screensize directly to BlendWeightSMAA_PS functions , rather than relying on side - effect in global PS_ScreenSize , which was being modified ( illegaly w / out dx9 compatibility mode ) in main PS function .
CRYTEK/CRYENGINE
7e9ef282aac07524166fe3922b06f900ceba4c78
2018-02-09T15:30:04Z
mmm a / lib / Basics / IndexBucket . h <nl> ppp b / lib / Basics / IndexBucket . h <nl> struct IndexBucket { <nl> TRI_ASSERT ( _file = = - 1 ) ; <nl> throw ; <nl> } <nl> + <nl> + _nrCollisions = 0 ; <nl> } <nl> <nl> void deallocate ( ) { <nl> struct IndexBucket { <nl> _table = nullptr ; <nl> _nrAlloc = 0 ; <nl> _nrUsed = 0 ; <nl> + _nrCollisions = 0 ; <nl> } <nl> <nl> int allocateTempfile ( char * & filename , size_t filesize ) { <nl>
properly reset _nrCollisions
arangodb/arangodb
41cc216012a34d2dd35d75bcd4359627e37adee0
2017-01-06T13:55:50Z
mmm a / include / swift / AST / Types . h <nl> ppp b / include / swift / AST / Types . h <nl> class SILFunctionType final : public TypeBase , public llvm : : FoldingSetNode , <nl> <nl> bool isNoReturnFunction ( ) ; / / Defined in SILType . cpp <nl> <nl> + class ABICompatibilityCheckResult { <nl> + friend class SILFunctionType ; <nl> + <nl> + enum innerty { <nl> + None , <nl> + DifferentFunctionRepresentations , <nl> + DifferentNumberOfResults , <nl> + DifferentReturnValueConventions , <nl> + ABIIncompatibleReturnValues , <nl> + DifferentErrorResultConventions , <nl> + ABIIncompatibleErrorResults , <nl> + DifferentNumberOfParameters , <nl> + DifferingParameterConvention , <nl> + ABIIncompatibleParameterType , <nl> + } kind ; <nl> + Optional < uintptr_t > payload ; <nl> + <nl> + ABICompatibilityCheckResult ( innerty kind ) : kind ( kind ) { } <nl> + ABICompatibilityCheckResult ( innerty kind , uintptr_t payload ) <nl> + : kind ( kind ) , payload ( payload ) { } <nl> + <nl> + public : <nl> + ABICompatibilityCheckResult ( ) = delete ; <nl> + <nl> + bool isCompatible ( ) const { return kind = = innerty : : None ; } <nl> + <nl> + bool hasPayload ( ) const { return payload . hasValue ( ) ; } <nl> + uintptr_t getPayload ( ) const { return payload . getValue ( ) ; } <nl> + StringRef getMessage ( ) const ; <nl> + } ; <nl> + <nl> + / / / Returns no - error if this SILFunctionType is ABI compatible with \ p <nl> + / / / other . Otherwise , it returns a true error with a message in <nl> + / / / std : : error_code . This is only meant to be used in assertions . When <nl> + / / / assertions are disabled , this just returns true . <nl> + ABICompatibilityCheckResult <nl> + isABICompatibleWith ( CanSILFunctionType other ) const ; <nl> + <nl> CanSILFunctionType substGenericArgs ( SILModule & silModule , <nl> SubstitutionList subs ) ; <nl> CanSILFunctionType substGenericArgs ( SILModule & silModule , <nl> mmm a / lib / SIL / SILFunctionType . cpp <nl> ppp b / lib / SIL / SILFunctionType . cpp <nl> TypeConverter : : getLoweredFormalTypes ( SILDeclRef constant , <nl> <nl> return { bridgingFnPattern , uncurried } ; <nl> } <nl> + <nl> + / / TODO : We should compare generic signatures . Class and witness methods <nl> + / / allow variance in " self " - fulfilled parameters ; other functions must <nl> + / / match exactly . <nl> + / / TODO : More sophisticated param and return ABI compatibility rules could <nl> + / / diverge . <nl> + static bool areABICompatibleParamsOrReturns ( SILType a , SILType b ) { <nl> + / / Address parameters are all ABI - compatible , though the referenced <nl> + / / values may not be . Assume whoever ' s doing this knows what they ' re <nl> + / / doing . <nl> + if ( a . isAddress ( ) & & b . isAddress ( ) ) <nl> + return true ; <nl> + <nl> + / / Addresses aren ' t compatible with values . <nl> + / / TODO : An exception for pointerish types ? <nl> + if ( a . isAddress ( ) | | b . isAddress ( ) ) <nl> + return false ; <nl> + <nl> + / / Tuples are ABI compatible if their elements are . <nl> + / / TODO : Should destructure recursively . <nl> + SmallVector < CanType , 1 > aElements , bElements ; <nl> + if ( auto tup = a . getAs < TupleType > ( ) ) { <nl> + auto types = tup . getElementTypes ( ) ; <nl> + aElements . append ( types . begin ( ) , types . end ( ) ) ; <nl> + } else { <nl> + aElements . push_back ( a . getSwiftRValueType ( ) ) ; <nl> + } <nl> + if ( auto tup = b . getAs < TupleType > ( ) ) { <nl> + auto types = tup . getElementTypes ( ) ; <nl> + bElements . append ( types . begin ( ) , types . end ( ) ) ; <nl> + } else { <nl> + bElements . push_back ( b . getSwiftRValueType ( ) ) ; <nl> + } <nl> + <nl> + if ( aElements . size ( ) ! = bElements . size ( ) ) <nl> + return false ; <nl> + <nl> + for ( unsigned i : indices ( aElements ) ) { <nl> + auto aa = SILType : : getPrimitiveObjectType ( aElements [ i ] ) ; <nl> + auto bb = SILType : : getPrimitiveObjectType ( bElements [ i ] ) ; <nl> + / / Equivalent types are always ABI - compatible . <nl> + if ( aa = = bb ) <nl> + continue ; <nl> + <nl> + / / FIXME : If one or both types are dependent , we can ' t accurately assess <nl> + / / whether they ' re ABI - compatible without a generic context . We can <nl> + / / do a better job here when dependent types are related to their <nl> + / / generic signatures . <nl> + if ( aa . hasTypeParameter ( ) | | bb . hasTypeParameter ( ) ) <nl> + continue ; <nl> + <nl> + / / Bridgeable object types are interchangeable . <nl> + if ( aa . isBridgeableObjectType ( ) & & bb . isBridgeableObjectType ( ) ) <nl> + continue ; <nl> + <nl> + / / Optional and IUO are interchangeable if their elements are . <nl> + auto aObject = aa . getAnyOptionalObjectType ( ) ; <nl> + auto bObject = bb . getAnyOptionalObjectType ( ) ; <nl> + if ( aObject & & bObject & & areABICompatibleParamsOrReturns ( aObject , bObject ) ) <nl> + continue ; <nl> + / / Optional objects are ABI - interchangeable with non - optionals ; <nl> + / / None is represented by a null pointer . <nl> + if ( aObject & & aObject . isBridgeableObjectType ( ) & & <nl> + bb . isBridgeableObjectType ( ) ) <nl> + continue ; <nl> + if ( bObject & & bObject . isBridgeableObjectType ( ) & & <nl> + aa . isBridgeableObjectType ( ) ) <nl> + continue ; <nl> + <nl> + / / Optional thick metatypes are ABI - interchangeable with non - optionals <nl> + / / too . <nl> + if ( aObject ) <nl> + if ( auto aObjMeta = aObject . getAs < MetatypeType > ( ) ) <nl> + if ( auto bMeta = bb . getAs < MetatypeType > ( ) ) <nl> + if ( aObjMeta - > getRepresentation ( ) = = bMeta - > getRepresentation ( ) & & <nl> + bMeta - > getRepresentation ( ) ! = MetatypeRepresentation : : Thin ) <nl> + continue ; <nl> + if ( bObject ) <nl> + if ( auto aMeta = aa . getAs < MetatypeType > ( ) ) <nl> + if ( auto bObjMeta = bObject . getAs < MetatypeType > ( ) ) <nl> + if ( aMeta - > getRepresentation ( ) = = bObjMeta - > getRepresentation ( ) & & <nl> + aMeta - > getRepresentation ( ) ! = MetatypeRepresentation : : Thin ) <nl> + continue ; <nl> + <nl> + / / Function types are interchangeable if they ' re also ABI - compatible . <nl> + if ( auto aFunc = aa . getAs < SILFunctionType > ( ) ) { <nl> + if ( auto bFunc = bb . getAs < SILFunctionType > ( ) ) { <nl> + / / * NOTE * We swallow the specific error here for now . We will still get <nl> + / / that the function types are incompatible though , just not more <nl> + / / specific information . <nl> + return aFunc - > isABICompatibleWith ( bFunc ) . isCompatible ( ) ; <nl> + } <nl> + } <nl> + <nl> + / / Metatypes are interchangeable with metatypes with the same <nl> + / / representation . <nl> + if ( auto aMeta = aa . getAs < MetatypeType > ( ) ) { <nl> + if ( auto bMeta = bb . getAs < MetatypeType > ( ) ) { <nl> + if ( aMeta - > getRepresentation ( ) = = bMeta - > getRepresentation ( ) ) <nl> + continue ; <nl> + } <nl> + } <nl> + / / Other types must match exactly . <nl> + return false ; <nl> + } <nl> + <nl> + return true ; <nl> + } <nl> + <nl> + namespace { <nl> + using ABICompatibilityCheckResult = <nl> + SILFunctionType : : ABICompatibilityCheckResult ; <nl> + } / / end anonymous namespace <nl> + <nl> + ABICompatibilityCheckResult <nl> + SILFunctionType : : isABICompatibleWith ( CanSILFunctionType other ) const { <nl> + / / The calling convention and function representation can ' t be changed . <nl> + if ( getRepresentation ( ) ! = other - > getRepresentation ( ) ) <nl> + return ABICompatibilityCheckResult : : DifferentFunctionRepresentations ; <nl> + <nl> + / / Check the results . <nl> + if ( getNumResults ( ) ! = other - > getNumResults ( ) ) <nl> + return ABICompatibilityCheckResult : : DifferentNumberOfResults ; <nl> + <nl> + for ( unsigned i : indices ( getResults ( ) ) ) { <nl> + auto result1 = getResults ( ) [ i ] ; <nl> + auto result2 = other - > getResults ( ) [ i ] ; <nl> + <nl> + if ( result1 . getConvention ( ) ! = result2 . getConvention ( ) ) <nl> + return ABICompatibilityCheckResult : : DifferentReturnValueConventions ; <nl> + <nl> + if ( ! areABICompatibleParamsOrReturns ( result1 . getSILStorageType ( ) , <nl> + result2 . getSILStorageType ( ) ) ) { <nl> + return ABICompatibilityCheckResult : : ABIIncompatibleReturnValues ; <nl> + } <nl> + } <nl> + <nl> + / / Our error result conventions are designed to be ABI compatible <nl> + / / with functions lacking error results . Just make sure that the <nl> + / / actual conventions match up . <nl> + if ( hasErrorResult ( ) & & other - > hasErrorResult ( ) ) { <nl> + auto error1 = getErrorResult ( ) ; <nl> + auto error2 = other - > getErrorResult ( ) ; <nl> + if ( error1 . getConvention ( ) ! = error2 . getConvention ( ) ) <nl> + return ABICompatibilityCheckResult : : DifferentErrorResultConventions ; <nl> + <nl> + if ( ! areABICompatibleParamsOrReturns ( error1 . getSILStorageType ( ) , <nl> + error2 . getSILStorageType ( ) ) ) <nl> + return ABICompatibilityCheckResult : : ABIIncompatibleErrorResults ; <nl> + } <nl> + <nl> + / / Check the parameters . <nl> + / / TODO : Could allow known - empty types to be inserted or removed , but SIL <nl> + / / doesn ' t know what empty types are yet . <nl> + if ( getParameters ( ) . size ( ) ! = other - > getParameters ( ) . size ( ) ) <nl> + return ABICompatibilityCheckResult : : DifferentNumberOfParameters ; <nl> + <nl> + for ( unsigned i : indices ( getParameters ( ) ) ) { <nl> + auto param1 = getParameters ( ) [ i ] ; <nl> + auto param2 = other - > getParameters ( ) [ i ] ; <nl> + <nl> + if ( param1 . getConvention ( ) ! = param2 . getConvention ( ) ) <nl> + return { ABICompatibilityCheckResult : : DifferingParameterConvention , i } ; <nl> + if ( ! areABICompatibleParamsOrReturns ( param1 . getSILStorageType ( ) , <nl> + param2 . getSILStorageType ( ) ) ) <nl> + return { ABICompatibilityCheckResult : : ABIIncompatibleParameterType , i } ; <nl> + } <nl> + <nl> + return ABICompatibilityCheckResult : : None ; <nl> + } <nl> + <nl> + StringRef SILFunctionType : : ABICompatibilityCheckResult : : getMessage ( ) const { <nl> + switch ( kind ) { <nl> + case innerty : : None : <nl> + return " None " ; <nl> + case innerty : : DifferentFunctionRepresentations : <nl> + return " Different function representations " ; <nl> + case innerty : : DifferentNumberOfResults : <nl> + return " Different number of results " ; <nl> + case innerty : : DifferentReturnValueConventions : <nl> + return " Different return value conventions " ; <nl> + case innerty : : ABIIncompatibleReturnValues : <nl> + return " ABI incompatible return values " ; <nl> + case innerty : : DifferentErrorResultConventions : <nl> + return " Different error result conventions " ; <nl> + case innerty : : ABIIncompatibleErrorResults : <nl> + return " ABI incompatible error results " ; <nl> + case innerty : : DifferentNumberOfParameters : <nl> + return " Different number of parameters " ; <nl> + <nl> + / / These two have to do with specific parameters , so keep the error message <nl> + / / non - plural . <nl> + case innerty : : DifferingParameterConvention : <nl> + return " Differing parameter convention " ; <nl> + case innerty : : ABIIncompatibleParameterType : <nl> + return " ABI incompatible parameter type . " ; <nl> + } <nl> + llvm_unreachable ( " Covered switch isn ' t completely covered ? ! " ) ; <nl> + } <nl> mmm a / lib / SIL / SILVerifier . cpp <nl> ppp b / lib / SIL / SILVerifier . cpp <nl> class SILVerifier : public SILVerifierBase < SILVerifier > { <nl> void requireABICompatibleFunctionTypes ( CanSILFunctionType type1 , <nl> CanSILFunctionType type2 , <nl> const Twine & what ) { <nl> - <nl> auto complain = [ = ] ( const char * msg ) - > std : : function < void ( ) > { <nl> return [ = ] { <nl> llvm : : dbgs ( ) < < " " < < msg < < ' \ n ' <nl> class SILVerifier : public SILVerifierBase < SILVerifier > { <nl> llvm : : dbgs ( ) < < " " < < type1 < < " \ n " < < type2 < < ' \ n ' ; <nl> } ; <nl> } ; <nl> - <nl> - / / The calling convention and function representation can ' t be changed . <nl> - _require ( type1 - > getRepresentation ( ) = = type2 - > getRepresentation ( ) , what , <nl> - complain ( " Different function representations " ) ) ; <nl> - <nl> - / / TODO : We should compare generic signatures . Class and witness methods <nl> - / / allow variance in " self " - fulfilled parameters ; other functions must <nl> - / / match exactly . <nl> - <nl> - / / TODO : More sophisticated param and return ABI compatibility rules could <nl> - / / diverge . <nl> - std : : function < bool ( SILType , SILType ) > <nl> - areABICompatibleParamsOrReturns = [ & ] ( SILType a , SILType b ) - > bool { <nl> - / / Address parameters are all ABI - compatible , though the referenced <nl> - / / values may not be . Assume whoever ' s doing this knows what they ' re <nl> - / / doing . <nl> - if ( a . isAddress ( ) & & b . isAddress ( ) ) <nl> - return true ; <nl> - / / Addresses aren ' t compatible with values . <nl> - / / TODO : An exception for pointerish types ? <nl> - else if ( a . isAddress ( ) | | b . isAddress ( ) ) <nl> - return false ; <nl> - <nl> - / / Tuples are ABI compatible if their elements are . <nl> - / / TODO : Should destructure recursively . <nl> - SmallVector < CanType , 1 > aElements , bElements ; <nl> - if ( auto tup = a . getAs < TupleType > ( ) ) { <nl> - auto types = tup . getElementTypes ( ) ; <nl> - aElements . append ( types . begin ( ) , types . end ( ) ) ; <nl> - } else { <nl> - aElements . push_back ( a . getSwiftRValueType ( ) ) ; <nl> - } <nl> - if ( auto tup = b . getAs < TupleType > ( ) ) { <nl> - auto types = tup . getElementTypes ( ) ; <nl> - bElements . append ( types . begin ( ) , types . end ( ) ) ; <nl> - } else { <nl> - bElements . push_back ( b . getSwiftRValueType ( ) ) ; <nl> - } <nl> - <nl> - if ( aElements . size ( ) ! = bElements . size ( ) ) <nl> - return false ; <nl> - <nl> - for ( unsigned i : indices ( aElements ) ) { <nl> - auto aa = SILType : : getPrimitiveObjectType ( aElements [ i ] ) , <nl> - bb = SILType : : getPrimitiveObjectType ( bElements [ i ] ) ; <nl> - / / Equivalent types are always ABI - compatible . <nl> - if ( aa = = bb ) <nl> - continue ; <nl> - <nl> - / / FIXME : If one or both types are dependent , we can ' t accurately assess <nl> - / / whether they ' re ABI - compatible without a generic context . We can <nl> - / / do a better job here when dependent types are related to their <nl> - / / generic signatures . <nl> - if ( aa . hasTypeParameter ( ) | | bb . hasTypeParameter ( ) ) <nl> - continue ; <nl> - <nl> - / / Bridgeable object types are interchangeable . <nl> - if ( aa . isBridgeableObjectType ( ) & & bb . isBridgeableObjectType ( ) ) <nl> - continue ; <nl> - <nl> - / / Optional and IUO are interchangeable if their elements are . <nl> - auto aObject = aa . getAnyOptionalObjectType ( ) ; <nl> - auto bObject = bb . getAnyOptionalObjectType ( ) ; <nl> - if ( aObject & & bObject <nl> - & & areABICompatibleParamsOrReturns ( aObject , bObject ) ) <nl> - continue ; <nl> - / / Optional objects are ABI - interchangeable with non - optionals ; <nl> - / / None is represented by a null pointer . <nl> - if ( aObject & & aObject . isBridgeableObjectType ( ) <nl> - & & bb . isBridgeableObjectType ( ) ) <nl> - continue ; <nl> - if ( bObject & & bObject . isBridgeableObjectType ( ) <nl> - & & aa . isBridgeableObjectType ( ) ) <nl> - continue ; <nl> - <nl> - / / Optional thick metatypes are ABI - interchangeable with non - optionals <nl> - / / too . <nl> - if ( aObject ) <nl> - if ( auto aObjMeta = aObject . getAs < MetatypeType > ( ) ) <nl> - if ( auto bMeta = bb . getAs < MetatypeType > ( ) ) <nl> - if ( aObjMeta - > getRepresentation ( ) = = bMeta - > getRepresentation ( ) <nl> - & & bMeta - > getRepresentation ( ) ! = MetatypeRepresentation : : Thin ) <nl> - continue ; <nl> - if ( bObject ) <nl> - if ( auto aMeta = aa . getAs < MetatypeType > ( ) ) <nl> - if ( auto bObjMeta = bObject . getAs < MetatypeType > ( ) ) <nl> - if ( aMeta - > getRepresentation ( ) = = bObjMeta - > getRepresentation ( ) <nl> - & & aMeta - > getRepresentation ( ) ! = MetatypeRepresentation : : Thin ) <nl> - continue ; <nl> - <nl> - / / Function types are interchangeable if they ' re also ABI - compatible . <nl> - if ( auto aFunc = aa . getAs < SILFunctionType > ( ) ) <nl> - if ( auto bFunc = bb . getAs < SILFunctionType > ( ) ) { <nl> - / / FIXME <nl> - requireABICompatibleFunctionTypes ( aFunc , bFunc , what ) ; <nl> - return true ; <nl> - } <nl> - <nl> - / / Metatypes are interchangeable with metatypes with the same <nl> - / / representation . <nl> - if ( auto aMeta = aa . getAs < MetatypeType > ( ) ) <nl> - if ( auto bMeta = bb . getAs < MetatypeType > ( ) ) <nl> - if ( aMeta - > getRepresentation ( ) = = bMeta - > getRepresentation ( ) ) <nl> - continue ; <nl> - <nl> - / / Other types must match exactly . <nl> - return false ; <nl> - } <nl> - return true ; <nl> - } ; <nl> - <nl> - / / Check the results . <nl> - _require ( type1 - > getNumResults ( ) = = type2 - > getNumResults ( ) , what , <nl> - complain ( " different number of results " ) ) ; <nl> - for ( unsigned i : indices ( type1 - > getResults ( ) ) ) { <nl> - auto result1 = type1 - > getResults ( ) [ i ] ; <nl> - auto result2 = type2 - > getResults ( ) [ i ] ; <nl> - <nl> - _require ( result1 . getConvention ( ) = = result2 . getConvention ( ) , what , <nl> - complain ( " Different return value conventions " ) ) ; <nl> - _require ( areABICompatibleParamsOrReturns ( result1 . getSILStorageType ( ) , <nl> - result2 . getSILStorageType ( ) ) , <nl> - what , complain ( " ABI - incompatible return values " ) ) ; <nl> - } <nl> <nl> - / / Our error result conventions are designed to be ABI compatible <nl> - / / with functions lacking error results . Just make sure that the <nl> - / / actual conventions match up . <nl> - if ( type1 - > hasErrorResult ( ) & & type2 - > hasErrorResult ( ) ) { <nl> - auto error1 = type1 - > getErrorResult ( ) ; <nl> - auto error2 = type2 - > getErrorResult ( ) ; <nl> - _require ( error1 . getConvention ( ) = = error2 . getConvention ( ) , what , <nl> - complain ( " Different error result conventions " ) ) ; <nl> - _require ( areABICompatibleParamsOrReturns ( error1 . getSILStorageType ( ) , <nl> - error2 . getSILStorageType ( ) ) , <nl> - what , complain ( " ABI - incompatible error results " ) ) ; <nl> - } <nl> + / / If we didn ' t have a failure , return . <nl> + auto Result = type1 - > isABICompatibleWith ( type2 ) ; <nl> + if ( Result . isCompatible ( ) ) <nl> + return ; <nl> <nl> - / / Check the parameters . <nl> - / / TODO : Could allow known - empty types to be inserted or removed , but SIL <nl> - / / doesn ' t know what empty types are yet . <nl> - <nl> - _require ( type1 - > getParameters ( ) . size ( ) = = type2 - > getParameters ( ) . size ( ) , <nl> - what , complain ( " different number of parameters " ) ) ; <nl> - for ( unsigned i : indices ( type1 - > getParameters ( ) ) ) { <nl> - auto param1 = type1 - > getParameters ( ) [ i ] ; <nl> - auto param2 = type2 - > getParameters ( ) [ i ] ; <nl> - <nl> - _require ( param1 . getConvention ( ) = = param2 . getConvention ( ) , what , <nl> - complainBy ( [ = ] { <nl> - llvm : : dbgs ( ) < < " Different conventions for parameter " < < i ; <nl> - } ) ) ; <nl> - _require ( areABICompatibleParamsOrReturns ( param1 . getSILStorageType ( ) , <nl> - param2 . getSILStorageType ( ) ) , <nl> - what , complainBy ( [ = ] { <nl> - llvm : : dbgs ( ) < < " ABI - incompatible types for parameter " < < i ; <nl> + if ( ! Result . hasPayload ( ) ) { <nl> + _require ( false , what , complain ( Result . getMessage ( ) . data ( ) ) ) ; <nl> + } else { <nl> + _require ( false , what , complainBy ( [ = ] { <nl> + llvm : : dbgs ( ) < < " " < < Result . getMessage ( ) . data ( ) <nl> + < < " . \ nParameter : " < < Result . getPayload ( ) ; <nl> } ) ) ; <nl> } <nl> } <nl> class SILVerifier : public SILVerifierBase < SILVerifier > { <nl> " convert_function result " ) ; <nl> <nl> / / convert_function is required to be an ABI - compatible conversion . <nl> - requireABICompatibleFunctionTypes ( opTI , resTI , <nl> - " convert_function cannot change function ABI " ) ; <nl> + requireABICompatibleFunctionTypes ( <nl> + opTI , resTI , " convert_function cannot change function ABI " ) ; <nl> } <nl> <nl> void checkThinFunctionToPointerInst ( ThinFunctionToPointerInst * CI ) { <nl>
Merge pull request from gottesmm / pr - a501646b040ec5fb99039cd0689b4468acdd0d23
apple/swift
b39c3372857d8c5976768e42aa7749c93bdae302
2017-11-29T05:06:20Z
mmm a / arangod / MMFiles / MMFilesWalRecoveryFeature . cpp <nl> ppp b / arangod / MMFiles / MMFilesWalRecoveryFeature . cpp <nl> void MMFilesWalRecoveryFeature : : start ( ) { <nl> if ( res ! = TRI_ERROR_NO_ERROR ) { <nl> LOG_TOPIC ( FATAL , arangodb : : Logger : : ENGINES ) <nl> < < " unable to finish WAL recovery : " < < TRI_errno_string ( res ) ; <nl> + # ifdef ARANGODB_ENABLE_MAINTAINER_MODE <nl> + FATAL_ERROR_ABORT ( ) ; <nl> + # endif <nl> FATAL_ERROR_EXIT ( ) ; <nl> } <nl> <nl>
use abort as SIGABRT has CORE as default action ( )
arangodb/arangodb
679ac123958e80a046bc40ecb41bd0d125669963
2019-03-21T14:55:21Z
mmm a / scene / gui / split_container . cpp <nl> ppp b / scene / gui / split_container . cpp <nl> void SplitContainer : : _resort ( ) { <nl> / / If we have only one element <nl> if ( ! first | | ! second ) { <nl> if ( first ) { <nl> - fit_child_in_rect ( _getch ( 0 ) , Rect2 ( Point2 ( ) , get_size ( ) ) ) ; <nl> + fit_child_in_rect ( first , Rect2 ( Point2 ( ) , get_size ( ) ) ) ; <nl> } else if ( second ) { <nl> - fit_child_in_rect ( _getch ( 1 ) , Rect2 ( Point2 ( ) , get_size ( ) ) ) ; <nl> + fit_child_in_rect ( second , Rect2 ( Point2 ( ) , get_size ( ) ) ) ; <nl> } <nl> return ; <nl> } <nl> <nl> / / Determine expanded children <nl> - bool first_expanded = false ; <nl> - bool second_expanded = false ; <nl> - if ( vertical ) { <nl> - first_expanded = first - > get_v_size_flags ( ) & SIZE_EXPAND ; <nl> - second_expanded = second - > get_v_size_flags ( ) & SIZE_EXPAND ; <nl> - } else { <nl> - first_expanded = first - > get_h_size_flags ( ) & SIZE_EXPAND ; <nl> - second_expanded = second - > get_h_size_flags ( ) & SIZE_EXPAND ; <nl> - } <nl> + bool first_expanded = ( vertical ? first - > get_v_size_flags ( ) : first - > get_h_size_flags ( ) ) & SIZE_EXPAND ; <nl> + bool second_expanded = ( vertical ? second - > get_v_size_flags ( ) : second - > get_h_size_flags ( ) ) & SIZE_EXPAND ; <nl> <nl> / / Determine the separation between items <nl> Ref < Texture > g = get_icon ( " grabber " ) ; <nl> int sep = get_constant ( " separation " ) ; <nl> - if ( dragger_visibility = = DRAGGER_HIDDEN_COLLAPSED ) { <nl> - sep = 0 ; <nl> - } else { <nl> - sep = MAX ( sep , vertical ? g - > get_height ( ) : g - > get_width ( ) ) ; <nl> - } <nl> + sep = ( dragger_visibility ! = DRAGGER_HIDDEN_COLLAPSED ) ? MAX ( sep , vertical ? g - > get_height ( ) : g - > get_width ( ) ) : 0 ; <nl> <nl> / / Compute the minimum size <nl> Size2 ms_first = first - > get_combined_minimum_size ( ) ; <nl> Size2 ms_second = second - > get_combined_minimum_size ( ) ; <nl> <nl> + / / Compute the separator position without the split offset <nl> float ratio = first - > get_stretch_ratio ( ) / ( first - > get_stretch_ratio ( ) + second - > get_stretch_ratio ( ) ) ; <nl> - <nl> int no_offset_middle_sep = 0 ; <nl> if ( first_expanded & & second_expanded ) { <nl> no_offset_middle_sep = get_size ( ) [ axis ] * ratio - sep / 2 ; <nl> void SplitContainer : : _resort ( ) { <nl> no_offset_middle_sep = ms_first [ axis ] ; <nl> } <nl> <nl> - middle_sep = no_offset_middle_sep ; <nl> - middle_sep + = ( collapsed ) ? 0 : split_offset ; <nl> - middle_sep = MIN ( middle_sep , get_size ( ) [ axis ] - ms_second [ axis ] - sep ) ; <nl> - middle_sep = MAX ( middle_sep , ms_first [ axis ] ) ; <nl> - if ( ! collapsed ) { <nl> - split_offset = middle_sep - no_offset_middle_sep ; <nl> + / / Compute the final middle separation <nl> + int clamped_split_offset = CLAMP ( split_offset , ms_first [ axis ] - no_offset_middle_sep , ( get_size ( ) [ axis ] - ms_second [ axis ] - sep ) - no_offset_middle_sep ) ; <nl> + middle_sep = no_offset_middle_sep + clamped_split_offset ; <nl> + if ( ! collapsed & & should_clamp_split_offset ) { <nl> + split_offset = clamped_split_offset ; <nl> + _change_notify ( " split_offset " ) ; <nl> + should_clamp_split_offset = false ; <nl> } <nl> <nl> if ( vertical ) { <nl> void SplitContainer : : _resort ( ) { <nl> } <nl> <nl> update ( ) ; <nl> - _change_notify ( " split_offset " ) ; <nl> } <nl> <nl> Size2 SplitContainer : : get_minimum_size ( ) const { <nl> Size2 SplitContainer : : get_minimum_size ( ) const { <nl> / * Calculate MINIMUM SIZE * / <nl> <nl> Size2i minimum ; <nl> - int sep = get_constant ( " separation " ) ; <nl> Ref < Texture > g = get_icon ( " grabber " ) ; <nl> + int sep = get_constant ( " separation " ) ; <nl> sep = ( dragger_visibility ! = DRAGGER_HIDDEN_COLLAPSED ) ? MAX ( sep , vertical ? g - > get_height ( ) : g - > get_width ( ) ) : 0 ; <nl> <nl> for ( int i = 0 ; i < 2 ; i + + ) { <nl> void SplitContainer : : _gui_input ( const Ref < InputEvent > & p_event ) { <nl> if ( mm . is_valid ( ) & & dragging ) { <nl> <nl> split_offset = drag_ofs + ( ( vertical ? mm - > get_position ( ) . y : mm - > get_position ( ) . x ) - drag_from ) ; <nl> + should_clamp_split_offset = true ; <nl> queue_sort ( ) ; <nl> emit_signal ( " dragged " , get_split_offset ( ) ) ; <nl> } <nl> void SplitContainer : : set_split_offset ( int p_offset ) { <nl> return ; <nl> <nl> split_offset = p_offset ; <nl> + <nl> queue_sort ( ) ; <nl> } <nl> <nl> int SplitContainer : : get_split_offset ( ) const { <nl> return split_offset ; <nl> } <nl> <nl> + void SplitContainer : : clamp_split_offset ( ) { <nl> + should_clamp_split_offset = true ; <nl> + <nl> + queue_sort ( ) ; <nl> + } <nl> + <nl> void SplitContainer : : set_collapsed ( bool p_collapsed ) { <nl> <nl> if ( collapsed = = p_collapsed ) <nl> bool SplitContainer : : is_collapsed ( ) const { <nl> void SplitContainer : : _bind_methods ( ) { <nl> <nl> ClassDB : : bind_method ( D_METHOD ( " _gui_input " ) , & SplitContainer : : _gui_input ) ; <nl> + <nl> ClassDB : : bind_method ( D_METHOD ( " set_split_offset " , " offset " ) , & SplitContainer : : set_split_offset ) ; <nl> ClassDB : : bind_method ( D_METHOD ( " get_split_offset " ) , & SplitContainer : : get_split_offset ) ; <nl> + ClassDB : : bind_method ( D_METHOD ( " clamp_split_offset " ) , & SplitContainer : : clamp_split_offset ) ; <nl> <nl> ClassDB : : bind_method ( D_METHOD ( " set_collapsed " , " collapsed " ) , & SplitContainer : : set_collapsed ) ; <nl> ClassDB : : bind_method ( D_METHOD ( " is_collapsed " ) , & SplitContainer : : is_collapsed ) ; <nl> SplitContainer : : SplitContainer ( bool p_vertical ) { <nl> <nl> mouse_inside = false ; <nl> split_offset = 0 ; <nl> + should_clamp_split_offset = false ; <nl> middle_sep = 0 ; <nl> vertical = p_vertical ; <nl> dragging = false ; <nl> mmm a / scene / gui / split_container . h <nl> ppp b / scene / gui / split_container . h <nl> class SplitContainer : public Container { <nl> } ; <nl> <nl> private : <nl> - bool vertical ; <nl> + bool should_clamp_split_offset ; <nl> int split_offset ; <nl> int middle_sep ; <nl> + bool vertical ; <nl> bool dragging ; <nl> int drag_from ; <nl> int drag_ofs ; <nl> class SplitContainer : public Container { <nl> public : <nl> void set_split_offset ( int p_offset ) ; <nl> int get_split_offset ( ) const ; <nl> + void clamp_split_offset ( ) ; <nl> <nl> void set_collapsed ( bool p_collapsed ) ; <nl> bool is_collapsed ( ) const ; <nl>
Keep the SplitContainer offset value when it is shrinked
godotengine/godot
a982531368db60ac130c615d31bf4e8629052f94
2018-11-15T15:47:28Z
mmm a / modules / planning / proto / decider_config . proto <nl> ppp b / modules / planning / proto / decider_config . proto <nl> message DeciderStopSignConfig { <nl> message SidePassSafetyConfig { <nl> / / min lateral distance ( m ) for safe obstacle <nl> optional double min_obstacle_lateral_distance = 1 [ default = 1 . 0 ] ; / / meter <nl> + optional double max_overlap_s_range = 2 [ default = 5 . 0 ] ; / / meter <nl> + optional double safe_duration_reach_ref_line = 3 [ default = 5 . 0 ] ; / / second <nl> } <nl> mmm a / modules / planning / toolkits / deciders / side_pass_safety . cc <nl> ppp b / modules / planning / toolkits / deciders / side_pass_safety . cc <nl> bool SidePassSafety : : IsSafeSidePass ( <nl> } <nl> / / ignore the obstacles behind adc and is able to catch adc after 5 secs . <nl> if ( path_obstacle - > PerceptionSLBoundary ( ) . end_s ( ) < adc_front_edge_s & & <nl> - path_obstacle - > st_boundary ( ) . min_t ( ) > 5 ) { <nl> + path_obstacle - > st_boundary ( ) . min_t ( ) > <nl> + Config ( ) . side_pass_safety_config ( ) . safe_duration_reach_ref_line ( ) ) { <nl> continue ; <nl> } <nl> / / not overlapped obstacles <nl> bool SidePassSafety : : IsSafeSidePass ( <nl> / / overlap is more than 5 meters <nl> double s_range = path_obstacle - > st_boundary ( ) . max_s ( ) - <nl> path_obstacle - > st_boundary ( ) . min_s ( ) ; <nl> - if ( s_range > 5 ) { <nl> + if ( s_range > Config ( ) . side_pass_safety_config ( ) . max_overlap_s_range ( ) ) { <nl> return false ; <nl> } <nl> } <nl>
planning : added a few configs in side pass safety decider .
ApolloAuto/apollo
d332578cbbf549238956071cb1e59817ed3cc5bc
2018-12-13T23:17:45Z
mmm a / modules / imgcodecs / src / exif . cpp <nl> ppp b / modules / imgcodecs / src / exif . cpp <nl> std : : map < int , ExifEntry_t > ExifReader : : getExif ( ) <nl> case APP9 : case APP10 : case APP11 : case APP12 : case APP13 : case APP14 : case APP15 : <nl> case COM : <nl> bytesToSkip = getFieldSize ( f ) ; <nl> + if ( bytesToSkip < markerSize ) { <nl> + fclose ( f ) ; <nl> + throw ExifParsingError ( ) ; <nl> + } <nl> fseek ( f , static_cast < long > ( bytesToSkip - markerSize ) , SEEK_CUR ) ; <nl> break ; <nl> <nl>
Update exif . cpp
opencv/opencv
e69253a4fb613ddbc5797c9f4828cd9200f64777
2016-11-24T03:08:11Z
mmm a / src / buffer_cache / mirrored / mirrored . cc <nl> ppp b / src / buffer_cache / mirrored / mirrored . cc <nl> struct load_buf_fsm_t : <nl> void on_thread_switch ( ) { <nl> if ( ! have_loaded ) { <nl> inner_buf - > subtree_recency = inner_buf - > cache - > serializer - > get_recency ( inner_buf - > block_id ) ; <nl> - if ( inner_buf - > cache - > serializer - > do_read ( inner_buf - > block_id , inner_buf - > data , this , ( ser_transaction_id_t * * ) & inner_buf - > transaction_id ) ) <nl> + if ( inner_buf - > cache - > serializer - > do_read ( inner_buf - > block_id , inner_buf - > data , this ) ) <nl> on_serializer_read ( ) ; <nl> } else { <nl> inner_buf - > lock . unlock ( ) ; <nl> struct load_buf_fsm_t : <nl> const std : : list < buf_patch_t * > * patches = inner_buf - > cache - > diff_core_storage . get_patches ( inner_buf - > block_id ) ; <nl> / / Remove obsolete patches from diff storage <nl> if ( patches ) { <nl> - inner_buf - > cache - > diff_core_storage . filter_applied_patches ( inner_buf - > block_id , * inner_buf - > transaction_id ) ; <nl> + inner_buf - > cache - > diff_core_storage . filter_applied_patches ( inner_buf - > block_id , inner_buf - > get_transaction_id ( ) ) ; <nl> patches = inner_buf - > cache - > diff_core_storage . get_patches ( inner_buf - > block_id ) ; <nl> } <nl> / / All patches that currently exist must have been materialized out of core . . . <nl> mc_inner_buf_t : : mc_inner_buf_t ( cache_t * cache , block_id_t block_id ) <nl> : cache ( cache ) , <nl> block_id ( block_id ) , <nl> data ( cache - > serializer - > malloc ( ) ) , <nl> - transaction_id ( NULL ) , <nl> next_patch_counter ( 1 ) , <nl> refcount ( 0 ) , <nl> do_delete ( false ) , <nl> mc_inner_buf_t : : mc_inner_buf_t ( cache_t * cache , block_id_t block_id ) <nl> page_repl_buf ( this ) , <nl> page_map_buf ( this ) { <nl> new load_buf_fsm_t ( this ) ; <nl> - <nl> + <nl> + / / Initialize the transaction id . . . <nl> + buf_data_t * ser_data = ( buf_data_t * ) data ; <nl> + ser_data - - ; <nl> + ser_data - > transaction_id = NULL_SER_TRANSACTION_ID ; <nl> + <nl> pm_n_blocks_in_memory + + ; <nl> refcount + + ; / / Make the refcount nonzero so this block won ' t be considered safe to unload . <nl> cache - > page_repl . make_space ( 1 ) ; <nl> mc_inner_buf_t : : mc_inner_buf_t ( cache_t * cache ) <nl> block_id ( cache - > free_list . gen_block_id ( ) ) , <nl> subtree_recency ( current_time ( ) ) , <nl> data ( cache - > serializer - > malloc ( ) ) , <nl> - transaction_id ( NULL ) , <nl> next_patch_counter ( 1 ) , <nl> refcount ( 0 ) , <nl> do_delete ( false ) , <nl> void mc_buf_t : : apply_patch ( buf_patch_t & patch ) { <nl> patch . apply_to_buf ( ( char * ) data ) ; <nl> inner_buf - > writeback_buf . set_dirty ( ) ; <nl> <nl> - / / We cannot accept patches for blocks without a valid transaction id ( newly allocated blocks etc . ) <nl> - / / TODO ! This is really bad currently , change the behavior of transaction ID reading <nl> - if ( ! inner_buf - > transaction_id ) <nl> + / / We cannot accept patches for blocks without a valid transaction id ( newly allocated blocks ) <nl> + if ( get_transaction_id ( ) = = NULL_SER_TRANSACTION_ID ) <nl> ensure_flush ( ) ; <nl> <nl> / / Check if we want to switch disable patching for this block and flush it directly instead <nl> mmm a / src / buffer_cache / mirrored / mirrored . hpp <nl> ppp b / src / buffer_cache / mirrored / mirrored . hpp <nl> class mc_inner_buf_t { <nl> block_id_t block_id ; <nl> repli_timestamp subtree_recency ; <nl> void * data ; <nl> - ser_transaction_id_t volatile * transaction_id ; <nl> rwi_lock_t lock ; <nl> patch_counter_t next_patch_counter ; <nl> <nl> class mc_inner_buf_t { <nl> explicit mc_inner_buf_t ( cache_t * cache ) ; <nl> <nl> ~ mc_inner_buf_t ( ) ; <nl> + <nl> + ser_transaction_id_t get_transaction_id ( ) const { <nl> + buf_data_t volatile * ser_data = ( buf_data_t * ) data ; <nl> + ser_data - - ; <nl> + return ser_data - > transaction_id ; <nl> + } <nl> } ; <nl> <nl> / * This class represents a hold on a mc_inner_buf_t . * / <nl> class mc_buf_t : <nl> / / the serializer <nl> rassert ( mode = = rwi_write ) ; <nl> rassert ( data = = inner_buf - > data ) ; <nl> - if ( inner_buf - > transaction_id = = NULL ) <nl> - return NULL_SER_TRANSACTION_ID ; <nl> - return * inner_buf - > transaction_id ; <nl> + return inner_buf - > get_transaction_id ( ) ; <nl> } <nl> <nl> const void * get_data_read ( ) const { <nl> mmm a / src / serializer / log / log_serializer . cc <nl> ppp b / src / serializer / log / log_serializer . cc <nl> struct ls_read_fsm_t : <nl> log_serializer_t * ser ; <nl> ser_block_id_t block_id ; <nl> void * buf ; <nl> - ser_transaction_id_t * * transaction_id ; <nl> <nl> - ls_read_fsm_t ( log_serializer_t * ser , ser_block_id_t block_id , void * buf , ser_transaction_id_t * * transaction_id ) <nl> - : ser ( ser ) , block_id ( block_id ) , buf ( buf ) , transaction_id ( transaction_id ) <nl> + ls_read_fsm_t ( log_serializer_t * ser , ser_block_id_t block_id , void * buf ) <nl> + : ser ( ser ) , block_id ( block_id ) , buf ( buf ) <nl> { <nl> pm_serializer_reads . begin ( & start_time ) ; <nl> } <nl> struct ls_read_fsm_t : <nl> } <nl> <nl> bool done ( ) { <nl> - if ( transaction_id ) { <nl> - buf_data_t * data = ( buf_data_t * ) buf ; <nl> - data - - ; <nl> - * transaction_id = & data - > transaction_id ; <nl> - } <nl> if ( read_callback ) read_callback - > on_serializer_read ( ) ; <nl> delete this ; <nl> return true ; <nl> } <nl> } ; <nl> <nl> - bool log_serializer_t : : do_read ( ser_block_id_t block_id , void * buf , read_callback_t * callback , ser_transaction_id_t * * transaction_id ) { <nl> + bool log_serializer_t : : do_read ( ser_block_id_t block_id , void * buf , read_callback_t * callback ) { <nl> rassert ( state = = state_ready ) ; <nl> assert_thread ( ) ; <nl> <nl> - ls_read_fsm_t * fsm = new ls_read_fsm_t ( this , block_id , buf , transaction_id ) ; <nl> + ls_read_fsm_t * fsm = new ls_read_fsm_t ( this , block_id , buf ) ; <nl> return fsm - > run ( callback ) ; <nl> } <nl> <nl> mmm a / src / serializer / log / log_serializer . hpp <nl> ppp b / src / serializer / log / log_serializer . hpp <nl> struct log_serializer_t : <nl> void * clone ( void * ) ; / / clones a buf <nl> void free ( void * ) ; <nl> <nl> - / / If transaction_id is given , it becomes a pointer to the block ' s transaction id attribute <nl> - bool do_read ( ser_block_id_t block_id , void * buf , read_callback_t * callback , ser_transaction_id_t * * transaction_id = NULL ) ; <nl> + bool do_read ( ser_block_id_t block_id , void * buf , read_callback_t * callback ) ; <nl> bool do_write ( write_t * writes , int num_writes , write_txn_callback_t * callback ) ; <nl> block_size_t get_block_size ( ) ; <nl> ser_block_id_t max_block_id ( ) ; <nl> mmm a / src / serializer / serializer . hpp <nl> ppp b / src / serializer / serializer . hpp <nl> struct serializer_t : <nl> virtual void on_serializer_read ( ) = 0 ; <nl> virtual ~ read_callback_t ( ) { } <nl> } ; <nl> - / / If transaction_id is given , it becomes a pointer to the block ' s transaction id attribute <nl> - virtual bool do_read ( ser_block_id_t block_id , void * buf , read_callback_t * callback , ser_transaction_id_t * * transaction_id = NULL ) = 0 ; <nl> + virtual bool do_read ( ser_block_id_t block_id , void * buf , read_callback_t * callback ) = 0 ; <nl> <nl> / * do_write ( ) updates or deletes a group of bufs . <nl> <nl> mmm a / src / serializer / translator . cc <nl> ppp b / src / serializer / translator . cc <nl> void translator_serializer_t : : free ( void * ptr ) { <nl> inner - > free ( ptr ) ; <nl> } <nl> <nl> - bool translator_serializer_t : : do_read ( block_id_t block_id , void * buf , serializer_t : : read_callback_t * callback , ser_transaction_id_t * * transaction_id ) { <nl> - return inner - > do_read ( xlate ( block_id ) , buf , callback , transaction_id ) ; <nl> + bool translator_serializer_t : : do_read ( block_id_t block_id , void * buf , serializer_t : : read_callback_t * callback ) { <nl> + return inner - > do_read ( xlate ( block_id ) , buf , callback ) ; <nl> } <nl> <nl> <nl> mmm a / src / serializer / translator . hpp <nl> ppp b / src / serializer / translator . hpp <nl> class translator_serializer_t : public home_thread_mixin_t <nl> virtual void * clone ( void * ) ; <nl> void free ( void * ptr ) ; <nl> <nl> - / / If transaction_id is given , it becomes a pointer to the block ' s transaction id attribute <nl> - bool do_read ( block_id_t block_id , void * buf , serializer_t : : read_callback_t * callback , ser_transaction_id_t * * transaction_id = NULL ) ; <nl> + bool do_read ( block_id_t block_id , void * buf , serializer_t : : read_callback_t * callback ) ; <nl> struct write_t { <nl> block_id_t block_id ; <nl> bool recency_specified ; <nl>
Overhauled transaction_id retrieval
rethinkdb/rethinkdb
1c07b75e656fa97848abbb29b6f6447c2e0080f0
2011-02-01T03:19:59Z
mmm a / tensorflow / go / op / wrappers . go <nl> ppp b / tensorflow / go / op / wrappers . go <nl> func SampleDistortedBoundingBoxMinObjectCovered ( value float32 ) SampleDistortedBo <nl> / / <nl> / / value : The cropped area of the image must have an aspect ratio = <nl> / / width / height within this range . <nl> - / / If not specified , defaults to { f : 0 . 75 f : 1 . 33 } <nl> + / / If not specified , defaults to { f : 0 . 75 f : 1 . 33 } <nl> func SampleDistortedBoundingBoxAspectRatioRange ( value [ ] float32 ) SampleDistortedBoundingBoxAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " aspect_ratio_range " ] = value <nl> func SampleDistortedBoundingBoxAspectRatioRange ( value [ ] float32 ) SampleDistorted <nl> / / <nl> / / value : The cropped area of the image must contain a fraction of the <nl> / / supplied image within this range . <nl> - / / If not specified , defaults to { f : 0 . 05 f : 1 } <nl> + / / If not specified , defaults to { f : 0 . 05 f : 1 } <nl> func SampleDistortedBoundingBoxAreaRange ( value [ ] float32 ) SampleDistortedBoundingBoxAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " area_range " ] = value <nl> func SampleDistortedBoundingBoxV2Seed2 ( value int64 ) SampleDistortedBoundingBoxV2 <nl> / / <nl> / / value : The cropped area of the image must have an aspect ratio = <nl> / / width / height within this range . <nl> - / / If not specified , defaults to { f : 0 . 75 f : 1 . 33 } <nl> + / / If not specified , defaults to { f : 0 . 75 f : 1 . 33 } <nl> func SampleDistortedBoundingBoxV2AspectRatioRange ( value [ ] float32 ) SampleDistortedBoundingBoxV2Attr { <nl> return func ( m optionalAttr ) { <nl> m [ " aspect_ratio_range " ] = value <nl> func SampleDistortedBoundingBoxV2AspectRatioRange ( value [ ] float32 ) SampleDistort <nl> / / <nl> / / value : The cropped area of the image must contain a fraction of the <nl> / / supplied image within this range . <nl> - / / If not specified , defaults to { f : 0 . 05 f : 1 } <nl> + / / If not specified , defaults to { f : 0 . 05 f : 1 } <nl> func SampleDistortedBoundingBoxV2AreaRange ( value [ ] float32 ) SampleDistortedBoundingBoxV2Attr { <nl> return func ( m optionalAttr ) { <nl> m [ " area_range " ] = value <nl> func ImageSummaryMaxImages ( value int64 ) ImageSummaryAttr { <nl> / / ImageSummaryBadColor sets the optional bad_color attribute to value . <nl> / / <nl> / / value : Color to use for pixels with non - finite values . <nl> - / / If not specified , defaults to { dtype : DT_UINT8 tensor_shape : { dim : { size : 4 } } int_val : 255 int_val : 0 int_val : 0 int_val : 255 } <nl> + / / If not specified , defaults to { dtype : DT_UINT8 tensor_shape : { dim : { size : 4 } } int_val : 255 int_val : 0 int_val : 0 int_val : 255 } <nl> func ImageSummaryBadColor ( value tf . Tensor ) ImageSummaryAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " bad_color " ] = value <nl> func Conv3DBackpropFilterV2DataFormat ( value string ) Conv3DBackpropFilterV2Attr { <nl> / / filter element on that dimension . The dimension order is determined by the <nl> / / value of ` data_format ` , see above for details . Dilations in the batch and <nl> / / depth dimensions must be 1 . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 i : 1 } <nl> func Conv3DBackpropFilterV2Dilations ( value [ ] int64 ) Conv3DBackpropFilterV2Attr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func Conv2DBackpropInputDataFormat ( value string ) Conv2DBackpropInputAttr { <nl> / / element on that dimension . The dimension order is determined by the value of <nl> / / ` data_format ` , see above for details . Dilations in the batch and depth <nl> / / dimensions must be 1 . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> func Conv2DBackpropInputDilations ( value [ ] int64 ) Conv2DBackpropInputAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func Conv2DDataFormat ( value string ) Conv2DAttr { <nl> / / filter element on that dimension . The dimension order is determined by the <nl> / / value of ` data_format ` , see above for details . Dilations in the batch and <nl> / / depth dimensions must be 1 . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> func Conv2DDilations ( value [ ] int64 ) Conv2DAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func QuantizedDepthwiseConv2DWithBiasAndReluAndRequantizeOutType ( value tf . DataTy <nl> / / QuantizedDepthwiseConv2DWithBiasAndReluAndRequantizeDilations sets the optional dilations attribute to value . <nl> / / <nl> / / value : List of dilation values . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> func QuantizedDepthwiseConv2DWithBiasAndReluAndRequantizeDilations ( value [ ] int64 ) QuantizedDepthwiseConv2DWithBiasAndReluAndRequantizeAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func QuantizedDepthwiseConv2DWithBiasAndReluOutType ( value tf . DataType ) Quantized <nl> / / QuantizedDepthwiseConv2DWithBiasAndReluDilations sets the optional dilations attribute to value . <nl> / / <nl> / / value : List of dilation values . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> func QuantizedDepthwiseConv2DWithBiasAndReluDilations ( value [ ] int64 ) QuantizedDepthwiseConv2DWithBiasAndReluAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func QuantizedDepthwiseConv2DWithBiasOutType ( value tf . DataType ) QuantizedDepthwi <nl> / / QuantizedDepthwiseConv2DWithBiasDilations sets the optional dilations attribute to value . <nl> / / <nl> / / value : List of dilation values . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> func QuantizedDepthwiseConv2DWithBiasDilations ( value [ ] int64 ) QuantizedDepthwiseConv2DWithBiasAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func QuantizedDepthwiseConv2DOutType ( value tf . DataType ) QuantizedDepthwiseConv2D <nl> / / QuantizedDepthwiseConv2DDilations sets the optional dilations attribute to value . <nl> / / <nl> / / value : List of dilation values . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> func QuantizedDepthwiseConv2DDilations ( value [ ] int64 ) QuantizedDepthwiseConv2DAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func QuantizedConv2DPerChannelOutType ( value tf . DataType ) QuantizedConv2DPerChann <nl> / / QuantizedConv2DPerChannelDilations sets the optional dilations attribute to value . <nl> / / <nl> / / value : list of dilation values . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> func QuantizedConv2DPerChannelDilations ( value [ ] int64 ) QuantizedConv2DPerChannelAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func Conv3DBackpropInputV2DataFormat ( value string ) Conv3DBackpropInputV2Attr { <nl> / / filter element on that dimension . The dimension order is determined by the <nl> / / value of ` data_format ` , see above for details . Dilations in the batch and <nl> / / depth dimensions must be 1 . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 i : 1 } <nl> func Conv3DBackpropInputV2Dilations ( value [ ] int64 ) Conv3DBackpropInputV2Attr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func AvgPool3DGrad ( scope * Scope , orig_input_shape tf . Output , grad tf . Output , ksi <nl> type Conv3DBackpropFilterAttr func ( optionalAttr ) <nl> <nl> / / Conv3DBackpropFilterDilations sets the optional dilations attribute to value . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 i : 1 } <nl> func Conv3DBackpropFilterDilations ( value [ ] int64 ) Conv3DBackpropFilterAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func Conv3DDataFormat ( value string ) Conv3DAttr { <nl> / / filter element on that dimension . The dimension order is determined by the <nl> / / value of ` data_format ` , see above for details . Dilations in the batch and <nl> / / depth dimensions must be 1 . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 i : 1 } <nl> func Conv3DDilations ( value [ ] int64 ) Conv3DAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func DepthwiseConv2dNativeBackpropInputDataFormat ( value string ) DepthwiseConv2dN <nl> / / element on that dimension . The dimension order is determined by the value of <nl> / / ` data_format ` , see above for details . Dilations in the batch and depth <nl> / / dimensions must be 1 . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> func DepthwiseConv2dNativeBackpropInputDilations ( value [ ] int64 ) DepthwiseConv2dNativeBackpropInputAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func QuantizedConv2DOutType ( value tf . DataType ) QuantizedConv2DAttr { <nl> / / filter element on that dimension . The dimension order is determined by the <nl> / / value of ` data_format ` , see above for details . Dilations in the batch and <nl> / / depth dimensions must be 1 . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> func QuantizedConv2DDilations ( value [ ] int64 ) QuantizedConv2DAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func DepthwiseConv2dNativeBackpropFilterDataFormat ( value string ) DepthwiseConv2d <nl> / / element on that dimension . The dimension order is determined by the value of <nl> / / ` data_format ` , see above for details . Dilations in the batch and depth <nl> / / dimensions must be 1 . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> func DepthwiseConv2dNativeBackpropFilterDilations ( value [ ] int64 ) DepthwiseConv2dNativeBackpropFilterAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func LoadTPUEmbeddingFTRLParameters ( scope * Scope , parameters tf . Output , accumula <nl> type Conv3DBackpropInputAttr func ( optionalAttr ) <nl> <nl> / / Conv3DBackpropInputDilations sets the optional dilations attribute to value . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 i : 1 } <nl> func Conv3DBackpropInputDilations ( value [ ] int64 ) Conv3DBackpropInputAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func DepthwiseConv2dNativeDataFormat ( value string ) DepthwiseConv2dNativeAttr { <nl> / / element on that dimension . The dimension order is determined by the value of <nl> / / ` data_format ` , see above for details . Dilations in the batch and depth <nl> / / dimensions must be 1 . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> func DepthwiseConv2dNativeDilations ( value [ ] int64 ) DepthwiseConv2dNativeAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl> func Conv2DBackpropFilterDataFormat ( value string ) Conv2DBackpropFilterAttr { <nl> / / element on that dimension . The dimension order is determined by the value of <nl> / / ` data_format ` , see above for details . Dilations in the batch and depth <nl> / / dimensions must be 1 . <nl> - / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> + / / If not specified , defaults to { i : 1 i : 1 i : 1 i : 1 } <nl> func Conv2DBackpropFilterDilations ( value [ ] int64 ) Conv2DBackpropFilterAttr { <nl> return func ( m optionalAttr ) { <nl> m [ " dilations " ] = value <nl>
Go : Update generated wrapper functions for TensorFlow ops .
tensorflow/tensorflow
11bb2167090994f880c73ec4f2121ecfa31d88a7
2020-05-04T17:24:36Z
mmm a / tests / integration / test_materialize_mysql_database / test . py <nl> ppp b / tests / integration / test_materialize_mysql_database / test . py <nl> def test_mysql_kill_sync_thread_restore_8_0 ( started_cluster , started_mysql_8_0 , <nl> materialize_with_ddl . mysql_kill_sync_thread_restore_test ( clickhouse_node , started_mysql_8_0 , " mysql8_0 " ) <nl> <nl> @ pytest . mark . parametrize ( ( ' clickhouse_node ' ) , [ node_db_ordinary , node_db_atomic ] ) <nl> - def test_mysql_killed_while_insert_5_7 ( started_cluster , started_mysql_5_7 ) : <nl> + def test_mysql_killed_while_insert_5_7 ( started_cluster , started_mysql_5_7 , clickhouse_node ) : <nl> materialize_with_ddl . mysql_killed_while_insert ( clickhouse_node , started_mysql_5_7 , " mysql1 " ) <nl> <nl> @ pytest . mark . parametrize ( ( ' clickhouse_node ' ) , [ node_db_ordinary , node_db_atomic ] ) <nl> - def test_mysql_killed_while_insert_8_0 ( started_cluster , started_mysql_8_0 ) : <nl> + def test_mysql_killed_while_insert_8_0 ( started_cluster , started_mysql_8_0 , clickhouse_node ) : <nl> materialize_with_ddl . mysql_killed_while_insert ( clickhouse_node , started_mysql_8_0 , " mysql8_0 " ) <nl> <nl> @ pytest . mark . parametrize ( ( ' clickhouse_node ' ) , [ node_db_ordinary , node_db_atomic ] ) <nl> - def test_clickhouse_killed_while_insert_5_7 ( started_cluster , started_mysql_5_7 ) : <nl> + def test_clickhouse_killed_while_insert_5_7 ( started_cluster , started_mysql_5_7 , clickhouse_node ) : <nl> materialize_with_ddl . clickhouse_killed_while_insert ( clickhouse_node , started_mysql_5_7 , " mysql1 " ) <nl> <nl> @ pytest . mark . parametrize ( ( ' clickhouse_node ' ) , [ node_db_ordinary , node_db_atomic ] ) <nl>
fix
ClickHouse/ClickHouse
ed355f866372504763d36983254dcca446f18281
2020-12-11T13:50:45Z
mmm a / include / spdlog / async_logger . h <nl> ppp b / include / spdlog / async_logger . h <nl> <nl> / / 3 . will throw spdlog_ex upon log exceptions <nl> / / Upon destruction , logs all remaining messages in the queue before destructing . . <nl> <nl> - # include < spdlog / common . h > <nl> - # include < spdlog / logger . h > <nl> + # include " spdlog / common . h " <nl> + # include " spdlog / logger . h " <nl> <nl> # include < chrono > <nl> # include < functional > <nl> class async_logger SPDLOG_FINAL : public logger <nl> } <nl> <nl> <nl> - # include < spdlog / details / async_logger_impl . h > <nl> + # include " spdlog / details / async_logger_impl . h " <nl> mmm a / include / spdlog / common . h <nl> ppp b / include / spdlog / common . h <nl> <nl> # include < locale > <nl> # endif <nl> <nl> - # include < spdlog / details / null_mutex . h > <nl> + # include " spdlog / details / null_mutex . h " <nl> <nl> / / visual studio upto 2013 does not support noexcept nor constexpr <nl> # if defined ( _MSC_VER ) & & ( _MSC_VER < 1900 ) <nl> <nl> # endif <nl> <nl> <nl> - # include < spdlog / fmt / fmt . h > <nl> + # include " spdlog / fmt / fmt . h " <nl> <nl> namespace spdlog <nl> { <nl> mmm a / include / spdlog / details / async_log_helper . h <nl> ppp b / include / spdlog / details / async_log_helper . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include < spdlog / common . h > <nl> - # include < spdlog / sinks / sink . h > <nl> - # include < spdlog / details / mpmc_bounded_q . h > <nl> - # include < spdlog / details / log_msg . h > <nl> - # include < spdlog / details / os . h > <nl> - # include < spdlog / formatter . h > <nl> + # include " spdlog / common . h " <nl> + # include " spdlog / sinks / sink . h " <nl> + # include " spdlog / details / mpmc_bounded_q . h " <nl> + # include " spdlog / details / log_msg . h " <nl> + # include " spdlog / details / os . h " <nl> + # include " spdlog / formatter . h " <nl> <nl> # include < chrono > <nl> # include < exception > <nl> mmm a / include / spdlog / details / async_logger_impl . h <nl> ppp b / include / spdlog / details / async_logger_impl . h <nl> <nl> / / Async Logger implementation <nl> / / Use an async_sink ( queue per logger ) to perform the logging in a worker thread <nl> <nl> - # include < spdlog / details / async_log_helper . h > <nl> - # include < spdlog / async_logger . h > <nl> + # include " spdlog / details / async_log_helper . h " <nl> + # include " spdlog / async_logger . h " <nl> <nl> # include < string > <nl> # include < functional > <nl> mmm a / include / spdlog / details / file_helper . h <nl> ppp b / include / spdlog / details / file_helper . h <nl> <nl> / / When failing to open a file , retry several times ( 5 ) with small delay between the tries ( 10 ms ) <nl> / / Throw spdlog_ex exception on errors <nl> <nl> - # include < spdlog / details / os . h > <nl> - # include < spdlog / details / log_msg . h > <nl> + # include " spdlog / details / os . h " <nl> + # include " spdlog / details / log_msg . h " <nl> <nl> # include < chrono > <nl> # include < cstdio > <nl> mmm a / include / spdlog / details / log_msg . h <nl> ppp b / include / spdlog / details / log_msg . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include < spdlog / common . h > <nl> - # include < spdlog / details / os . h > <nl> + # include " spdlog / common . h " <nl> + # include " spdlog / details / os . h " <nl> <nl> <nl> # include < string > <nl> mmm a / include / spdlog / details / logger_impl . h <nl> ppp b / include / spdlog / details / logger_impl . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include < spdlog / logger . h > <nl> - # include < spdlog / sinks / stdout_sinks . h > <nl> + # include " spdlog / logger . h " <nl> + # include " spdlog / sinks / stdout_sinks . h " <nl> <nl> # include < memory > <nl> # include < string > <nl> mmm a / include / spdlog / details / mpmc_bounded_q . h <nl> ppp b / include / spdlog / details / mpmc_bounded_q . h <nl> Distributed under the MIT License ( http : / / opensource . org / licenses / MIT ) <nl> <nl> # pragma once <nl> <nl> - # include < spdlog / common . h > <nl> + # include " spdlog / common . h " <nl> <nl> # include < atomic > <nl> # include < utility > <nl> mmm a / include / spdlog / details / os . h <nl> ppp b / include / spdlog / details / os . h <nl> <nl> / / <nl> # pragma once <nl> <nl> - # include < spdlog / common . h > <nl> + # include " spdlog / common . h " <nl> <nl> # include < cstdio > <nl> # include < ctime > <nl> mmm a / include / spdlog / details / pattern_formatter_impl . h <nl> ppp b / include / spdlog / details / pattern_formatter_impl . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include < spdlog / formatter . h > <nl> - # include < spdlog / details / log_msg . h > <nl> - # include < spdlog / details / os . h > <nl> - # include < spdlog / fmt / fmt . h > <nl> + # include " spdlog / formatter . h " <nl> + # include " spdlog / details / log_msg . h " <nl> + # include " spdlog / details / os . h " <nl> + # include " spdlog / fmt / fmt . h " <nl> <nl> # include < chrono > <nl> # include < ctime > <nl> mmm a / include / spdlog / details / registry . h <nl> ppp b / include / spdlog / details / registry . h <nl> <nl> / / If user requests a non existing logger , nullptr will be returned <nl> / / This class is thread safe <nl> <nl> - # include < spdlog / details / null_mutex . h > <nl> - # include < spdlog / logger . h > <nl> - # include < spdlog / async_logger . h > <nl> - # include < spdlog / common . h > <nl> + # include " spdlog / details / null_mutex . h " <nl> + # include " spdlog / logger . h " <nl> + # include " spdlog / async_logger . h " <nl> + # include " spdlog / common . h " <nl> <nl> # include < chrono > <nl> # include < functional > <nl> mmm a / include / spdlog / details / spdlog_impl . h <nl> ppp b / include / spdlog / details / spdlog_impl . h <nl> <nl> / / <nl> / / Global registry functions <nl> / / <nl> - # include < spdlog / spdlog . h > <nl> - # include < spdlog / details / registry . h > <nl> - # include < spdlog / sinks / file_sinks . h > <nl> - # include < spdlog / sinks / stdout_sinks . h > <nl> + # include " spdlog / spdlog . h " <nl> + # include " spdlog / details / registry . h " <nl> + # include " spdlog / sinks / file_sinks . h " <nl> + # include " spdlog / sinks / stdout_sinks . h " <nl> # ifdef SPDLOG_ENABLE_SYSLOG <nl> - # include < spdlog / sinks / syslog_sink . h > <nl> + # include " spdlog / sinks / syslog_sink . h " <nl> # endif <nl> <nl> # ifdef _WIN32 <nl> - # include < spdlog / sinks / wincolor_sink . h > <nl> + # include " spdlog / sinks / wincolor_sink . h " <nl> # else <nl> - # include < spdlog / sinks / ansicolor_sink . h > <nl> + # include " spdlog / sinks / ansicolor_sink . h " <nl> # endif <nl> <nl> <nl> # ifdef __ANDROID__ <nl> - # include < spdlog / sinks / android_sink . h > <nl> + # include " spdlog / sinks / android_sink . h " <nl> # endif <nl> <nl> # include < chrono > <nl> mmm a / include / spdlog / fmt / fmt . h <nl> ppp b / include / spdlog / fmt / fmt . h <nl> <nl> # ifndef FMT_USE_WINDOWS_H <nl> # define FMT_USE_WINDOWS_H 0 <nl> # endif <nl> - # include < spdlog / fmt / bundled / format . h > <nl> + # include " spdlog / fmt / bundled / format . h " <nl> <nl> # else / / external fmtlib <nl> <nl> mmm a / include / spdlog / fmt / ostr . h <nl> ppp b / include / spdlog / fmt / ostr . h <nl> <nl> / / include external or bundled copy of fmtlib ' s ostream support <nl> / / <nl> # if ! defined ( SPDLOG_FMT_EXTERNAL ) <nl> - # include < spdlog / fmt / fmt . h > <nl> - # include < spdlog / fmt / bundled / ostream . h > <nl> + # include " spdlog / fmt / fmt . h " <nl> + # include " spdlog / fmt / bundled / ostream . h " <nl> # else <nl> # include < fmt / ostream . h > <nl> # endif <nl> mmm a / include / spdlog / formatter . h <nl> ppp b / include / spdlog / formatter . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include < spdlog / details / log_msg . h > <nl> + # include " spdlog / details / log_msg . h " <nl> <nl> # include < vector > <nl> # include < string > <nl> class pattern_formatter SPDLOG_FINAL : public formatter <nl> } ; <nl> } <nl> <nl> - # include < spdlog / details / pattern_formatter_impl . h > <nl> + # include " spdlog / details / pattern_formatter_impl . h " <nl> <nl> mmm a / include / spdlog / logger . h <nl> ppp b / include / spdlog / logger . h <nl> <nl> / / 2 . Format the message using the formatter function <nl> / / 3 . Pass the formatted message to its sinks to performa the actual logging <nl> <nl> - # include < spdlog / sinks / base_sink . h > <nl> - # include < spdlog / common . h > <nl> + # include " spdlog / sinks / base_sink . h " <nl> + # include " spdlog / common . h " <nl> <nl> # include < vector > <nl> # include < memory > <nl> class logger <nl> } ; <nl> } <nl> <nl> - # include < spdlog / details / logger_impl . h > <nl> + # include " spdlog / details / logger_impl . h " <nl> mmm a / include / spdlog / sinks / base_sink . h <nl> ppp b / include / spdlog / sinks / base_sink . h <nl> <nl> / / all locking is taken care of here so no locking needed by the implementers . . <nl> / / <nl> <nl> - # include < spdlog / sinks / sink . h > <nl> - # include < spdlog / formatter . h > <nl> - # include < spdlog / common . h > <nl> - # include < spdlog / details / log_msg . h > <nl> + # include " spdlog / sinks / sink . h " <nl> + # include " spdlog / formatter . h " <nl> + # include " spdlog / common . h " <nl> + # include " spdlog / details / log_msg . h " <nl> <nl> # include < mutex > <nl> <nl> mmm a / include / spdlog / sinks / file_sinks . h <nl> ppp b / include / spdlog / sinks / file_sinks . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include < spdlog / sinks / base_sink . h > <nl> - # include < spdlog / details / null_mutex . h > <nl> - # include < spdlog / details / file_helper . h > <nl> - # include < spdlog / fmt / fmt . h > <nl> + # include " spdlog / sinks / base_sink . h " <nl> + # include " spdlog / details / null_mutex . h " <nl> + # include " spdlog / details / file_helper . h " <nl> + # include " spdlog / fmt / fmt . h " <nl> <nl> # include < algorithm > <nl> # include < chrono > <nl> mmm a / include / spdlog / sinks / sink . h <nl> ppp b / include / spdlog / sinks / sink . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include < spdlog / details / log_msg . h > <nl> + # include " spdlog / details / log_msg . h " <nl> <nl> namespace spdlog <nl> { <nl> mmm a / include / spdlog / sinks / stdout_sinks . h <nl> ppp b / include / spdlog / sinks / stdout_sinks . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include < spdlog / details / null_mutex . h > <nl> - # include < spdlog / sinks / base_sink . h > <nl> + # include " spdlog / details / null_mutex . h " <nl> + # include " spdlog / sinks / base_sink . h " <nl> <nl> # include < cstdio > <nl> # include < memory > <nl> mmm a / include / spdlog / sinks / wincolor_sink . h <nl> ppp b / include / spdlog / sinks / wincolor_sink . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include < spdlog / sinks / base_sink . h > <nl> - # include < spdlog / details / null_mutex . h > <nl> - # include < spdlog / common . h > <nl> + # include " spdlog / sinks / base_sink . h " <nl> + # include " spdlog / details / null_mutex . h " <nl> + # include " spdlog / common . h " <nl> <nl> # include < mutex > <nl> # include < string > <nl> mmm a / include / spdlog / spdlog . h <nl> ppp b / include / spdlog / spdlog . h <nl> <nl> <nl> # define SPDLOG_VERSION " 0 . 13 . 0 " <nl> <nl> - # include < spdlog / tweakme . h > <nl> - # include < spdlog / common . h > <nl> - # include < spdlog / logger . h > <nl> + # include " spdlog / tweakme . h " <nl> + # include " spdlog / common . h " <nl> + # include " spdlog / logger . h " <nl> <nl> # include < memory > <nl> # include < functional > <nl> void drop_all ( ) ; <nl> } <nl> <nl> <nl> - # include < spdlog / details / spdlog_impl . h > <nl> + # include " spdlog / details / spdlog_impl . h " <nl>
Fixed issues 449
gabime/spdlog
f8d509d0101bd7d7d11fdc5d01cef8bd0b10517d
2017-05-21T09:44:44Z
mmm a / xbmc / cores / dvdplayer / DVDInputStreams / DVDInputStreamNavigator . cpp <nl> ppp b / xbmc / cores / dvdplayer / DVDInputStreams / DVDInputStreamNavigator . cpp <nl> bool CDVDInputStreamNavigator : : SeekTime ( int iTimeInMsec ) <nl> <nl> bool CDVDInputStreamNavigator : : SeekChapter ( int iChapter ) <nl> { <nl> + bool enabled = IsSubtitleStreamEnabled ( ) ; <nl> int audio = GetActiveAudioStream ( ) ; <nl> int subtitle = GetActiveSubtitleStream ( ) ; <nl> <nl> bool CDVDInputStreamNavigator : : SeekChapter ( int iChapter ) <nl> <nl> SetActiveSubtitleStream ( subtitle ) ; <nl> SetActiveAudioStream ( audio ) ; <nl> - <nl> + EnableSubtitleStream ( enabled ) ; <nl> return true ; <nl> } <nl> <nl>
fixed : restore the enabled state of subtitles on chapter seeks aswell .
xbmc/xbmc
a467902f721b65a273a58b53b52a7eea1035e2e1
2010-02-05T20:38:53Z
mmm a / src / gui / properties / peerlistwidget . cpp <nl> ppp b / src / gui / properties / peerlistwidget . cpp <nl> PeerListWidget : : PeerListWidget ( PropertiesWidget * parent ) <nl> header ( ) - > setStretchLastSection ( false ) ; <nl> / / List Model <nl> m_listModel = new QStandardItemModel ( 0 , PeerListDelegate : : COL_COUNT , this ) ; <nl> - m_listModel - > setHeaderData ( PeerListDelegate : : COUNTRY , Qt : : Horizontal , tr ( " Country " ) ) ; / / Country flag column <nl> + m_listModel - > setHeaderData ( PeerListDelegate : : COUNTRY , Qt : : Horizontal , tr ( " Country / Region " ) ) ; / / Country flag column <nl> m_listModel - > setHeaderData ( PeerListDelegate : : IP , Qt : : Horizontal , tr ( " IP " ) ) ; <nl> m_listModel - > setHeaderData ( PeerListDelegate : : PORT , Qt : : Horizontal , tr ( " Port " ) ) ; <nl> m_listModel - > setHeaderData ( PeerListDelegate : : FLAGS , Qt : : Horizontal , tr ( " Flags " ) ) ; <nl> mmm a / src / webui / www / private / scripts / dynamicTable . js <nl> ppp b / src / webui / www / private / scripts / dynamicTable . js <nl> window . qBittorrent . DynamicTable = ( function ( ) { <nl> Extends : DynamicTable , <nl> <nl> initColumns : function ( ) { <nl> - this . newColumn ( ' country ' , ' ' , ' QBT_TR ( Country ) QBT_TR [ CONTEXT = PeerListWidget ] ' , 22 , true ) ; <nl> + this . newColumn ( ' country ' , ' ' , ' QBT_TR ( Country / Region ) QBT_TR [ CONTEXT = PeerListWidget ] ' , 22 , true ) ; <nl> this . newColumn ( ' ip ' , ' ' , ' QBT_TR ( IP ) QBT_TR [ CONTEXT = PeerListWidget ] ' , 80 , true ) ; <nl> this . newColumn ( ' port ' , ' ' , ' QBT_TR ( Port ) QBT_TR [ CONTEXT = PeerListWidget ] ' , 35 , true ) ; <nl> this . newColumn ( ' connection ' , ' ' , ' QBT_TR ( Connection ) QBT_TR [ CONTEXT = PeerListWidget ] ' , 50 , true ) ; <nl>
Merge pull request from Piccirello / country_region
qbittorrent/qBittorrent
f672df1cf1a8e6784148781a49bf13b39af2aa0d
2019-12-23T19:54:30Z
mmm a / src / core / lib / profiling / basic_timers . c <nl> ppp b / src / core / lib / profiling / basic_timers . c <nl> <nl> # include < grpc / support / time . h > <nl> # include < stdio . h > <nl> <nl> + # include " src / core / lib / support / env . h " <nl> + <nl> typedef enum { BEGIN = ' { ' , END = ' } ' , MARK = ' . ' } marker_type ; <nl> <nl> typedef struct gpr_timer_entry { <nl> typedef struct gpr_timer_log_list { <nl> static __thread gpr_timer_log * g_thread_log ; <nl> static gpr_once g_once_init = GPR_ONCE_INIT ; <nl> static FILE * output_file ; <nl> - static const char * output_filename = " latency_trace . txt " ; <nl> + static const char * output_filename_or_null = NULL ; <nl> static pthread_mutex_t g_mu ; <nl> static pthread_cond_t g_cv ; <nl> static gpr_timer_log_list g_in_progress_logs ; <nl> static __thread int g_thread_id ; <nl> static int g_next_thread_id ; <nl> static int g_writing_enabled = 1 ; <nl> <nl> + static const char * output_filename ( ) { <nl> + if ( output_filename_or_null = = NULL ) { <nl> + output_filename_or_null = gpr_getenv ( " LATENCY_TRACE " ) ; <nl> + if ( output_filename_or_null = = NULL ) { <nl> + output_filename_or_null = " latency_trace . txt " ; <nl> + } <nl> + } <nl> + return output_filename_or_null ; <nl> + } <nl> + <nl> static int timer_log_push_back ( gpr_timer_log_list * list , gpr_timer_log * log ) { <nl> if ( list - > head = = NULL ) { <nl> list - > head = list - > tail = log ; <nl> static void timer_log_remove ( gpr_timer_log_list * list , gpr_timer_log * log ) { <nl> static void write_log ( gpr_timer_log * log ) { <nl> size_t i ; <nl> if ( output_file = = NULL ) { <nl> - output_file = fopen ( output_filename , " w " ) ; <nl> + output_file = fopen ( output_filename ( ) , " w " ) ; <nl> } <nl> for ( i = 0 ; i < log - > num_entries ; i + + ) { <nl> gpr_timer_entry * entry = & ( log - > log [ i ] ) ; <nl> static void finish_writing ( void ) { <nl> } <nl> <nl> void gpr_timers_set_log_filename ( const char * filename ) { <nl> - output_filename = filename ; <nl> + output_filename_or_null = filename ; <nl> } <nl> <nl> static void init_output ( ) { <nl> mmm a / tools / profiling / latency_profile / profile_analyzer . py <nl> ppp b / tools / profiling / latency_profile / profile_analyzer . py <nl> <nl> import itertools <nl> import json <nl> import math <nl> + import sys <nl> import tabulate <nl> import time <nl> <nl> <nl> argp = argparse . ArgumentParser ( description = ' Process output of basic_prof builds ' ) <nl> argp . add_argument ( ' - - source ' , default = ' latency_trace . txt ' , type = str ) <nl> argp . add_argument ( ' - - fmt ' , choices = tabulate . tabulate_formats , default = ' simple ' ) <nl> + argp . add_argument ( ' - - out ' , default = ' - ' , type = str ) <nl> args = argp . parse_args ( ) <nl> <nl> class LineItem ( object ) : <nl> def ent ( line , idx = idx ) : <nl> ( ' TO_SCOPE_END ' , time_format ( TIME_TO_SCOPE_END ) ) , <nl> ] <nl> <nl> + out = sys . stdout <nl> + if args . out ! = ' - ' : <nl> + out = open ( args . out , ' w ' ) <nl> + <nl> if args . fmt = = ' html ' : <nl> - print ' < html > ' <nl> - print ' < head > ' <nl> - print ' < title > Profile Report < / title > ' <nl> - print ' < / head > ' <nl> + print > > out , ' < html > ' <nl> + print > > out , ' < head > ' <nl> + print > > out , ' < title > Profile Report < / title > ' <nl> + print > > out , ' < / head > ' <nl> <nl> accounted_for = 0 <nl> for cs in call_stacks : <nl> if args . fmt in BANNER : <nl> - print BANNER [ args . fmt ] % { <nl> + print > > out , BANNER [ args . fmt ] % { <nl> ' count ' : cs . count , <nl> } <nl> header , _ = zip ( * FORMAT ) <nl> def ent ( line , idx = idx ) : <nl> for _ , fn in FORMAT : <nl> fields . append ( fn ( line ) ) <nl> table . append ( fields ) <nl> - print tabulate . tabulate ( table , header , tablefmt = args . fmt ) <nl> + print > > out , tabulate . tabulate ( table , header , tablefmt = args . fmt ) <nl> accounted_for + = cs . count <nl> if accounted_for > . 99 * total_stacks : <nl> break <nl> new file mode 100644 <nl> index 00000000000 . . 4103eb0534b <nl> mmm / dev / null <nl> ppp b / tools / run_tests / python_utils / start_port_server . py <nl> <nl> + # Copyright 2015 , Google Inc . <nl> + # All rights reserved . <nl> + # <nl> + # Redistribution and use in source and binary forms , with or without <nl> + # modification , are permitted provided that the following conditions are <nl> + # met : <nl> + # <nl> + # * Redistributions of source code must retain the above copyright <nl> + # notice , this list of conditions and the following disclaimer . <nl> + # * Redistributions in binary form must reproduce the above <nl> + # copyright notice , this list of conditions and the following disclaimer <nl> + # in the documentation and / or other materials provided with the <nl> + # distribution . <nl> + # * Neither the name of Google Inc . nor the names of its <nl> + # contributors may be used to endorse or promote products derived from <nl> + # this software without specific prior written permission . <nl> + # <nl> + # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> + # " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> + # LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> + # A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> + # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> + # SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> + # LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> + # DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> + # THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> + # ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> + # OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> + <nl> + from __future__ import print_function <nl> + <nl> + from six . moves import urllib <nl> + import os <nl> + import subprocess <nl> + import tempfile <nl> + import sys <nl> + import time <nl> + <nl> + def start_port_server ( port_server_port ) : <nl> + # check if a compatible port server is running <nl> + # if incompatible ( version mismatch ) = = > start a new one <nl> + # if not running = = > start a new one <nl> + # otherwise , leave it up <nl> + try : <nl> + version = int ( urllib . request . urlopen ( <nl> + ' http : / / localhost : % d / version_number ' % port_server_port , <nl> + timeout = 10 ) . read ( ) ) <nl> + print ( ' detected port server running version % d ' % version ) <nl> + running = True <nl> + except Exception as e : <nl> + print ( ' failed to detect port server : % s ' % sys . exc_info ( ) [ 0 ] ) <nl> + print ( e . strerror ) <nl> + running = False <nl> + if running : <nl> + current_version = int ( subprocess . check_output ( <nl> + [ sys . executable , os . path . abspath ( ' tools / run_tests / python_utils / port_server . py ' ) , <nl> + ' dump_version ' ] ) ) <nl> + print ( ' my port server is version % d ' % current_version ) <nl> + running = ( version > = current_version ) <nl> + if not running : <nl> + print ( ' port_server version mismatch : killing the old one ' ) <nl> + urllib . request . urlopen ( ' http : / / localhost : % d / quitquitquit ' % port_server_port ) . read ( ) <nl> + time . sleep ( 1 ) <nl> + if not running : <nl> + fd , logfile = tempfile . mkstemp ( ) <nl> + os . close ( fd ) <nl> + print ( ' starting port_server , with log file % s ' % logfile ) <nl> + args = [ sys . executable , os . path . abspath ( ' tools / run_tests / python_utils / port_server . py ' ) , <nl> + ' - p ' , ' % d ' % port_server_port , ' - l ' , logfile ] <nl> + env = dict ( os . environ ) <nl> + env [ ' BUILD_ID ' ] = ' pleaseDontKillMeJenkins ' <nl> + if platform_string ( ) = = ' windows ' : <nl> + # Working directory of port server needs to be outside of Jenkins <nl> + # workspace to prevent file lock issues . <nl> + tempdir = tempfile . mkdtemp ( ) <nl> + port_server = subprocess . Popen ( <nl> + args , <nl> + env = env , <nl> + cwd = tempdir , <nl> + creationflags = 0x00000008 , # detached process <nl> + close_fds = True ) <nl> + else : <nl> + port_server = subprocess . Popen ( <nl> + args , <nl> + env = env , <nl> + preexec_fn = os . setsid , <nl> + close_fds = True ) <nl> + time . sleep ( 1 ) <nl> + # ensure port server is up <nl> + waits = 0 <nl> + while True : <nl> + if waits > 10 : <nl> + print ( ' killing port server due to excessive start up waits ' ) <nl> + port_server . kill ( ) <nl> + if port_server . poll ( ) is not None : <nl> + print ( ' port_server failed to start ' ) <nl> + # try one final time : maybe another build managed to start one <nl> + time . sleep ( 1 ) <nl> + try : <nl> + urllib . request . urlopen ( ' http : / / localhost : % d / get ' % port_server_port , <nl> + timeout = 1 ) . read ( ) <nl> + print ( ' last ditch attempt to contact port server succeeded ' ) <nl> + break <nl> + except : <nl> + traceback . print_exc ( ) <nl> + port_log = open ( logfile , ' r ' ) . read ( ) <nl> + print ( port_log ) <nl> + sys . exit ( 1 ) <nl> + try : <nl> + urllib . request . urlopen ( ' http : / / localhost : % d / get ' % port_server_port , <nl> + timeout = 1 ) . read ( ) <nl> + print ( ' port server is up and ready ' ) <nl> + break <nl> + except socket . timeout : <nl> + print ( ' waiting for port_server : timeout ' ) <nl> + traceback . print_exc ( ) ; <nl> + time . sleep ( 1 ) <nl> + waits + = 1 <nl> + except urllib . error . URLError : <nl> + print ( ' waiting for port_server : urlerror ' ) <nl> + traceback . print_exc ( ) ; <nl> + time . sleep ( 1 ) <nl> + waits + = 1 <nl> + except : <nl> + traceback . print_exc ( ) <nl> + port_server . kill ( ) <nl> + raise <nl> + <nl> similarity index 78 % <nl> rename from tools / profiling / microbenchmark / bm . py <nl> rename to tools / run_tests / run_microbenchmark . py <nl> mmm a / tools / profiling / microbenchmark / bm . py <nl> ppp b / tools / run_tests / run_microbenchmark . py <nl> <nl> import subprocess <nl> import sys <nl> <nl> + import python_utils . jobset as jobset <nl> + import python_utils . start_port_server as start_port_server <nl> + <nl> flamegraph_dir = os . path . join ( os . path . expanduser ( ' ~ ' ) , ' FlameGraph ' ) <nl> <nl> + os . chdir ( os . path . join ( os . path . dirname ( sys . argv [ 0 ] ) , ' . . / . . ' ) ) <nl> + if not os . path . exists ( ' reports ' ) : <nl> + os . makedirs ( ' reports ' ) <nl> + <nl> + port_server_port = 32766 <nl> + start_port_server . start_port_server ( port_server_port ) <nl> + <nl> def fnize ( s ) : <nl> out = ' ' <nl> for c in s : <nl> def fnize ( s ) : <nl> out + = c <nl> return out <nl> <nl> - os . chdir ( os . path . join ( os . path . dirname ( sys . argv [ 0 ] ) , ' . . / . . / . . ' ) ) <nl> - if not os . path . exists ( ' reports ' ) : <nl> - os . makedirs ( ' reports ' ) <nl> - <nl> # index html <nl> index_html = " " " <nl> < html > <nl> def link ( txt , tgt ) : <nl> global index_html <nl> index_html + = " < p > < a href = \ " % s \ " > % s < / a > < / p > \ n " % ( tgt , txt ) <nl> <nl> + benchmarks = [ ] <nl> + profile_analysis = [ ] <nl> + <nl> for bm_name in sys . argv [ 1 : ] : <nl> # generate latency profiles <nl> heading ( ' Latency Profiles : % s ' % bm_name ) <nl> def link ( txt , tgt ) : <nl> for line in subprocess . check_output ( [ ' bins / basicprof / % s ' % bm_name , <nl> ' - - benchmark_list_tests ' ] ) . splitlines ( ) : <nl> link ( line , ' % s . txt ' % fnize ( line ) ) <nl> - with open ( ' reports / % s . txt ' % fnize ( line ) , ' w ' ) as f : <nl> - f . write ( subprocess . check_output ( [ ' bins / basicprof / % s ' % bm_name , <nl> - ' - - benchmark_filter = ^ % s $ ' % line ] ) ) <nl> - f . write ( ' \ n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \ n ' ) <nl> - f . write ( subprocess . check_output ( [ <nl> - sys . executable , ' tools / profiling / latency_profile / profile_analyzer . py ' , <nl> - ' - - source ' , ' latency_trace . txt ' , ' - - fmt ' , ' simple ' ] ) ) <nl> + benchmarks . append ( <nl> + jobset . JobSpec ( [ ' bins / basicprof / % s ' % bm_name , ' - - benchmark_filter = ^ % s $ ' % line ] , <nl> + environ = { ' LATENCY_TRACE ' : ' % s . trace ' % fnize ( line ) } ) ) <nl> + profile_analysis . append ( <nl> + jobset . JobSpec ( [ sys . executable , <nl> + ' tools / profiling / latency_profile / profile_analyzer . py ' , <nl> + ' - - source ' , ' % s . trace ' % fnize ( line ) , ' - - fmt ' , ' simple ' , <nl> + ' - - out ' , ' reports / % s . txt ' % fnize ( line ) ] , timeout_seconds = None ) ) <nl> + <nl> + jobset . run ( benchmarks , maxjobs = multiprocessing . cpu_count ( ) / 2 , <nl> + add_env = { ' GRPC_TEST_PORT_SERVER ' : ' localhost : % d ' % port_server_port } ) <nl> + jobset . run ( profile_analysis , maxjobs = multiprocessing . cpu_count ( ) ) <nl> <nl> # generate flamegraphs <nl> heading ( ' Flamegraphs : % s ' % bm_name ) <nl> mmm a / tools / run_tests / run_tests . py <nl> ppp b / tools / run_tests / run_tests . py <nl> <nl> import python_utils . jobset as jobset <nl> import python_utils . report_utils as report_utils <nl> import python_utils . watch_dirs as watch_dirs <nl> + import python_utils . start_port_server as start_port_server <nl> <nl> <nl> _ROOT = os . path . abspath ( os . path . join ( os . path . dirname ( sys . argv [ 0 ] ) , ' . . / . . ' ) ) <nl> def _shut_down_legacy_server ( legacy_server_port ) : <nl> ' http : / / localhost : % d / quitquitquit ' % legacy_server_port ) . read ( ) <nl> <nl> <nl> - def _start_port_server ( port_server_port ) : <nl> - # check if a compatible port server is running <nl> - # if incompatible ( version mismatch ) = = > start a new one <nl> - # if not running = = > start a new one <nl> - # otherwise , leave it up <nl> - try : <nl> - version = int ( urllib . request . urlopen ( <nl> - ' http : / / localhost : % d / version_number ' % port_server_port , <nl> - timeout = 10 ) . read ( ) ) <nl> - print ( ' detected port server running version % d ' % version ) <nl> - running = True <nl> - except Exception as e : <nl> - print ( ' failed to detect port server : % s ' % sys . exc_info ( ) [ 0 ] ) <nl> - print ( e . strerror ) <nl> - running = False <nl> - if running : <nl> - current_version = int ( subprocess . check_output ( <nl> - [ sys . executable , os . path . abspath ( ' tools / run_tests / python_utils / port_server . py ' ) , <nl> - ' dump_version ' ] ) ) <nl> - print ( ' my port server is version % d ' % current_version ) <nl> - running = ( version > = current_version ) <nl> - if not running : <nl> - print ( ' port_server version mismatch : killing the old one ' ) <nl> - urllib . request . urlopen ( ' http : / / localhost : % d / quitquitquit ' % port_server_port ) . read ( ) <nl> - time . sleep ( 1 ) <nl> - if not running : <nl> - fd , logfile = tempfile . mkstemp ( ) <nl> - os . close ( fd ) <nl> - print ( ' starting port_server , with log file % s ' % logfile ) <nl> - args = [ sys . executable , os . path . abspath ( ' tools / run_tests / python_utils / port_server . py ' ) , <nl> - ' - p ' , ' % d ' % port_server_port , ' - l ' , logfile ] <nl> - env = dict ( os . environ ) <nl> - env [ ' BUILD_ID ' ] = ' pleaseDontKillMeJenkins ' <nl> - if platform_string ( ) = = ' windows ' : <nl> - # Working directory of port server needs to be outside of Jenkins <nl> - # workspace to prevent file lock issues . <nl> - tempdir = tempfile . mkdtemp ( ) <nl> - port_server = subprocess . Popen ( <nl> - args , <nl> - env = env , <nl> - cwd = tempdir , <nl> - creationflags = 0x00000008 , # detached process <nl> - close_fds = True ) <nl> - else : <nl> - port_server = subprocess . Popen ( <nl> - args , <nl> - env = env , <nl> - preexec_fn = os . setsid , <nl> - close_fds = True ) <nl> - time . sleep ( 1 ) <nl> - # ensure port server is up <nl> - waits = 0 <nl> - while True : <nl> - if waits > 10 : <nl> - print ( ' killing port server due to excessive start up waits ' ) <nl> - port_server . kill ( ) <nl> - if port_server . poll ( ) is not None : <nl> - print ( ' port_server failed to start ' ) <nl> - # try one final time : maybe another build managed to start one <nl> - time . sleep ( 1 ) <nl> - try : <nl> - urllib . request . urlopen ( ' http : / / localhost : % d / get ' % port_server_port , <nl> - timeout = 1 ) . read ( ) <nl> - print ( ' last ditch attempt to contact port server succeeded ' ) <nl> - break <nl> - except : <nl> - traceback . print_exc ( ) <nl> - port_log = open ( logfile , ' r ' ) . read ( ) <nl> - print ( port_log ) <nl> - sys . exit ( 1 ) <nl> - try : <nl> - urllib . request . urlopen ( ' http : / / localhost : % d / get ' % port_server_port , <nl> - timeout = 1 ) . read ( ) <nl> - print ( ' port server is up and ready ' ) <nl> - break <nl> - except socket . timeout : <nl> - print ( ' waiting for port_server : timeout ' ) <nl> - traceback . print_exc ( ) ; <nl> - time . sleep ( 1 ) <nl> - waits + = 1 <nl> - except urllib . error . URLError : <nl> - print ( ' waiting for port_server : urlerror ' ) <nl> - traceback . print_exc ( ) ; <nl> - time . sleep ( 1 ) <nl> - waits + = 1 <nl> - except : <nl> - traceback . print_exc ( ) <nl> - port_server . kill ( ) <nl> - raise <nl> - <nl> - <nl> def _calculate_num_runs_failures ( list_of_results ) : <nl> " " " Caculate number of runs and failures for a particular test . <nl> <nl> def _build_and_run ( <nl> antagonists = [ subprocess . Popen ( [ ' tools / run_tests / python_utils / antagonist . py ' ] ) <nl> for _ in range ( 0 , args . antagonists ) ] <nl> port_server_port = 32766 <nl> - _start_port_server ( port_server_port ) <nl> + start_port_server . start_port_server ( port_server_port ) <nl> resultset = None <nl> num_test_failures = 0 <nl> try : <nl>
Make the microbenchmark profile gatherer run some in parallel
grpc/grpc
7dc4ea66f0688c30aa7ddd865074a808fd20f076
2017-02-03T00:08:05Z
mmm a / stdlib / private / StdlibCollectionUnittest / CheckCollectionType . swift . gyb <nl> ppp b / stdlib / private / StdlibCollectionUnittest / CheckCollectionType . swift . gyb <nl> internal func _product < C1 : Collection , C2 : Collection > ( <nl> return ' ' ' <nl> C : % ( protocol ) s , <nl> CollectionWithEquatableElement : % ( protocol ) s , <nl> + CollectionWithEquatableElement . SubSequence : Collection , <nl> + CollectionWithEquatableElement . SubSequence . Iterator . Element <nl> + = = CollectionWithEquatableElement . Iterator . Element , <nl> C . SubSequence : % ( protocol ) s , <nl> C . SubSequence . Iterator . Element = = C . Iterator . Element , <nl> C . SubSequence . Index = = C . Index , <nl> mmm a / stdlib / private / StdlibCollectionUnittest / CheckMutableCollectionType . swift . gyb <nl> ppp b / stdlib / private / StdlibCollectionUnittest / CheckMutableCollectionType . swift . gyb <nl> extension TestSuite { <nl> C . Indices . Index = = C . Index , <nl> C . Indices . SubSequence = = C . Indices , <nl> CollectionWithEquatableElement . Iterator . Element : Equatable , <nl> + CollectionWithEquatableElement . SubSequence : Collection , <nl> + CollectionWithEquatableElement . SubSequence . Iterator . Element <nl> + = = CollectionWithEquatableElement . Iterator . Element , <nl> CollectionWithComparableElement . Iterator . Element : Comparable { <nl> <nl> var testNamePrefix = testNamePrefix <nl> self . test ( " \ ( testNamePrefix ) . partition / InvalidOrderings " ) { <nl> C . Indices . Index = = C . Index , <nl> C . Indices . SubSequence = = C . Indices , <nl> CollectionWithEquatableElement . Iterator . Element : Equatable , <nl> + CollectionWithEquatableElement . SubSequence : Collection , <nl> + CollectionWithEquatableElement . SubSequence . Iterator . Element <nl> + = = CollectionWithEquatableElement . Iterator . Element , <nl> CollectionWithComparableElement . Iterator . Element : Comparable { <nl> <nl> var testNamePrefix = testNamePrefix <nl> self . test ( " \ ( testNamePrefix ) . partition / DispatchesThrough_withUnsafeMutableBuffer <nl> C . Indices . Index = = C . Index , <nl> C . Indices . SubSequence = = C . Indices , <nl> CollectionWithEquatableElement . Iterator . Element : Equatable , <nl> + CollectionWithEquatableElement . SubSequence : Collection , <nl> + CollectionWithEquatableElement . SubSequence . Iterator . Element <nl> + = = CollectionWithEquatableElement . Iterator . Element , <nl> CollectionWithComparableElement . Iterator . Element : Comparable , <nl> CollectionWithComparableElement . SubSequence . Indices . Iterator . Element = = CollectionWithComparableElement . Index { <nl> <nl> mmm a / stdlib / private / StdlibCollectionUnittest / CheckRangeReplaceableCollectionType . swift <nl> ppp b / stdlib / private / StdlibCollectionUnittest / CheckRangeReplaceableCollectionType . swift <nl> extension TestSuite { <nl> C . Indices . Iterator . Element = = C . Index , <nl> C . Indices . Index = = C . Index , <nl> C . Indices . SubSequence = = C . Indices , <nl> - CollectionWithEquatableElement . Iterator . Element : Equatable { <nl> + CollectionWithEquatableElement . Iterator . Element : Equatable , <nl> + CollectionWithEquatableElement . SubSequence : Collection , <nl> + CollectionWithEquatableElement . SubSequence . Iterator . Element <nl> + = = CollectionWithEquatableElement . Iterator . Element { <nl> <nl> var testNamePrefix = testNamePrefix <nl> <nl> self . test ( " \ ( testNamePrefix ) . OperatorPlus " ) { <nl> C . Indices . Iterator . Element = = C . Index , <nl> C . Indices . Index = = C . Index , <nl> C . Indices . SubSequence = = C . Indices , <nl> - CollectionWithEquatableElement . Iterator . Element : Equatable { <nl> + CollectionWithEquatableElement . Iterator . Element : Equatable , <nl> + CollectionWithEquatableElement . SubSequence : Collection , <nl> + CollectionWithEquatableElement . SubSequence . Iterator . Element <nl> + = = CollectionWithEquatableElement . Iterator . Element { <nl> <nl> var testNamePrefix = testNamePrefix <nl> <nl> self . test ( " \ ( testNamePrefix ) . removeLast ( n : Int ) / whereIndexIsBidirectional / remove <nl> C . Indices . Iterator . Element = = C . Index , <nl> C . Indices . Index = = C . Index , <nl> C . Indices . SubSequence = = C . Indices , <nl> - CollectionWithEquatableElement . Iterator . Element : Equatable { <nl> + CollectionWithEquatableElement . Iterator . Element : Equatable , <nl> + CollectionWithEquatableElement . SubSequence : Collection , <nl> + CollectionWithEquatableElement . SubSequence . Iterator . Element <nl> + = = CollectionWithEquatableElement . Iterator . Element { <nl> <nl> var testNamePrefix = testNamePrefix <nl> <nl> mmm a / stdlib / private / StdlibCollectionUnittest / CheckSequenceType . swift <nl> ppp b / stdlib / private / StdlibCollectionUnittest / CheckSequenceType . swift <nl> extension TestSuite { <nl> resiliencyChecks : CollectionMisuseResiliencyChecks = . all <nl> ) where <nl> SequenceWithEquatableElement . Iterator . Element : Equatable , <nl> + SequenceWithEquatableElement . SubSequence : Sequence , <nl> + SequenceWithEquatableElement . SubSequence . Iterator . Element <nl> + = = SequenceWithEquatableElement . Iterator . Element , <nl> S . SubSequence : Sequence , <nl> S . SubSequence . Iterator . Element = = S . Iterator . Element , <nl> S . SubSequence . SubSequence = = S . SubSequence { <nl> self . test ( " \ ( testNamePrefix ) . dropLast / semantics / negative " ) { <nl> _ = s . dropLast ( - 1 ) <nl> } <nl> <nl> + / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> + / / drop ( while : ) <nl> + / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> + <nl> + self . test ( " \ ( testNamePrefix ) . drop ( while : ) / semantics " ) . forEach ( in : findTests ) { <nl> + test in <nl> + let s = makeWrappedSequenceWithEquatableElement ( test . sequence ) <nl> + let closureLifetimeTracker = LifetimeTracked ( 0 ) <nl> + let remainingSequence = s . drop { <nl> + _blackHole ( closureLifetimeTracker ) <nl> + return $ 0 ! = wrapValueIntoEquatable ( test . element ) <nl> + } <nl> + let remaining = Array ( remainingSequence ) <nl> + let expectedSuffix = test . sequence . suffix ( <nl> + from : test . expected ? ? test . sequence . endIndex ) <nl> + expectEqual ( expectedSuffix . count , remaining . count ) <nl> + expectEqualSequence ( expectedSuffix . map ( wrapValueIntoEquatable ) , remaining ) <nl> + } <nl> + <nl> / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> / / prefix ( ) <nl> / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> self . test ( " \ ( testNamePrefix ) . prefix / semantics / negative " ) { <nl> _ = s . prefix ( - 1 ) <nl> } <nl> <nl> + / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> + / / prefix ( while : ) <nl> + / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> + <nl> + self . test ( " \ ( testNamePrefix ) . prefix ( while : ) / semantics " ) . forEach ( in : findTests ) { <nl> + test in <nl> + let s = makeWrappedSequenceWithEquatableElement ( test . sequence ) <nl> + let closureLifetimeTracker = LifetimeTracked ( 0 ) <nl> + let remainingSequence = s . prefix { <nl> + _blackHole ( closureLifetimeTracker ) <nl> + return $ 0 ! = wrapValueIntoEquatable ( test . element ) <nl> + } <nl> + let expectedPrefix = test . sequence . prefix ( <nl> + upTo : test . expected ? ? test . sequence . endIndex ) <nl> + let remaining = Array ( remainingSequence ) <nl> + expectEqual ( expectedPrefix . count , remaining . count ) <nl> + expectEqualSequence ( expectedPrefix . map ( wrapValueIntoEquatable ) , remaining ) <nl> + } <nl> + <nl> / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> / / suffix ( ) <nl> / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> mmm a / stdlib / private / StdlibCollectionUnittest / LoggingWrappers . swift . gyb <nl> ppp b / stdlib / private / StdlibCollectionUnittest / LoggingWrappers . swift . gyb <nl> public class SequenceLog { <nl> public static var first = TypeIndexed ( 0 ) <nl> public static var dropFirst = TypeIndexed ( 0 ) <nl> public static var dropLast = TypeIndexed ( 0 ) <nl> + public static var dropWhile = TypeIndexed ( 0 ) <nl> + public static var prefixWhile = TypeIndexed ( 0 ) <nl> public static var prefixMaxLength = TypeIndexed ( 0 ) <nl> public static var suffixMaxLength = TypeIndexed ( 0 ) <nl> public static var split = TypeIndexed ( 0 ) <nl> public struct $ { Self } < <nl> Log . dropLast [ selfType ] + = 1 <nl> return base . dropLast ( n ) <nl> } <nl> + <nl> + public func drop ( <nl> + while predicate : @ noescape ( Base . Iterator . Element ) throws - > Bool <nl> + ) rethrows - > SubSequence { <nl> + Log . dropWhile [ selfType ] + = 1 <nl> + return try base . drop ( while : predicate ) <nl> + } <nl> <nl> public func prefix ( _ maxLength : Int ) - > SubSequence { <nl> Log . prefixMaxLength [ selfType ] + = 1 <nl> return base . prefix ( maxLength ) <nl> } <nl> + <nl> + public func prefix ( <nl> + while predicate : @ noescape ( Base . Iterator . Element ) throws - > Bool <nl> + ) rethrows - > SubSequence { <nl> + Log . prefixWhile [ selfType ] + = 1 <nl> + return try base . prefix ( while : predicate ) <nl> + } <nl> <nl> public func suffix ( _ maxLength : Int ) - > SubSequence { <nl> Log . suffixMaxLength [ selfType ] + = 1 <nl> mmm a / stdlib / public / core / CMakeLists . txt <nl> ppp b / stdlib / public / core / CMakeLists . txt <nl> set ( SWIFTLIB_ESSENTIAL <nl> CString . swift <nl> CTypes . swift <nl> DebuggerSupport . swift <nl> + DropWhile . swift . gyb <nl> EmptyCollection . swift <nl> Equatable . swift <nl> ErrorType . swift <nl> set ( SWIFTLIB_ESSENTIAL <nl> OutputStream . swift <nl> Pointer . swift <nl> Policy . swift <nl> + PrefixWhile . swift . gyb <nl> Print . swift <nl> RandomAccessCollection . swift <nl> Range . swift . gyb <nl> mmm a / stdlib / public / core / Collection . swift <nl> ppp b / stdlib / public / core / Collection . swift <nl> extension Collection { <nl> offsetBy : numericCast ( amount ) , limitedBy : endIndex ) ? ? endIndex <nl> return self [ startIndex . . < end ] <nl> } <nl> + <nl> + / / / Returns a subsequence by skipping elements while ` predicate ` returns <nl> + / / / ` true ` and returning the remaining elements . <nl> + / / / <nl> + / / / - Parameter predicate : A closure that takes an element of the <nl> + / / / sequence as its argument and returns ` true ` if the element should <nl> + / / / be skipped or ` false ` if it should be included . Once the predicate <nl> + / / / returns ` false ` it will not be called again . <nl> + / / / <nl> + / / / - Complexity : O ( * n * ) , where * n * is the length of the collection . <nl> + public func drop ( <nl> + while predicate : @ noescape ( Iterator . Element ) throws - > Bool <nl> + ) rethrows - > SubSequence { <nl> + var start = startIndex <nl> + while try start ! = endIndex & & predicate ( self [ start ] ) { <nl> + formIndex ( after : & start ) <nl> + } <nl> + return self [ start . . < endIndex ] <nl> + } <nl> <nl> / / / Returns a subsequence , up to the specified maximum length , containing <nl> / / / the initial elements of the collection . <nl> extension Collection { <nl> offsetBy : numericCast ( maxLength ) , limitedBy : endIndex ) ? ? endIndex <nl> return self [ startIndex . . < end ] <nl> } <nl> + <nl> + / / / Returns a subsequence containing the initial elements until ` predicate ` <nl> + / / / returns ` false ` and skipping the remaining elements . <nl> + / / / <nl> + / / / - Parameter predicate : A closure that takes an element of the <nl> + / / / sequence as its argument and returns ` true ` if the element should <nl> + / / / be included or ` false ` if it should be excluded . Once the predicate <nl> + / / / returns ` false ` it will not be called again . <nl> + / / / <nl> + / / / - Complexity : O ( * n * ) , where * n * is the length of the collection . <nl> + public func prefix ( <nl> + while predicate : @ noescape ( Iterator . Element ) throws - > Bool <nl> + ) rethrows - > SubSequence { <nl> + var end = startIndex <nl> + while try end ! = endIndex & & predicate ( self [ end ] ) { <nl> + formIndex ( after : & end ) <nl> + } <nl> + return self [ startIndex . . < end ] <nl> + } <nl> <nl> / / / Returns a subsequence , up to the given maximum length , containing the <nl> / / / final elements of the collection . <nl> new file mode 100644 <nl> index 000000000000 . . 00ae2c2903a8 <nl> mmm / dev / null <nl> ppp b / stdlib / public / core / DropWhile . swift . gyb <nl> <nl> + / / = = = mmm DropWhile . swift . gyb - Lazy views for drop ( while : ) mmmmmmmmmmmmmmm - = = = / / <nl> + / / <nl> + / / This source file is part of the Swift . org open source project <nl> + / / <nl> + / / Copyright ( c ) 2014 - 2016 Apple Inc . and the Swift project authors <nl> + / / Licensed under Apache License v2 . 0 with Runtime Library Exception <nl> + / / <nl> + / / See http : / / swift . org / LICENSE . txt for license information <nl> + / / See http : / / swift . org / CONTRIBUTORS . txt for the list of Swift project authors <nl> + / / <nl> + / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> + <nl> + % { <nl> + from gyb_stdlib_support import ( <nl> + TRAVERSALS , <nl> + collectionForTraversal <nl> + ) <nl> + } % <nl> + <nl> + / / = = = mmm Iterator & Sequence mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> + <nl> + / / / An iterator over the elements traversed by a base iterator that follow the <nl> + / / / initial consecutive elements that satisfy a given predicate . <nl> + / / / <nl> + / / / This is the associated iterator for the ` LazyDropWhileSequence ` , <nl> + / / / ` LazyDropWhileCollection ` , and ` LazyDropWhileBidirectionalCollection ` <nl> + / / / types . <nl> + public struct LazyDropWhileIterator < Base : IteratorProtocol > : <nl> + IteratorProtocol , Sequence { <nl> + <nl> + public mutating func next ( ) - > Base . Element ? { <nl> + / / Once the predicate has failed for the first time , the base iterator <nl> + / / can be used for the rest of the elements . <nl> + if _predicateHasFailed { <nl> + return _base . next ( ) <nl> + } <nl> + <nl> + / / Retrieve and discard elements from the base iterator until one fails <nl> + / / the predicate . <nl> + while let nextElement = _base . next ( ) { <nl> + if ! _predicate ( nextElement ) { <nl> + _predicateHasFailed = true <nl> + return nextElement <nl> + } <nl> + } <nl> + return nil <nl> + } <nl> + <nl> + internal init ( _base : Base , predicate : @ escaping ( Base . Element ) - > Bool ) { <nl> + self . _base = _base <nl> + self . _predicate = predicate <nl> + } <nl> + <nl> + internal var _predicateHasFailed = false <nl> + internal var _base : Base <nl> + internal let _predicate : ( Base . Element ) - > Bool <nl> + } <nl> + <nl> + / / / A sequence whose elements consist of the elements that follow the initial <nl> + / / / consecutive elements of some base sequence that satisfy a given predicate . <nl> + public struct LazyDropWhileSequence < Base : Sequence > : LazySequenceProtocol { <nl> + <nl> + public typealias Elements = LazyDropWhileSequence <nl> + <nl> + / / / Returns an iterator over the elements of this sequence . <nl> + / / / <nl> + / / / - Complexity : O ( 1 ) . <nl> + public func makeIterator ( ) - > LazyDropWhileIterator < Base . Iterator > { <nl> + return LazyDropWhileIterator ( <nl> + _base : _base . makeIterator ( ) , predicate : _predicate ) <nl> + } <nl> + <nl> + / / / Create an instance with elements ` transform ( x ) ` for each element <nl> + / / / ` x ` of base . <nl> + internal init ( _base : Base , predicate : @ escaping ( Base . Iterator . Element ) - > Bool ) { <nl> + self . _base = _base <nl> + self . _predicate = predicate <nl> + } <nl> + <nl> + internal var _base : Base <nl> + internal let _predicate : ( Base . Iterator . Element ) - > Bool <nl> + } <nl> + <nl> + extension LazySequenceProtocol { <nl> + / / / Returns a lazy sequence that skips any initial elements that satisfy <nl> + / / / ` predicate ` . <nl> + / / / <nl> + / / / - Parameter predicate : A closure that takes an element of the sequence as <nl> + / / / its argument and returns ` true ` if the element should be skipped or <nl> + / / / ` false ` otherwise . Once ` predicate ` returns ` false ` it will not be <nl> + / / / called again . <nl> + public func drop ( <nl> + while predicate : @ escaping ( Elements . Iterator . Element ) - > Bool <nl> + ) - > LazyDropWhileSequence < Self . Elements > { <nl> + return LazyDropWhileSequence ( _base : self . elements , predicate : predicate ) <nl> + } <nl> + } <nl> + <nl> + / / = = = mmm Collections mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm = = = / / <nl> + <nl> + / / / A position in a ` LazyDropWhileCollection ` or <nl> + / / / ` LazyDropWhileBidirectionalCollection ` instance . <nl> + public struct LazyDropWhileIndex < Base : Collection > : Comparable { <nl> + / / / The position corresponding to ` self ` in the underlying collection . <nl> + public let base : Base . Index <nl> + } <nl> + <nl> + public func = = < Base : Collection > ( <nl> + lhs : LazyDropWhileIndex < Base > , <nl> + rhs : LazyDropWhileIndex < Base > <nl> + ) - > Bool { <nl> + return lhs . base = = rhs . base <nl> + } <nl> + <nl> + public func < < Base : Collection > ( <nl> + lhs : LazyDropWhileIndex < Base > , <nl> + rhs : LazyDropWhileIndex < Base > <nl> + ) - > Bool { <nl> + return lhs . base < rhs . base <nl> + } <nl> + <nl> + % for Traversal in [ ' Forward ' , ' Bidirectional ' ] : <nl> + % Collection = collectionForTraversal ( Traversal ) <nl> + % Self = " LazyDropWhile " + Collection <nl> + <nl> + / / / A lazy ` $ { Collection } ` wrapper that includes the elements of an underlying <nl> + / / / collection after any initial consecutive elements that satisfy a <nl> + / / / predicate . <nl> + / / / <nl> + / / / - Note : The performance of accessing ` startIndex ` , ` first ` , or any methods <nl> + / / / that depend on ` startIndex ` depends on how many elements satisfy the <nl> + / / / predicate at the start of the collection , and may not offer the usual <nl> + / / / performance given by the ` Collection ` protocol . Be aware , therefore , <nl> + / / / that general operations on ` $ { Self } ` instances may not have the <nl> + / / / documented complexity . <nl> + public struct $ { Self } < <nl> + Base : $ { Collection } <nl> + > : LazyCollectionProtocol , $ { Collection } { <nl> + <nl> + / / FIXME ( compiler limitation ) : should be inferrable . <nl> + public typealias Index = LazyDropWhileIndex < Base > <nl> + <nl> + public var startIndex : Index { <nl> + var index = _base . startIndex <nl> + while index ! = _base . endIndex & & _predicate ( _base [ index ] ) { <nl> + _base . formIndex ( after : & index ) <nl> + } <nl> + return LazyDropWhileIndex ( base : index ) <nl> + } <nl> + <nl> + public var endIndex : Index { <nl> + return LazyDropWhileIndex ( base : _base . endIndex ) <nl> + } <nl> + <nl> + public func index ( after i : Index ) - > Index { <nl> + _precondition ( i . base < _base . endIndex , " can ' t advance past endIndex " ) <nl> + return LazyDropWhileIndex ( base : _base . index ( after : i . base ) ) <nl> + } <nl> + <nl> + % if Traversal = = ' Bidirectional ' : <nl> + <nl> + public func index ( before i : Index ) - > Index { <nl> + _precondition ( i > startIndex , " can ' t move before startIndex " ) <nl> + return LazyDropWhileIndex ( base : _base . index ( before : i . base ) ) <nl> + } <nl> + <nl> + % end <nl> + <nl> + public subscript ( position : Index ) - > Base . Iterator . Element { <nl> + return _base [ position . base ] <nl> + } <nl> + <nl> + public func makeIterator ( ) - > LazyDropWhileIterator < Base . Iterator > { <nl> + return LazyDropWhileIterator ( <nl> + _base : _base . makeIterator ( ) , predicate : _predicate ) <nl> + } <nl> + <nl> + internal init ( _base : Base , predicate : @ escaping ( Base . Iterator . Element ) - > Bool ) { <nl> + self . _base = _base <nl> + self . _predicate = predicate <nl> + } <nl> + <nl> + internal var _base : Base <nl> + internal let _predicate : ( Base . Iterator . Element ) - > Bool <nl> + } <nl> + <nl> + extension LazyCollectionProtocol <nl> + where <nl> + Self : $ { Collection } , <nl> + Elements : $ { Collection } <nl> + { <nl> + / / / Returns a lazy collection that skips any initial elements that satisfy <nl> + / / / ` predicate ` . <nl> + / / / <nl> + / / / - Parameter predicate : A closure that takes an element of the collection <nl> + / / / as its argument and returns ` true ` if the element should be skipped or <nl> + / / / ` false ` otherwise . Once ` predicate ` returns ` false ` it will not be <nl> + / / / called again . <nl> + public func drop ( <nl> + while predicate : @ escaping ( Elements . Iterator . Element ) - > Bool <nl> + ) - > LazyDropWhile $ { Collection } < Self . Elements > { <nl> + return LazyDropWhile $ { Collection } ( <nl> + _base : self . elements , predicate : predicate ) <nl> + } <nl> + } <nl> + <nl> + % end <nl> + <nl> + / / $ { ' Local Variables ' } : <nl> + / / eval : ( read - only - mode 1 ) <nl> + / / End : <nl> mmm a / stdlib / public / core / ExistentialCollection . swift . gyb <nl> ppp b / stdlib / public / core / ExistentialCollection . swift . gyb <nl> internal class _AnyRandomAccessCollectionBox < Element > <nl> % end <nl> <nl> % override = ' override ' if Kind ! = ' Sequence ' else ' ' <nl> + internal $ { override } func _drop ( <nl> + while predicate : ( Element ) throws - > Bool <nl> + ) rethrows - > _Any $ { Kind } Box < Element > { <nl> + _abstract ( ) <nl> + } <nl> + <nl> internal $ { override } func _dropFirst ( _ n : Int ) - > _Any $ { Kind } Box < Element > { <nl> _abstract ( ) <nl> } <nl> internal class _AnyRandomAccessCollectionBox < Element > <nl> internal $ { override } func _prefix ( _ maxLength : Int ) - > _Any $ { Kind } Box < Element > { <nl> _abstract ( ) <nl> } <nl> + <nl> + internal $ { override } func _prefix ( <nl> + while predicate : ( Element ) throws - > Bool <nl> + ) rethrows - > _Any $ { Kind } Box < Element > { <nl> + _abstract ( ) <nl> + } <nl> <nl> internal $ { override } func _suffix ( _ maxLength : Int ) - > _Any $ { Kind } Box < Element > { <nl> _abstract ( ) <nl> internal final class _ $ { Kind } Box < S : $ { Kind } > : _Any $ { Kind } Box < S . Iterator . Elemen <nl> - > UnsafeMutablePointer < Element > { <nl> return _base . _copyContents ( initializing : ptr ) <nl> } <nl> + internal override func _drop ( <nl> + while predicate : ( Element ) throws - > Bool <nl> + ) rethrows - > _Any $ { Kind } Box < Element > { <nl> + return try _ $ { Kind } Box < S . SubSequence > ( _base : _base . drop ( while : predicate ) ) <nl> + } <nl> internal override func _dropFirst ( _ n : Int ) - > _Any $ { Kind } Box < Element > { <nl> return _ $ { Kind } Box < S . SubSequence > ( _base : _base . dropFirst ( n ) ) <nl> } <nl> internal override func _dropLast ( _ n : Int ) - > _Any $ { Kind } Box < Element > { <nl> return _ $ { Kind } Box < S . SubSequence > ( _base : _base . dropLast ( n ) ) <nl> } <nl> + internal override func _prefix ( <nl> + while predicate : ( Element ) throws - > Bool <nl> + ) rethrows - > _Any $ { Kind } Box < Element > { <nl> + return try _ $ { Kind } Box < S . SubSequence > ( _base : _base . prefix ( while : predicate ) ) <nl> + } <nl> internal override func _prefix ( _ maxLength : Int ) - > _Any $ { Kind } Box < Element > { <nl> return _ $ { Kind } Box < S . SubSequence > ( _base : _base . prefix ( maxLength ) ) <nl> } <nl> extension Any $ { Kind } { <nl> return try _box . _forEach ( body ) <nl> } <nl> <nl> + public func drop ( <nl> + while predicate : ( Element ) throws - > Bool <nl> + ) rethrows - > Any $ { Kind } < Element > { <nl> + return try Any $ { Kind } ( _box : _box . _drop ( while : predicate ) ) <nl> + } <nl> + <nl> public func dropFirst ( _ n : Int ) - > Any $ { Kind } < Element > { <nl> return Any $ { Kind } ( _box : _box . _dropFirst ( n ) ) <nl> } <nl> extension Any $ { Kind } { <nl> return Any $ { Kind } ( _box : _box . _dropLast ( n ) ) <nl> } <nl> <nl> + public func prefix ( <nl> + while predicate : ( Element ) throws - > Bool <nl> + ) rethrows - > Any $ { Kind } < Element > { <nl> + return try Any $ { Kind } ( _box : _box . _prefix ( while : predicate ) ) <nl> + } <nl> + <nl> public func prefix ( _ maxLength : Int ) - > Any $ { Kind } < Element > { <nl> return Any $ { Kind } ( _box : _box . _prefix ( maxLength ) ) <nl> } <nl> mmm a / stdlib / public / core / GroupInfo . json <nl> ppp b / stdlib / public / core / GroupInfo . json <nl> <nl> " Filter . swift " , <nl> " Reverse . swift " , <nl> " Slice . swift " , <nl> + " DropWhile . swift " , <nl> + " PrefixWhile . swift " , <nl> " SequenceWrapper . swift " , <nl> " LazyCollection . swift " , <nl> " LazySequence . swift " ] , <nl> new file mode 100644 <nl> index 000000000000 . . 3aeb52b19013 <nl> mmm / dev / null <nl> ppp b / stdlib / public / core / PrefixWhile . swift . gyb <nl> <nl> + / / = = = mmm PrefixWhile . swift . gyb - Lazy views for prefix ( while : ) mmmmmmmmmmmm = = = / / <nl> + / / <nl> + / / This source file is part of the Swift . org open source project <nl> + / / <nl> + / / Copyright ( c ) 2014 - 2016 Apple Inc . and the Swift project authors <nl> + / / Licensed under Apache License v2 . 0 with Runtime Library Exception <nl> + / / <nl> + / / See http : / / swift . org / LICENSE . txt for license information <nl> + / / See http : / / swift . org / CONTRIBUTORS . txt for the list of Swift project authors <nl> + / / <nl> + / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> + <nl> + % { <nl> + from gyb_stdlib_support import ( <nl> + TRAVERSALS , <nl> + collectionForTraversal <nl> + ) <nl> + } % <nl> + <nl> + / / = = = mmm Iterator & Sequence mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> + <nl> + / / / An iterator over the initial elements traversed by a base iterator that <nl> + / / / satisfy a given predicate . <nl> + / / / <nl> + / / / This is the associated iterator for the ` LazyPrefixWhileSequence ` , <nl> + / / / ` LazyPrefixWhileCollection ` , and ` LazyPrefixWhileBidirectionalCollection ` <nl> + / / / types . <nl> + public struct LazyPrefixWhileIterator < Base : IteratorProtocol > : <nl> + IteratorProtocol , Sequence { <nl> + <nl> + public mutating func next ( ) - > Base . Element ? { <nl> + / / Return elements from the base iterator until one fails the predicate . <nl> + if ! _predicateHasFailed , let nextElement = _base . next ( ) { <nl> + if _predicate ( nextElement ) { <nl> + return nextElement <nl> + } else { <nl> + _predicateHasFailed = true <nl> + } <nl> + } <nl> + return nil <nl> + } <nl> + <nl> + internal init ( _base : Base , predicate : @ escaping ( Base . Element ) - > Bool ) { <nl> + self . _base = _base <nl> + self . _predicate = predicate <nl> + } <nl> + <nl> + internal var _predicateHasFailed = false <nl> + internal var _base : Base <nl> + internal let _predicate : ( Base . Element ) - > Bool <nl> + } <nl> + <nl> + / / / A sequence whose elements consist of the initial consecutive elements of <nl> + / / / some base sequence that satisfy a given predicate . <nl> + public struct LazyPrefixWhileSequence < Base : Sequence > : LazySequenceProtocol { <nl> + <nl> + public typealias Elements = LazyPrefixWhileSequence <nl> + <nl> + public func makeIterator ( ) - > LazyPrefixWhileIterator < Base . Iterator > { <nl> + return LazyPrefixWhileIterator ( <nl> + _base : _base . makeIterator ( ) , predicate : _predicate ) <nl> + } <nl> + <nl> + internal init ( _base : Base , predicate : @ escaping ( Base . Iterator . Element ) - > Bool ) { <nl> + self . _base = _base <nl> + self . _predicate = predicate <nl> + } <nl> + <nl> + internal var _base : Base <nl> + internal let _predicate : ( Base . Iterator . Element ) - > Bool <nl> + } <nl> + <nl> + extension LazySequenceProtocol { <nl> + / / / Returns a lazy sequence of the initial consecutive elements that satisfy <nl> + / / / ` predicate ` . <nl> + / / / <nl> + / / / - Parameter predicate : A closure that takes an element of the sequence as <nl> + / / / its argument and returns ` true ` if the element should be included or <nl> + / / / ` false ` otherwise . Once ` predicate ` returns ` false ` it will not be <nl> + / / / called again . <nl> + public func prefix ( <nl> + while predicate : @ escaping ( Elements . Iterator . Element ) - > Bool <nl> + ) - > LazyPrefixWhileSequence < Self . Elements > { <nl> + return LazyPrefixWhileSequence ( _base : self . elements , predicate : predicate ) <nl> + } <nl> + } <nl> + <nl> + / / = = = mmm Collections mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm = = = / / <nl> + <nl> + / / / A position in the base collection of a ` LazyPrefixWhileCollection ` or the <nl> + / / / end of that collection . <nl> + public enum _LazyPrefixWhileIndexRepresentation < Base : Collection > { <nl> + case index ( Base . Index ) <nl> + case pastEnd <nl> + } <nl> + <nl> + / / / A position in a ` LazyPrefixWhileCollection ` or <nl> + / / / ` LazyPrefixWhileBidirectionalCollection ` instance . <nl> + public struct LazyPrefixWhileIndex < Base : Collection > : Comparable { <nl> + / / / The position corresponding to ` self ` in the underlying collection . <nl> + internal let _value : _LazyPrefixWhileIndexRepresentation < Base > <nl> + <nl> + / / / Creates a new index wrapper for ` i ` . <nl> + internal init ( _ i : Base . Index ) { <nl> + self . _value = . index ( i ) <nl> + } <nl> + <nl> + / / / Creates a new index that can represent the ` endIndex ` of a <nl> + / / / ` LazyPrefixWhileCollection < Base > ` . This is not the same as a wrapper <nl> + / / / around ` Base . endIndex ` . <nl> + internal init ( endOf : Base ) { <nl> + self . _value = . pastEnd <nl> + } <nl> + } <nl> + <nl> + public func = = < Base : Collection > ( <nl> + lhs : LazyPrefixWhileIndex < Base > , <nl> + rhs : LazyPrefixWhileIndex < Base > <nl> + ) - > Bool { <nl> + switch ( lhs . _value , rhs . _value ) { <nl> + case let ( . index ( l ) , . index ( r ) ) : <nl> + return l = = r <nl> + case ( . pastEnd , . pastEnd ) : <nl> + return true <nl> + default : <nl> + return false <nl> + } <nl> + } <nl> + <nl> + public func < < Base : Collection > ( <nl> + lhs : LazyPrefixWhileIndex < Base > , <nl> + rhs : LazyPrefixWhileIndex < Base > <nl> + ) - > Bool { <nl> + switch ( lhs . _value , rhs . _value ) { <nl> + case let ( . index ( l ) , . index ( r ) ) : <nl> + return l < r <nl> + case ( . index , . pastEnd ) : <nl> + return true <nl> + default : <nl> + return false <nl> + } <nl> + } <nl> + <nl> + % for Traversal in [ ' Forward ' , ' Bidirectional ' ] : <nl> + % Collection = collectionForTraversal ( Traversal ) <nl> + % Self = " LazyPrefixWhile " + Collection <nl> + <nl> + / / / A lazy ` $ { Collection } ` wrapper that includes the initial consecutive <nl> + / / / elements of an underlying collection that satisfy a predicate . <nl> + / / / <nl> + / / / - Note : The performance of accessing ` endIndex ` , ` last ` , any methods that <nl> + / / / depend on ` endIndex ` , or moving an index depends on how many elements <nl> + / / / satisfy the predicate at the start of the collection , and may not offer <nl> + / / / the usual performance given by the ` Collection ` protocol . Be aware , <nl> + / / / therefore , that general operations on ` $ { Self } ` instances may not have <nl> + / / / the documented complexity . <nl> + public struct $ { Self } < <nl> + Base : $ { Collection } <nl> + > : LazyCollectionProtocol , $ { Collection } { <nl> + <nl> + public typealias Index = LazyPrefixWhileIndex < Base > <nl> + <nl> + public var startIndex : Index { <nl> + return LazyPrefixWhileIndex ( _base . startIndex ) <nl> + } <nl> + <nl> + public var endIndex : Index { <nl> + / / If the first element of ` _base ` satisfies the predicate , there is at <nl> + / / least one element in the lazy collection : Use the explicit ` . pastEnd ` index . <nl> + if let first = _base . first , _predicate ( first ) { <nl> + return LazyPrefixWhileIndex ( endOf : _base ) <nl> + } <nl> + <nl> + / / ` _base ` is either empty or ` _predicate ( _base . first ! ) = = false ` . In either <nl> + / / case , the lazy collection is empty , so ` endIndex = = startIndex ` . <nl> + return startIndex <nl> + } <nl> + <nl> + public func index ( after i : Index ) - > Index { <nl> + _precondition ( i ! = endIndex , " can ' t advance past endIndex " ) <nl> + guard case . index ( let i ) = i . _value else { <nl> + _preconditionFailure ( " invalid index passed to index ( after : ) " ) <nl> + } <nl> + let nextIndex = _base . index ( after : i ) <nl> + guard nextIndex ! = _base . endIndex & & _predicate ( _base [ nextIndex ] ) else { <nl> + return LazyPrefixWhileIndex ( endOf : _base ) <nl> + } <nl> + return LazyPrefixWhileIndex ( nextIndex ) <nl> + } <nl> + <nl> + % if Traversal = = ' Bidirectional ' : <nl> + <nl> + public func index ( before i : Index ) - > Index { <nl> + switch i . _value { <nl> + case . index ( let i ) : <nl> + _precondition ( i ! = _base . startIndex , " can ' t move before startIndex " ) <nl> + return LazyPrefixWhileIndex ( _base . index ( before : i ) ) <nl> + case . pastEnd : <nl> + / / Look for the position of the last element in a non - empty <nl> + / / prefix ( while : ) collection by searching forward for a predicate <nl> + / / failure . <nl> + <nl> + / / Safe to assume that ` _base . startIndex ! = _base . endIndex ` ; if they <nl> + / / were equal , ` _base . startIndex ` would be used as the ` endIndex ` of <nl> + / / this collection . <nl> + _sanityCheck ( ! _base . isEmpty ) <nl> + var result = _base . startIndex <nl> + while true { <nl> + let next = _base . index ( after : result ) <nl> + if next = = _base . endIndex | | ! _predicate ( _base [ next ] ) { <nl> + break <nl> + } <nl> + result = next <nl> + } <nl> + return LazyPrefixWhileIndex ( result ) <nl> + } <nl> + } <nl> + <nl> + % end <nl> + <nl> + public subscript ( position : Index ) - > Base . Iterator . Element { <nl> + switch position . _value { <nl> + case . index ( let i ) : <nl> + return _base [ i ] <nl> + case . pastEnd : <nl> + _preconditionFailure ( " Index out of range " ) <nl> + } <nl> + } <nl> + <nl> + public func makeIterator ( ) - > LazyPrefixWhileIterator < Base . Iterator > { <nl> + return LazyPrefixWhileIterator ( <nl> + _base : _base . makeIterator ( ) , predicate : _predicate ) <nl> + } <nl> + <nl> + internal init ( _base : Base , predicate : @ escaping ( Base . Iterator . Element ) - > Bool ) { <nl> + self . _base = _base <nl> + self . _predicate = predicate <nl> + } <nl> + <nl> + internal var _base : Base <nl> + internal let _predicate : ( Base . Iterator . Element ) - > Bool <nl> + } <nl> + <nl> + extension LazyCollectionProtocol <nl> + where <nl> + Self : $ { Collection } , <nl> + Elements : $ { Collection } <nl> + { <nl> + / / / Returns a lazy collection of the initial consecutive elements that <nl> + / / / satisfy ` predicate ` . <nl> + / / / <nl> + / / / - Parameter predicate : A closure that takes an element of the collection <nl> + / / / as its argument and returns ` true ` if the element should be included <nl> + / / / or ` false ` otherwise . Once ` predicate ` returns ` false ` it will not be <nl> + / / / called again . <nl> + public func prefix ( <nl> + while predicate : @ escaping ( Elements . Iterator . Element ) - > Bool <nl> + ) - > LazyPrefixWhile $ { Collection } < Self . Elements > { <nl> + return LazyPrefixWhile $ { Collection } ( <nl> + _base : self . elements , predicate : predicate ) <nl> + } <nl> + } <nl> + <nl> + % end <nl> + <nl> + / / $ { ' Local Variables ' } : <nl> + / / eval : ( read - only - mode 1 ) <nl> + / / End : <nl> mmm a / stdlib / public / core / Sequence . swift <nl> ppp b / stdlib / public / core / Sequence . swift <nl> public protocol Sequence { <nl> / / / - Complexity : O ( * n * ) , where * n * is the length of the sequence . <nl> func dropLast ( _ n : Int ) - > SubSequence <nl> <nl> + / / / Returns a subsequence by skipping elements while ` predicate ` returns <nl> + / / / ` true ` and returning the remaining elements . <nl> + / / / <nl> + / / / - Parameter predicate : A closure that takes an element of the <nl> + / / / sequence as its argument and returns a Boolean value indicating <nl> + / / / whether the element is a match . <nl> + / / / <nl> + / / / - Complexity : O ( * n * ) , where * n * is the length of the collection . <nl> + func drop ( <nl> + while predicate : ( Iterator . Element ) throws - > Bool <nl> + ) rethrows - > SubSequence <nl> + <nl> / / / Returns a subsequence , up to the specified maximum length , containing <nl> / / / the initial elements of the sequence . <nl> / / / <nl> public protocol Sequence { <nl> / / / - Returns : A subsequence starting at the beginning of this sequence <nl> / / / with at most ` maxLength ` elements . <nl> func prefix ( _ maxLength : Int ) - > SubSequence <nl> + <nl> + / / / Returns a subsequence containing the initial elements until ` predicate ` <nl> + / / / returns ` false ` and skipping the remaining elements . <nl> + / / / <nl> + / / / - Parameter predicate : A closure that takes an element of the <nl> + / / / sequence as its argument and returns a Boolean value indicating <nl> + / / / whether the element is a match . <nl> + / / / <nl> + / / / - Complexity : O ( * n * ) , where * n * is the length of the collection . <nl> + func prefix ( <nl> + while predicate : ( Iterator . Element ) throws - > Bool <nl> + ) rethrows - > SubSequence <nl> <nl> / / / Returns a subsequence , up to the given maximum length , containing the <nl> / / / final elements of the sequence . <nl> internal class _PrefixSequence < Base : IteratorProtocol > <nl> } <nl> } <nl> <nl> + / / / A sequence that lazily consumes and drops ` n ` elements from an underlying <nl> + / / / ` Base ` iterator before possibly returning the first available element . <nl> + / / / <nl> + / / / The underlying iterator ' s sequence may be infinite . <nl> + / / / <nl> + / / / This is a class - we require reference semantics to keep track <nl> + / / / of how many elements we ' ve already dropped from the underlying sequence . <nl> + internal class _DropWhileSequence < Base : IteratorProtocol > <nl> + : Sequence , IteratorProtocol { <nl> + <nl> + internal var _iterator : Base <nl> + internal var _nextElement : Base . Element ? <nl> + <nl> + internal init ( <nl> + iterator : Base , <nl> + nextElement : Base . Element ? , <nl> + predicate : ( Base . Element ) throws - > Bool <nl> + ) rethrows { <nl> + self . _iterator = iterator <nl> + self . _nextElement = nextElement ? ? _iterator . next ( ) <nl> + <nl> + while try _nextElement . flatMap ( predicate ) = = true { <nl> + _nextElement = _iterator . next ( ) <nl> + } <nl> + } <nl> + <nl> + internal func makeIterator ( ) - > _DropWhileSequence < Base > { <nl> + return self <nl> + } <nl> + <nl> + internal func next ( ) - > Base . Element ? { <nl> + guard _nextElement ! = nil else { <nl> + return _iterator . next ( ) <nl> + } <nl> + <nl> + let next = _nextElement <nl> + _nextElement = nil <nl> + return next <nl> + } <nl> + <nl> + internal func drop ( <nl> + while predicate : ( Base . Element ) throws - > Bool <nl> + ) rethrows - > AnySequence < Base . Element > { <nl> + / / If this is already a _DropWhileSequence , avoid multiple <nl> + / / layers of wrapping and keep the same iterator . <nl> + return try AnySequence ( <nl> + _DropWhileSequence ( <nl> + iterator : _iterator , nextElement : _nextElement , predicate : predicate ) ) <nl> + } <nl> + } <nl> + <nl> / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> / / Default implementations for Sequence <nl> / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> extension Sequence where <nl> } <nl> return AnySequence ( result ) <nl> } <nl> + <nl> + / / / Returns a subsequence by skipping elements while ` predicate ` returns <nl> + / / / ` true ` and returning the remaining elements . <nl> + / / / <nl> + / / / - Parameter predicate : A closure that takes an element of the <nl> + / / / sequence as its argument and returns ` true ` if the element should <nl> + / / / be skipped or ` false ` if it should be included . Once the predicate <nl> + / / / returns ` false ` it will not be called again . <nl> + / / / <nl> + / / / - Complexity : O ( * n * ) , where * n * is the length of the collection . <nl> + public func drop ( <nl> + while predicate : ( Iterator . Element ) throws - > Bool <nl> + ) rethrows - > AnySequence < Iterator . Element > { <nl> + return try AnySequence ( <nl> + _DropWhileSequence ( <nl> + iterator : makeIterator ( ) , nextElement : nil , predicate : predicate ) ) <nl> + } <nl> <nl> / / / Returns a subsequence , up to the specified maximum length , containing the <nl> / / / initial elements of the sequence . <nl> extension Sequence where <nl> return AnySequence ( <nl> _PrefixSequence ( _iterator : makeIterator ( ) , maxLength : maxLength ) ) <nl> } <nl> + <nl> + / / / Returns a subsequence containing the initial elements until ` predicate ` <nl> + / / / returns ` false ` and skipping the remaining elements . <nl> + / / / <nl> + / / / - Parameter predicate : A closure that takes an element of the <nl> + / / / sequence as its argument and returns ` true ` if the element should <nl> + / / / be included or ` false ` if it should be excluded . Once the predicate <nl> + / / / returns ` false ` it will not be called again . <nl> + / / / <nl> + / / / - Complexity : O ( * n * ) , where * n * is the length of the collection . <nl> + public func prefix ( <nl> + while predicate : ( Iterator . Element ) throws - > Bool <nl> + ) rethrows - > AnySequence < Iterator . Element > { <nl> + var result : [ Iterator . Element ] = [ ] <nl> + <nl> + for element in self { <nl> + guard try predicate ( element ) else { <nl> + break <nl> + } <nl> + result . append ( element ) <nl> + } <nl> + return AnySequence ( result ) <nl> + } <nl> } <nl> <nl> extension Sequence { <nl> mmm a / validation - test / stdlib / Lazy . swift . gyb <nl> ppp b / validation - test / stdlib / Lazy . swift . gyb <nl> func expectSequencePassthrough < <nl> <nl> SequenceLog . _copyContents . expectIncrement ( baseType ) { ( ) - > Void in <nl> let buf = UnsafeMutablePointer < S . Iterator . Element > . allocate ( capacity : count ) <nl> - <nl> + <nl> let end = s . _copyContents ( initializing : buf ) <nl> expectTrue ( end < = buf + count ) <nl> buf . deinitialize ( count : end - buf ) <nl> tests . test ( " ReversedCollection / Lazy " ) { <nl> / / Check that reversing a lazy collection , or lazy - ing a reverse <nl> / / collection , produces the same lazy reverse collection . <nl> do { <nl> - <nl> + <nl> let base = Array ( stride ( from : 11 , through : 0 , by : - 1 ) ) . lazy . map { $ 0 } <nl> - <nl> + <nl> typealias Base = LazyMapRandomAccessCollection < [ Int ] , Int > <nl> ExpectType < Base > . test ( base ) <nl> <nl> do { <nl> } <nl> } <nl> <nl> - runAllTests ( ) <nl> + / / = = = mmm LazyPrefixWhile mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - = = = / / <nl> + <nl> + let prefixDropWhileTests : [ ( data : [ Int ] , value : Int , pivot : Int ) ] = [ <nl> + ( [ ] , 0 , 0 ) , <nl> + ( [ 0 ] , 0 , 0 ) , <nl> + ( [ 0 ] , 99 , 1 ) , <nl> + ( [ 0 , 10 ] , 0 , 0 ) , <nl> + ( [ 0 , 10 ] , 10 , 1 ) , <nl> + ( [ 0 , 10 ] , 99 , 2 ) , <nl> + ( [ 0 , 10 , 20 , 30 , 40 ] , 0 , 0 ) , <nl> + ( [ 0 , 10 , 20 , 30 , 40 ] , 10 , 1 ) , <nl> + ( [ 0 , 10 , 20 , 30 , 40 ] , 20 , 2 ) , <nl> + ( [ 0 , 10 , 20 , 30 , 40 ] , 30 , 3 ) , <nl> + ( [ 0 , 10 , 20 , 30 , 40 ] , 40 , 4 ) , <nl> + ( [ 0 , 10 , 20 , 30 , 40 ] , 99 , 5 ) ] <nl> + <nl> + tests . test ( " LazyPrefixWhileIterator " ) { <nl> + let base = ( 1 . . . 10 ) . lazy . prefix ( while : { $ 0 < 4 } ) <nl> + <nl> + var iter1 = base . makeIterator ( ) <nl> + expectEqual ( 1 , iter1 . next ( ) ) <nl> + expectEqual ( 2 , iter1 . next ( ) ) <nl> + expectEqual ( 3 , iter1 . next ( ) ) <nl> + expectEqual ( nil , iter1 . next ( ) ) <nl> + } <nl> + <nl> + % for Kind in ' Sequence ' , ' Forward ' , ' Bidirectional ' : <nl> + % Self = ' Sequence ' if Kind = = ' Sequence ' else collectionForTraversal ( Kind ) <nl> + % checkKind = ' ForwardCollection ' if Kind = = ' Forward ' else Self <nl> + tests . test ( " LazyPrefixWhile $ { Self } " ) . forEach ( in : prefixDropWhileTests ) { <nl> + ( data , value , pivot ) in <nl> + <nl> + let base = Minimal $ { Self } ( elements : data ) <nl> + <nl> + var calls1 = 0 <nl> + let prefixed = base . lazy . prefix ( while : { calls1 + = 1 ; return $ 0 ! = value } ) <nl> + let expected = data . prefix ( upTo : pivot ) <nl> + expectEqual ( 0 , calls1 ) <nl> + check $ { checkKind } ( expected , prefixed ) <nl> + <nl> + var calls2 = 0 <nl> + _ = prefixed . map { _ in calls2 + = 1 } <nl> + expectEqual ( 0 , calls2 , " unexpected eagerness in \ ( type ( of : prefixed ) ) " ) <nl> + <nl> + % if Kind = = ' Bidirectional ' : <nl> + check $ { checkKind } ( expected . reversed ( ) , prefixed . reversed ( ) ) <nl> + % end <nl> + } <nl> + % end <nl> + <nl> + tests . test ( " LazyPrefixWhileSequence / AssociatedTypes " ) { <nl> + typealias Base = MinimalSequence < OpaqueValue < Int > > <nl> + typealias Subject = LazyPrefixWhileSequence < Base > <nl> + expectSequenceAssociatedTypes ( <nl> + sequenceType : Subject . self , <nl> + iteratorType : LazyPrefixWhileIterator < Base . Iterator > . self , <nl> + subSequenceType : AnySequence < OpaqueValue < Int > > . self ) <nl> + } <nl> + <nl> + tests . test ( " LazyPrefixWhileCollection / AssociatedTypes " ) { <nl> + typealias Base = MinimalCollection < OpaqueValue < Int > > <nl> + typealias Subject = LazyPrefixWhileCollection < Base > <nl> + expectCollectionAssociatedTypes ( <nl> + collectionType : Subject . self , <nl> + iteratorType : LazyPrefixWhileIterator < Base . Iterator > . self , <nl> + subSequenceType : Slice < Subject > . self , <nl> + indexType : LazyPrefixWhileIndex < Base > . self , <nl> + indexDistanceType : Base . IndexDistance . self , <nl> + indicesType : DefaultIndices < Subject > . self ) <nl> + } <nl> + <nl> + tests . test ( " LazyPrefixWhileBidirectionalCollection / AssociatedTypes " ) { <nl> + typealias Base = MinimalBidirectionalCollection < OpaqueValue < Int > > <nl> + typealias Subject = LazyPrefixWhileBidirectionalCollection < Base > <nl> + expectBidirectionalCollectionAssociatedTypes ( <nl> + collectionType : Subject . self , <nl> + iteratorType : LazyPrefixWhileIterator < Base . Iterator > . self , <nl> + / / FIXME ( ABI ) : SubSequence should be ` LazyFilterBidirectionalCollection < Base . Slice > ` . <nl> + subSequenceType : BidirectionalSlice < Subject > . self , <nl> + indexType : LazyPrefixWhileIndex < Base > . self , <nl> + indexDistanceType : Base . IndexDistance . self , <nl> + indicesType : DefaultBidirectionalIndices < Subject > . self ) <nl> + } <nl> + <nl> + / / = = = mmm LazyDropWhile mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> + <nl> + tests . test ( " LazyDropWhileIterator " ) { <nl> + let base = ( 1 . . . 10 ) . lazy . drop ( while : { $ 0 < 4 } ) <nl> + <nl> + var iter1 = base . makeIterator ( ) <nl> + expectEqual ( 4 , iter1 . next ( ) ) <nl> + expectEqual ( 5 , iter1 . next ( ) ) <nl> + expectEqual ( 6 , iter1 . next ( ) ) <nl> + expectEqual ( 7 , iter1 . next ( ) ) <nl> + } <nl> + <nl> + % for Kind in ' Sequence ' , ' Forward ' , ' Bidirectional ' : <nl> + % Self = ' Sequence ' if Kind = = ' Sequence ' else collectionForTraversal ( Kind ) <nl> + % checkKind = ' ForwardCollection ' if Kind = = ' Forward ' else Self <nl> + tests . test ( " LazyDropWhile $ { Self } " ) . forEach ( in : prefixDropWhileTests ) { <nl> + ( data , value , pivot ) in <nl> + <nl> + let base = Minimal $ { Self } ( elements : data ) <nl> + <nl> + var calls1 = 0 <nl> + let dropped = base . lazy . drop ( while : { calls1 + = 1 ; return $ 0 ! = value } ) <nl> + let expected = data . suffix ( from : pivot ) <nl> + expectEqual ( 0 , calls1 ) <nl> + check $ { checkKind } ( expected , dropped ) <nl> + <nl> + var calls2 = 0 <nl> + _ = dropped . map { _ in calls2 + = 1 } <nl> + expectEqual ( 0 , calls2 , " unexpected eagerness in \ ( type ( of : dropped ) ) " ) <nl> + <nl> + % if Kind = = ' Bidirectional ' : <nl> + check $ { checkKind } ( expected . reversed ( ) , dropped . reversed ( ) ) <nl> + % end <nl> + } <nl> + % end <nl> <nl> + tests . test ( " LazyDropWhileSequence / AssociatedTypes " ) { <nl> + typealias Base = MinimalSequence < OpaqueValue < Int > > <nl> + typealias Subject = LazyDropWhileSequence < Base > <nl> + expectSequenceAssociatedTypes ( <nl> + sequenceType : Subject . self , <nl> + iteratorType : LazyDropWhileIterator < Base . Iterator > . self , <nl> + subSequenceType : AnySequence < OpaqueValue < Int > > . self ) <nl> + } <nl> + <nl> + tests . test ( " LazyDropWhileCollection / AssociatedTypes " ) { <nl> + typealias Base = MinimalCollection < OpaqueValue < Int > > <nl> + typealias Subject = LazyDropWhileCollection < Base > <nl> + expectCollectionAssociatedTypes ( <nl> + collectionType : Subject . self , <nl> + iteratorType : LazyDropWhileIterator < Base . Iterator > . self , <nl> + subSequenceType : Slice < Subject > . self , <nl> + indexType : LazyDropWhileIndex < Base > . self , <nl> + indexDistanceType : Base . IndexDistance . self , <nl> + indicesType : DefaultIndices < Subject > . self ) <nl> + } <nl> + <nl> + tests . test ( " LazyDropWhileBidirectionalCollection / AssociatedTypes " ) { <nl> + typealias Base = MinimalBidirectionalCollection < OpaqueValue < Int > > <nl> + typealias Subject = LazyDropWhileBidirectionalCollection < Base > <nl> + expectBidirectionalCollectionAssociatedTypes ( <nl> + collectionType : Subject . self , <nl> + iteratorType : LazyDropWhileIterator < Base . Iterator > . self , <nl> + / / FIXME ( ABI ) : SubSequence should be ` LazyFilterBidirectionalCollection < Base . Slice > ` . <nl> + subSequenceType : BidirectionalSlice < Subject > . self , <nl> + indexType : LazyDropWhileIndex < Base > . self , <nl> + indexDistanceType : Base . IndexDistance . self , <nl> + indicesType : DefaultBidirectionalIndices < Subject > . self ) <nl> + } <nl> + <nl> + runAllTests ( ) <nl> mmm a / validation - test / stdlib / SequenceType . swift . gyb <nl> ppp b / validation - test / stdlib / SequenceType . swift . gyb <nl> SequenceTypeTests . test ( " dropLast / dispatch " ) { <nl> expectCustomizable ( tester , tester . log . dropLast ) <nl> } <nl> <nl> + / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> + / / drop ( while : ) <nl> + / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> + <nl> + SequenceTypeTests . test ( " drop ( while : ) / dispatch " ) { <nl> + var tester = SequenceLog . dispatchTester ( [ OpaqueValue ( 1 ) ] ) <nl> + tester . drop { _ in return false } <nl> + expectCustomizable ( tester , tester . log . dropWhile ) <nl> + } <nl> + <nl> / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> / / prefix ( ) <nl> / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> SequenceTypeTests . test ( " prefix / dispatch " ) { <nl> expectCustomizable ( tester , tester . log . prefixMaxLength ) <nl> } <nl> <nl> + / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> + / / prefix ( while : ) <nl> + / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> + <nl> + SequenceTypeTests . test ( " prefix ( while : ) / dispatch " ) { <nl> + var tester = SequenceLog . dispatchTester ( [ OpaqueValue ( 1 ) ] ) <nl> + tester . prefix { _ in return false } <nl> + expectCustomizable ( tester , tester . log . prefixWhile ) <nl> + } <nl> + <nl> / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> / / suffix ( ) <nl> / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl>
Merge pull request from russbishop / se0045
apple/swift
e6c313bce3ff977789b68996fd43a5b54cf25e61
2016-08-16T23:26:21Z
mmm a / lib / ClangImporter / SwiftLookupTable . cpp <nl> ppp b / lib / ClangImporter / SwiftLookupTable . cpp <nl> SwiftLookupTableReader : : create ( clang : : ModuleFileExtension * extension , <nl> / / Look for the base name - > entities table record . <nl> SmallVector < uint64_t , 64 > scratch ; <nl> auto cursor = stream ; <nl> - auto next = cursor . advance ( ) ; <nl> + llvm : : Expected < llvm : : BitstreamEntry > maybeNext = cursor . advance ( ) ; <nl> + if ( ! maybeNext ) { <nl> + / / FIXME this drops the error on the floor . <nl> + consumeError ( maybeNext . takeError ( ) ) ; <nl> + return nullptr ; <nl> + } <nl> + llvm : : BitstreamEntry next = maybeNext . get ( ) ; <nl> std : : unique_ptr < SerializedBaseNameToEntitiesTable > serializedTable ; <nl> std : : unique_ptr < SerializedGlobalsAsMembersTable > globalsAsMembersTable ; <nl> ArrayRef < clang : : serialization : : DeclID > categories ; <nl> SwiftLookupTableReader : : create ( clang : : ModuleFileExtension * extension , <nl> / / API notes format . <nl> if ( cursor . SkipBlock ( ) ) <nl> return nullptr ; <nl> - <nl> - next = cursor . advance ( ) ; <nl> + <nl> + maybeNext = cursor . advance ( ) ; <nl> + if ( ! maybeNext ) { <nl> + / / FIXME this drops the error on the floor . <nl> + consumeError ( maybeNext . takeError ( ) ) ; <nl> + return nullptr ; <nl> + } <nl> + next = maybeNext . get ( ) ; <nl> continue ; <nl> } <nl> <nl> scratch . clear ( ) ; <nl> StringRef blobData ; <nl> - unsigned kind = cursor . readRecord ( next . ID , scratch , & blobData ) ; <nl> + llvm : : Expected < unsigned > maybeKind = <nl> + cursor . readRecord ( next . ID , scratch , & blobData ) ; <nl> + if ( ! maybeKind ) { <nl> + / / FIXME this drops the error on the floor . <nl> + consumeError ( maybeNext . takeError ( ) ) ; <nl> + return nullptr ; <nl> + } <nl> + unsigned kind = maybeKind . get ( ) ; <nl> switch ( kind ) { <nl> case BASE_NAME_TO_ENTITIES_RECORD_ID : { <nl> / / Already saw base name - > entities table . <nl> SwiftLookupTableReader : : create ( clang : : ModuleFileExtension * extension , <nl> break ; <nl> } <nl> <nl> - next = cursor . advance ( ) ; <nl> + maybeNext = cursor . advance ( ) ; <nl> + if ( ! maybeNext ) { <nl> + / / FIXME this drops the error on the floor . <nl> + consumeError ( maybeNext . takeError ( ) ) ; <nl> + return nullptr ; <nl> + } <nl> + next = maybeNext . get ( ) ; <nl> } <nl> <nl> if ( ! serializedTable ) return nullptr ; <nl> mmm a / lib / Serialization / BCReadingExtras . h <nl> ppp b / lib / Serialization / BCReadingExtras . h <nl> class BCOffsetRAII { <nl> <nl> ~ BCOffsetRAII ( ) { <nl> if ( Cursor ) <nl> - Cursor - > JumpToBit ( Offset ) ; <nl> + cantFail ( Cursor - > JumpToBit ( Offset ) , <nl> + " BCOffsetRAII must be able to go back " ) ; <nl> } <nl> } ; <nl> <nl> mmm a / lib / Serialization / Deserialization . cpp <nl> ppp b / lib / Serialization / Deserialization . cpp <nl> void ExtensionError : : anchor ( ) { } <nl> <nl> / / / Skips a single record in the bitstream . <nl> / / / <nl> - / / / Returns true if the next entry is a record of type \ p recordKind . <nl> / / / Destroys the stream position if the next entry is not a record . <nl> static void skipRecord ( llvm : : BitstreamCursor & cursor , unsigned recordKind ) { <nl> - auto next = cursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + auto next = llvm : : cantFail < llvm : : BitstreamEntry > ( <nl> + cursor . advance ( AF_DontPopBlockAtEnd ) ) ; <nl> assert ( next . Kind = = llvm : : BitstreamEntry : : Record ) ; <nl> <nl> - unsigned kind = cursor . skipRecord ( next . ID ) ; <nl> + unsigned kind = llvm : : cantFail < unsigned > ( cursor . skipRecord ( next . ID ) ) ; <nl> assert ( kind = = recordKind ) ; <nl> ( void ) kind ; <nl> } <nl> ParameterList * ModuleFile : : readParameterList ( ) { <nl> using namespace decls_block ; <nl> <nl> SmallVector < uint64_t , 8 > scratch ; <nl> - auto entry = DeclTypeCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> - unsigned recordID = DeclTypeCursor . readRecord ( entry . ID , scratch ) ; <nl> + llvm : : BitstreamEntry entry = <nl> + fatalIfUnexpected ( DeclTypeCursor . advance ( AF_DontPopBlockAtEnd ) ) ; <nl> + unsigned recordID = <nl> + fatalIfUnexpected ( DeclTypeCursor . readRecord ( entry . ID , scratch ) ) ; <nl> assert ( recordID = = PARAMETERLIST ) ; <nl> ( void ) recordID ; <nl> <nl> Expected < Pattern * > ModuleFile : : readPattern ( DeclContext * owningDC ) { <nl> SmallVector < uint64_t , 8 > scratch ; <nl> <nl> BCOffsetRAII restoreOffset ( DeclTypeCursor ) ; <nl> - auto next = DeclTypeCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + llvm : : BitstreamEntry next = <nl> + fatalIfUnexpected ( DeclTypeCursor . advance ( AF_DontPopBlockAtEnd ) ) ; <nl> if ( next . Kind ! = llvm : : BitstreamEntry : : Record ) <nl> fatal ( ) ; <nl> <nl> Expected < Pattern * > ModuleFile : : readPattern ( DeclContext * owningDC ) { <nl> pattern - > setType ( type ) ; <nl> } ; <nl> <nl> - unsigned kind = DeclTypeCursor . readRecord ( next . ID , scratch ) ; <nl> + unsigned kind = <nl> + fatalIfUnexpected ( DeclTypeCursor . readRecord ( next . ID , scratch ) ) ; <nl> switch ( kind ) { <nl> case decls_block : : PAREN_PATTERN : { <nl> bool isImplicit ; <nl> Expected < Pattern * > ModuleFile : : readPattern ( DeclContext * owningDC ) { <nl> SmallVector < TuplePatternElt , 8 > elements ; <nl> for ( ; count > 0 ; - - count ) { <nl> scratch . clear ( ) ; <nl> - next = DeclTypeCursor . advance ( ) ; <nl> + next = fatalIfUnexpected ( DeclTypeCursor . advance ( ) ) ; <nl> assert ( next . Kind = = llvm : : BitstreamEntry : : Record ) ; <nl> <nl> - kind = DeclTypeCursor . readRecord ( next . ID , scratch ) ; <nl> + kind = fatalIfUnexpected ( DeclTypeCursor . readRecord ( next . ID , scratch ) ) ; <nl> assert ( kind = = decls_block : : TUPLE_PATTERN_ELT ) ; <nl> <nl> / / FIXME : Add something for this record or remove it . <nl> SILLayout * ModuleFile : : readSILLayout ( llvm : : BitstreamCursor & Cursor ) { <nl> <nl> SmallVector < uint64_t , 16 > scratch ; <nl> <nl> - auto next = Cursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + llvm : : BitstreamEntry next = <nl> + fatalIfUnexpected ( Cursor . advance ( AF_DontPopBlockAtEnd ) ) ; <nl> assert ( next . Kind = = llvm : : BitstreamEntry : : Record ) ; <nl> <nl> - unsigned kind = Cursor . readRecord ( next . ID , scratch ) ; <nl> + unsigned kind = fatalIfUnexpected ( Cursor . readRecord ( next . ID , scratch ) ) ; <nl> switch ( kind ) { <nl> case decls_block : : SIL_LAYOUT : { <nl> GenericSignatureID rawGenericSig ; <nl> ModuleFile : : readConformanceChecked ( llvm : : BitstreamCursor & Cursor , <nl> <nl> SmallVector < uint64_t , 16 > scratch ; <nl> <nl> - auto next = Cursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + llvm : : BitstreamEntry next = <nl> + fatalIfUnexpected ( Cursor . advance ( AF_DontPopBlockAtEnd ) ) ; <nl> assert ( next . Kind = = llvm : : BitstreamEntry : : Record ) ; <nl> <nl> if ( getContext ( ) . Stats ) <nl> getContext ( ) . Stats - > getFrontendCounters ( ) . NumConformancesDeserialized + + ; <nl> <nl> - unsigned kind = Cursor . readRecord ( next . ID , scratch ) ; <nl> + unsigned kind = fatalIfUnexpected ( Cursor . readRecord ( next . ID , scratch ) ) ; <nl> switch ( kind ) { <nl> case INVALID_PROTOCOL_CONFORMANCE : { <nl> return ProtocolConformanceRef : : forInvalid ( ) ; <nl> NormalProtocolConformance * ModuleFile : : readNormalConformance ( <nl> <nl> / / Find the conformance record . <nl> BCOffsetRAII restoreOffset ( DeclTypeCursor ) ; <nl> - DeclTypeCursor . JumpToBit ( conformanceEntry ) ; <nl> - auto entry = DeclTypeCursor . advance ( ) ; <nl> + fatalIfNotSuccess ( DeclTypeCursor . JumpToBit ( conformanceEntry ) ) ; <nl> + llvm : : BitstreamEntry entry = fatalIfUnexpected ( DeclTypeCursor . advance ( ) ) ; <nl> if ( entry . Kind ! = llvm : : BitstreamEntry : : Record ) <nl> fatal ( ) ; <nl> <nl> NormalProtocolConformance * ModuleFile : : readNormalConformance ( <nl> ArrayRef < uint64_t > rawIDs ; <nl> SmallVector < uint64_t , 16 > scratch ; <nl> <nl> - unsigned kind = DeclTypeCursor . readRecord ( entry . ID , scratch ) ; <nl> + unsigned kind = <nl> + fatalIfUnexpected ( DeclTypeCursor . readRecord ( entry . ID , scratch ) ) ; <nl> if ( kind ! = NORMAL_PROTOCOL_CONFORMANCE ) <nl> fatal ( ) ; <nl> + <nl> NormalProtocolConformanceLayout : : readRecord ( scratch , protoID , <nl> contextID , typeCount , <nl> valueCount , conformanceCount , <nl> GenericParamList * ModuleFile : : maybeReadGenericParams ( DeclContext * DC ) { <nl> SmallVector < uint64_t , 8 > scratch ; <nl> StringRef blobData ; <nl> <nl> - auto next = DeclTypeCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + llvm : : BitstreamEntry next = <nl> + fatalIfUnexpected ( DeclTypeCursor . advance ( AF_DontPopBlockAtEnd ) ) ; <nl> if ( next . Kind ! = llvm : : BitstreamEntry : : Record ) <nl> return nullptr ; <nl> <nl> - unsigned kind = DeclTypeCursor . readRecord ( next . ID , scratch , & blobData ) ; <nl> + unsigned kind = <nl> + fatalIfUnexpected ( DeclTypeCursor . readRecord ( next . ID , scratch , & blobData ) ) ; <nl> if ( kind ! = GENERIC_PARAM_LIST ) <nl> return nullptr ; <nl> lastRecordOffset . reset ( ) ; <nl> llvm : : Error ModuleFile : : readGenericRequirementsChecked ( <nl> lastRecordOffset . reset ( ) ; <nl> bool shouldContinue = true ; <nl> <nl> - auto entry = Cursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + llvm : : BitstreamEntry entry = <nl> + fatalIfUnexpected ( Cursor . advance ( AF_DontPopBlockAtEnd ) ) ; <nl> if ( entry . Kind ! = llvm : : BitstreamEntry : : Record ) <nl> break ; <nl> <nl> scratch . clear ( ) ; <nl> - unsigned recordID = Cursor . readRecord ( entry . ID , scratch , & blobData ) ; <nl> + unsigned recordID = fatalIfUnexpected ( <nl> + Cursor . readRecord ( entry . ID , scratch , & blobData ) ) ; <nl> switch ( recordID ) { <nl> case GENERIC_REQUIREMENT : { <nl> uint8_t rawKind ; <nl> llvm : : Error ModuleFile : : readGenericRequirementsChecked ( <nl> } <nl> <nl> / / / Advances past any records that might be part of a requirement signature . <nl> - static void skipGenericRequirements ( llvm : : BitstreamCursor & Cursor ) { <nl> + static llvm : : Error skipGenericRequirements ( llvm : : BitstreamCursor & Cursor ) { <nl> using namespace decls_block ; <nl> <nl> BCOffsetRAII lastRecordOffset ( Cursor ) ; <nl> <nl> while ( true ) { <nl> - auto entry = Cursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + Expected < llvm : : BitstreamEntry > maybeEntry = <nl> + Cursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + if ( ! maybeEntry ) <nl> + return maybeEntry . takeError ( ) ; <nl> + llvm : : BitstreamEntry entry = maybeEntry . get ( ) ; <nl> if ( entry . Kind ! = llvm : : BitstreamEntry : : Record ) <nl> break ; <nl> <nl> - unsigned recordID = Cursor . skipRecord ( entry . ID ) ; <nl> - switch ( recordID ) { <nl> + Expected < unsigned > maybeRecordID = Cursor . skipRecord ( entry . ID ) ; <nl> + if ( ! maybeRecordID ) <nl> + return maybeRecordID . takeError ( ) ; <nl> + switch ( maybeRecordID . get ( ) ) { <nl> case GENERIC_REQUIREMENT : <nl> case LAYOUT_REQUIREMENT : <nl> break ; <nl> <nl> default : <nl> / / This record is not a generic requirement . <nl> - return ; <nl> + return llvm : : Error : : success ( ) ; <nl> } <nl> <nl> lastRecordOffset . reset ( ) ; <nl> } <nl> + return llvm : : Error : : success ( ) ; <nl> } <nl> <nl> GenericSignature ModuleFile : : getGenericSignature ( <nl> ModuleFile : : getGenericSignatureChecked ( serialization : : GenericSignatureID ID ) { <nl> <nl> / / Read the generic signature . <nl> BCOffsetRAII restoreOffset ( DeclTypeCursor ) ; <nl> - DeclTypeCursor . JumpToBit ( sigOffset ) ; <nl> + fatalIfNotSuccess ( DeclTypeCursor . JumpToBit ( sigOffset ) ) ; <nl> <nl> / / Read the parameter types . <nl> SmallVector < GenericTypeParamType * , 4 > paramTypes ; <nl> StringRef blobData ; <nl> SmallVector < uint64_t , 8 > scratch ; <nl> <nl> - auto entry = DeclTypeCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + llvm : : BitstreamEntry entry = <nl> + fatalIfUnexpected ( DeclTypeCursor . advance ( AF_DontPopBlockAtEnd ) ) ; <nl> if ( entry . Kind ! = llvm : : BitstreamEntry : : Record ) <nl> fatal ( ) ; <nl> <nl> - unsigned recordID = DeclTypeCursor . readRecord ( entry . ID , scratch , & blobData ) ; <nl> + unsigned recordID = fatalIfUnexpected ( <nl> + DeclTypeCursor . readRecord ( entry . ID , scratch , & blobData ) ) ; <nl> switch ( recordID ) { <nl> case GENERIC_SIGNATURE : { <nl> ArrayRef < uint64_t > rawParamIDs ; <nl> ModuleFile : : getGenericSignatureChecked ( serialization : : GenericSignatureID ID ) { <nl> } <nl> break ; <nl> } <nl> + <nl> case SIL_GENERIC_SIGNATURE : { <nl> ArrayRef < uint64_t > rawParamIDs ; <nl> SILGenericSignatureLayout : : readRecord ( scratch , rawParamIDs ) ; <nl> ModuleFile : : getSubstitutionMapChecked ( serialization : : SubstitutionMapID id ) { <nl> <nl> / / Read the substitution map . <nl> BCOffsetRAII restoreOffset ( DeclTypeCursor ) ; <nl> - DeclTypeCursor . JumpToBit ( substitutionsOrOffset ) ; <nl> + fatalIfNotSuccess ( DeclTypeCursor . JumpToBit ( substitutionsOrOffset ) ) ; <nl> <nl> / / Read the substitution map . <nl> - auto entry = DeclTypeCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + llvm : : BitstreamEntry entry = <nl> + fatalIfUnexpected ( DeclTypeCursor . advance ( AF_DontPopBlockAtEnd ) ) ; <nl> if ( entry . Kind ! = llvm : : BitstreamEntry : : Record ) <nl> fatal ( ) ; <nl> <nl> StringRef blobData ; <nl> SmallVector < uint64_t , 8 > scratch ; <nl> - unsigned recordID = DeclTypeCursor . readRecord ( entry . ID , scratch , & blobData ) ; <nl> + unsigned recordID = fatalIfUnexpected ( <nl> + DeclTypeCursor . readRecord ( entry . ID , scratch , & blobData ) ) ; <nl> if ( recordID ! = SUBSTITUTION_MAP ) <nl> fatal ( ) ; <nl> <nl> ModuleFile : : getSubstitutionMapChecked ( serialization : : SubstitutionMapID id ) { <nl> bool ModuleFile : : readDefaultWitnessTable ( ProtocolDecl * proto ) { <nl> using namespace decls_block ; <nl> <nl> - auto entry = DeclTypeCursor . advance ( ) ; <nl> + llvm : : BitstreamEntry entry = <nl> + fatalIfUnexpected ( DeclTypeCursor . advance ( AF_DontPopBlockAtEnd ) ) ; <nl> if ( entry . Kind ! = llvm : : BitstreamEntry : : Record ) <nl> return true ; <nl> <nl> SmallVector < uint64_t , 16 > witnessIDBuffer ; <nl> <nl> - unsigned kind = DeclTypeCursor . readRecord ( entry . ID , witnessIDBuffer ) ; <nl> + unsigned kind = <nl> + fatalIfUnexpected ( DeclTypeCursor . readRecord ( entry . ID , witnessIDBuffer ) ) ; <nl> assert ( kind = = DEFAULT_WITNESS_TABLE ) ; <nl> ( void ) kind ; <nl> <nl> ModuleFile : : resolveCrossReference ( ModuleID MID , uint32_t pathLen ) { <nl> assert ( baseModule & & " missing dependency " ) ; <nl> PrettyXRefTrace pathTrace ( * baseModule ) ; <nl> <nl> - auto entry = DeclTypeCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + llvm : : BitstreamEntry entry = <nl> + fatalIfUnexpected ( DeclTypeCursor . advance ( AF_DontPopBlockAtEnd ) ) ; <nl> if ( entry . Kind ! = llvm : : BitstreamEntry : : Record ) <nl> fatal ( ) ; <nl> <nl> ModuleFile : : resolveCrossReference ( ModuleID MID , uint32_t pathLen ) { <nl> / / In particular , operator path pieces represent actual operators here , but <nl> / / filters on operator functions when they appear later on . <nl> scratch . clear ( ) ; <nl> - unsigned recordID = DeclTypeCursor . readRecord ( entry . ID , scratch , <nl> - & blobData ) ; <nl> + unsigned recordID = fatalIfUnexpected ( <nl> + DeclTypeCursor . readRecord ( entry . ID , scratch , & blobData ) ) ; <nl> switch ( recordID ) { <nl> case XREF_TYPE_PATH_PIECE : <nl> case XREF_VALUE_PATH_PIECE : { <nl> ModuleFile : : resolveCrossReference ( ModuleID MID , uint32_t pathLen ) { <nl> auto maybeType = getTypeChecked ( TID ) ; <nl> if ( ! maybeType ) { <nl> / / FIXME : Don ' t throw away the inner error ' s information . <nl> - llvm : : consumeError ( maybeType . takeError ( ) ) ; <nl> + consumeError ( maybeType . takeError ( ) ) ; <nl> return llvm : : make_error < XRefError > ( " couldn ' t decode type " , <nl> pathTrace , name ) ; <nl> } <nl> ModuleFile : : resolveCrossReference ( ModuleID MID , uint32_t pathLen ) { <nl> auto getXRefDeclNameForError = [ & ] ( ) - > DeclName { <nl> DeclName result = pathTrace . getLastName ( ) ; <nl> while ( - - pathLen ) { <nl> - auto entry = DeclTypeCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + llvm : : BitstreamEntry entry = <nl> + fatalIfUnexpected ( DeclTypeCursor . advance ( AF_DontPopBlockAtEnd ) ) ; <nl> if ( entry . Kind ! = llvm : : BitstreamEntry : : Record ) <nl> return Identifier ( ) ; <nl> <nl> scratch . clear ( ) ; <nl> - unsigned recordID = DeclTypeCursor . readRecord ( entry . ID , scratch , <nl> - & blobData ) ; <nl> + unsigned recordID = fatalIfUnexpected ( <nl> + DeclTypeCursor . readRecord ( entry . ID , scratch , & blobData ) ) ; <nl> switch ( recordID ) { <nl> case XREF_TYPE_PATH_PIECE : { <nl> IdentifierID IID ; <nl> ModuleFile : : resolveCrossReference ( ModuleID MID , uint32_t pathLen ) { <nl> <nl> / / For remaining path pieces , filter or drill down into the results we have . <nl> while ( - - pathLen ) { <nl> - auto entry = DeclTypeCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + llvm : : BitstreamEntry entry = <nl> + fatalIfUnexpected ( DeclTypeCursor . advance ( AF_DontPopBlockAtEnd ) ) ; <nl> if ( entry . Kind ! = llvm : : BitstreamEntry : : Record ) <nl> fatal ( ) ; <nl> <nl> scratch . clear ( ) ; <nl> - unsigned recordID = DeclTypeCursor . readRecord ( entry . ID , scratch , <nl> - & blobData ) ; <nl> + unsigned recordID = fatalIfUnexpected ( <nl> + DeclTypeCursor . readRecord ( entry . ID , scratch , & blobData ) ) ; <nl> switch ( recordID ) { <nl> case XREF_TYPE_PATH_PIECE : { <nl> if ( values . size ( ) = = 1 & & isa < NominalTypeDecl > ( values . front ( ) ) ) { <nl> ModuleFile : : resolveCrossReference ( ModuleID MID , uint32_t pathLen ) { <nl> auto maybeType = getTypeChecked ( TID ) ; <nl> if ( ! maybeType ) { <nl> / / FIXME : Don ' t throw away the inner error ' s information . <nl> - llvm : : consumeError ( maybeType . takeError ( ) ) ; <nl> + consumeError ( maybeType . takeError ( ) ) ; <nl> return llvm : : make_error < XRefError > ( " couldn ' t decode type " , <nl> pathTrace , memberName ) ; <nl> } <nl> DeclContext * ModuleFile : : getLocalDeclContext ( LocalDeclContextID DCID ) { <nl> return declContextOrOffset ; <nl> <nl> BCOffsetRAII restoreOffset ( DeclTypeCursor ) ; <nl> - DeclTypeCursor . JumpToBit ( declContextOrOffset ) ; <nl> - auto entry = DeclTypeCursor . advance ( ) ; <nl> + fatalIfNotSuccess ( DeclTypeCursor . JumpToBit ( declContextOrOffset ) ) ; <nl> + llvm : : BitstreamEntry entry = fatalIfUnexpected ( DeclTypeCursor . advance ( ) ) ; <nl> <nl> if ( entry . Kind ! = llvm : : BitstreamEntry : : Record ) <nl> fatal ( ) ; <nl> DeclContext * ModuleFile : : getLocalDeclContext ( LocalDeclContextID DCID ) { <nl> SmallVector < uint64_t , 64 > scratch ; <nl> StringRef blobData ; <nl> <nl> - unsigned recordID = DeclTypeCursor . readRecord ( entry . ID , scratch , <nl> - & blobData ) ; <nl> + unsigned recordID = fatalIfUnexpected ( <nl> + DeclTypeCursor . readRecord ( entry . ID , scratch , & blobData ) ) ; <nl> switch ( recordID ) { <nl> case decls_block : : ABSTRACT_CLOSURE_EXPR_CONTEXT : { <nl> TypeID closureTypeID ; <nl> class swift : : DeclDeserializer { <nl> <nl> proto - > setLazyRequirementSignature ( & MF , <nl> MF . DeclTypeCursor . GetCurrentBitNo ( ) ) ; <nl> - skipGenericRequirements ( MF . DeclTypeCursor ) ; <nl> + if ( llvm : : Error Err = skipGenericRequirements ( MF . DeclTypeCursor ) ) <nl> + MF . fatal ( std : : move ( Err ) ) ; <nl> <nl> proto - > setMemberLoader ( & MF , MF . DeclTypeCursor . GetCurrentBitNo ( ) ) ; <nl> <nl> ModuleFile : : getDeclChecked ( DeclID DID ) { <nl> if ( ! declOrOffset . isComplete ( ) ) { <nl> + + NumDeclsLoaded ; <nl> BCOffsetRAII restoreOffset ( DeclTypeCursor ) ; <nl> - DeclTypeCursor . JumpToBit ( declOrOffset ) ; <nl> + fatalIfNotSuccess ( DeclTypeCursor . JumpToBit ( declOrOffset ) ) ; <nl> <nl> Expected < Decl * > deserialized = <nl> DeclDeserializer ( * this , declOrOffset ) . getDeclCheckedImpl ( ) ; <nl> llvm : : Error DeclDeserializer : : deserializeDeclAttributes ( ) { <nl> StringRef blobData ; <nl> while ( true ) { <nl> BCOffsetRAII restoreOffset ( MF . DeclTypeCursor ) ; <nl> - auto entry = MF . DeclTypeCursor . advance ( ) ; <nl> + llvm : : BitstreamEntry entry = <nl> + MF . fatalIfUnexpected ( MF . DeclTypeCursor . advance ( ) ) ; <nl> if ( entry . Kind ! = llvm : : BitstreamEntry : : Record ) { <nl> / / We don ' t know how to serialize decls represented by sub - blocks . <nl> MF . fatal ( ) ; <nl> } <nl> <nl> - unsigned recordID = MF . DeclTypeCursor . readRecord ( entry . ID , scratch , <nl> - & blobData ) ; <nl> + unsigned recordID = MF . fatalIfUnexpected ( <nl> + MF . DeclTypeCursor . readRecord ( entry . ID , scratch , & blobData ) ) ; <nl> <nl> if ( isDeclAttrRecord ( recordID ) ) { <nl> DeclAttribute * Attr = nullptr ; <nl> DeclDeserializer : : getDeclCheckedImpl ( ) { <nl> if ( declOrOffset . isComplete ( ) ) <nl> return declOrOffset ; <nl> <nl> - auto entry = MF . DeclTypeCursor . advance ( ) ; <nl> + llvm : : BitstreamEntry entry = <nl> + MF . fatalIfUnexpected ( MF . DeclTypeCursor . advance ( ) ) ; <nl> if ( entry . Kind ! = llvm : : BitstreamEntry : : Record ) { <nl> / / We don ' t know how to serialize decls represented by sub - blocks . <nl> MF . fatal ( ) ; <nl> DeclDeserializer : : getDeclCheckedImpl ( ) { <nl> <nl> SmallVector < uint64_t , 64 > scratch ; <nl> StringRef blobData ; <nl> - unsigned recordID = MF . DeclTypeCursor . readRecord ( entry . ID , scratch , <nl> - & blobData ) ; <nl> + unsigned recordID = MF . fatalIfUnexpected ( <nl> + MF . DeclTypeCursor . readRecord ( entry . ID , scratch , & blobData ) ) ; <nl> <nl> PrettyDeclDeserialization stackTraceEntry ( <nl> & MF , declOrOffset , static_cast < decls_block : : RecordKind > ( recordID ) ) ; <nl> class swift : : TypeDeserializer { <nl> / / The tuple record itself is empty . Read all trailing elements . <nl> SmallVector < TupleTypeElt , 8 > elements ; <nl> while ( true ) { <nl> - auto entry = MF . DeclTypeCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + llvm : : BitstreamEntry entry = <nl> + MF . fatalIfUnexpected ( MF . DeclTypeCursor . advance ( AF_DontPopBlockAtEnd ) ) ; <nl> if ( entry . Kind ! = llvm : : BitstreamEntry : : Record ) <nl> break ; <nl> <nl> scratch . clear ( ) ; <nl> - unsigned recordID = MF . DeclTypeCursor . readRecord ( entry . ID , scratch , <nl> - & blobData ) ; <nl> + unsigned recordID = MF . fatalIfUnexpected ( <nl> + MF . DeclTypeCursor . readRecord ( entry . ID , scratch , & blobData ) ) ; <nl> if ( recordID ! = decls_block : : TUPLE_TYPE_ELT ) <nl> break ; <nl> <nl> class swift : : TypeDeserializer { <nl> <nl> SmallVector < AnyFunctionType : : Param , 8 > params ; <nl> while ( true ) { <nl> - auto entry = MF . DeclTypeCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + llvm : : BitstreamEntry entry = <nl> + MF . fatalIfUnexpected ( MF . DeclTypeCursor . advance ( AF_DontPopBlockAtEnd ) ) ; <nl> if ( entry . Kind ! = llvm : : BitstreamEntry : : Record ) <nl> break ; <nl> <nl> scratch . clear ( ) ; <nl> - unsigned recordID = MF . DeclTypeCursor . readRecord ( entry . ID , scratch , <nl> - & blobData ) ; <nl> + unsigned recordID = MF . fatalIfUnexpected ( <nl> + MF . DeclTypeCursor . readRecord ( entry . ID , scratch , & blobData ) ) ; <nl> if ( recordID ! = decls_block : : FUNCTION_PARAM ) <nl> break ; <nl> <nl> class swift : : TypeDeserializer { <nl> } <nl> <nl> BCOffsetRAII saveOffset ( MF . DeclTypeCursor ) ; <nl> - MF . DeclTypeCursor . JumpToBit ( layoutOrOffset ) ; <nl> + MF . fatalIfNotSuccess ( MF . DeclTypeCursor . JumpToBit ( layoutOrOffset ) ) ; <nl> auto layout = MF . readSILLayout ( MF . DeclTypeCursor ) ; <nl> if ( ! layout ) <nl> MF . fatal ( ) ; <nl> Expected < Type > ModuleFile : : getTypeChecked ( TypeID TID ) { <nl> return typeOrOffset ; <nl> <nl> BCOffsetRAII restoreOffset ( DeclTypeCursor ) ; <nl> - DeclTypeCursor . JumpToBit ( typeOrOffset ) ; <nl> + fatalIfNotSuccess ( DeclTypeCursor . JumpToBit ( typeOrOffset ) ) ; <nl> <nl> auto result = TypeDeserializer ( * this ) . getTypeCheckedImpl ( ) ; <nl> if ( ! result ) <nl> Expected < Type > TypeDeserializer : : getTypeCheckedImpl ( ) { <nl> if ( auto s = ctx . Stats ) <nl> s - > getFrontendCounters ( ) . NumTypesDeserialized + + ; <nl> <nl> - auto entry = MF . DeclTypeCursor . advance ( ) ; <nl> + llvm : : BitstreamEntry entry = <nl> + MF . fatalIfUnexpected ( MF . DeclTypeCursor . advance ( ) ) ; <nl> <nl> if ( entry . Kind ! = llvm : : BitstreamEntry : : Record ) { <nl> / / We don ' t know how to serialize types represented by sub - blocks . <nl> Expected < Type > TypeDeserializer : : getTypeCheckedImpl ( ) { <nl> <nl> SmallVector < uint64_t , 64 > scratch ; <nl> StringRef blobData ; <nl> - unsigned recordID = MF . DeclTypeCursor . readRecord ( entry . ID , scratch , <nl> - & blobData ) ; <nl> + unsigned recordID = MF . fatalIfUnexpected ( <nl> + MF . DeclTypeCursor . readRecord ( entry . ID , scratch , & blobData ) ) ; <nl> <nl> switch ( recordID ) { <nl> # define CASE ( RECORD_NAME ) \ <nl> void ModuleFile : : loadAllMembers ( Decl * container , uint64_t contextData ) { <nl> IDC = cast < ExtensionDecl > ( container ) ; <nl> <nl> BCOffsetRAII restoreOffset ( DeclTypeCursor ) ; <nl> - DeclTypeCursor . JumpToBit ( contextData ) ; <nl> - auto entry = DeclTypeCursor . advance ( ) ; <nl> + fatalIfNotSuccess ( DeclTypeCursor . JumpToBit ( contextData ) ) ; <nl> + llvm : : BitstreamEntry entry = fatalIfUnexpected ( DeclTypeCursor . advance ( ) ) ; <nl> if ( entry . Kind ! = llvm : : BitstreamEntry : : Record ) <nl> fatal ( ) ; <nl> <nl> SmallVector < uint64_t , 16 > memberIDBuffer ; <nl> <nl> - unsigned kind = DeclTypeCursor . readRecord ( entry . ID , memberIDBuffer ) ; <nl> + unsigned kind = <nl> + fatalIfUnexpected ( DeclTypeCursor . readRecord ( entry . ID , memberIDBuffer ) ) ; <nl> assert ( kind = = decls_block : : MEMBERS ) ; <nl> ( void ) kind ; <nl> <nl> ModuleFile : : loadAllConformances ( const Decl * D , uint64_t contextData , <nl> = decodeLazyConformanceContextData ( contextData ) ; <nl> <nl> BCOffsetRAII restoreOffset ( DeclTypeCursor ) ; <nl> - DeclTypeCursor . JumpToBit ( bitPosition ) ; <nl> + fatalIfNotSuccess ( DeclTypeCursor . JumpToBit ( bitPosition ) ) ; <nl> <nl> while ( numConformances - - ) { <nl> auto conf = readConformance ( DeclTypeCursor ) ; <nl> void ModuleFile : : finishNormalConformance ( NormalProtocolConformance * conformance , <nl> <nl> / / Find the conformance record . <nl> BCOffsetRAII restoreOffset ( DeclTypeCursor ) ; <nl> - DeclTypeCursor . JumpToBit ( contextData ) ; <nl> - auto entry = DeclTypeCursor . advance ( ) ; <nl> + fatalIfNotSuccess ( DeclTypeCursor . JumpToBit ( contextData ) ) ; <nl> + llvm : : BitstreamEntry entry = fatalIfUnexpected ( DeclTypeCursor . advance ( ) ) ; <nl> assert ( entry . Kind = = llvm : : BitstreamEntry : : Record & & <nl> " registered lazy loader incorrectly " ) ; <nl> <nl> void ModuleFile : : finishNormalConformance ( NormalProtocolConformance * conformance , <nl> ArrayRef < uint64_t > rawIDs ; <nl> SmallVector < uint64_t , 16 > scratch ; <nl> <nl> - unsigned kind = DeclTypeCursor . readRecord ( entry . ID , scratch ) ; <nl> + unsigned kind = <nl> + fatalIfUnexpected ( DeclTypeCursor . readRecord ( entry . ID , scratch ) ) ; <nl> ( void ) kind ; <nl> assert ( kind = = NORMAL_PROTOCOL_CONFORMANCE & & <nl> " registered lazy loader incorrectly " ) ; <nl> void ModuleFile : : loadRequirementSignature ( const ProtocolDecl * decl , <nl> uint64_t contextData , <nl> SmallVectorImpl < Requirement > & reqs ) { <nl> BCOffsetRAII restoreOffset ( DeclTypeCursor ) ; <nl> - DeclTypeCursor . JumpToBit ( contextData ) ; <nl> + fatalIfNotSuccess ( DeclTypeCursor . JumpToBit ( contextData ) ) ; <nl> readGenericRequirements ( reqs , DeclTypeCursor ) ; <nl> } <nl> <nl> Optional < StringRef > ModuleFile : : maybeReadInlinableBodyText ( ) { <nl> BCOffsetRAII restoreOffset ( DeclTypeCursor ) ; <nl> StringRef blobData ; <nl> <nl> - auto next = DeclTypeCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + llvm : : BitstreamEntry next = <nl> + fatalIfUnexpected ( DeclTypeCursor . advance ( AF_DontPopBlockAtEnd ) ) ; <nl> if ( next . Kind ! = llvm : : BitstreamEntry : : Record ) <nl> return None ; <nl> <nl> - unsigned recKind = DeclTypeCursor . readRecord ( next . ID , scratch , & blobData ) ; <nl> + unsigned recKind = <nl> + fatalIfUnexpected ( DeclTypeCursor . readRecord ( next . ID , scratch , & blobData ) ) ; <nl> if ( recKind ! = INLINABLE_BODY_TEXT ) <nl> return None ; <nl> <nl> Optional < ForeignErrorConvention > ModuleFile : : maybeReadForeignErrorConvention ( ) { <nl> <nl> BCOffsetRAII restoreOffset ( DeclTypeCursor ) ; <nl> <nl> - auto next = DeclTypeCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + llvm : : BitstreamEntry next = <nl> + fatalIfUnexpected ( DeclTypeCursor . advance ( AF_DontPopBlockAtEnd ) ) ; <nl> if ( next . Kind ! = llvm : : BitstreamEntry : : Record ) <nl> return None ; <nl> <nl> - unsigned recKind = DeclTypeCursor . readRecord ( next . ID , scratch ) ; <nl> + unsigned recKind = <nl> + fatalIfUnexpected ( DeclTypeCursor . readRecord ( next . ID , scratch ) ) ; <nl> switch ( recKind ) { <nl> case FOREIGN_ERROR_CONVENTION : <nl> restoreOffset . reset ( ) ; <nl> mmm a / lib / Serialization / DeserializeSIL . cpp <nl> ppp b / lib / Serialization / DeserializeSIL . cpp <nl> SILDeserializer : : SILDeserializer ( <nl> return ; <nl> <nl> / / Load any abbrev records at the start of the block . <nl> - SILCursor . advance ( ) ; <nl> + MF - > fatalIfUnexpected ( SILCursor . advance ( ) ) ; <nl> <nl> llvm : : BitstreamCursor cursor = SILIndexCursor ; <nl> / / We expect SIL_FUNC_NAMES first , then SIL_VTABLE_NAMES , then <nl> SILDeserializer : : SILDeserializer ( <nl> / / omitted if no entries exist in the module file . <nl> unsigned kind = 0 ; <nl> while ( kind ! = sil_index_block : : SIL_PROPERTY_OFFSETS ) { <nl> - auto next = cursor . advance ( ) ; <nl> + llvm : : BitstreamEntry next = MF - > fatalIfUnexpected ( cursor . advance ( ) ) ; <nl> if ( next . Kind = = llvm : : BitstreamEntry : : EndBlock ) <nl> return ; <nl> <nl> SmallVector < uint64_t , 4 > scratch ; <nl> StringRef blobData ; <nl> unsigned prevKind = kind ; <nl> - kind = cursor . readRecord ( next . ID , scratch , & blobData ) ; <nl> + kind = <nl> + MF - > fatalIfUnexpected ( cursor . readRecord ( next . ID , scratch , & blobData ) ) ; <nl> assert ( ( next . Kind = = llvm : : BitstreamEntry : : Record & & <nl> kind > prevKind & & <nl> ( kind = = sil_index_block : : SIL_FUNC_NAMES | | <nl> SILDeserializer : : SILDeserializer ( <nl> } <nl> <nl> / / Read SIL_FUNC | VTABLE | GLOBALVAR_OFFSETS record . <nl> - next = cursor . advance ( ) ; <nl> + next = MF - > fatalIfUnexpected ( cursor . advance ( ) ) ; <nl> scratch . clear ( ) ; <nl> - unsigned offKind = cursor . readRecord ( next . ID , scratch , & blobData ) ; <nl> + unsigned offKind = <nl> + MF - > fatalIfUnexpected ( cursor . readRecord ( next . ID , scratch , & blobData ) ) ; <nl> ( void ) offKind ; <nl> if ( kind = = sil_index_block : : SIL_FUNC_NAMES ) { <nl> assert ( ( next . Kind = = llvm : : BitstreamEntry : : Record & & <nl> SILDeserializer : : readSILFunctionChecked ( DeclID FID , SILFunction * existingFn , <nl> return cacheEntry . get ( ) ; <nl> <nl> BCOffsetRAII restoreOffset ( SILCursor ) ; <nl> - SILCursor . JumpToBit ( cacheEntry . getOffset ( ) ) ; <nl> - <nl> - auto entry = SILCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + if ( llvm : : Error Err = SILCursor . JumpToBit ( cacheEntry . getOffset ( ) ) ) <nl> + return std : : move ( Err ) ; <nl> + <nl> + llvm : : Expected < llvm : : BitstreamEntry > maybeEntry = <nl> + SILCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + if ( ! maybeEntry ) <nl> + return maybeEntry . takeError ( ) ; <nl> + llvm : : BitstreamEntry entry = maybeEntry . get ( ) ; <nl> if ( entry . Kind = = llvm : : BitstreamEntry : : Error ) { <nl> LLVM_DEBUG ( llvm : : dbgs ( ) < < " Cursor advance error in readSILFunction . \ n " ) ; <nl> MF - > fatal ( ) ; <nl> SILDeserializer : : readSILFunctionChecked ( DeclID FID , SILFunction * existingFn , <nl> <nl> SmallVector < uint64_t , 64 > scratch ; <nl> StringRef blobData ; <nl> - unsigned kind = SILCursor . readRecord ( entry . ID , scratch , & blobData ) ; <nl> + llvm : : Expected < unsigned > maybeKind = <nl> + SILCursor . readRecord ( entry . ID , scratch , & blobData ) ; <nl> + if ( ! maybeKind ) <nl> + MF - > fatal ( maybeKind . takeError ( ) ) ; <nl> + unsigned kind = maybeKind . get ( ) ; <nl> assert ( kind = = SIL_FUNCTION & & " expect a sil function " ) ; <nl> ( void ) kind ; <nl> <nl> SILDeserializer : : readSILFunctionChecked ( DeclID FID , SILFunction * existingFn , <nl> return llvm : : make_error < SILEntityError > ( <nl> name , takeErrorInfo ( astType . takeError ( ) ) ) ; <nl> } <nl> - llvm : : consumeError ( astType . takeError ( ) ) ; <nl> + consumeError ( astType . takeError ( ) ) ; <nl> return existingFn ; <nl> } <nl> auto ty = getSILType ( astType . get ( ) , SILValueCategory : : Object ) ; <nl> SILDeserializer : : readSILFunctionChecked ( DeclID FID , SILFunction * existingFn , <nl> <nl> / / Read and instantiate the specialize attributes . <nl> while ( numSpecAttrs - - ) { <nl> - auto next = SILCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + llvm : : Expected < llvm : : BitstreamEntry > maybeNext = <nl> + SILCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + if ( ! maybeNext ) <nl> + return maybeNext . takeError ( ) ; <nl> + llvm : : BitstreamEntry next = maybeNext . get ( ) ; <nl> assert ( next . Kind = = llvm : : BitstreamEntry : : Record ) ; <nl> <nl> scratch . clear ( ) ; <nl> - kind = SILCursor . readRecord ( next . ID , scratch ) ; <nl> + llvm : : Expected < unsigned > maybeKind = SILCursor . readRecord ( next . ID , scratch ) ; <nl> + if ( ! maybeKind ) <nl> + return maybeKind . takeError ( ) ; <nl> + unsigned kind = maybeKind . get ( ) ; <nl> assert ( kind = = SIL_SPECIALIZE_ATTR & & " Missing specialization attribute " ) ; <nl> <nl> unsigned exported ; <nl> SILDeserializer : : readSILFunctionChecked ( DeclID FID , SILFunction * existingFn , <nl> <nl> / / If the next entry is the end of the block , then this function has <nl> / / no contents . <nl> - entry = SILCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + maybeEntry = SILCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + if ( ! maybeEntry ) <nl> + return maybeEntry . takeError ( ) ; <nl> + entry = maybeEntry . get ( ) ; <nl> bool isEmptyFunction = ( entry . Kind = = llvm : : BitstreamEntry : : EndBlock ) ; <nl> assert ( ( ! isEmptyFunction | | ! genericEnv ) & & <nl> " generic environment without body ? ! " ) ; <nl> SILDeserializer : : readSILFunctionChecked ( DeclID FID , SILFunction * existingFn , <nl> fn - > setGenericEnvironment ( genericEnv ) ; <nl> <nl> scratch . clear ( ) ; <nl> - kind = SILCursor . readRecord ( entry . ID , scratch ) ; <nl> + maybeKind = SILCursor . readRecord ( entry . ID , scratch ) ; <nl> + if ( ! maybeKind ) <nl> + return maybeKind . takeError ( ) ; <nl> + kind = maybeKind . get ( ) ; <nl> <nl> SILBasicBlock * CurrentBB = nullptr ; <nl> <nl> SILDeserializer : : readSILFunctionChecked ( DeclID FID , SILFunction * existingFn , <nl> <nl> / / Fetch the next record . <nl> scratch . clear ( ) ; <nl> - entry = SILCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + llvm : : Expected < llvm : : BitstreamEntry > maybeEntry = <nl> + SILCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + if ( ! maybeEntry ) <nl> + return maybeEntry . takeError ( ) ; <nl> + llvm : : BitstreamEntry entry = maybeEntry . get ( ) ; <nl> <nl> / / EndBlock means the end of this SILFunction . <nl> if ( entry . Kind = = llvm : : BitstreamEntry : : EndBlock ) <nl> break ; <nl> - kind = SILCursor . readRecord ( entry . ID , scratch ) ; <nl> + maybeKind = SILCursor . readRecord ( entry . ID , scratch ) ; <nl> + if ( ! maybeKind ) <nl> + return maybeKind . takeError ( ) ; <nl> + kind = maybeKind . get ( ) ; <nl> } <nl> <nl> / / If fn is empty , we failed to deserialize its body . Return nullptr to signal <nl> SILFunction * SILDeserializer : : lookupSILFunction ( SILFunction * InFunc ) { <nl> / * declarationOnly * / false ) ; <nl> if ( ! maybeFunc ) { <nl> / / Ignore the error ; treat it as if we didn ' t have a definition . <nl> - llvm : : consumeError ( maybeFunc . takeError ( ) ) ; <nl> + consumeError ( maybeFunc . takeError ( ) ) ; <nl> return nullptr ; <nl> } <nl> <nl> bool SILDeserializer : : hasSILFunction ( StringRef Name , <nl> return ! Linkage | | cacheEntry . get ( ) - > getLinkage ( ) = = * Linkage ; <nl> <nl> BCOffsetRAII restoreOffset ( SILCursor ) ; <nl> - SILCursor . JumpToBit ( cacheEntry . getOffset ( ) ) ; <nl> - <nl> - auto entry = SILCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + if ( llvm : : Error Err = SILCursor . JumpToBit ( cacheEntry . getOffset ( ) ) ) <nl> + MF - > fatal ( std : : move ( Err ) ) ; <nl> + <nl> + llvm : : Expected < llvm : : BitstreamEntry > maybeEntry = <nl> + SILCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + if ( ! maybeEntry ) <nl> + MF - > fatal ( maybeEntry . takeError ( ) ) ; <nl> + llvm : : BitstreamEntry entry = maybeEntry . get ( ) ; <nl> if ( entry . Kind = = llvm : : BitstreamEntry : : Error ) { <nl> LLVM_DEBUG ( llvm : : dbgs ( ) < < " Cursor advance error in hasSILFunction . \ n " ) ; <nl> MF - > fatal ( ) ; <nl> bool SILDeserializer : : hasSILFunction ( StringRef Name , <nl> <nl> SmallVector < uint64_t , 64 > scratch ; <nl> StringRef blobData ; <nl> - unsigned kind = SILCursor . readRecord ( entry . ID , scratch , & blobData ) ; <nl> + llvm : : Expected < unsigned > maybeKind = <nl> + SILCursor . readRecord ( entry . ID , scratch , & blobData ) ; <nl> + if ( ! maybeKind ) <nl> + MF - > fatal ( maybeKind . takeError ( ) ) ; <nl> + unsigned kind = maybeKind . get ( ) ; <nl> assert ( kind = = SIL_FUNCTION & & " expect a sil function " ) ; <nl> ( void ) kind ; <nl> <nl> SILFunction * SILDeserializer : : lookupSILFunction ( StringRef name , <nl> <nl> if ( ! maybeFunc ) { <nl> / / Ignore the error ; treat it as if we didn ' t have a definition . <nl> - llvm : : consumeError ( maybeFunc . takeError ( ) ) ; <nl> + consumeError ( maybeFunc . takeError ( ) ) ; <nl> return nullptr ; <nl> } <nl> <nl> SILGlobalVariable * SILDeserializer : : readGlobalVar ( StringRef Name ) { <nl> return globalVarOrOffset ; <nl> <nl> BCOffsetRAII restoreOffset ( SILCursor ) ; <nl> - SILCursor . JumpToBit ( globalVarOrOffset ) ; <nl> - auto entry = SILCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + if ( llvm : : Error Err = SILCursor . JumpToBit ( globalVarOrOffset ) ) <nl> + MF - > fatal ( std : : move ( Err ) ) ; <nl> + llvm : : Expected < llvm : : BitstreamEntry > maybeEntry = <nl> + SILCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + if ( ! maybeEntry ) <nl> + MF - > fatal ( maybeEntry . takeError ( ) ) ; <nl> + llvm : : BitstreamEntry entry = maybeEntry . get ( ) ; <nl> if ( entry . Kind = = llvm : : BitstreamEntry : : Error ) { <nl> LLVM_DEBUG ( llvm : : dbgs ( ) < < " Cursor advance error in readGlobalVar . \ n " ) ; <nl> return nullptr ; <nl> SILGlobalVariable * SILDeserializer : : readGlobalVar ( StringRef Name ) { <nl> <nl> SmallVector < uint64_t , 64 > scratch ; <nl> StringRef blobData ; <nl> - unsigned kind = SILCursor . readRecord ( entry . ID , scratch , & blobData ) ; <nl> + llvm : : Expected < unsigned > maybeKind = <nl> + SILCursor . readRecord ( entry . ID , scratch , & blobData ) ; <nl> + if ( ! maybeKind ) <nl> + MF - > fatal ( maybeKind . takeError ( ) ) ; <nl> + unsigned kind = maybeKind . get ( ) ; <nl> assert ( kind = = SIL_GLOBALVAR & & " expect a sil global var " ) ; <nl> ( void ) kind ; <nl> <nl> void SILDeserializer : : getAllSILFunctions ( ) { <nl> false / * errorIfEmptyBody * / ) ; <nl> if ( ! maybeFunc ) { <nl> / / Ignore the error ; treat it as if we didn ' t have a definition . <nl> - llvm : : consumeError ( maybeFunc . takeError ( ) ) ; <nl> + consumeError ( maybeFunc . takeError ( ) ) ; <nl> } <nl> } <nl> } <nl> SILVTable * SILDeserializer : : readVTable ( DeclID VId ) { <nl> return vTableOrOffset ; <nl> <nl> BCOffsetRAII restoreOffset ( SILCursor ) ; <nl> - SILCursor . JumpToBit ( vTableOrOffset ) ; <nl> - auto entry = SILCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + if ( llvm : : Error Err = SILCursor . JumpToBit ( vTableOrOffset ) ) <nl> + MF - > fatal ( std : : move ( Err ) ) ; <nl> + llvm : : Expected < llvm : : BitstreamEntry > maybeEntry = <nl> + SILCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + if ( ! maybeEntry ) <nl> + MF - > fatal ( maybeEntry . takeError ( ) ) ; <nl> + llvm : : BitstreamEntry entry = maybeEntry . get ( ) ; <nl> if ( entry . Kind = = llvm : : BitstreamEntry : : Error ) { <nl> LLVM_DEBUG ( llvm : : dbgs ( ) < < " Cursor advance error in readVTable . \ n " ) ; <nl> return nullptr ; <nl> SILVTable * SILDeserializer : : readVTable ( DeclID VId ) { <nl> <nl> SmallVector < uint64_t , 64 > scratch ; <nl> StringRef blobData ; <nl> - unsigned kind = SILCursor . readRecord ( entry . ID , scratch , & blobData ) ; <nl> + llvm : : Expected < unsigned > maybeKind = <nl> + SILCursor . readRecord ( entry . ID , scratch , & blobData ) ; <nl> + if ( ! maybeKind ) <nl> + MF - > fatal ( maybeKind . takeError ( ) ) ; <nl> + unsigned kind = maybeKind . get ( ) ; <nl> assert ( kind = = SIL_VTABLE & & " expect a sil vtable " ) ; <nl> ( void ) kind ; <nl> <nl> SILVTable * SILDeserializer : : readVTable ( DeclID VId ) { <nl> <nl> / / Fetch the next record . <nl> scratch . clear ( ) ; <nl> - entry = SILCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + maybeEntry = SILCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + if ( ! maybeEntry ) <nl> + MF - > fatal ( maybeEntry . takeError ( ) ) ; <nl> + entry = maybeEntry . get ( ) ; <nl> if ( entry . Kind = = llvm : : BitstreamEntry : : EndBlock ) <nl> / / This vtable has no contents . <nl> return nullptr ; <nl> - kind = SILCursor . readRecord ( entry . ID , scratch ) ; <nl> + maybeKind = SILCursor . readRecord ( entry . ID , scratch ) ; <nl> + if ( ! maybeKind ) <nl> + MF - > fatal ( maybeKind . takeError ( ) ) ; <nl> + kind = maybeKind . get ( ) ; <nl> <nl> std : : vector < SILVTable : : Entry > vtableEntries ; <nl> / / Another SIL_VTABLE record means the end of this VTable . <nl> SILVTable * SILDeserializer : : readVTable ( DeclID VId ) { <nl> <nl> / / Fetch the next record . <nl> scratch . clear ( ) ; <nl> - entry = SILCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + maybeEntry = SILCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + if ( ! maybeEntry ) <nl> + MF - > fatal ( maybeEntry . takeError ( ) ) ; <nl> + entry = maybeEntry . get ( ) ; <nl> if ( entry . Kind = = llvm : : BitstreamEntry : : EndBlock ) <nl> / / EndBlock means the end of this VTable . <nl> break ; <nl> - kind = SILCursor . readRecord ( entry . ID , scratch ) ; <nl> + maybeKind = SILCursor . readRecord ( entry . ID , scratch ) ; <nl> + if ( ! maybeKind ) <nl> + MF - > fatal ( maybeKind . takeError ( ) ) ; <nl> + kind = maybeKind . get ( ) ; <nl> } <nl> <nl> / / If we ' ve already serialized the module , don ' t mark the witness table <nl> SILProperty * SILDeserializer : : readProperty ( DeclID PId ) { <nl> return propOrOffset . get ( ) ; <nl> <nl> BCOffsetRAII restoreOffset ( SILCursor ) ; <nl> - SILCursor . JumpToBit ( propOrOffset . getOffset ( ) ) ; <nl> - auto entry = SILCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + if ( llvm : : Error Err = SILCursor . JumpToBit ( propOrOffset . getOffset ( ) ) ) <nl> + MF - > fatal ( std : : move ( Err ) ) ; <nl> + llvm : : Expected < llvm : : BitstreamEntry > maybeEntry = <nl> + SILCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + if ( ! maybeEntry ) <nl> + MF - > fatal ( maybeEntry . takeError ( ) ) ; <nl> + llvm : : BitstreamEntry entry = maybeEntry . get ( ) ; <nl> if ( entry . Kind = = llvm : : BitstreamEntry : : Error ) { <nl> LLVM_DEBUG ( llvm : : dbgs ( ) < < " Cursor advance error in readProperty . \ n " ) ; <nl> return nullptr ; <nl> SILProperty * SILDeserializer : : readProperty ( DeclID PId ) { <nl> <nl> SmallVector < uint64_t , 64 > scratch ; <nl> StringRef blobData ; <nl> - unsigned kind = SILCursor . readRecord ( entry . ID , scratch , & blobData ) ; <nl> + llvm : : Expected < unsigned > maybeKind = <nl> + SILCursor . readRecord ( entry . ID , scratch , & blobData ) ; <nl> + if ( ! maybeKind ) <nl> + MF - > fatal ( maybeKind . takeError ( ) ) ; <nl> + unsigned kind = maybeKind . get ( ) ; <nl> assert ( kind = = SIL_PROPERTY & & " expect a sil_property " ) ; <nl> ( void ) kind ; <nl> <nl> void SILDeserializer : : readWitnessTableEntries ( <nl> std : : vector < SILWitnessTable : : ConditionalConformance > <nl> & conditionalConformances ) { <nl> SmallVector < uint64_t , 64 > scratch ; <nl> - unsigned kind = SILCursor . readRecord ( entry . ID , scratch ) ; <nl> + llvm : : Expected < unsigned > maybeKind = SILCursor . readRecord ( entry . ID , scratch ) ; <nl> + if ( ! maybeKind ) <nl> + MF - > fatal ( maybeKind . takeError ( ) ) ; <nl> + unsigned kind = maybeKind . get ( ) ; <nl> <nl> / / Another record means the end of this WitnessTable . <nl> while ( kind ! = SIL_WITNESS_TABLE & & <nl> void SILDeserializer : : readWitnessTableEntries ( <nl> <nl> / / Fetch the next record . <nl> scratch . clear ( ) ; <nl> - entry = SILCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + llvm : : Expected < llvm : : BitstreamEntry > maybeEntry = <nl> + SILCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + if ( ! maybeEntry ) <nl> + MF - > fatal ( maybeEntry . takeError ( ) ) ; <nl> + entry = maybeEntry . get ( ) ; <nl> if ( entry . Kind = = llvm : : BitstreamEntry : : EndBlock ) <nl> / / EndBlock means the end of this WitnessTable . <nl> break ; <nl> - kind = SILCursor . readRecord ( entry . ID , scratch ) ; <nl> + maybeKind = SILCursor . readRecord ( entry . ID , scratch ) ; <nl> + if ( ! maybeKind ) <nl> + MF - > fatal ( maybeKind . takeError ( ) ) ; <nl> + kind = maybeKind . get ( ) ; <nl> } <nl> } <nl> <nl> SILWitnessTable * SILDeserializer : : readWitnessTable ( DeclID WId , <nl> return wTableOrOffset . get ( ) ; <nl> <nl> BCOffsetRAII restoreOffset ( SILCursor ) ; <nl> - SILCursor . JumpToBit ( wTableOrOffset . getOffset ( ) ) ; <nl> - auto entry = SILCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + if ( llvm : : Error Err = SILCursor . JumpToBit ( wTableOrOffset . getOffset ( ) ) ) <nl> + MF - > fatal ( std : : move ( Err ) ) ; <nl> + llvm : : Expected < llvm : : BitstreamEntry > maybeEntry = <nl> + SILCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + if ( ! maybeEntry ) <nl> + MF - > fatal ( maybeEntry . takeError ( ) ) ; <nl> + llvm : : BitstreamEntry entry = maybeEntry . get ( ) ; <nl> if ( entry . Kind = = llvm : : BitstreamEntry : : Error ) { <nl> LLVM_DEBUG ( llvm : : dbgs ( ) < < " Cursor advance error in readWitnessTable . \ n " ) ; <nl> return nullptr ; <nl> SILWitnessTable * SILDeserializer : : readWitnessTable ( DeclID WId , <nl> <nl> SmallVector < uint64_t , 64 > scratch ; <nl> StringRef blobData ; <nl> - unsigned kind = SILCursor . readRecord ( entry . ID , scratch , & blobData ) ; <nl> + llvm : : Expected < unsigned > maybeKind = <nl> + SILCursor . readRecord ( entry . ID , scratch , & blobData ) ; <nl> + if ( ! maybeKind ) <nl> + MF - > fatal ( maybeKind . takeError ( ) ) ; <nl> + unsigned kind = maybeKind . get ( ) ; <nl> assert ( kind = = SIL_WITNESS_TABLE & & " expect a sil witnesstable " ) ; <nl> ( void ) kind ; <nl> <nl> SILWitnessTable * SILDeserializer : : readWitnessTable ( DeclID WId , <nl> <nl> / / Fetch the next record . <nl> scratch . clear ( ) ; <nl> - entry = SILCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + maybeEntry = SILCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + if ( ! maybeEntry ) <nl> + MF - > fatal ( maybeEntry . takeError ( ) ) ; <nl> + entry = maybeEntry . get ( ) ; <nl> if ( entry . Kind = = llvm : : BitstreamEntry : : EndBlock ) <nl> return nullptr ; <nl> <nl> readDefaultWitnessTable ( DeclID WId , SILDefaultWitnessTable * existingWt ) { <nl> return wTableOrOffset . get ( ) ; <nl> <nl> BCOffsetRAII restoreOffset ( SILCursor ) ; <nl> - SILCursor . JumpToBit ( wTableOrOffset . getOffset ( ) ) ; <nl> - auto entry = SILCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + if ( llvm : : Error Err = SILCursor . JumpToBit ( wTableOrOffset . getOffset ( ) ) ) <nl> + MF - > fatal ( std : : move ( Err ) ) ; <nl> + llvm : : Expected < llvm : : BitstreamEntry > maybeEntry = <nl> + SILCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + if ( ! maybeEntry ) <nl> + MF - > fatal ( maybeEntry . takeError ( ) ) ; <nl> + llvm : : BitstreamEntry entry = maybeEntry . get ( ) ; <nl> if ( entry . Kind = = llvm : : BitstreamEntry : : Error ) { <nl> LLVM_DEBUG ( llvm : : dbgs ( ) < < " Cursor advance error in " <nl> " readDefaultWitnessTable . \ n " ) ; <nl> readDefaultWitnessTable ( DeclID WId , SILDefaultWitnessTable * existingWt ) { <nl> <nl> SmallVector < uint64_t , 64 > scratch ; <nl> StringRef blobData ; <nl> - unsigned kind = SILCursor . readRecord ( entry . ID , scratch , & blobData ) ; <nl> + llvm : : Expected < unsigned > maybeKind = <nl> + SILCursor . readRecord ( entry . ID , scratch , & blobData ) ; <nl> + if ( ! maybeKind ) <nl> + MF - > fatal ( maybeKind . takeError ( ) ) ; <nl> + unsigned kind = maybeKind . get ( ) ; <nl> assert ( kind = = SIL_DEFAULT_WITNESS_TABLE & & " expect a sil default witness table " ) ; <nl> ( void ) kind ; <nl> <nl> readDefaultWitnessTable ( DeclID WId , SILDefaultWitnessTable * existingWt ) { <nl> <nl> / / Fetch the next record . <nl> scratch . clear ( ) ; <nl> - entry = SILCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + maybeEntry = SILCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + if ( ! maybeEntry ) <nl> + MF - > fatal ( maybeEntry . takeError ( ) ) ; <nl> + entry = maybeEntry . get ( ) ; <nl> if ( entry . Kind = = llvm : : BitstreamEntry : : EndBlock ) <nl> return nullptr ; <nl> <nl> mmm a / lib / Serialization / ModuleFile . cpp <nl> ppp b / lib / Serialization / ModuleFile . cpp <nl> static_assert ( IsTriviallyDestructible < SerializedASTFile > : : value , <nl> <nl> static bool checkModuleSignature ( llvm : : BitstreamCursor & cursor , <nl> ArrayRef < unsigned char > signature ) { <nl> - for ( unsigned char byte : signature ) <nl> - if ( cursor . AtEndOfStream ( ) | | cursor . Read ( 8 ) ! = byte ) <nl> + for ( unsigned char byte : signature ) { <nl> + if ( cursor . AtEndOfStream ( ) ) <nl> return false ; <nl> + if ( Expected < llvm : : SimpleBitstreamCursor : : word_t > maybeRead = <nl> + cursor . Read ( 8 ) ) { <nl> + if ( maybeRead . get ( ) ! = byte ) <nl> + return false ; <nl> + } else { <nl> + consumeError ( maybeRead . takeError ( ) ) ; <nl> + return false ; <nl> + } <nl> + } <nl> return true ; <nl> } <nl> <nl> static bool enterTopLevelModuleBlock ( llvm : : BitstreamCursor & cursor , <nl> unsigned ID , <nl> bool shouldReadBlockInfo = true ) { <nl> - auto next = cursor . advance ( ) ; <nl> + Expected < llvm : : BitstreamEntry > maybeNext = cursor . advance ( ) ; <nl> + if ( ! maybeNext ) { <nl> + / / FIXME this drops the error on the floor . <nl> + consumeError ( maybeNext . takeError ( ) ) ; <nl> + return false ; <nl> + } <nl> + llvm : : BitstreamEntry next = maybeNext . get ( ) ; <nl> <nl> if ( next . Kind ! = llvm : : BitstreamEntry : : SubBlock ) <nl> return false ; <nl> static bool enterTopLevelModuleBlock ( llvm : : BitstreamCursor & cursor , <nl> if ( next . ID ! = ID ) <nl> return false ; <nl> <nl> - cursor . EnterSubBlock ( ID ) ; <nl> + if ( llvm : : Error Err = cursor . EnterSubBlock ( ID ) ) { <nl> + / / FIXME this drops the error on the floor . <nl> + consumeError ( std : : move ( Err ) ) ; <nl> + return false ; <nl> + } <nl> + <nl> return true ; <nl> } <nl> <nl> static bool readOptionsBlock ( llvm : : BitstreamCursor & cursor , <nl> SmallVectorImpl < uint64_t > & scratch , <nl> ExtendedValidationInfo & extendedInfo ) { <nl> while ( ! cursor . AtEndOfStream ( ) ) { <nl> - auto entry = cursor . advance ( ) ; <nl> + Expected < llvm : : BitstreamEntry > maybeEntry = cursor . advance ( ) ; <nl> + if ( ! maybeEntry ) { <nl> + / / FIXME this drops the error on the floor . <nl> + consumeError ( maybeEntry . takeError ( ) ) ; <nl> + return false ; <nl> + } <nl> + llvm : : BitstreamEntry entry = maybeEntry . get ( ) ; <nl> if ( entry . Kind = = llvm : : BitstreamEntry : : EndBlock ) <nl> break ; <nl> <nl> static bool readOptionsBlock ( llvm : : BitstreamCursor & cursor , <nl> <nl> scratch . clear ( ) ; <nl> StringRef blobData ; <nl> - unsigned kind = cursor . readRecord ( entry . ID , scratch , & blobData ) ; <nl> + Expected < unsigned > maybeKind = <nl> + cursor . readRecord ( entry . ID , scratch , & blobData ) ; <nl> + if ( ! maybeKind ) { <nl> + / / FIXME this drops the error on the floor . <nl> + consumeError ( maybeKind . takeError ( ) ) ; <nl> + return false ; <nl> + } <nl> + unsigned kind = maybeKind . get ( ) ; <nl> switch ( kind ) { <nl> case options_block : : SDK_PATH : <nl> extendedInfo . setSDKPath ( blobData ) ; <nl> validateControlBlock ( llvm : : BitstreamCursor & cursor , <nl> bool versionSeen = false ; <nl> <nl> while ( ! cursor . AtEndOfStream ( ) ) { <nl> - auto entry = cursor . advance ( ) ; <nl> + Expected < llvm : : BitstreamEntry > maybeEntry = cursor . advance ( ) ; <nl> + if ( ! maybeEntry ) { <nl> + / / FIXME this drops the error on the floor . <nl> + consumeError ( maybeEntry . takeError ( ) ) ; <nl> + result . status = Status : : Malformed ; <nl> + return result ; <nl> + } <nl> + llvm : : BitstreamEntry entry = maybeEntry . get ( ) ; <nl> if ( entry . Kind = = llvm : : BitstreamEntry : : EndBlock ) <nl> break ; <nl> <nl> validateControlBlock ( llvm : : BitstreamCursor & cursor , <nl> <nl> if ( entry . Kind = = llvm : : BitstreamEntry : : SubBlock ) { <nl> if ( entry . ID = = OPTIONS_BLOCK_ID & & extendedInfo ) { <nl> - cursor . EnterSubBlock ( OPTIONS_BLOCK_ID ) ; <nl> + if ( llvm : : Error Err = cursor . EnterSubBlock ( OPTIONS_BLOCK_ID ) ) { <nl> + / / FIXME this drops the error on the floor . <nl> + consumeError ( std : : move ( Err ) ) ; <nl> + result . status = Status : : Malformed ; <nl> + return result ; <nl> + } <nl> if ( ! readOptionsBlock ( cursor , scratch , * extendedInfo ) ) { <nl> result . status = Status : : Malformed ; <nl> return result ; <nl> validateControlBlock ( llvm : : BitstreamCursor & cursor , <nl> <nl> scratch . clear ( ) ; <nl> StringRef blobData ; <nl> - unsigned kind = cursor . readRecord ( entry . ID , scratch , & blobData ) ; <nl> + Expected < unsigned > maybeKind = <nl> + cursor . readRecord ( entry . ID , scratch , & blobData ) ; <nl> + if ( ! maybeKind ) { <nl> + / / FIXME this drops the error on the floor . <nl> + consumeError ( maybeKind . takeError ( ) ) ; <nl> + result . status = Status : : Malformed ; <nl> + return result ; <nl> + } <nl> + unsigned kind = maybeKind . get ( ) ; <nl> switch ( kind ) { <nl> case control_block : : METADATA : { <nl> if ( versionSeen ) { <nl> static bool validateInputBlock ( <nl> SmallString < 256 > dependencyFullPathBuffer ; <nl> <nl> while ( ! cursor . AtEndOfStream ( ) ) { <nl> - auto entry = cursor . advance ( ) ; <nl> + Expected < llvm : : BitstreamEntry > maybeEntry = cursor . advance ( ) ; <nl> + if ( ! maybeEntry ) { <nl> + / / FIXME this drops the error on the floor . <nl> + consumeError ( maybeEntry . takeError ( ) ) ; <nl> + return true ; <nl> + } <nl> + llvm : : BitstreamEntry entry = maybeEntry . get ( ) ; <nl> if ( entry . Kind = = llvm : : BitstreamEntry : : EndBlock ) <nl> break ; <nl> <nl> static bool validateInputBlock ( <nl> <nl> scratch . clear ( ) ; <nl> StringRef blobData ; <nl> - unsigned kind = cursor . readRecord ( entry . ID , scratch , & blobData ) ; <nl> + Expected < unsigned > maybeKind = <nl> + cursor . readRecord ( entry . ID , scratch , & blobData ) ; <nl> + if ( ! maybeKind ) { <nl> + / / FIXME this drops the error on the floor . <nl> + consumeError ( maybeKind . takeError ( ) ) ; <nl> + return true ; <nl> + } <nl> + unsigned kind = maybeKind . get ( ) ; <nl> switch ( kind ) { <nl> case input_block : : FILE_DEPENDENCY : { <nl> bool isHashBased = scratch [ 2 ] ! = 0 ; <nl> ValidationInfo serialization : : validateSerializedAST ( <nl> llvm : : BitstreamEntry topLevelEntry ; <nl> <nl> while ( ! cursor . AtEndOfStream ( ) ) { <nl> - topLevelEntry = cursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + Expected < llvm : : BitstreamEntry > maybeEntry = <nl> + cursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + if ( ! maybeEntry ) { <nl> + / / FIXME this drops the error on the floor . <nl> + consumeError ( maybeEntry . takeError ( ) ) ; <nl> + result . status = Status : : Malformed ; <nl> + return result ; <nl> + } <nl> + topLevelEntry = maybeEntry . get ( ) ; <nl> if ( topLevelEntry . Kind ! = llvm : : BitstreamEntry : : SubBlock ) <nl> break ; <nl> <nl> if ( topLevelEntry . ID = = CONTROL_BLOCK_ID ) { <nl> - cursor . EnterSubBlock ( CONTROL_BLOCK_ID ) ; <nl> + if ( llvm : : Error Err = cursor . EnterSubBlock ( CONTROL_BLOCK_ID ) ) { <nl> + / / FIXME this drops the error on the floor . <nl> + consumeError ( std : : move ( Err ) ) ; <nl> + result . status = Status : : Malformed ; <nl> + return result ; <nl> + } <nl> result = validateControlBlock ( cursor , scratch , <nl> { SWIFTMODULE_VERSION_MAJOR , <nl> SWIFTMODULE_VERSION_MINOR } , <nl> ValidationInfo serialization : : validateSerializedAST ( <nl> } else if ( dependencies & & <nl> result . status = = Status : : Valid & & <nl> topLevelEntry . ID = = INPUT_BLOCK_ID ) { <nl> - cursor . EnterSubBlock ( INPUT_BLOCK_ID ) ; <nl> + if ( llvm : : Error Err = cursor . EnterSubBlock ( INPUT_BLOCK_ID ) ) { <nl> + / / FIXME this drops the error on the floor . <nl> + consumeError ( std : : move ( Err ) ) ; <nl> + result . status = Status : : Malformed ; <nl> + return result ; <nl> + } <nl> if ( validateInputBlock ( cursor , scratch , * dependencies ) ) { <nl> result . status = Status : : Malformed ; <nl> return result ; <nl> ModuleFile : : readObjCMethodTable ( ArrayRef < uint64_t > fields , StringRef blobData ) { <nl> } <nl> <nl> bool ModuleFile : : readIndexBlock ( llvm : : BitstreamCursor & cursor ) { <nl> - cursor . EnterSubBlock ( INDEX_BLOCK_ID ) ; <nl> + if ( llvm : : Error Err = cursor . EnterSubBlock ( INDEX_BLOCK_ID ) ) { <nl> + / / FIXME this drops the error on the floor . <nl> + consumeError ( std : : move ( Err ) ) ; <nl> + return false ; <nl> + } <nl> <nl> SmallVector < uint64_t , 4 > scratch ; <nl> StringRef blobData ; <nl> <nl> while ( ! cursor . AtEndOfStream ( ) ) { <nl> - auto entry = cursor . advance ( ) ; <nl> + Expected < llvm : : BitstreamEntry > maybeEntry = cursor . advance ( ) ; <nl> + if ( ! maybeEntry ) { <nl> + / / FIXME this drops the error on the floor . <nl> + consumeError ( maybeEntry . takeError ( ) ) ; <nl> + return false ; <nl> + } <nl> + llvm : : BitstreamEntry entry = maybeEntry . get ( ) ; <nl> switch ( entry . Kind ) { <nl> case llvm : : BitstreamEntry : : EndBlock : <nl> return true ; <nl> bool ModuleFile : : readIndexBlock ( llvm : : BitstreamCursor & cursor ) { <nl> case llvm : : BitstreamEntry : : SubBlock : <nl> if ( entry . ID = = DECL_MEMBER_TABLES_BLOCK_ID ) { <nl> DeclMemberTablesCursor = cursor ; <nl> - DeclMemberTablesCursor . EnterSubBlock ( DECL_MEMBER_TABLES_BLOCK_ID ) ; <nl> + if ( llvm : : Error Err = DeclMemberTablesCursor . EnterSubBlock ( <nl> + DECL_MEMBER_TABLES_BLOCK_ID ) ) { <nl> + / / FIXME this drops the error on the floor . <nl> + consumeError ( std : : move ( Err ) ) ; <nl> + return false ; <nl> + } <nl> llvm : : BitstreamEntry subentry ; <nl> do { <nl> / / Scan forward , to load the cursor with any abbrevs we ' ll need while <nl> / / seeking inside this block later . <nl> - subentry = DeclMemberTablesCursor . advance ( <nl> - llvm : : BitstreamCursor : : AF_DontPopBlockAtEnd ) ; <nl> + Expected < llvm : : BitstreamEntry > maybeEntry = <nl> + DeclMemberTablesCursor . advance ( <nl> + llvm : : BitstreamCursor : : AF_DontPopBlockAtEnd ) ; <nl> + if ( ! maybeEntry ) { <nl> + / / FIXME this drops the error on the floor . <nl> + consumeError ( maybeEntry . takeError ( ) ) ; <nl> + return false ; <nl> + } <nl> + subentry = maybeEntry . get ( ) ; <nl> } while ( ! DeclMemberTablesCursor . AtEndOfStream ( ) & & <nl> subentry . Kind ! = llvm : : BitstreamEntry : : Record & & <nl> subentry . Kind ! = llvm : : BitstreamEntry : : EndBlock ) ; <nl> bool ModuleFile : : readIndexBlock ( llvm : : BitstreamCursor & cursor ) { <nl> case llvm : : BitstreamEntry : : Record : <nl> scratch . clear ( ) ; <nl> blobData = { } ; <nl> - unsigned kind = cursor . readRecord ( entry . ID , scratch , & blobData ) ; <nl> + Expected < unsigned > maybeKind = <nl> + cursor . readRecord ( entry . ID , scratch , & blobData ) ; <nl> + if ( ! maybeKind ) { <nl> + / / FIXME this drops the error on the floor . <nl> + consumeError ( maybeKind . takeError ( ) ) ; <nl> + return false ; <nl> + } <nl> + unsigned kind = maybeKind . get ( ) ; <nl> <nl> switch ( kind ) { <nl> case index_block : : DECL_OFFSETS : <nl> ModuleFile : : readGroupTable ( ArrayRef < uint64_t > Fields , StringRef BlobData ) { <nl> } <nl> <nl> bool ModuleFile : : readCommentBlock ( llvm : : BitstreamCursor & cursor ) { <nl> - cursor . EnterSubBlock ( COMMENT_BLOCK_ID ) ; <nl> + if ( llvm : : Error Err = cursor . EnterSubBlock ( COMMENT_BLOCK_ID ) ) { <nl> + / / FIXME this drops the error on the floor . <nl> + consumeError ( std : : move ( Err ) ) ; <nl> + return false ; <nl> + } <nl> <nl> SmallVector < uint64_t , 4 > scratch ; <nl> StringRef blobData ; <nl> <nl> while ( ! cursor . AtEndOfStream ( ) ) { <nl> - auto entry = cursor . advance ( ) ; <nl> + Expected < llvm : : BitstreamEntry > maybeEntry = cursor . advance ( ) ; <nl> + if ( ! maybeEntry ) { <nl> + / / FIXME this drops the error on the floor . <nl> + consumeError ( maybeEntry . takeError ( ) ) ; <nl> + return false ; <nl> + } <nl> + llvm : : BitstreamEntry entry = maybeEntry . get ( ) ; <nl> switch ( entry . Kind ) { <nl> case llvm : : BitstreamEntry : : EndBlock : <nl> return true ; <nl> bool ModuleFile : : readCommentBlock ( llvm : : BitstreamCursor & cursor ) { <nl> <nl> case llvm : : BitstreamEntry : : Record : <nl> scratch . clear ( ) ; <nl> - unsigned kind = cursor . readRecord ( entry . ID , scratch , & blobData ) ; <nl> + Expected < unsigned > maybeKind = <nl> + cursor . readRecord ( entry . ID , scratch , & blobData ) ; <nl> + if ( ! maybeKind ) { <nl> + / / FIXME this drops the error on the floor . <nl> + consumeError ( maybeKind . takeError ( ) ) ; <nl> + return false ; <nl> + } <nl> + unsigned kind = maybeKind . get ( ) ; <nl> <nl> switch ( kind ) { <nl> case comment_block : : DECL_COMMENTS : <nl> bool ModuleFile : : readModuleDocIfPresent ( ) { <nl> ValidationInfo info ; <nl> <nl> while ( ! docCursor . AtEndOfStream ( ) ) { <nl> - topLevelEntry = docCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + Expected < llvm : : BitstreamEntry > maybeEntry = <nl> + docCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + if ( ! maybeEntry ) { <nl> + / / FIXME this drops the error on the floor . <nl> + consumeError ( maybeEntry . takeError ( ) ) ; <nl> + return false ; <nl> + } <nl> + topLevelEntry = maybeEntry . get ( ) ; <nl> if ( topLevelEntry . Kind ! = llvm : : BitstreamEntry : : SubBlock ) <nl> break ; <nl> <nl> switch ( topLevelEntry . ID ) { <nl> case CONTROL_BLOCK_ID : { <nl> - docCursor . EnterSubBlock ( CONTROL_BLOCK_ID ) ; <nl> + if ( llvm : : Error Err = docCursor . EnterSubBlock ( CONTROL_BLOCK_ID ) ) { <nl> + / / FIXME this drops the error on the floor . <nl> + consumeError ( std : : move ( Err ) ) ; <nl> + return false ; <nl> + } <nl> <nl> info = validateControlBlock ( docCursor , scratch , <nl> { SWIFTDOC_VERSION_MAJOR , <nl> ModuleFile : : readDeclUSRsTable ( ArrayRef < uint64_t > fields , StringRef blobData ) { <nl> } <nl> <nl> bool ModuleFile : : readDeclLocsBlock ( llvm : : BitstreamCursor & cursor ) { <nl> - cursor . EnterSubBlock ( DECL_LOCS_BLOCK_ID ) ; <nl> + if ( llvm : : Error Err = cursor . EnterSubBlock ( CONTROL_BLOCK_ID ) ) { <nl> + consumeError ( std : : move ( Err ) ) ; <nl> + return false ; <nl> + } <nl> <nl> SmallVector < uint64_t , 4 > scratch ; <nl> StringRef blobData ; <nl> <nl> while ( ! cursor . AtEndOfStream ( ) ) { <nl> - auto entry = cursor . advance ( ) ; <nl> - switch ( entry . Kind ) { <nl> + Expected < llvm : : BitstreamEntry > entry = cursor . advance ( ) ; <nl> + if ( ! entry ) { <nl> + consumeError ( entry . takeError ( ) ) ; <nl> + return false ; <nl> + } <nl> + switch ( entry - > Kind ) { <nl> case llvm : : BitstreamEntry : : EndBlock : <nl> return true ; <nl> <nl> bool ModuleFile : : readDeclLocsBlock ( llvm : : BitstreamCursor & cursor ) { <nl> <nl> case llvm : : BitstreamEntry : : Record : <nl> scratch . clear ( ) ; <nl> - unsigned kind = cursor . readRecord ( entry . ID , scratch , & blobData ) ; <nl> - <nl> - switch ( kind ) { <nl> + Expected < unsigned > kind = <nl> + cursor . readRecord ( entry - > ID , scratch , & blobData ) ; <nl> + if ( ! kind ) { <nl> + consumeError ( kind . takeError ( ) ) ; <nl> + return false ; <nl> + } <nl> + switch ( * kind ) { <nl> case decl_locs_block : : BASIC_DECL_LOCS : <nl> BasicDeclLocsData = blobData ; <nl> break ; <nl> bool ModuleFile : : readModuleSourceInfoIfPresent ( ) { <nl> } <nl> <nl> SmallVector < uint64_t , 64 > scratch ; <nl> - llvm : : BitstreamEntry topLevelEntry ; <nl> <nl> bool hasValidControlBlock = false ; <nl> ValidationInfo info ; <nl> + unsigned kind = llvm : : BitstreamEntry : : Error ; <nl> <nl> while ( ! infoCursor . AtEndOfStream ( ) ) { <nl> - topLevelEntry = infoCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> - if ( topLevelEntry . Kind ! = llvm : : BitstreamEntry : : SubBlock ) <nl> + Expected < llvm : : BitstreamEntry > topLevelEntry = <nl> + infoCursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + if ( ! topLevelEntry ) { <nl> + consumeError ( topLevelEntry . takeError ( ) ) ; <nl> + return false ; <nl> + } <nl> + kind = topLevelEntry - > Kind ; <nl> + if ( kind ! = llvm : : BitstreamEntry : : SubBlock ) <nl> break ; <nl> <nl> - switch ( topLevelEntry . ID ) { <nl> + switch ( topLevelEntry - > ID ) { <nl> case CONTROL_BLOCK_ID : { <nl> - infoCursor . EnterSubBlock ( CONTROL_BLOCK_ID ) ; <nl> - <nl> + if ( llvm : : Error Err = infoCursor . EnterSubBlock ( CONTROL_BLOCK_ID ) ) { <nl> + consumeError ( std : : move ( Err ) ) ; <nl> + return false ; <nl> + } <nl> info = validateControlBlock ( infoCursor , scratch , <nl> { SWIFTSOURCEINFO_VERSION_MAJOR , <nl> SWIFTSOURCEINFO_VERSION_MINOR } , <nl> bool ModuleFile : : readModuleSourceInfoIfPresent ( ) { <nl> } <nl> } <nl> <nl> - if ( topLevelEntry . Kind ! = llvm : : BitstreamEntry : : EndBlock ) <nl> + if ( kind ! = llvm : : BitstreamEntry : : EndBlock ) <nl> return false ; <nl> <nl> return true ; <nl> ModuleFile : : ModuleFile ( <nl> llvm : : BitstreamEntry topLevelEntry ; <nl> <nl> while ( ! cursor . AtEndOfStream ( ) ) { <nl> - topLevelEntry = cursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + Expected < llvm : : BitstreamEntry > maybeEntry = <nl> + cursor . advance ( AF_DontPopBlockAtEnd ) ; <nl> + if ( ! maybeEntry ) { <nl> + / / FIXME this drops the error diagnostic on the floor . <nl> + consumeError ( maybeEntry . takeError ( ) ) ; <nl> + info . status = error ( Status : : Malformed ) ; <nl> + return ; <nl> + } <nl> + topLevelEntry = maybeEntry . get ( ) ; <nl> if ( topLevelEntry . Kind ! = llvm : : BitstreamEntry : : SubBlock ) <nl> break ; <nl> <nl> switch ( topLevelEntry . ID ) { <nl> case CONTROL_BLOCK_ID : { <nl> - cursor . EnterSubBlock ( CONTROL_BLOCK_ID ) ; <nl> + if ( llvm : : Error Err = cursor . EnterSubBlock ( CONTROL_BLOCK_ID ) ) { <nl> + / / FIXME this drops the error on the floor . <nl> + consumeError ( std : : move ( Err ) ) ; <nl> + info . status = error ( Status : : Malformed ) ; <nl> + return ; <nl> + } <nl> <nl> info = validateControlBlock ( cursor , scratch , <nl> { SWIFTMODULE_VERSION_MAJOR , <nl> ModuleFile : : ModuleFile ( <nl> return ; <nl> } <nl> <nl> - cursor . EnterSubBlock ( INPUT_BLOCK_ID ) ; <nl> + if ( llvm : : Error Err = cursor . EnterSubBlock ( INPUT_BLOCK_ID ) ) { <nl> + / / FIXME this drops the error on the floor . <nl> + consumeError ( std : : move ( Err ) ) ; <nl> + info . status = error ( Status : : Malformed ) ; <nl> + return ; <nl> + } <nl> <nl> - auto next = cursor . advance ( ) ; <nl> + Expected < llvm : : BitstreamEntry > maybeNext = cursor . advance ( ) ; <nl> + if ( ! maybeNext ) { <nl> + / / FIXME this drops the error on the floor . <nl> + consumeError ( maybeNext . takeError ( ) ) ; <nl> + info . status = error ( Status : : Malformed ) ; <nl> + return ; <nl> + } <nl> + llvm : : BitstreamEntry next = maybeNext . get ( ) ; <nl> while ( next . Kind = = llvm : : BitstreamEntry : : Record ) { <nl> scratch . clear ( ) ; <nl> StringRef blobData ; <nl> - unsigned kind = cursor . readRecord ( next . ID , scratch , & blobData ) ; <nl> + Expected < unsigned > maybeKind = <nl> + cursor . readRecord ( next . ID , scratch , & blobData ) ; <nl> + if ( ! maybeKind ) { <nl> + / / FIXME this drops the error on the floor . <nl> + consumeError ( maybeKind . takeError ( ) ) ; <nl> + info . status = error ( Status : : Malformed ) ; <nl> + return ; <nl> + } <nl> + unsigned kind = maybeKind . get ( ) ; <nl> switch ( kind ) { <nl> case input_block : : IMPORTED_MODULE : { <nl> unsigned rawImportControl ; <nl> ModuleFile : : ModuleFile ( <nl> break ; <nl> } <nl> <nl> - next = cursor . advance ( ) ; <nl> + maybeNext = cursor . advance ( ) ; <nl> + if ( ! maybeNext ) { <nl> + / / FIXME this drops the error on the floor . <nl> + consumeError ( maybeNext . takeError ( ) ) ; <nl> + info . status = error ( Status : : Malformed ) ; <nl> + return ; <nl> + } <nl> + next = maybeNext . get ( ) ; <nl> } <nl> <nl> if ( next . Kind ! = llvm : : BitstreamEntry : : EndBlock ) <nl> ModuleFile : : ModuleFile ( <nl> / / The decls - and - types block is lazily loaded . Save the cursor and load <nl> / / any abbrev records at the start of the block . <nl> DeclTypeCursor = cursor ; <nl> - DeclTypeCursor . EnterSubBlock ( DECLS_AND_TYPES_BLOCK_ID ) ; <nl> - if ( DeclTypeCursor . advance ( ) . Kind = = llvm : : BitstreamEntry : : Error ) <nl> + if ( llvm : : Error Err = <nl> + DeclTypeCursor . EnterSubBlock ( DECLS_AND_TYPES_BLOCK_ID ) ) { <nl> + / / FIXME this drops the error on the floor . <nl> + consumeError ( std : : move ( Err ) ) ; <nl> + info . status = error ( Status : : Malformed ) ; <nl> + return ; <nl> + } <nl> + <nl> + Expected < llvm : : BitstreamEntry > maybeCursor = DeclTypeCursor . advance ( ) ; <nl> + if ( ! maybeCursor ) { <nl> + / / FIXME this drops the error on the floor . <nl> + consumeError ( maybeCursor . takeError ( ) ) ; <nl> + info . status = error ( Status : : Malformed ) ; <nl> + return ; <nl> + } <nl> + if ( maybeCursor . get ( ) . Kind = = llvm : : BitstreamEntry : : Error ) <nl> info . status = error ( Status : : Malformed ) ; <nl> <nl> / / With the main cursor , skip over the block and continue . <nl> ModuleFile : : ModuleFile ( <nl> return ; <nl> } <nl> <nl> - cursor . EnterSubBlock ( IDENTIFIER_DATA_BLOCK_ID ) ; <nl> + if ( llvm : : Error Err = cursor . EnterSubBlock ( IDENTIFIER_DATA_BLOCK_ID ) ) { <nl> + / / FIXME this drops the error on the floor . <nl> + consumeError ( std : : move ( Err ) ) ; <nl> + info . status = error ( Status : : Malformed ) ; <nl> + return ; <nl> + } <nl> <nl> - auto next = cursor . advanceSkippingSubblocks ( ) ; <nl> + Expected < llvm : : BitstreamEntry > maybeNext = <nl> + cursor . advanceSkippingSubblocks ( ) ; <nl> + if ( ! maybeNext ) { <nl> + / / FIXME this drops the error on the floor . <nl> + consumeError ( maybeNext . takeError ( ) ) ; <nl> + info . status = error ( Status : : Malformed ) ; <nl> + return ; <nl> + } <nl> + llvm : : BitstreamEntry next = maybeNext . get ( ) ; <nl> while ( next . Kind = = llvm : : BitstreamEntry : : Record ) { <nl> scratch . clear ( ) ; <nl> StringRef blobData ; <nl> - unsigned kind = cursor . readRecord ( next . ID , scratch , & blobData ) ; <nl> + Expected < unsigned > maybeKind = <nl> + cursor . readRecord ( next . ID , scratch , & blobData ) ; <nl> + if ( ! maybeKind ) { <nl> + / / FIXME this drops the error on the floor . <nl> + consumeError ( maybeKind . takeError ( ) ) ; <nl> + info . status = error ( Status : : Malformed ) ; <nl> + return ; <nl> + } <nl> + unsigned kind = maybeKind . get ( ) ; <nl> <nl> switch ( kind ) { <nl> case identifier_block : : IDENTIFIER_DATA : <nl> ModuleFile : : ModuleFile ( <nl> break ; <nl> } <nl> <nl> - next = cursor . advanceSkippingSubblocks ( ) ; <nl> + maybeNext = cursor . advanceSkippingSubblocks ( ) ; <nl> + if ( ! maybeNext ) { <nl> + / / FIXME this drops the error on the floor . <nl> + consumeError ( maybeNext . takeError ( ) ) ; <nl> + info . status = error ( Status : : Malformed ) ; <nl> + return ; <nl> + } <nl> + next = maybeNext . get ( ) ; <nl> } <nl> <nl> if ( next . Kind ! = llvm : : BitstreamEntry : : EndBlock ) { <nl> ModuleFile : : ModuleFile ( <nl> case SIL_INDEX_BLOCK_ID : { <nl> / / Save the cursor . <nl> SILIndexCursor = cursor ; <nl> - SILIndexCursor . EnterSubBlock ( SIL_INDEX_BLOCK_ID ) ; <nl> + if ( llvm : : Error Err = SILIndexCursor . EnterSubBlock ( SIL_INDEX_BLOCK_ID ) ) { <nl> + / / FIXME this drops the error on the floor . <nl> + consumeError ( std : : move ( Err ) ) ; <nl> + info . status = error ( Status : : Malformed ) ; <nl> + return ; <nl> + } <nl> <nl> / / With the main cursor , skip over the block and continue . <nl> if ( cursor . SkipBlock ( ) ) { <nl> ModuleFile : : ModuleFile ( <nl> case SIL_BLOCK_ID : { <nl> / / Save the cursor . <nl> SILCursor = cursor ; <nl> - SILCursor . EnterSubBlock ( SIL_BLOCK_ID ) ; <nl> + if ( llvm : : Error Err = SILCursor . EnterSubBlock ( SIL_BLOCK_ID ) ) { <nl> + / / FIXME this drops the error on the floor . <nl> + consumeError ( std : : move ( Err ) ) ; <nl> + info . status = error ( Status : : Malformed ) ; <nl> + return ; <nl> + } <nl> <nl> / / With the main cursor , skip over the block and continue . <nl> if ( cursor . SkipBlock ( ) ) { <nl> ModuleFile : : loadNamedMembers ( const IterableDeclContext * IDC , DeclBaseName N , <nl> DeclMembersTables [ subTableOffset ] ; <nl> if ( ! subTable ) { <nl> BCOffsetRAII restoreOffset ( DeclMemberTablesCursor ) ; <nl> - DeclMemberTablesCursor . JumpToBit ( subTableOffset ) ; <nl> - auto entry = DeclMemberTablesCursor . advance ( ) ; <nl> + fatalIfNotSuccess ( DeclMemberTablesCursor . JumpToBit ( subTableOffset ) ) ; <nl> + llvm : : BitstreamEntry entry = <nl> + fatalIfUnexpected ( DeclMemberTablesCursor . advance ( ) ) ; <nl> if ( entry . Kind ! = llvm : : BitstreamEntry : : Record ) { <nl> fatal ( ) ; <nl> return None ; <nl> } <nl> SmallVector < uint64_t , 64 > scratch ; <nl> StringRef blobData ; <nl> - unsigned kind = DeclMemberTablesCursor . readRecord ( entry . ID , scratch , <nl> - & blobData ) ; <nl> + unsigned kind = fatalIfUnexpected ( <nl> + DeclMemberTablesCursor . readRecord ( entry . ID , scratch , & blobData ) ) ; <nl> assert ( kind = = decl_member_tables_block : : DECL_MEMBERS ) ; <nl> ( void ) kind ; <nl> subTable = readDeclMembersTable ( scratch , blobData ) ; <nl> ModuleFile : : loadNamedMembers ( const IterableDeclContext * IDC , DeclBaseName N , <nl> } else { <nl> if ( ! getContext ( ) . LangOpts . EnableDeserializationRecovery ) <nl> fatal ( mem . takeError ( ) ) ; <nl> - llvm : : consumeError ( mem . takeError ( ) ) ; <nl> + consumeError ( mem . takeError ( ) ) ; <nl> <nl> / / Treat this as a cache - miss to the caller and let them attempt <nl> / / to refill through the normal loadAllMembers ( ) path . <nl> void ModuleFile : : getTopLevelDecls ( SmallVectorImpl < Decl * > & results ) { <nl> if ( ! declOrError ) { <nl> if ( ! getContext ( ) . LangOpts . EnableDeserializationRecovery ) <nl> fatal ( declOrError . takeError ( ) ) ; <nl> - llvm : : consumeError ( declOrError . takeError ( ) ) ; <nl> + consumeError ( declOrError . takeError ( ) ) ; <nl> continue ; <nl> } <nl> results . push_back ( declOrError . get ( ) ) ; <nl> mmm a / lib / Serialization / ModuleFile . h <nl> ppp b / lib / Serialization / ModuleFile . h <nl> class ModuleFile <nl> / / / Emits one last diagnostic , logs the error , and then aborts for the stack <nl> / / / trace . <nl> LLVM_ATTRIBUTE_NORETURN void fatal ( llvm : : Error error ) ; <nl> + void fatalIfNotSuccess ( llvm : : Error error ) { <nl> + if ( error ) <nl> + fatal ( std : : move ( error ) ) ; <nl> + } <nl> + template < typename T > T fatalIfUnexpected ( llvm : : Expected < T > expected ) { <nl> + if ( expected ) <nl> + return std : : move ( expected . get ( ) ) ; <nl> + fatal ( expected . takeError ( ) ) ; <nl> + } <nl> <nl> LLVM_ATTRIBUTE_NORETURN void fatal ( ) { <nl> fatal ( llvm : : make_error < llvm : : StringError > ( <nl>
Fix Swift following bitstream reader API update ( )
apple/swift
e56e311a2360d7165a3a1cb1d8934959777e4e86
2019-11-12T18:46:07Z
mmm a / editor / plugins / visual_shader_editor_plugin . cpp <nl> ppp b / editor / plugins / visual_shader_editor_plugin . cpp <nl> void VisualShaderEditor : : _node_selected ( Object * p_node ) { <nl> / / EditorNode : : get_singleton ( ) - > push_item ( vsnode . ptr ( ) , " " , true ) ; <nl> } <nl> <nl> + void VisualShaderEditor : : _input ( const Ref < InputEvent > p_event ) { <nl> + if ( graph - > has_focus ( ) ) { <nl> + Ref < InputEventMouseButton > mb = p_event ; <nl> + <nl> + if ( mb . is_valid ( ) & & mb - > is_pressed ( ) & & mb - > get_button_index ( ) = = BUTTON_RIGHT ) { <nl> + add_node - > get_popup ( ) - > set_position ( get_viewport ( ) - > get_mouse_position ( ) ) ; <nl> + add_node - > get_popup ( ) - > show_modal ( ) ; <nl> + } <nl> + } <nl> + } <nl> + <nl> void VisualShaderEditor : : _notification ( int p_what ) { <nl> <nl> if ( p_what = = NOTIFICATION_ENTER_TREE | | p_what = = NOTIFICATION_THEME_CHANGED ) { <nl> void VisualShaderEditor : : _bind_methods ( ) { <nl> ClassDB : : bind_method ( " _mode_selected " , & VisualShaderEditor : : _mode_selected ) ; <nl> ClassDB : : bind_method ( " _input_select_item " , & VisualShaderEditor : : _input_select_item ) ; <nl> ClassDB : : bind_method ( " _preview_select_port " , & VisualShaderEditor : : _preview_select_port ) ; <nl> + ClassDB : : bind_method ( " _input " , & VisualShaderEditor : : _input ) ; <nl> } <nl> <nl> VisualShaderEditor * VisualShaderEditor : : singleton = NULL ; <nl> void VisualShaderEditorPlugin : : make_visible ( bool p_visible ) { <nl> / / editor - > animation_panel_make_visible ( true ) ; <nl> button - > show ( ) ; <nl> editor - > make_bottom_panel_item_visible ( visual_shader_editor ) ; <nl> + visual_shader_editor - > set_process_input ( true ) ; <nl> / / visual_shader_editor - > set_process ( true ) ; <nl> } else { <nl> <nl> if ( visual_shader_editor - > is_visible_in_tree ( ) ) <nl> editor - > hide_bottom_panel ( ) ; <nl> button - > hide ( ) ; <nl> + visual_shader_editor - > set_process_input ( false ) ; <nl> / / visual_shader_editor - > set_process ( false ) ; <nl> } <nl> } <nl> mmm a / editor / plugins / visual_shader_editor_plugin . h <nl> ppp b / editor / plugins / visual_shader_editor_plugin . h <nl> class VisualShaderEditor : public VBoxContainer { <nl> void _input_select_item ( Ref < VisualShaderNodeInput > input , String name ) ; <nl> <nl> void _preview_select_port ( int p_node , int p_port ) ; <nl> + void _input ( const Ref < InputEvent > p_event ) ; <nl> <nl> protected : <nl> void _notification ( int p_what ) ; <nl>
Merge pull request from Chaosus / rightclick_vs
godotengine/godot
72430b041e4d8e937e4c9c890d121558cf5046b6
2018-07-16T13:46:18Z
new file mode 100644 <nl> index 0000000000000 . . f266b9be77f78 <nl> mmm / dev / null <nl> ppp b / tensorflow / lite / experimental / micro / examples / network_tester / . gitignore <nl> <nl> + input_data . h <nl> + expected_output_data . h <nl> + network_model . h <nl> new file mode 100644 <nl> index 0000000000000 . . 9dbcbe4c55b4f <nl> mmm / dev / null <nl> ppp b / tensorflow / lite / experimental / micro / examples / network_tester / Makefile . inc <nl> <nl> + NETWORK_TESTER_TEST_SRCS : = \ <nl> + tensorflow / lite / experimental / micro / examples / network_tester / network_tester_test . cc <nl> + <nl> + NETWORK_TESTER_TEST_HDRS : = \ <nl> + tensorflow / lite / experimental / micro / examples / network_tester / network_model . h \ <nl> + tensorflow / lite / experimental / micro / examples / network_tester / input_data . h \ <nl> + tensorflow / lite / experimental / micro / examples / network_tester / expected_output_data . h <nl> + <nl> + # Find any platform - specific rules for this example . <nl> + include $ ( wildcard tensorflow / lite / experimental / micro / examples / network_tester / * / Makefile . inc ) <nl> + <nl> + ifdef NETWORK_MODEL <nl> + INCLUDES + = - include $ ( NETWORK_MODEL ) <nl> + endif <nl> + <nl> + ifdef OUTPUT_DATA <nl> + INCLUDES + = - include $ ( OUTPUT_DATA ) <nl> + endif <nl> + <nl> + ifdef INPUT_DATA <nl> + INCLUDES + = - include $ ( INPUT_DATA ) <nl> + endif <nl> + <nl> + ifdef ARENA_SIZE <nl> + CXXFLAGS + = - DTENSOR_ARENA_SIZE = $ ( ARENA_SIZE ) <nl> + endif <nl> + <nl> + ifdef NUM_BYTES_TO_PRINT <nl> + CXXFLAGS + = - DNUM_BYTES_TO_PRINT = $ ( NUM_BYTES_TO_PRINT ) <nl> + endif <nl> + <nl> + ifeq ( $ ( COMPARE_OUTPUT_DATA ) , no ) <nl> + CXXFLAGS + = - DNO_COMPARE_OUTPUT_DATA <nl> + endif <nl> + <nl> + # Builds a standalone object recognition binary . <nl> + $ ( eval $ ( call microlite_test , network_tester_test , \ <nl> + $ ( NETWORK_TESTER_TEST_SRCS ) , $ ( NETWORK_TESTER_TEST_HDRS ) ) ) <nl> new file mode 100644 <nl> index 0000000000000 . . 5c2034e888c9f <nl> mmm / dev / null <nl> ppp b / tensorflow / lite / experimental / micro / examples / network_tester / README . md <nl> <nl> + The aim of this application is to provide a quick way to test different <nl> + networks . <nl> + <nl> + It contains one testcase and a default network model ( network_model . h ) , default <nl> + input data ( input_data . h ) and default expected output data <nl> + ( expected_output_data . h ) . The header files were created using the ` xxd ` command . <nl> + <nl> + The default model is a single MaxPool2D operator , with an input shape of { 1 , 4 , <nl> + 4 , 1 } and an output shape of { 1 , 2 , 2 , 1 } . <nl> + <nl> + In order to use another model , input data , or expected output data , simply <nl> + specify the path to the new header files when running make as seen below . <nl> + <nl> + The variables in the specified header files ( array and array length ) needs to <nl> + have the same name and type as the ones in the default header files . The include <nl> + guards also needs to be the same . When swapping out the network model , it is <nl> + likely that the memory allocated by the interpreter needs to be increased to fit <nl> + the new model . This is done by using the ` ARENA_SIZE ` option when running <nl> + ` make ` . <nl> + <nl> + ` ` ` <nl> + make - f tensorflow / lite / experimental / micro / example / network_tester_test \ <nl> + NETWORK_MODEL = path / to / network_model . h \ <nl> + INPUT_DATA = path / to / input_data . h \ <nl> + OUTPUT_DATA = path / to / expected_output_data . h \ <nl> + ARENA_SIZE = < tensor arena size in bytes > \ <nl> + NUM_BYTES_TO_PRINT = < number of bytes to print > \ <nl> + COMPARE_OUTPUT_DATA = no <nl> + ` ` ` <nl> + <nl> + ` NETWORK_MODEL ` : The path to the network model header . \ <nl> + ` INPUT_DATA ` : The path to the input data . \ <nl> + ` OUTPUT_DATA ` : The path to the expected output data . \ <nl> + ` ARENA_SIZE ` : The size of the memory to be allocated ( in bytes ) by the <nl> + interpreter . \ <nl> + ` NUM_BYTES_TO_PRINT ` : The number of bytes of the output data to print . \ <nl> + Defaults to 0 if not specified . \ <nl> + ` COMPARE_OUTPUT_DATA ` : If set to " no " the output data is not compared to the <nl> + expected output data . This could be useful e . g . if the execution time needs to <nl> + be minimized , or there is no expected output data . If omitted , the output data <nl> + is compared to the expected output . <nl> new file mode 100644 <nl> index 0000000000000 . . 4347f169ff5d4 <nl> mmm / dev / null <nl> ppp b / tensorflow / lite / experimental / micro / examples / network_tester / expected_output_data . h <nl> <nl> + / * Copyright 2019 The TensorFlow Authors . All Rights Reserved . <nl> + <nl> + Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + you may not use this file except in compliance with the License . <nl> + You may obtain a copy of the License at <nl> + <nl> + http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + <nl> + Unless required by applicable law or agreed to in writing , software <nl> + distributed under the License is distributed on an " AS IS " BASIS , <nl> + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + See the License for the specific language governing permissions and <nl> + limitations under the License . <nl> + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = * / <nl> + <nl> + # ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_NETWORK_TESTER_EXPECTED_OUTPUT_DATA_H_ <nl> + # define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_NETWORK_TESTER_EXPECTED_OUTPUT_DATA_H_ <nl> + <nl> + static unsigned int expected_output_data_len = 4 ; <nl> + static unsigned char expected_output_data [ ] = { 6 , 8 , 14 , 16 } ; <nl> + <nl> + # endif / / TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_NETWORK_TESTER_EXPECTED_OUTPUT_DATA_H_ <nl> new file mode 100644 <nl> index 0000000000000 . . dd8646176c1bb <nl> mmm / dev / null <nl> ppp b / tensorflow / lite / experimental / micro / examples / network_tester / input_data . h <nl> <nl> + / * Copyright 2019 The TensorFlow Authors . All Rights Reserved . <nl> + <nl> + Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + you may not use this file except in compliance with the License . <nl> + You may obtain a copy of the License at <nl> + <nl> + http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + <nl> + Unless required by applicable law or agreed to in writing , software <nl> + distributed under the License is distributed on an " AS IS " BASIS , <nl> + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + See the License for the specific language governing permissions and <nl> + limitations under the License . <nl> + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = * / <nl> + <nl> + # ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_NETWORK_TESTER_INPUT_DATA_H_ <nl> + # define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_NETWORK_TESTER_INPUT_DATA_H_ <nl> + <nl> + static const int input_data_len = 16 ; <nl> + static const unsigned char input_data [ ] = { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , <nl> + 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 } ; <nl> + <nl> + # endif / / TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_NETWORK_TESTER_INPUT_DATA_H_ <nl> new file mode 100644 <nl> index 0000000000000 . . dc23a226b0874 <nl> mmm / dev / null <nl> ppp b / tensorflow / lite / experimental / micro / examples / network_tester / network_model . h <nl> <nl> + / * Copyright 2019 The TensorFlow Authors . All Rights Reserved . <nl> + Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + you may not use this file except in compliance with the License . <nl> + You may obtain a copy of the License at <nl> + http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + Unless required by applicable law or agreed to in writing , software <nl> + distributed under the License is distributed on an " AS IS " BASIS , <nl> + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + See the License for the specific language governing permissions and <nl> + limitations under the License . <nl> + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = * / <nl> + <nl> + # ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_NETWORK_TESTER_NETWORK_MODEL_H_ <nl> + # define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_EXAMPLES_NETWORK_TESTER_NETWORK_MODEL_H_ <nl> + <nl> + const unsigned char network_model [ ] = { <nl> + 0x18 , 0x00 , 0x00 , 0x00 , 0x54 , 0x46 , 0x4c , 0x33 , 0x00 , 0x00 , 0x0e , 0x00 , <nl> + 0x18 , 0x00 , 0x04 , 0x00 , 0x08 , 0x00 , 0x0c , 0x00 , 0x10 , 0x00 , 0x14 , 0x00 , <nl> + 0x0e , 0x00 , 0x00 , 0x00 , 0x03 , 0x00 , 0x00 , 0x00 , 0x08 , 0x02 , 0x00 , 0x00 , <nl> + 0x0c , 0x00 , 0x00 , 0x00 , 0x10 , 0x00 , 0x00 , 0x00 , 0x20 , 0x00 , 0x00 , 0x00 , <nl> + 0x01 , 0x00 , 0x00 , 0x00 , 0x38 , 0x00 , 0x00 , 0x00 , 0x0f , 0x00 , 0x00 , 0x00 , <nl> + 0x54 , 0x4f , 0x43 , 0x4f , 0x20 , 0x43 , 0x6f , 0x6e , 0x76 , 0x65 , 0x72 , 0x74 , <nl> + 0x65 , 0x64 , 0x2e , 0x00 , 0x03 , 0x00 , 0x00 , 0x00 , 0x18 , 0x00 , 0x00 , 0x00 , <nl> + 0x0c , 0x00 , 0x00 , 0x00 , 0x04 , 0x00 , 0x00 , 0x00 , 0xf8 , 0xff , 0xff , 0xff , <nl> + 0xfc , 0xff , 0xff , 0xff , 0x04 , 0x00 , 0x04 , 0x00 , 0x04 , 0x00 , 0x00 , 0x00 , <nl> + 0xf8 , 0xfe , 0xff , 0xff , 0x20 , 0x00 , 0x00 , 0x00 , 0x14 , 0x00 , 0x00 , 0x00 , <nl> + 0x08 , 0x00 , 0x00 , 0x00 , 0x3c , 0x01 , 0x00 , 0x00 , 0x01 , 0x00 , 0x00 , 0x00 , <nl> + 0x01 , 0x00 , 0x00 , 0x00 , 0x01 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , <nl> + 0x02 , 0x00 , 0x00 , 0x00 , 0x08 , 0x00 , 0x00 , 0x00 , 0x94 , 0x00 , 0x00 , 0x00 , <nl> + 0x7e , 0xff , 0xff , 0xff , 0x00 , 0x00 , 0x00 , 0x03 , 0x10 , 0x00 , 0x00 , 0x00 , <nl> + 0x02 , 0x00 , 0x00 , 0x00 , 0x1c , 0x00 , 0x00 , 0x00 , 0x30 , 0x00 , 0x00 , 0x00 , <nl> + 0x04 , 0x00 , 0x00 , 0x00 , 0x01 , 0x00 , 0x00 , 0x00 , 0x04 , 0x00 , 0x00 , 0x00 , <nl> + 0x04 , 0x00 , 0x00 , 0x00 , 0x01 , 0x00 , 0x00 , 0x00 , 0x10 , 0x00 , 0x00 , 0x00 , <nl> + 0x64 , 0x61 , 0x74 , 0x61 , 0x2f , 0x50 , 0x6c , 0x61 , 0x63 , 0x65 , 0x68 , 0x6f , <nl> + 0x6c , 0x64 , 0x65 , 0x72 , 0x00 , 0x00 , 0x00 , 0x00 , 0x6c , 0xff , 0xff , 0xff , <nl> + 0x30 , 0x00 , 0x00 , 0x00 , 0x24 , 0x00 , 0x00 , 0x00 , 0x18 , 0x00 , 0x00 , 0x00 , <nl> + 0x04 , 0x00 , 0x00 , 0x00 , 0x01 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , <nl> + 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x01 , 0x00 , 0x00 , 0x00 , <nl> + 0x00 , 0x00 , 0x80 , 0x3f , 0x01 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x7f , 0x43 , <nl> + 0x01 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x0e , 0x00 , <nl> + 0x18 , 0x00 , 0x08 , 0x00 , 0x07 , 0x00 , 0x0c , 0x00 , 0x10 , 0x00 , 0x14 , 0x00 , <nl> + 0x0e , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x03 , 0x10 , 0x00 , 0x00 , 0x00 , <nl> + 0x01 , 0x00 , 0x00 , 0x00 , 0x1c , 0x00 , 0x00 , 0x00 , 0x40 , 0x00 , 0x00 , 0x00 , <nl> + 0x04 , 0x00 , 0x00 , 0x00 , 0x01 , 0x00 , 0x00 , 0x00 , 0x02 , 0x00 , 0x00 , 0x00 , <nl> + 0x02 , 0x00 , 0x00 , 0x00 , 0x01 , 0x00 , 0x00 , 0x00 , 0x17 , 0x00 , 0x00 , 0x00 , <nl> + 0x70 , 0x6f , 0x6f , 0x6c , 0x31 , 0x2f , 0x4d , 0x61 , 0x78 , 0x50 , 0x6f , 0x6f , <nl> + 0x6c , 0x32 , 0x44 , 0x2f , 0x4d , 0x61 , 0x78 , 0x50 , 0x6f , 0x6f , 0x6c , 0x00 , <nl> + 0x0c , 0x00 , 0x14 , 0x00 , 0x04 , 0x00 , 0x08 , 0x00 , 0x0c , 0x00 , 0x10 , 0x00 , <nl> + 0x0c , 0x00 , 0x00 , 0x00 , 0x2c , 0x00 , 0x00 , 0x00 , 0x20 , 0x00 , 0x00 , 0x00 , <nl> + 0x14 , 0x00 , 0x00 , 0x00 , 0x04 , 0x00 , 0x00 , 0x00 , 0x01 , 0x00 , 0x00 , 0x00 , <nl> + 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x01 , 0x00 , 0x00 , 0x00 , <nl> + 0x00 , 0x00 , 0x80 , 0x3f , 0x01 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x7f , 0x43 , <nl> + 0x01 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x01 , 0x00 , 0x00 , 0x00 , <nl> + 0x18 , 0x00 , 0x00 , 0x00 , 0x14 , 0x00 , 0x18 , 0x00 , 0x00 , 0x00 , 0x08 , 0x00 , <nl> + 0x0c , 0x00 , 0x07 , 0x00 , 0x10 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x14 , 0x00 , <nl> + 0x14 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x05 , 0x10 , 0x00 , 0x00 , 0x00 , <nl> + 0x14 , 0x00 , 0x00 , 0x00 , 0x2c , 0x00 , 0x00 , 0x00 , 0x14 , 0x00 , 0x00 , 0x00 , <nl> + 0x01 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x01 , 0x00 , 0x00 , 0x00 , <nl> + 0x01 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x0e , 0x00 , <nl> + 0x18 , 0x00 , 0x07 , 0x00 , 0x08 , 0x00 , 0x0c , 0x00 , 0x10 , 0x00 , 0x14 , 0x00 , <nl> + 0x0e , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x01 , 0x02 , 0x00 , 0x00 , 0x00 , <nl> + 0x02 , 0x00 , 0x00 , 0x00 , 0x02 , 0x00 , 0x00 , 0x00 , 0x02 , 0x00 , 0x00 , 0x00 , <nl> + 0x01 , 0x00 , 0x00 , 0x00 , 0x0c , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x06 , 0x00 , <nl> + 0x08 , 0x00 , 0x07 , 0x00 , 0x06 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x11 } ; <nl> + const unsigned int network_model_len = 576 ; <nl> + <nl> + # endif <nl> new file mode 100644 <nl> index 0000000000000 . . c6fba1cb9df37 <nl> mmm / dev / null <nl> ppp b / tensorflow / lite / experimental / micro / examples / network_tester / network_tester_test . cc <nl> <nl> + / * Copyright 2019 The TensorFlow Authors . All Rights Reserved . <nl> + Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + you may not use this file except in compliance with the License . <nl> + You may obtain a copy of the License at <nl> + http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + Unless required by applicable law or agreed to in writing , software <nl> + distributed under the License is distributed on an " AS IS " BASIS , <nl> + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + See the License for the specific language governing permissions and <nl> + limitations under the License . <nl> + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = * / <nl> + <nl> + # include " tensorflow / lite / experimental / micro / examples / network_tester / expected_output_data . h " <nl> + # include " tensorflow / lite / experimental / micro / examples / network_tester / input_data . h " <nl> + # include " tensorflow / lite / experimental / micro / examples / network_tester / network_model . h " <nl> + # include " tensorflow / lite / experimental / micro / kernels / all_ops_resolver . h " <nl> + # include " tensorflow / lite / experimental / micro / micro_error_reporter . h " <nl> + # include " tensorflow / lite / experimental / micro / micro_interpreter . h " <nl> + # include " tensorflow / lite / experimental / micro / testing / micro_test . h " <nl> + # include " tensorflow / lite / experimental / micro / testing / test_utils . h " <nl> + # include " tensorflow / lite / schema / schema_generated . h " <nl> + # include " tensorflow / lite / version . h " <nl> + <nl> + # ifndef TENSOR_ARENA_SIZE <nl> + # define TENSOR_ARENA_SIZE ( 1024 ) <nl> + # endif <nl> + <nl> + uint8_t tensor_arena [ TENSOR_ARENA_SIZE ] ; <nl> + <nl> + # ifdef NUM_BYTES_TO_PRINT <nl> + inline void print_output_data ( TfLiteTensor * output ) { <nl> + int num_bytes_to_print = <nl> + ( output - > bytes < NUM_BYTES_TO_PRINT ) ? output - > bytes : NUM_BYTES_TO_PRINT ; <nl> + <nl> + int dims_size = output - > dims - > size ; <nl> + printf ( " dims : { % d , " , dims_size ) ; <nl> + for ( int i = 0 ; i < output - > dims - > size - 1 ; + + i ) { <nl> + printf ( " % d , " , output - > dims - > data [ i ] ) ; <nl> + } <nl> + printf ( " % d } \ n " , output - > dims - > data [ dims_size - 1 ] ) ; <nl> + <nl> + printf ( " data_address : % p \ n " , output - > data . raw ) ; <nl> + printf ( " data : \ n { " ) ; <nl> + for ( int i = 0 ; i < num_bytes_to_print - 1 ; + + i ) { <nl> + if ( i % 16 = = 0 ) { <nl> + printf ( " \ n " ) ; <nl> + } <nl> + printf ( " 0x % 02x , " , output - > data . uint8 [ i ] ) ; <nl> + } <nl> + printf ( " 0x % 02x \ n } \ n " , output - > data . uint8 [ num_bytes_to_print - 1 ] ) ; <nl> + } <nl> + # endif <nl> + <nl> + TF_LITE_MICRO_TESTS_BEGIN <nl> + <nl> + TF_LITE_MICRO_TEST ( TestInvoke ) { <nl> + tflite : : MicroErrorReporter micro_error_reporter ; <nl> + tflite : : ErrorReporter * error_reporter = & micro_error_reporter ; <nl> + <nl> + const tflite : : Model * model = : : tflite : : GetModel ( network_model ) ; <nl> + if ( model - > version ( ) ! = TFLITE_SCHEMA_VERSION ) { <nl> + error_reporter - > Report ( <nl> + " Model provided is schema version % d not equal " <nl> + " to supported version % d . \ n " , <nl> + model - > version ( ) , TFLITE_SCHEMA_VERSION ) ; <nl> + return 1 ; <nl> + } <nl> + <nl> + tflite : : ops : : micro : : AllOpsResolver resolver ; <nl> + <nl> + tflite : : MicroInterpreter interpreter ( model , resolver , tensor_arena , <nl> + TENSOR_ARENA_SIZE , error_reporter ) ; <nl> + interpreter . AllocateTensors ( ) ; <nl> + <nl> + TfLiteTensor * input = interpreter . input ( 0 ) ; <nl> + memcpy ( input - > data . uint8 , input_data , input - > bytes ) ; <nl> + <nl> + TfLiteStatus invoke_status = interpreter . Invoke ( ) ; <nl> + if ( invoke_status ! = kTfLiteOk ) { <nl> + error_reporter - > Report ( " Invoke failed \ n " ) ; <nl> + } <nl> + TF_LITE_MICRO_EXPECT_EQ ( kTfLiteOk , invoke_status ) ; <nl> + <nl> + TfLiteTensor * output = interpreter . output ( 0 ) ; <nl> + <nl> + # ifdef NUM_BYTES_TO_PRINT <nl> + print_output_data ( output ) ; <nl> + # endif <nl> + <nl> + # ifndef NO_COMPARE_OUTPUT_DATA <nl> + for ( int i = 0 ; i < output - > bytes ; + + i ) { <nl> + TF_LITE_MICRO_EXPECT_EQ ( output - > data . uint8 [ i ] , expected_output_data [ i ] ) ; <nl> + } <nl> + # endif <nl> + error_reporter - > Report ( " Ran successfully \ n " ) ; <nl> + } <nl> + <nl> + TF_LITE_MICRO_TESTS_END <nl>
Merge pull request from jenselofsson : network_tester
tensorflow/tensorflow
22fc68919e93c838586586e9f8a9e147e5829cd4
2019-10-28T23:42:36Z
mmm a / modules / prediction / container / obstacles / obstacles_container . cc <nl> ppp b / modules / prediction / container / obstacles / obstacles_container . cc <nl> void ObstaclesContainer : : Insert ( const : : google : : protobuf : : Message & message ) { <nl> for ( const PerceptionObstacle & perception_obstacle : <nl> perception_obstacles . perception_obstacle ( ) ) { <nl> if ( IsPredictable ( perception_obstacle ) ) { <nl> + curr_frame_non_predictable_obstacle_ids_ . push_back ( <nl> + perception_obstacle . id ( ) ) ; <nl> continue ; <nl> } <nl> Obstacle * obstacle_ptr = GetObstacle ( perception_obstacle . id ( ) ) ; <nl> void ObstaclesContainer : : Clear ( ) { <nl> timestamp_ = - 1 . 0 ; <nl> } <nl> <nl> + std : : vector < int > ObstaclesContainer : : curr_frame_predictable_obstacle_ids ( ) { <nl> + return curr_frame_predictable_obstacle_ids_ ; <nl> + } <nl> + <nl> + std : : vector < int > ObstaclesContainer : : curr_frame_non_predictable_obstacle_ids ( ) { <nl> + return curr_frame_non_predictable_obstacle_ids_ ; <nl> + } <nl> + <nl> + std : : vector < int > ObstaclesContainer : : curr_frame_obstacle_ids ( ) { <nl> + std : : vector < int > curr_frame_obs_ids = curr_frame_predictable_obstacle_ids_ ; <nl> + curr_frame_obs_ids . insert ( curr_frame_obs_ids . end ( ) , <nl> + curr_frame_non_predictable_obstacle_ids_ . begin ( ) , <nl> + curr_frame_non_predictable_obstacle_ids_ . end ( ) ) ; <nl> + return curr_frame_obs_ids ; <nl> + } <nl> + <nl> <nl> void ObstaclesContainer : : InsertPerceptionObstacle ( <nl> const PerceptionObstacle & perception_obstacle , const double timestamp ) { <nl> mmm a / modules / prediction / container / obstacles / obstacles_container . h <nl> ppp b / modules / prediction / container / obstacles / obstacles_container . h <nl> class ObstaclesContainer : public Container { <nl> <nl> size_t NumOfObstacles ( ) { return ptr_obstacles_ . size ( ) ; } <nl> <nl> + std : : vector < int > curr_frame_predictable_obstacle_ids ( ) ; <nl> + <nl> + std : : vector < int > curr_frame_non_predictable_obstacle_ids ( ) ; <nl> + <nl> + std : : vector < int > curr_frame_obstacle_ids ( ) ; <nl> + <nl> private : <nl> Obstacle * GetObstacleWithLRUUpdate ( const int obstacle_id ) ; <nl> / * * <nl> class ObstaclesContainer : public Container { <nl> / / an id_mapping from perception_id to prediction_id <nl> common : : util : : LRUCache < int , int > id_mapping_ ; <nl> std : : vector < int > curr_frame_predictable_obstacle_ids_ ; <nl> + std : : vector < int > curr_frame_non_predictable_obstacle_ids_ ; <nl> std : : unordered_map < int , int > curr_frame_id_mapping_ ; <nl> } ; <nl> <nl>
Prediction : add interfaces of current frame obstacle ids
ApolloAuto/apollo
547591c238610e5aa16de40bac9014d11a55564c
2019-01-15T04:51:44Z
mmm a / native_mate / function_template . h <nl> ppp b / native_mate / function_template . h <nl> class PerIsolateData ; <nl> <nl> enum CreateFunctionTemplateFlags { <nl> HolderIsFirstArgument = 1 < < 0 , <nl> + SafeAfterDestroyed = 1 < < 1 , <nl> } ; <nl> <nl> namespace internal { <nl> struct Dispatcher < R ( P1 ) > { <nl> <nl> typename CallbackParamTraits < P1 > : : LocalType a1 ; <nl> if ( ( holder - > flags & HolderIsFirstArgument ) & & <nl> + ! ( holder - > flags & SafeAfterDestroyed ) & & <nl> DestroyedChecker < typename <nl> CallbackParamTraits < P1 > : : LocalType > : : IsDestroyed ( & args ) ) { <nl> args . ThrowError ( " Object has been destroyed " ) ; <nl> struct Dispatcher < R ( P1 , P2 ) > { <nl> typename CallbackParamTraits < P1 > : : LocalType a1 ; <nl> typename CallbackParamTraits < P2 > : : LocalType a2 ; <nl> if ( ( holder - > flags & HolderIsFirstArgument ) & & <nl> + ! ( holder - > flags & SafeAfterDestroyed ) & & <nl> DestroyedChecker < typename <nl> CallbackParamTraits < P1 > : : LocalType > : : IsDestroyed ( & args ) ) { <nl> args . ThrowError ( " Object has been destroyed " ) ; <nl> struct Dispatcher < R ( P1 , P2 , P3 ) > { <nl> typename CallbackParamTraits < P2 > : : LocalType a2 ; <nl> typename CallbackParamTraits < P3 > : : LocalType a3 ; <nl> if ( ( holder - > flags & HolderIsFirstArgument ) & & <nl> + ! ( holder - > flags & SafeAfterDestroyed ) & & <nl> DestroyedChecker < typename <nl> CallbackParamTraits < P1 > : : LocalType > : : IsDestroyed ( & args ) ) { <nl> args . ThrowError ( " Object has been destroyed " ) ; <nl> struct Dispatcher < R ( P1 , P2 , P3 , P4 ) > { <nl> typename CallbackParamTraits < P3 > : : LocalType a3 ; <nl> typename CallbackParamTraits < P4 > : : LocalType a4 ; <nl> if ( ( holder - > flags & HolderIsFirstArgument ) & & <nl> + ! ( holder - > flags & SafeAfterDestroyed ) & & <nl> DestroyedChecker < typename <nl> CallbackParamTraits < P1 > : : LocalType > : : IsDestroyed ( & args ) ) { <nl> args . ThrowError ( " Object has been destroyed " ) ; <nl> struct Dispatcher < R ( P1 , P2 , P3 , P4 , P5 ) > { <nl> typename CallbackParamTraits < P4 > : : LocalType a4 ; <nl> typename CallbackParamTraits < P5 > : : LocalType a5 ; <nl> if ( ( holder - > flags & HolderIsFirstArgument ) & & <nl> + ! ( holder - > flags & SafeAfterDestroyed ) & & <nl> DestroyedChecker < typename <nl> CallbackParamTraits < P1 > : : LocalType > : : IsDestroyed ( & args ) ) { <nl> args . ThrowError ( " Object has been destroyed " ) ; <nl> struct Dispatcher < R ( P1 , P2 , P3 , P4 , P5 , P6 ) > { <nl> typename CallbackParamTraits < P5 > : : LocalType a5 ; <nl> typename CallbackParamTraits < P6 > : : LocalType a6 ; <nl> if ( ( holder - > flags & HolderIsFirstArgument ) & & <nl> + ! ( holder - > flags & SafeAfterDestroyed ) & & <nl> DestroyedChecker < typename <nl> CallbackParamTraits < P1 > : : LocalType > : : IsDestroyed ( & args ) ) { <nl> args . ThrowError ( " Object has been destroyed " ) ; <nl> struct Dispatcher < R ( P1 , P2 , P3 , P4 , P5 , P6 , P7 ) > { <nl> typename CallbackParamTraits < P6 > : : LocalType a6 ; <nl> typename CallbackParamTraits < P7 > : : LocalType a7 ; <nl> if ( ( holder - > flags & HolderIsFirstArgument ) & & <nl> + ! ( holder - > flags & SafeAfterDestroyed ) & & <nl> DestroyedChecker < typename <nl> CallbackParamTraits < P1 > : : LocalType > : : IsDestroyed ( & args ) ) { <nl> args . ThrowError ( " Object has been destroyed " ) ; <nl> mmm a / native_mate / function_template . h . pump <nl> ppp b / native_mate / function_template . h . pump <nl> class PerIsolateData ; <nl> <nl> enum CreateFunctionTemplateFlags { <nl> HolderIsFirstArgument = 1 < < 0 , <nl> + SafeAfterDestroyed = 1 < < 1 , <nl> } ; <nl> <nl> namespace internal { <nl> $ for ARG [ [ typename CallbackParamTraits < P $ ( ARG ) > : : LocalType a $ ( ARG ) ; <nl> <nl> ] ] <nl> if ( ( holder - > flags & HolderIsFirstArgument ) & & <nl> + ! ( holder - > flags & SafeAfterDestroyed ) & & <nl> DestroyedChecker < typename CallbackParamTraits < P1 > : : LocalType > : : IsDestroyed ( & args ) ) { <nl> args . ThrowError ( " Object has been destroyed " ) ; <nl> MATE_METHOD_RETURN_UNDEFINED ( ) ; <nl> mmm a / native_mate / object_template_builder . h <nl> ppp b / native_mate / object_template_builder . h <nl> namespace { <nl> template < typename T , typename Enable = void > <nl> struct CallbackTraits { <nl> static v8 : : Local < v8 : : FunctionTemplate > CreateTemplate ( v8 : : Isolate * isolate , <nl> - T callback ) { <nl> + T callback , <nl> + bool = true ) { <nl> return CreateFunctionTemplate ( isolate , base : : Bind ( callback ) ) ; <nl> } <nl> } ; <nl> struct CallbackTraits { <nl> template < typename T > <nl> struct CallbackTraits < base : : Callback < T > > { <nl> static v8 : : Local < v8 : : FunctionTemplate > CreateTemplate ( <nl> - v8 : : Isolate * isolate , const base : : Callback < T > & callback ) { <nl> + v8 : : Isolate * isolate , const base : : Callback < T > & callback , bool = true ) { <nl> return CreateFunctionTemplate ( isolate , callback ) ; <nl> } <nl> } ; <nl> struct CallbackTraits < base : : Callback < T > > { <nl> template < typename T > <nl> struct CallbackTraits < T , typename enable_if < <nl> is_member_function_pointer < T > : : value > : : type > { <nl> - static v8 : : Local < v8 : : FunctionTemplate > CreateTemplate ( v8 : : Isolate * isolate , <nl> - T callback ) { <nl> - return CreateFunctionTemplate ( isolate , base : : Bind ( callback ) , <nl> - HolderIsFirstArgument ) ; <nl> + static v8 : : Local < v8 : : FunctionTemplate > CreateTemplate ( <nl> + v8 : : Isolate * isolate , T callback , bool safe_after_destroyed = false ) { <nl> + int flags = HolderIsFirstArgument ; <nl> + if ( safe_after_destroyed ) <nl> + flags | = SafeAfterDestroyed ; <nl> + return CreateFunctionTemplate ( isolate , base : : Bind ( callback ) , flags ) ; <nl> } <nl> } ; <nl> <nl> class ObjectTemplateBuilder { <nl> / / for creating raw function templates . <nl> template < typename T > <nl> ObjectTemplateBuilder & SetMethod ( const base : : StringPiece & name , <nl> - const T & callback ) { <nl> - return SetImpl ( name , CallbackTraits < T > : : CreateTemplate ( isolate_ , callback ) ) ; <nl> + const T & callback , <nl> + bool safe_after_destroyed = false ) { <nl> + return SetImpl ( name , <nl> + CallbackTraits < T > : : CreateTemplate ( isolate_ , <nl> + callback , <nl> + safe_after_destroyed ) ) ; <nl> } <nl> template < typename T > <nl> ObjectTemplateBuilder & SetProperty ( const base : : StringPiece & name , <nl> - const T & getter ) { <nl> - return SetPropertyImpl ( name , <nl> - CallbackTraits < T > : : CreateTemplate ( isolate_ , getter ) , <nl> - v8 : : Local < v8 : : FunctionTemplate > ( ) ) ; <nl> + const T & getter , <nl> + bool safe_after_destroyed = false ) { <nl> + return SetPropertyImpl ( <nl> + name , <nl> + CallbackTraits < T > : : CreateTemplate ( isolate_ , getter , <nl> + safe_after_destroyed ) , <nl> + v8 : : Local < v8 : : FunctionTemplate > ( ) ) ; <nl> } <nl> template < typename T , typename U > <nl> ObjectTemplateBuilder & SetProperty ( const base : : StringPiece & name , <nl> - const T & getter , const U & setter ) { <nl> - return SetPropertyImpl ( name , <nl> - CallbackTraits < T > : : CreateTemplate ( isolate_ , getter ) , <nl> - CallbackTraits < U > : : CreateTemplate ( isolate_ , setter ) ) ; <nl> + const T & getter , <nl> + const U & setter , <nl> + bool safe_after_destroyed = false ) { <nl> + return SetPropertyImpl ( <nl> + name , <nl> + CallbackTraits < T > : : CreateTemplate ( isolate_ , getter , <nl> + safe_after_destroyed ) , <nl> + CallbackTraits < U > : : CreateTemplate ( isolate_ , setter , <nl> + safe_after_destroyed ) ) ; <nl> } <nl> <nl> v8 : : Local < v8 : : ObjectTemplate > Build ( ) ; <nl>
Allow specify methods that can be called after object is destroyed
electron/electron
41cd6d13c9c9be164f427864277f3cc36b69eb39
2015-07-06T13:25:55Z
new file mode 100644 <nl> index 000000000000 . . 5634482675fa <nl> mmm / dev / null <nl> ppp b / docs / source / notes / ddp . rst <nl> <nl> + . . _ddp : <nl> + <nl> + Distributed Data Parallel <nl> + = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + <nl> + . . warning : : <nl> + The implementation of : class : ` torch . nn . parallel . DistributedDataParallel ` <nl> + evolves over time . This design note is written based on the state as of v1 . 4 . <nl> + <nl> + <nl> + : class : ` torch . nn . parallel . DistributedDataParallel ` ( DDP ) transparently performs <nl> + distributed data parallel training . This page describes how it works and reveals <nl> + implementation details . <nl> + <nl> + Example <nl> + ^ ^ ^ ^ ^ ^ ^ <nl> + <nl> + Let us start with a simple : class : ` torch . nn . parallel . DistributedDataParallel ` <nl> + example . This example uses a : class : ` torch . nn . Linear ` as the local model , wraps <nl> + it with DDP , and then runs one forward pass , one backward pass , and an optimizer <nl> + step on the DDP model . After that , parameters on the local model will be <nl> + updated , and all models on different processes should be exactly the same . <nl> + <nl> + . . code : : <nl> + <nl> + import torch <nl> + import torch . distributed as dist <nl> + import torch . multiprocessing as mp <nl> + import torch . nn as nn <nl> + import torch . optim as optim <nl> + from torch . nn . parallel import DistributedDataParallel as DDP <nl> + <nl> + <nl> + def example ( rank , world_size ) : <nl> + # create default process group <nl> + dist . init_process_group ( " gloo " , rank = rank , world_size = world_size ) <nl> + # create local model <nl> + model = nn . Linear ( 10 , 10 ) . to ( rank ) <nl> + # construct DDP model <nl> + ddp_model = DDP ( model , device_ids = [ rank ] ) <nl> + # define loss function and optimizer <nl> + loss_fn = nn . MSELoss ( ) <nl> + optimizer = optim . SGD ( ddp_model . parameters ( ) , lr = 0 . 001 ) <nl> + <nl> + # forward pass <nl> + outputs = ddp_model ( torch . randn ( 20 , 10 ) . to ( rank ) ) <nl> + labels = torch . randn ( 20 , 10 ) . to ( rank ) <nl> + # backward pass <nl> + loss_fn ( outputs , labels ) . backward ( ) <nl> + # update parameters <nl> + optimizer . step ( ) <nl> + <nl> + def main ( ) : <nl> + world_size = 2 <nl> + mp . spawn ( example , <nl> + args = ( world_size , ) , <nl> + nprocs = world_size , <nl> + join = True ) <nl> + <nl> + if __name__ = = " __main__ " : <nl> + main ( ) <nl> + <nl> + <nl> + <nl> + Internal Design <nl> + ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ <nl> + <nl> + This section reveals how it works under the hood of <nl> + : class : ` torch . nn . parallel . DistributedDataParallel ` by diving into details of <nl> + every step in one iteration . <nl> + <nl> + - * * Prerequisite * * : DDP relies on c10d ` ` ProcessGroup ` ` for communications . <nl> + Hence , applications must create ` ` ProcessGroup ` ` instances before constructing <nl> + DDP . <nl> + - * * Construction * * : The DDP constructor takes a reference to the local module , <nl> + and broadcasts ` ` state_dict ( ) ` ` from the process with rank 0 to all other <nl> + processes in the group to make sure that all model replicas start from the <nl> + exact same state . Then , each DDP process creates a local ` ` Reducer ` ` , which <nl> + later will take care of the gradients synchronization during the backward <nl> + pass . To improve communication efficiency , the ` ` Reducer ` ` organizes parameter <nl> + gradients into buckets , and reduces one bucket at a time . Bucket size can be <nl> + configured by setting the ` bucket_cap_mb ` argument in DDP constructor . The <nl> + mapping from parameter gradients to buckets is determined at the construction <nl> + time , based on the bucket size limit and parameter sizes . Model parameters are <nl> + allocated into buckets in ( roughly ) the reverse order of <nl> + ` ` Model . parameters ( ) ` ` from the given model . The reason for using the reverse <nl> + order is because DDP expects gradients to become ready during the backward <nl> + pass in approximately that order . The figure below shows an example . Note <nl> + that , the ` ` grad0 ` ` and ` ` grad1 ` ` are in ` ` bucket1 ` ` , and the other two <nl> + gradients are in ` ` bucket0 ` ` . Of course , this assumption might not always <nl> + be true , and when that happens it could hurt DDP backward speed as the <nl> + ` ` Reducer ` ` cannot kick off the communication at the earliest possible time . <nl> + Besides bucketing , the ` ` Reducer ` ` also registers autograd hooks during <nl> + construction , one hook per parameter . These hooks will be triggered during <nl> + the backward pass when the gradient becomes ready . <nl> + - * * Forward Pass * * : The DDP takes the input and passes it to the local model , <nl> + and then analyzes the output from the local model if <nl> + ` ` find_unused_parameters ` ` is set to ` ` True ` ` . This mode allows running <nl> + backward on a subgraph of the model , and DDP finds out which parameters are <nl> + involved in the backward pass by traversing the autograd graph from the model <nl> + output and marking all unused parameters as ready for reduction . During the <nl> + backward pass , the ` ` Reducer ` ` would only wait for unready parameters , but it <nl> + would still reduce all buckets . Marking a parameter gradient as ready does not <nl> + help DDP skip buckets as for now , but it will prevent DDP from waiting for <nl> + absent gradients forever during the backward pass . Note that traversing the <nl> + autograd graph introduces extra overheads , so applications should only set <nl> + ` ` find_unused_parameters ` ` to ` ` True ` ` when necessary . <nl> + - * * Backward Pass * * : The ` ` backward ( ) ` ` function is directly invoked on the loss <nl> + ` ` Tensor ` ` , which is out of DDP ' s control , and DDP uses autograd hooks <nl> + registered at construction time to trigger gradients synchronizations . When <nl> + one gradient becomes ready , its corresponding DDP hook on that grad <nl> + accumulator will fire , and DDP will then mark that parameter gradient as <nl> + ready for reduction . When gradients in one bucket are all ready , the <nl> + ` ` Reducer ` ` kicks off an asynchronous ` ` allreduce ` ` on that bucket to <nl> + calculate mean of gradients across all processes . When all buckets are ready , <nl> + the ` ` Reducer ` ` will block waiting for all ` ` allreduce ` ` operations to finish . <nl> + When this is done , averaged gradients are written to the ` ` param . grad ` ` field <nl> + of all parameters . So after the backward pass , the ` grad ` field on the same <nl> + corresponding parameter across different DDP processes should be the same . <nl> + - * * Optimizer Step * * : From the optimizer ' s perspective , it is optimizing a local <nl> + model . Model replicas on all DDP processes can keep in sync because they all <nl> + start from the same state and they have the same averaged gradients in <nl> + every iteration . <nl> + <nl> + <nl> + . . image : : https : / / user - images . githubusercontent . com / 16999635 / 72401724 - d296d880 - 371a - 11ea - 90ab - 737f86543df9 . png <nl> + : alt : ddp_grad_sync . png <nl> + : width : 700 px <nl> + <nl> + . . note : : <nl> + DDP requires ` ` Reducer ` ` instances on all processes to invoke ` ` allreduce ` ` <nl> + in exactly the same order , which is done by always running ` ` allreduce ` ` <nl> + in the bucket index order instead of actual bucket ready order . Mismatched <nl> + ` ` allreduce ` ` order across processes can lead to wrong results or DDP backward <nl> + hang . <nl> + <nl> + Implementation <nl> + ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ <nl> + <nl> + Below are pointers to the DDP implementation components . The stacked graph shows <nl> + the structure of the code . <nl> + <nl> + ProcessGroup <nl> + mmmmmmmmmmmm <nl> + <nl> + - ` ProcessGroup . hpp < https : / / github . com / pytorch / pytorch / blob / v1 . 4 . 0 / torch / lib / c10d / ProcessGroup . hpp > ` __ : <nl> + contains the abstract API of all process group implementations . The ` ` c10d ` ` <nl> + library provides 4 implementations out of the box , namely , <nl> + ` ProcessGroupGloo ` , ` ProcessGroupNCCL ` , ` ProcessGroupMPI ` , and <nl> + ` ProcessGroupRoundRobin ` , where ` ProcessGroupRoundRobin ` is a composition of <nl> + multiple process group instances and launches collective communications in a <nl> + round - robin manner . ` ` DistributedDataParallel ` ` uses <nl> + ` ` ProcessGroup : : broadcast ( ) ` ` to send model states from the process with rank <nl> + 0 to others during initialization and ` ` ProcessGroup : : allreduce ( ) ` ` to sum <nl> + gradients . <nl> + <nl> + <nl> + - ` Store . hpp < https : / / github . com / pytorch / pytorch / blob / v1 . 4 . 0 / torch / lib / c10d / Store . hpp > ` __ : <nl> + assists the rendezvous service for process group instances to find each other . <nl> + <nl> + DistributedDataParallel <nl> + mmmmmmmmmmmmmmmmmmmmm - - <nl> + <nl> + - ` distributed . py < https : / / github . com / pytorch / pytorch / blob / v1 . 4 . 0 / torch / nn / parallel / distributed . py > ` __ : <nl> + is the Python entry point for DDP . It implements the initialization steps and <nl> + the ` ` forward ` ` function for the ` ` nn . parallel . DistributedDataParallel ` ` <nl> + module which call into C + + libraries . Its ` ` _sync_param ` ` function performs <nl> + intra - process parameter synchronization when one DDP process works on multiple <nl> + devices , and it also broadcasts model buffers from the process with rank 0 to <nl> + all other processes . The inter - process parameter synchronization happens in <nl> + ` ` Reducer . cpp ` ` . <nl> + <nl> + - ` comm . h < https : / / github . com / pytorch / pytorch / blob / v1 . 4 . 0 / torch / csrc / distributed / c10d / comm . h > ` __ : <nl> + implements the coalesced broadcast helper function which is invoked to <nl> + broadcast model states during initialization and synchronize model buffers <nl> + before the forward pass . <nl> + <nl> + - ` reducer . h < https : / / github . com / pytorch / pytorch / blob / v1 . 4 . 0 / torch / csrc / distributed / c10d / comm . h > ` __ : <nl> + provides the core implementation for gradient synchronization in the backward <nl> + pass . It has three entry point functions : <nl> + <nl> + * ` ` Reducer ` ` : The constructor is called in ` ` distributed . py ` ` which registers <nl> + ` ` Reducer : : autograd_hook ( ) ` ` to gradient accumulators . <nl> + * ` ` autograd_hook ( ) ` ` function will be invoked by the autograd engine when <nl> + a gradient becomes ready . <nl> + * ` ` prepare_for_backward ( ) ` ` is called at the end of DDP forward pass in <nl> + ` ` distributed . py ` ` . It traverses the autograd graph to find unused <nl> + parameters when ` ` find_unused_parameters ` ` is set to ` ` True ` ` in DDP <nl> + constructor . <nl> + <nl> + . . image : : https : / / user - images . githubusercontent . com / 16999635 / 72313120 - 4e7c1c80 - 3658 - 11ea - 9c6d - 44336b2daeac . png <nl> + : alt : ddp_code . png <nl> + : width : 400 px <nl>
Adding DDP Design Note
pytorch/pytorch
322f34b245b7f3522a527deb09ef6274ccac6f2e
2020-01-15T22:10:45Z
mmm a / src / yuzu / bootmanager . cpp <nl> ppp b / src / yuzu / bootmanager . cpp <nl> void GRenderWindow : : ForwardKeyReleaseEvent ( QKeyEvent * event ) { <nl> } <nl> <nl> void GRenderWindow : : BackupGeometry ( ) { <nl> - geometry = ( ( QWidget * ) this ) - > saveGeometry ( ) ; <nl> + geometry = QWidget : : saveGeometry ( ) ; <nl> } <nl> <nl> void GRenderWindow : : RestoreGeometry ( ) { <nl> void GRenderWindow : : restoreGeometry ( const QByteArray & geometry ) { <nl> QByteArray GRenderWindow : : saveGeometry ( ) { <nl> / / If we are a top - level widget , store the current geometry <nl> / / otherwise , store the last backup <nl> - if ( parent ( ) = = nullptr ) <nl> - return ( ( QWidget * ) this ) - > saveGeometry ( ) ; <nl> - else <nl> - return geometry ; <nl> + if ( parent ( ) = = nullptr ) { <nl> + return QWidget : : saveGeometry ( ) ; <nl> + } <nl> + <nl> + return geometry ; <nl> } <nl> <nl> qreal GRenderWindow : : GetWindowPixelRatio ( ) const { <nl>
yuzu / bootmanager : Remove unnecessary pointer casts
yuzu-emu/yuzu
49e3a6e924c4ee47b3aa5acab2427fab5636793b
2019-06-03T19:31:51Z
mmm a / src / library_gl . js <nl> ppp b / src / library_gl . js <nl> var LibraryGL = { <nl> / / Framebuffer objects <nl> glBlitFramebuffer__sig : ' viiiiiiiiii ' , <nl> glBlitFramebuffer : function ( srcX0 , srcY0 , srcX1 , srcY1 , dstX0 , dstY0 , dstX1 , dstY1 , mask , filter ) { <nl> - GLctx . blitFramebuffer ( srcX0 , srcY0 , srxC1 , srcY1 , dstX0 , dstY0 , dstX1 , dstY1 , mask , filter ) ; <nl> + GLctx . blitFramebuffer ( srcX0 , srcY0 , srcX1 , srcY1 , dstX0 , dstY0 , dstX1 , dstY1 , mask , filter ) ; <nl> } , <nl> <nl> glReadBuffer__sig : ' vi ' , <nl>
Merge pull request from djg / gles3 - glblitframebuffer - typo - fix
emscripten-core/emscripten
e64e7feec514f0058aa758a7a1b49fe5c88683c3
2015-01-29T09:41:51Z
mmm a / bitcoin - qt . pro <nl> ppp b / bitcoin - qt . pro <nl> SOURCES + = src / qt / bitcoin . cpp src / qt / bitcoingui . cpp \ <nl> src / bitcoinrpc . cpp \ <nl> src / rpcdump . cpp \ <nl> src / rpcnet . cpp \ <nl> + src / rpcmining . cpp \ <nl> src / rpcrawtransaction . cpp \ <nl> src / qt / overviewpage . cpp \ <nl> src / qt / csvmodelwriter . cpp \ <nl> mmm a / src / bitcoinrpc . cpp <nl> ppp b / src / bitcoinrpc . cpp <nl> <nl> <nl> # include " main . h " <nl> # include " wallet . h " <nl> - # include " db . h " <nl> # include " walletdb . h " <nl> # include " net . h " <nl> # include " init . h " <nl> extern Value getconnectioncount ( const Array & params , bool fHelp ) ; / / in rpcnet . c <nl> extern Value getpeerinfo ( const Array & params , bool fHelp ) ; <nl> extern Value dumpprivkey ( const Array & params , bool fHelp ) ; / / in rpcdump . cpp <nl> extern Value importprivkey ( const Array & params , bool fHelp ) ; <nl> + <nl> + extern Value getgenerate ( const Array & params , bool fHelp ) ; / / in rpcmining . cpp <nl> + extern Value setgenerate ( const Array & params , bool fHelp ) ; <nl> + extern Value gethashespersec ( const Array & params , bool fHelp ) ; <nl> + extern Value getmininginfo ( const Array & params , bool fHelp ) ; <nl> + extern Value getwork ( const Array & params , bool fHelp ) ; <nl> + extern Value getblocktemplate ( const Array & params , bool fHelp ) ; <nl> + extern Value submitblock ( const Array & params , bool fHelp ) ; <nl> + <nl> extern Value getrawtransaction ( const Array & params , bool fHelp ) ; / / in rcprawtransaction . cpp <nl> extern Value listunspent ( const Array & params , bool fHelp ) ; <nl> extern Value createrawtransaction ( const Array & params , bool fHelp ) ; <nl> Value getdifficulty ( const Array & params , bool fHelp ) <nl> } <nl> <nl> <nl> - Value getgenerate ( const Array & params , bool fHelp ) <nl> - { <nl> - if ( fHelp | | params . size ( ) ! = 0 ) <nl> - throw runtime_error ( <nl> - " getgenerate \ n " <nl> - " Returns true or false . " ) ; <nl> - <nl> - return GetBoolArg ( " - gen " ) ; <nl> - } <nl> - <nl> - <nl> - Value setgenerate ( const Array & params , bool fHelp ) <nl> - { <nl> - if ( fHelp | | params . size ( ) < 1 | | params . size ( ) > 2 ) <nl> - throw runtime_error ( <nl> - " setgenerate < generate > [ genproclimit ] \ n " <nl> - " < generate > is true or false to turn generation on or off . \ n " <nl> - " Generation is limited to [ genproclimit ] processors , - 1 is unlimited . " ) ; <nl> - <nl> - bool fGenerate = true ; <nl> - if ( params . size ( ) > 0 ) <nl> - fGenerate = params [ 0 ] . get_bool ( ) ; <nl> - <nl> - if ( params . size ( ) > 1 ) <nl> - { <nl> - int nGenProcLimit = params [ 1 ] . get_int ( ) ; <nl> - mapArgs [ " - genproclimit " ] = itostr ( nGenProcLimit ) ; <nl> - if ( nGenProcLimit = = 0 ) <nl> - fGenerate = false ; <nl> - } <nl> - mapArgs [ " - gen " ] = ( fGenerate ? " 1 " : " 0 " ) ; <nl> - <nl> - GenerateBitcoins ( fGenerate , pwalletMain ) ; <nl> - return Value : : null ; <nl> - } <nl> - <nl> - <nl> - Value gethashespersec ( const Array & params , bool fHelp ) <nl> - { <nl> - if ( fHelp | | params . size ( ) ! = 0 ) <nl> - throw runtime_error ( <nl> - " gethashespersec \ n " <nl> - " Returns a recent hashes per second performance measurement while generating . " ) ; <nl> - <nl> - if ( GetTimeMillis ( ) - nHPSTimerStart > 8000 ) <nl> - return ( boost : : int64_t ) 0 ; <nl> - return ( boost : : int64_t ) dHashesPerSec ; <nl> - } <nl> - <nl> - <nl> Value getinfo ( const Array & params , bool fHelp ) <nl> { <nl> if ( fHelp | | params . size ( ) ! = 0 ) <nl> Value getinfo ( const Array & params , bool fHelp ) <nl> } <nl> <nl> <nl> - Value getmininginfo ( const Array & params , bool fHelp ) <nl> - { <nl> - if ( fHelp | | params . size ( ) ! = 0 ) <nl> - throw runtime_error ( <nl> - " getmininginfo \ n " <nl> - " Returns an object containing mining - related information . " ) ; <nl> - <nl> - Object obj ; <nl> - obj . push_back ( Pair ( " blocks " , ( int ) nBestHeight ) ) ; <nl> - obj . push_back ( Pair ( " currentblocksize " , ( uint64_t ) nLastBlockSize ) ) ; <nl> - obj . push_back ( Pair ( " currentblocktx " , ( uint64_t ) nLastBlockTx ) ) ; <nl> - obj . push_back ( Pair ( " difficulty " , ( double ) GetDifficulty ( ) ) ) ; <nl> - obj . push_back ( Pair ( " errors " , GetWarnings ( " statusbar " ) ) ) ; <nl> - obj . push_back ( Pair ( " generate " , GetBoolArg ( " - gen " ) ) ) ; <nl> - obj . push_back ( Pair ( " genproclimit " , ( int ) GetArg ( " - genproclimit " , - 1 ) ) ) ; <nl> - obj . push_back ( Pair ( " hashespersec " , gethashespersec ( params , false ) ) ) ; <nl> - obj . push_back ( Pair ( " pooledtx " , ( uint64_t ) mempool . size ( ) ) ) ; <nl> - obj . push_back ( Pair ( " testnet " , fTestNet ) ) ; <nl> - return obj ; <nl> - } <nl> - <nl> - <nl> Value getnewaddress ( const Array & params , bool fHelp ) <nl> { <nl> if ( fHelp | | params . size ( ) > 1 ) <nl> Value validateaddress ( const Array & params , bool fHelp ) <nl> return ret ; <nl> } <nl> <nl> - Value getwork ( const Array & params , bool fHelp ) <nl> - { <nl> - if ( fHelp | | params . size ( ) > 1 ) <nl> - throw runtime_error ( <nl> - " getwork [ data ] \ n " <nl> - " If [ data ] is not specified , returns formatted hash data to work on : \ n " <nl> - " \ " midstate \ " : precomputed hash state after hashing the first half of the data ( DEPRECATED ) \ n " / / deprecated <nl> - " \ " data \ " : block data \ n " <nl> - " \ " hash1 \ " : formatted hash buffer for second hash ( DEPRECATED ) \ n " / / deprecated <nl> - " \ " target \ " : little endian hash target \ n " <nl> - " If [ data ] is specified , tries to solve the block and returns true if it was successful . " ) ; <nl> - <nl> - if ( vNodes . empty ( ) ) <nl> - throw JSONRPCError ( - 9 , " Bitcoin is not connected ! " ) ; <nl> - <nl> - if ( IsInitialBlockDownload ( ) ) <nl> - throw JSONRPCError ( - 10 , " Bitcoin is downloading blocks . . . " ) ; <nl> - <nl> - typedef map < uint256 , pair < CBlock * , CScript > > mapNewBlock_t ; <nl> - static mapNewBlock_t mapNewBlock ; / / FIXME : thread safety <nl> - static vector < CBlock * > vNewBlock ; <nl> - static CReserveKey reservekey ( pwalletMain ) ; <nl> - <nl> - if ( params . size ( ) = = 0 ) <nl> - { <nl> - / / Update block <nl> - static unsigned int nTransactionsUpdatedLast ; <nl> - static CBlockIndex * pindexPrev ; <nl> - static int64 nStart ; <nl> - static CBlock * pblock ; <nl> - if ( pindexPrev ! = pindexBest | | <nl> - ( nTransactionsUpdated ! = nTransactionsUpdatedLast & & GetTime ( ) - nStart > 60 ) ) <nl> - { <nl> - if ( pindexPrev ! = pindexBest ) <nl> - { <nl> - / / Deallocate old blocks since they ' re obsolete now <nl> - mapNewBlock . clear ( ) ; <nl> - BOOST_FOREACH ( CBlock * pblock , vNewBlock ) <nl> - delete pblock ; <nl> - vNewBlock . clear ( ) ; <nl> - } <nl> - <nl> - / / Clear pindexPrev so future getworks make a new block , despite any failures from here on <nl> - pindexPrev = NULL ; <nl> - <nl> - / / Store the pindexBest used before CreateNewBlock , to avoid races <nl> - nTransactionsUpdatedLast = nTransactionsUpdated ; <nl> - CBlockIndex * pindexPrevNew = pindexBest ; <nl> - nStart = GetTime ( ) ; <nl> - <nl> - / / Create new block <nl> - pblock = CreateNewBlock ( reservekey ) ; <nl> - if ( ! pblock ) <nl> - throw JSONRPCError ( - 7 , " Out of memory " ) ; <nl> - vNewBlock . push_back ( pblock ) ; <nl> - <nl> - / / Need to update only after we know CreateNewBlock succeeded <nl> - pindexPrev = pindexPrevNew ; <nl> - } <nl> - <nl> - / / Update nTime <nl> - pblock - > UpdateTime ( pindexPrev ) ; <nl> - pblock - > nNonce = 0 ; <nl> - <nl> - / / Update nExtraNonce <nl> - static unsigned int nExtraNonce = 0 ; <nl> - IncrementExtraNonce ( pblock , pindexPrev , nExtraNonce ) ; <nl> - <nl> - / / Save <nl> - mapNewBlock [ pblock - > hashMerkleRoot ] = make_pair ( pblock , pblock - > vtx [ 0 ] . vin [ 0 ] . scriptSig ) ; <nl> - <nl> - / / Pre - build hash buffers <nl> - char pmidstate [ 32 ] ; <nl> - char pdata [ 128 ] ; <nl> - char phash1 [ 64 ] ; <nl> - FormatHashBuffers ( pblock , pmidstate , pdata , phash1 ) ; <nl> - <nl> - uint256 hashTarget = CBigNum ( ) . SetCompact ( pblock - > nBits ) . getuint256 ( ) ; <nl> - <nl> - Object result ; <nl> - result . push_back ( Pair ( " midstate " , HexStr ( BEGIN ( pmidstate ) , END ( pmidstate ) ) ) ) ; / / deprecated <nl> - result . push_back ( Pair ( " data " , HexStr ( BEGIN ( pdata ) , END ( pdata ) ) ) ) ; <nl> - result . push_back ( Pair ( " hash1 " , HexStr ( BEGIN ( phash1 ) , END ( phash1 ) ) ) ) ; / / deprecated <nl> - result . push_back ( Pair ( " target " , HexStr ( BEGIN ( hashTarget ) , END ( hashTarget ) ) ) ) ; <nl> - return result ; <nl> - } <nl> - else <nl> - { <nl> - / / Parse parameters <nl> - vector < unsigned char > vchData = ParseHex ( params [ 0 ] . get_str ( ) ) ; <nl> - if ( vchData . size ( ) ! = 128 ) <nl> - throw JSONRPCError ( - 8 , " Invalid parameter " ) ; <nl> - CBlock * pdata = ( CBlock * ) & vchData [ 0 ] ; <nl> - <nl> - / / Byte reverse <nl> - for ( int i = 0 ; i < 128 / 4 ; i + + ) <nl> - ( ( unsigned int * ) pdata ) [ i ] = ByteReverse ( ( ( unsigned int * ) pdata ) [ i ] ) ; <nl> - <nl> - / / Get saved block <nl> - if ( ! mapNewBlock . count ( pdata - > hashMerkleRoot ) ) <nl> - return false ; <nl> - CBlock * pblock = mapNewBlock [ pdata - > hashMerkleRoot ] . first ; <nl> - <nl> - pblock - > nTime = pdata - > nTime ; <nl> - pblock - > nNonce = pdata - > nNonce ; <nl> - pblock - > vtx [ 0 ] . vin [ 0 ] . scriptSig = mapNewBlock [ pdata - > hashMerkleRoot ] . second ; <nl> - pblock - > hashMerkleRoot = pblock - > BuildMerkleTree ( ) ; <nl> - <nl> - return CheckWork ( pblock , * pwalletMain , reservekey ) ; <nl> - } <nl> - } <nl> - <nl> - <nl> - Value getblocktemplate ( const Array & params , bool fHelp ) <nl> - { <nl> - if ( fHelp | | params . size ( ) ! = 1 ) <nl> - throw runtime_error ( <nl> - " getblocktemplate [ params ] \ n " <nl> - " If [ params ] does not contain a \ " data \ " key , returns data needed to construct a block to work on : \ n " <nl> - " \ " version \ " : block version \ n " <nl> - " \ " previousblockhash \ " : hash of current highest block \ n " <nl> - " \ " transactions \ " : contents of non - coinbase transactions that should be included in the next block \ n " <nl> - " \ " coinbaseaux \ " : data that should be included in coinbase \ n " <nl> - " \ " coinbasevalue \ " : maximum allowable input to coinbase transaction , including the generation award and transaction fees \ n " <nl> - " \ " target \ " : hash target \ n " <nl> - " \ " mintime \ " : minimum timestamp appropriate for next block \ n " <nl> - " \ " curtime \ " : current timestamp \ n " <nl> - " \ " mutable \ " : list of ways the block template may be changed \ n " <nl> - " \ " noncerange \ " : range of valid nonces \ n " <nl> - " \ " sigoplimit \ " : limit of sigops in blocks \ n " <nl> - " \ " sizelimit \ " : limit of block size \ n " <nl> - " \ " bits \ " : compressed target of next block \ n " <nl> - " \ " height \ " : height of the next block \ n " <nl> - " If [ params ] does contain a \ " data \ " key , tries to solve the block and returns null if it was successful ( and \ " rejected \ " if not ) \ n " <nl> - " See https : / / en . bitcoin . it / wiki / BIP_0022 for full specification . " ) ; <nl> - <nl> - const Object & oparam = params [ 0 ] . get_obj ( ) ; <nl> - std : : string strMode ; <nl> - { <nl> - const Value & modeval = find_value ( oparam , " mode " ) ; <nl> - if ( modeval . type ( ) = = str_type ) <nl> - strMode = modeval . get_str ( ) ; <nl> - else <nl> - if ( find_value ( oparam , " data " ) . type ( ) = = null_type ) <nl> - strMode = " template " ; <nl> - else <nl> - strMode = " submit " ; <nl> - } <nl> - <nl> - if ( strMode = = " template " ) <nl> - { <nl> - if ( vNodes . empty ( ) ) <nl> - throw JSONRPCError ( - 9 , " Bitcoin is not connected ! " ) ; <nl> - <nl> - if ( IsInitialBlockDownload ( ) ) <nl> - throw JSONRPCError ( - 10 , " Bitcoin is downloading blocks . . . " ) ; <nl> - <nl> - static CReserveKey reservekey ( pwalletMain ) ; <nl> - <nl> - / / Update block <nl> - static unsigned int nTransactionsUpdatedLast ; <nl> - static CBlockIndex * pindexPrev ; <nl> - static int64 nStart ; <nl> - static CBlock * pblock ; <nl> - if ( pindexPrev ! = pindexBest | | <nl> - ( nTransactionsUpdated ! = nTransactionsUpdatedLast & & GetTime ( ) - nStart > 5 ) ) <nl> - { <nl> - / / Clear pindexPrev so future calls make a new block , despite any failures from here on <nl> - pindexPrev = NULL ; <nl> - <nl> - / / Store the pindexBest used before CreateNewBlock , to avoid races <nl> - nTransactionsUpdatedLast = nTransactionsUpdated ; <nl> - CBlockIndex * pindexPrevNew = pindexBest ; <nl> - nStart = GetTime ( ) ; <nl> - <nl> - / / Create new block <nl> - if ( pblock ) <nl> - { <nl> - delete pblock ; <nl> - pblock = NULL ; <nl> - } <nl> - pblock = CreateNewBlock ( reservekey ) ; <nl> - if ( ! pblock ) <nl> - throw JSONRPCError ( - 7 , " Out of memory " ) ; <nl> - <nl> - / / Need to update only after we know CreateNewBlock succeeded <nl> - pindexPrev = pindexPrevNew ; <nl> - } <nl> - <nl> - / / Update nTime <nl> - pblock - > UpdateTime ( pindexPrev ) ; <nl> - pblock - > nNonce = 0 ; <nl> - <nl> - Array transactions ; <nl> - map < uint256 , int64_t > setTxIndex ; <nl> - int i = 0 ; <nl> - CTxDB txdb ( " r " ) ; <nl> - BOOST_FOREACH ( CTransaction & tx , pblock - > vtx ) <nl> - { <nl> - uint256 txHash = tx . GetHash ( ) ; <nl> - setTxIndex [ txHash ] = i + + ; <nl> - <nl> - if ( tx . IsCoinBase ( ) ) <nl> - continue ; <nl> - <nl> - Object entry ; <nl> - <nl> - CDataStream ssTx ( SER_NETWORK , PROTOCOL_VERSION ) ; <nl> - ssTx < < tx ; <nl> - entry . push_back ( Pair ( " data " , HexStr ( ssTx . begin ( ) , ssTx . end ( ) ) ) ) ; <nl> - <nl> - entry . push_back ( Pair ( " hash " , txHash . GetHex ( ) ) ) ; <nl> - <nl> - MapPrevTx mapInputs ; <nl> - map < uint256 , CTxIndex > mapUnused ; <nl> - bool fInvalid = false ; <nl> - if ( tx . FetchInputs ( txdb , mapUnused , false , false , mapInputs , fInvalid ) ) <nl> - { <nl> - entry . push_back ( Pair ( " fee " , ( int64_t ) ( tx . GetValueIn ( mapInputs ) - tx . GetValueOut ( ) ) ) ) ; <nl> - <nl> - Array deps ; <nl> - BOOST_FOREACH ( MapPrevTx : : value_type & inp , mapInputs ) <nl> - { <nl> - if ( setTxIndex . count ( inp . first ) ) <nl> - deps . push_back ( setTxIndex [ inp . first ] ) ; <nl> - } <nl> - entry . push_back ( Pair ( " depends " , deps ) ) ; <nl> - <nl> - int64_t nSigOps = tx . GetLegacySigOpCount ( ) ; <nl> - nSigOps + = tx . GetP2SHSigOpCount ( mapInputs ) ; <nl> - entry . push_back ( Pair ( " sigops " , nSigOps ) ) ; <nl> - } <nl> - <nl> - transactions . push_back ( entry ) ; <nl> - } <nl> - <nl> - Object aux ; <nl> - aux . push_back ( Pair ( " flags " , HexStr ( COINBASE_FLAGS . begin ( ) , COINBASE_FLAGS . end ( ) ) ) ) ; <nl> - <nl> - uint256 hashTarget = CBigNum ( ) . SetCompact ( pblock - > nBits ) . getuint256 ( ) ; <nl> - <nl> - static Array aMutable ; <nl> - if ( aMutable . empty ( ) ) <nl> - { <nl> - aMutable . push_back ( " time " ) ; <nl> - aMutable . push_back ( " transactions " ) ; <nl> - aMutable . push_back ( " prevblock " ) ; <nl> - } <nl> - <nl> - Object result ; <nl> - result . push_back ( Pair ( " version " , pblock - > nVersion ) ) ; <nl> - result . push_back ( Pair ( " previousblockhash " , pblock - > hashPrevBlock . GetHex ( ) ) ) ; <nl> - result . push_back ( Pair ( " transactions " , transactions ) ) ; <nl> - result . push_back ( Pair ( " coinbaseaux " , aux ) ) ; <nl> - result . push_back ( Pair ( " coinbasevalue " , ( int64_t ) pblock - > vtx [ 0 ] . vout [ 0 ] . nValue ) ) ; <nl> - result . push_back ( Pair ( " target " , hashTarget . GetHex ( ) ) ) ; <nl> - result . push_back ( Pair ( " mintime " , ( int64_t ) pindexPrev - > GetMedianTimePast ( ) + 1 ) ) ; <nl> - result . push_back ( Pair ( " mutable " , aMutable ) ) ; <nl> - result . push_back ( Pair ( " noncerange " , " 00000000ffffffff " ) ) ; <nl> - result . push_back ( Pair ( " sigoplimit " , ( int64_t ) MAX_BLOCK_SIGOPS ) ) ; <nl> - result . push_back ( Pair ( " sizelimit " , ( int64_t ) MAX_BLOCK_SIZE ) ) ; <nl> - result . push_back ( Pair ( " curtime " , ( int64_t ) pblock - > nTime ) ) ; <nl> - result . push_back ( Pair ( " bits " , HexBits ( pblock - > nBits ) ) ) ; <nl> - result . push_back ( Pair ( " height " , ( int64_t ) ( pindexPrev - > nHeight + 1 ) ) ) ; <nl> - <nl> - return result ; <nl> - } <nl> - else <nl> - if ( strMode = = " submit " ) <nl> - { <nl> - / / Parse parameters <nl> - CDataStream ssBlock ( ParseHex ( find_value ( oparam , " data " ) . get_str ( ) ) , SER_NETWORK , PROTOCOL_VERSION ) ; <nl> - CBlock pblock ; <nl> - ssBlock > > pblock ; <nl> - <nl> - bool fAccepted = ProcessBlock ( NULL , & pblock ) ; <nl> - <nl> - return fAccepted ? Value : : null : " rejected " ; <nl> - } <nl> - <nl> - throw JSONRPCError ( - 8 , " Invalid mode " ) ; <nl> - } <nl> - <nl> Value getrawmempool ( const Array & params , bool fHelp ) <nl> { <nl> if ( fHelp | | params . size ( ) ! = 0 ) <nl> static const CRPCCommand vRPCCommands [ ] = <nl> { " listaccounts " , & listaccounts , false } , <nl> { " settxfee " , & settxfee , false } , <nl> { " getblocktemplate " , & getblocktemplate , true } , <nl> + { " submitblock " , & submitblock , false } , <nl> { " listsinceblock " , & listsinceblock , false } , <nl> { " dumpprivkey " , & dumpprivkey , false } , <nl> { " importprivkey " , & importprivkey , false } , <nl> mmm a / src / makefile . linux - mingw <nl> ppp b / src / makefile . linux - mingw <nl> OBJS = \ <nl> obj / bitcoinrpc . o \ <nl> obj / rpcdump . o \ <nl> obj / rpcnet . o \ <nl> + obj / rpcmining . o \ <nl> obj / rpcrawtransaction . o \ <nl> obj / script . o \ <nl> obj / sync . o \ <nl> mmm a / src / makefile . mingw <nl> ppp b / src / makefile . mingw <nl> OBJS = \ <nl> obj / bitcoinrpc . o \ <nl> obj / rpcdump . o \ <nl> obj / rpcnet . o \ <nl> + obj / rpcmining . o \ <nl> obj / rpcrawtransaction . o \ <nl> obj / script . o \ <nl> obj / sync . o \ <nl> mmm a / src / makefile . osx <nl> ppp b / src / makefile . osx <nl> OBJS = \ <nl> obj / bitcoinrpc . o \ <nl> obj / rpcdump . o \ <nl> obj / rpcnet . o \ <nl> + obj / rpcmining . o \ <nl> obj / rpcrawtransaction . o \ <nl> obj / script . o \ <nl> obj / sync . o \ <nl> mmm a / src / makefile . unix <nl> ppp b / src / makefile . unix <nl> OBJS = \ <nl> obj / bitcoinrpc . o \ <nl> obj / rpcdump . o \ <nl> obj / rpcnet . o \ <nl> + obj / rpcmining . o \ <nl> obj / rpcrawtransaction . o \ <nl> obj / script . o \ <nl> obj / sync . o \ <nl> new file mode 100644 <nl> index 000000000000 . . fa6fdd6d3562 <nl> mmm / dev / null <nl> ppp b / src / rpcmining . cpp <nl> <nl> + / / Copyright ( c ) 2010 Satoshi Nakamoto <nl> + / / Copyright ( c ) 2009 - 2012 The Bitcoin developers <nl> + / / Distributed under the MIT / X11 software license , see the accompanying <nl> + / / file COPYING or http : / / www . opensource . org / licenses / mit - license . php . <nl> + <nl> + # include " main . h " <nl> + # include " db . h " <nl> + # include " init . h " <nl> + # include " bitcoinrpc . h " <nl> + <nl> + using namespace json_spirit ; <nl> + using namespace std ; <nl> + <nl> + extern double GetDifficulty ( const CBlockIndex * blockindex = NULL ) ; <nl> + extern std : : string HexBits ( unsigned int nBits ) ; <nl> + <nl> + Value getgenerate ( const Array & params , bool fHelp ) <nl> + { <nl> + if ( fHelp | | params . size ( ) ! = 0 ) <nl> + throw runtime_error ( <nl> + " getgenerate \ n " <nl> + " Returns true or false . " ) ; <nl> + <nl> + return GetBoolArg ( " - gen " ) ; <nl> + } <nl> + <nl> + <nl> + Value setgenerate ( const Array & params , bool fHelp ) <nl> + { <nl> + if ( fHelp | | params . size ( ) < 1 | | params . size ( ) > 2 ) <nl> + throw runtime_error ( <nl> + " setgenerate < generate > [ genproclimit ] \ n " <nl> + " < generate > is true or false to turn generation on or off . \ n " <nl> + " Generation is limited to [ genproclimit ] processors , - 1 is unlimited . " ) ; <nl> + <nl> + bool fGenerate = true ; <nl> + if ( params . size ( ) > 0 ) <nl> + fGenerate = params [ 0 ] . get_bool ( ) ; <nl> + <nl> + if ( params . size ( ) > 1 ) <nl> + { <nl> + int nGenProcLimit = params [ 1 ] . get_int ( ) ; <nl> + mapArgs [ " - genproclimit " ] = itostr ( nGenProcLimit ) ; <nl> + if ( nGenProcLimit = = 0 ) <nl> + fGenerate = false ; <nl> + } <nl> + mapArgs [ " - gen " ] = ( fGenerate ? " 1 " : " 0 " ) ; <nl> + <nl> + GenerateBitcoins ( fGenerate , pwalletMain ) ; <nl> + return Value : : null ; <nl> + } <nl> + <nl> + <nl> + Value gethashespersec ( const Array & params , bool fHelp ) <nl> + { <nl> + if ( fHelp | | params . size ( ) ! = 0 ) <nl> + throw runtime_error ( <nl> + " gethashespersec \ n " <nl> + " Returns a recent hashes per second performance measurement while generating . " ) ; <nl> + <nl> + if ( GetTimeMillis ( ) - nHPSTimerStart > 8000 ) <nl> + return ( boost : : int64_t ) 0 ; <nl> + return ( boost : : int64_t ) dHashesPerSec ; <nl> + } <nl> + <nl> + <nl> + Value getmininginfo ( const Array & params , bool fHelp ) <nl> + { <nl> + if ( fHelp | | params . size ( ) ! = 0 ) <nl> + throw runtime_error ( <nl> + " getmininginfo \ n " <nl> + " Returns an object containing mining - related information . " ) ; <nl> + <nl> + Object obj ; <nl> + obj . push_back ( Pair ( " blocks " , ( int ) nBestHeight ) ) ; <nl> + obj . push_back ( Pair ( " currentblocksize " , ( uint64_t ) nLastBlockSize ) ) ; <nl> + obj . push_back ( Pair ( " currentblocktx " , ( uint64_t ) nLastBlockTx ) ) ; <nl> + obj . push_back ( Pair ( " difficulty " , ( double ) GetDifficulty ( ) ) ) ; <nl> + obj . push_back ( Pair ( " errors " , GetWarnings ( " statusbar " ) ) ) ; <nl> + obj . push_back ( Pair ( " generate " , GetBoolArg ( " - gen " ) ) ) ; <nl> + obj . push_back ( Pair ( " genproclimit " , ( int ) GetArg ( " - genproclimit " , - 1 ) ) ) ; <nl> + obj . push_back ( Pair ( " hashespersec " , gethashespersec ( params , false ) ) ) ; <nl> + obj . push_back ( Pair ( " pooledtx " , ( uint64_t ) mempool . size ( ) ) ) ; <nl> + obj . push_back ( Pair ( " testnet " , fTestNet ) ) ; <nl> + return obj ; <nl> + } <nl> + <nl> + <nl> + Value getwork ( const Array & params , bool fHelp ) <nl> + { <nl> + if ( fHelp | | params . size ( ) > 1 ) <nl> + throw runtime_error ( <nl> + " getwork [ data ] \ n " <nl> + " If [ data ] is not specified , returns formatted hash data to work on : \ n " <nl> + " \ " midstate \ " : precomputed hash state after hashing the first half of the data ( DEPRECATED ) \ n " / / deprecated <nl> + " \ " data \ " : block data \ n " <nl> + " \ " hash1 \ " : formatted hash buffer for second hash ( DEPRECATED ) \ n " / / deprecated <nl> + " \ " target \ " : little endian hash target \ n " <nl> + " If [ data ] is specified , tries to solve the block and returns true if it was successful . " ) ; <nl> + <nl> + if ( vNodes . empty ( ) ) <nl> + throw JSONRPCError ( - 9 , " Bitcoin is not connected ! " ) ; <nl> + <nl> + if ( IsInitialBlockDownload ( ) ) <nl> + throw JSONRPCError ( - 10 , " Bitcoin is downloading blocks . . . " ) ; <nl> + <nl> + typedef map < uint256 , pair < CBlock * , CScript > > mapNewBlock_t ; <nl> + static mapNewBlock_t mapNewBlock ; / / FIXME : thread safety <nl> + static vector < CBlock * > vNewBlock ; <nl> + static CReserveKey reservekey ( pwalletMain ) ; <nl> + <nl> + if ( params . size ( ) = = 0 ) <nl> + { <nl> + / / Update block <nl> + static unsigned int nTransactionsUpdatedLast ; <nl> + static CBlockIndex * pindexPrev ; <nl> + static int64 nStart ; <nl> + static CBlock * pblock ; <nl> + if ( pindexPrev ! = pindexBest | | <nl> + ( nTransactionsUpdated ! = nTransactionsUpdatedLast & & GetTime ( ) - nStart > 60 ) ) <nl> + { <nl> + if ( pindexPrev ! = pindexBest ) <nl> + { <nl> + / / Deallocate old blocks since they ' re obsolete now <nl> + mapNewBlock . clear ( ) ; <nl> + BOOST_FOREACH ( CBlock * pblock , vNewBlock ) <nl> + delete pblock ; <nl> + vNewBlock . clear ( ) ; <nl> + } <nl> + <nl> + / / Clear pindexPrev so future getworks make a new block , despite any failures from here on <nl> + pindexPrev = NULL ; <nl> + <nl> + / / Store the pindexBest used before CreateNewBlock , to avoid races <nl> + nTransactionsUpdatedLast = nTransactionsUpdated ; <nl> + CBlockIndex * pindexPrevNew = pindexBest ; <nl> + nStart = GetTime ( ) ; <nl> + <nl> + / / Create new block <nl> + pblock = CreateNewBlock ( reservekey ) ; <nl> + if ( ! pblock ) <nl> + throw JSONRPCError ( - 7 , " Out of memory " ) ; <nl> + vNewBlock . push_back ( pblock ) ; <nl> + <nl> + / / Need to update only after we know CreateNewBlock succeeded <nl> + pindexPrev = pindexPrevNew ; <nl> + } <nl> + <nl> + / / Update nTime <nl> + pblock - > UpdateTime ( pindexPrev ) ; <nl> + pblock - > nNonce = 0 ; <nl> + <nl> + / / Update nExtraNonce <nl> + static unsigned int nExtraNonce = 0 ; <nl> + IncrementExtraNonce ( pblock , pindexPrev , nExtraNonce ) ; <nl> + <nl> + / / Save <nl> + mapNewBlock [ pblock - > hashMerkleRoot ] = make_pair ( pblock , pblock - > vtx [ 0 ] . vin [ 0 ] . scriptSig ) ; <nl> + <nl> + / / Pre - build hash buffers <nl> + char pmidstate [ 32 ] ; <nl> + char pdata [ 128 ] ; <nl> + char phash1 [ 64 ] ; <nl> + FormatHashBuffers ( pblock , pmidstate , pdata , phash1 ) ; <nl> + <nl> + uint256 hashTarget = CBigNum ( ) . SetCompact ( pblock - > nBits ) . getuint256 ( ) ; <nl> + <nl> + Object result ; <nl> + result . push_back ( Pair ( " midstate " , HexStr ( BEGIN ( pmidstate ) , END ( pmidstate ) ) ) ) ; / / deprecated <nl> + result . push_back ( Pair ( " data " , HexStr ( BEGIN ( pdata ) , END ( pdata ) ) ) ) ; <nl> + result . push_back ( Pair ( " hash1 " , HexStr ( BEGIN ( phash1 ) , END ( phash1 ) ) ) ) ; / / deprecated <nl> + result . push_back ( Pair ( " target " , HexStr ( BEGIN ( hashTarget ) , END ( hashTarget ) ) ) ) ; <nl> + return result ; <nl> + } <nl> + else <nl> + { <nl> + / / Parse parameters <nl> + vector < unsigned char > vchData = ParseHex ( params [ 0 ] . get_str ( ) ) ; <nl> + if ( vchData . size ( ) ! = 128 ) <nl> + throw JSONRPCError ( - 8 , " Invalid parameter " ) ; <nl> + CBlock * pdata = ( CBlock * ) & vchData [ 0 ] ; <nl> + <nl> + / / Byte reverse <nl> + for ( int i = 0 ; i < 128 / 4 ; i + + ) <nl> + ( ( unsigned int * ) pdata ) [ i ] = ByteReverse ( ( ( unsigned int * ) pdata ) [ i ] ) ; <nl> + <nl> + / / Get saved block <nl> + if ( ! mapNewBlock . count ( pdata - > hashMerkleRoot ) ) <nl> + return false ; <nl> + CBlock * pblock = mapNewBlock [ pdata - > hashMerkleRoot ] . first ; <nl> + <nl> + pblock - > nTime = pdata - > nTime ; <nl> + pblock - > nNonce = pdata - > nNonce ; <nl> + pblock - > vtx [ 0 ] . vin [ 0 ] . scriptSig = mapNewBlock [ pdata - > hashMerkleRoot ] . second ; <nl> + pblock - > hashMerkleRoot = pblock - > BuildMerkleTree ( ) ; <nl> + <nl> + return CheckWork ( pblock , * pwalletMain , reservekey ) ; <nl> + } <nl> + } <nl> + <nl> + <nl> + Value getblocktemplate ( const Array & params , bool fHelp ) <nl> + { <nl> + if ( fHelp | | params . size ( ) > 1 ) <nl> + throw runtime_error ( <nl> + " getblocktemplate [ params ] \ n " <nl> + " Returns data needed to construct a block to work on : \ n " <nl> + " \ " version \ " : block version \ n " <nl> + " \ " previousblockhash \ " : hash of current highest block \ n " <nl> + " \ " transactions \ " : contents of non - coinbase transactions that should be included in the next block \ n " <nl> + " \ " coinbaseaux \ " : data that should be included in coinbase \ n " <nl> + " \ " coinbasevalue \ " : maximum allowable input to coinbase transaction , including the generation award and transaction fees \ n " <nl> + " \ " target \ " : hash target \ n " <nl> + " \ " mintime \ " : minimum timestamp appropriate for next block \ n " <nl> + " \ " curtime \ " : current timestamp \ n " <nl> + " \ " mutable \ " : list of ways the block template may be changed \ n " <nl> + " \ " noncerange \ " : range of valid nonces \ n " <nl> + " \ " sigoplimit \ " : limit of sigops in blocks \ n " <nl> + " \ " sizelimit \ " : limit of block size \ n " <nl> + " \ " bits \ " : compressed target of next block \ n " <nl> + " \ " height \ " : height of the next block \ n " <nl> + " See https : / / en . bitcoin . it / wiki / BIP_0022 for full specification . " ) ; <nl> + <nl> + std : : string strMode = " template " ; <nl> + if ( params . size ( ) > 0 ) <nl> + { <nl> + const Object & oparam = params [ 0 ] . get_obj ( ) ; <nl> + const Value & modeval = find_value ( oparam , " mode " ) ; <nl> + if ( modeval . type ( ) = = str_type ) <nl> + strMode = modeval . get_str ( ) ; <nl> + else <nl> + throw JSONRPCError ( - 8 , " Invalid mode " ) ; <nl> + } <nl> + <nl> + if ( strMode ! = " template " ) <nl> + throw JSONRPCError ( - 8 , " Invalid mode " ) ; <nl> + <nl> + if ( vNodes . empty ( ) ) <nl> + throw JSONRPCError ( - 9 , " Bitcoin is not connected ! " ) ; <nl> + <nl> + if ( IsInitialBlockDownload ( ) ) <nl> + throw JSONRPCError ( - 10 , " Bitcoin is downloading blocks . . . " ) ; <nl> + <nl> + static CReserveKey reservekey ( pwalletMain ) ; <nl> + <nl> + / / Update block <nl> + static unsigned int nTransactionsUpdatedLast ; <nl> + static CBlockIndex * pindexPrev ; <nl> + static int64 nStart ; <nl> + static CBlock * pblock ; <nl> + if ( pindexPrev ! = pindexBest | | <nl> + ( nTransactionsUpdated ! = nTransactionsUpdatedLast & & GetTime ( ) - nStart > 5 ) ) <nl> + { <nl> + / / Clear pindexPrev so future calls make a new block , despite any failures from here on <nl> + pindexPrev = NULL ; <nl> + <nl> + / / Store the pindexBest used before CreateNewBlock , to avoid races <nl> + nTransactionsUpdatedLast = nTransactionsUpdated ; <nl> + CBlockIndex * pindexPrevNew = pindexBest ; <nl> + nStart = GetTime ( ) ; <nl> + <nl> + / / Create new block <nl> + if ( pblock ) <nl> + { <nl> + delete pblock ; <nl> + pblock = NULL ; <nl> + } <nl> + pblock = CreateNewBlock ( reservekey ) ; <nl> + if ( ! pblock ) <nl> + throw JSONRPCError ( - 7 , " Out of memory " ) ; <nl> + <nl> + / / Need to update only after we know CreateNewBlock succeeded <nl> + pindexPrev = pindexPrevNew ; <nl> + } <nl> + <nl> + / / Update nTime <nl> + pblock - > UpdateTime ( pindexPrev ) ; <nl> + pblock - > nNonce = 0 ; <nl> + <nl> + Array transactions ; <nl> + map < uint256 , int64_t > setTxIndex ; <nl> + int i = 0 ; <nl> + CTxDB txdb ( " r " ) ; <nl> + BOOST_FOREACH ( CTransaction & tx , pblock - > vtx ) <nl> + { <nl> + uint256 txHash = tx . GetHash ( ) ; <nl> + setTxIndex [ txHash ] = i + + ; <nl> + <nl> + if ( tx . IsCoinBase ( ) ) <nl> + continue ; <nl> + <nl> + Object entry ; <nl> + <nl> + CDataStream ssTx ( SER_NETWORK , PROTOCOL_VERSION ) ; <nl> + ssTx < < tx ; <nl> + entry . push_back ( Pair ( " data " , HexStr ( ssTx . begin ( ) , ssTx . end ( ) ) ) ) ; <nl> + <nl> + entry . push_back ( Pair ( " hash " , txHash . GetHex ( ) ) ) ; <nl> + <nl> + MapPrevTx mapInputs ; <nl> + map < uint256 , CTxIndex > mapUnused ; <nl> + bool fInvalid = false ; <nl> + if ( tx . FetchInputs ( txdb , mapUnused , false , false , mapInputs , fInvalid ) ) <nl> + { <nl> + entry . push_back ( Pair ( " fee " , ( int64_t ) ( tx . GetValueIn ( mapInputs ) - tx . GetValueOut ( ) ) ) ) ; <nl> + <nl> + Array deps ; <nl> + BOOST_FOREACH ( MapPrevTx : : value_type & inp , mapInputs ) <nl> + { <nl> + if ( setTxIndex . count ( inp . first ) ) <nl> + deps . push_back ( setTxIndex [ inp . first ] ) ; <nl> + } <nl> + entry . push_back ( Pair ( " depends " , deps ) ) ; <nl> + <nl> + int64_t nSigOps = tx . GetLegacySigOpCount ( ) ; <nl> + nSigOps + = tx . GetP2SHSigOpCount ( mapInputs ) ; <nl> + entry . push_back ( Pair ( " sigops " , nSigOps ) ) ; <nl> + } <nl> + <nl> + transactions . push_back ( entry ) ; <nl> + } <nl> + <nl> + Object aux ; <nl> + aux . push_back ( Pair ( " flags " , HexStr ( COINBASE_FLAGS . begin ( ) , COINBASE_FLAGS . end ( ) ) ) ) ; <nl> + <nl> + uint256 hashTarget = CBigNum ( ) . SetCompact ( pblock - > nBits ) . getuint256 ( ) ; <nl> + <nl> + static Array aMutable ; <nl> + if ( aMutable . empty ( ) ) <nl> + { <nl> + aMutable . push_back ( " time " ) ; <nl> + aMutable . push_back ( " transactions " ) ; <nl> + aMutable . push_back ( " prevblock " ) ; <nl> + } <nl> + <nl> + Object result ; <nl> + result . push_back ( Pair ( " version " , pblock - > nVersion ) ) ; <nl> + result . push_back ( Pair ( " previousblockhash " , pblock - > hashPrevBlock . GetHex ( ) ) ) ; <nl> + result . push_back ( Pair ( " transactions " , transactions ) ) ; <nl> + result . push_back ( Pair ( " coinbaseaux " , aux ) ) ; <nl> + result . push_back ( Pair ( " coinbasevalue " , ( int64_t ) pblock - > vtx [ 0 ] . vout [ 0 ] . nValue ) ) ; <nl> + result . push_back ( Pair ( " target " , hashTarget . GetHex ( ) ) ) ; <nl> + result . push_back ( Pair ( " mintime " , ( int64_t ) pindexPrev - > GetMedianTimePast ( ) + 1 ) ) ; <nl> + result . push_back ( Pair ( " mutable " , aMutable ) ) ; <nl> + result . push_back ( Pair ( " noncerange " , " 00000000ffffffff " ) ) ; <nl> + result . push_back ( Pair ( " sigoplimit " , ( int64_t ) MAX_BLOCK_SIGOPS ) ) ; <nl> + result . push_back ( Pair ( " sizelimit " , ( int64_t ) MAX_BLOCK_SIZE ) ) ; <nl> + result . push_back ( Pair ( " curtime " , ( int64_t ) pblock - > nTime ) ) ; <nl> + result . push_back ( Pair ( " bits " , HexBits ( pblock - > nBits ) ) ) ; <nl> + result . push_back ( Pair ( " height " , ( int64_t ) ( pindexPrev - > nHeight + 1 ) ) ) ; <nl> + <nl> + return result ; <nl> + } <nl> + <nl> + Value submitblock ( const Array & params , bool fHelp ) <nl> + { <nl> + if ( fHelp | | params . size ( ) < 1 | | params . size ( ) > 2 ) <nl> + throw runtime_error ( <nl> + " submitblock < hex data > [ optional - params - obj ] \ n " <nl> + " [ optional - params - obj ] parameter is currently ignored . \ n " <nl> + " Attempts to submit new block to network . \ n " <nl> + " See https : / / en . bitcoin . it / wiki / BIP_0022 for full specification . " ) ; <nl> + <nl> + vector < unsigned char > blockData ( ParseHex ( params [ 0 ] . get_str ( ) ) ) ; <nl> + CDataStream ssBlock ( blockData , SER_NETWORK , PROTOCOL_VERSION ) ; <nl> + CBlock block ; <nl> + try { <nl> + ssBlock > > block ; <nl> + } <nl> + catch ( std : : exception & e ) { <nl> + throw JSONRPCError ( - 22 , " Block decode failed " ) ; <nl> + } <nl> + <nl> + bool fAccepted = ProcessBlock ( NULL , & block ) ; <nl> + if ( ! fAccepted ) <nl> + return " rejected " ; <nl> + <nl> + return Value : : null ; <nl> + } <nl> + <nl>
Merge pull request from jgarzik / submitwork
bitcoin/bitcoin
a483c27704fb22ddd3dce50db69cfca110d23b0f
2012-08-21T06:49:45Z
mmm a / src / api . cc <nl> ppp b / src / api . cc <nl> v8 : : TryCatch : : TryCatch ( ) <nl> ResetInternal ( ) ; <nl> / / Special handling for simulators which have a separate JS stack . <nl> js_stack_comparable_address_ = <nl> - reinterpret_cast < void * > ( v8 : : internal : : SimulatorStack : : RegisterCTryCatch ( <nl> - isolate_ , v8 : : internal : : GetCurrentStackPosition ( ) ) ) ; <nl> + reinterpret_cast < void * > ( i : : SimulatorStack : : RegisterCTryCatch ( <nl> + isolate_ , i : : GetCurrentStackPosition ( ) ) ) ; <nl> isolate_ - > RegisterTryCatchHandler ( this ) ; <nl> } <nl> <nl> v8 : : TryCatch : : TryCatch ( v8 : : Isolate * isolate ) <nl> ResetInternal ( ) ; <nl> / / Special handling for simulators which have a separate JS stack . <nl> js_stack_comparable_address_ = <nl> - reinterpret_cast < void * > ( v8 : : internal : : SimulatorStack : : RegisterCTryCatch ( <nl> - isolate_ , v8 : : internal : : GetCurrentStackPosition ( ) ) ) ; <nl> + reinterpret_cast < void * > ( i : : SimulatorStack : : RegisterCTryCatch ( <nl> + isolate_ , i : : GetCurrentStackPosition ( ) ) ) ; <nl> isolate_ - > RegisterTryCatchHandler ( this ) ; <nl> } <nl> <nl> v8 : : TryCatch : : ~ TryCatch ( ) { <nl> isolate_ - > RestorePendingMessageFromTryCatch ( this ) ; <nl> } <nl> isolate_ - > UnregisterTryCatchHandler ( this ) ; <nl> - v8 : : internal : : SimulatorStack : : UnregisterCTryCatch ( isolate_ ) ; <nl> + i : : SimulatorStack : : UnregisterCTryCatch ( isolate_ ) ; <nl> reinterpret_cast < Isolate * > ( isolate_ ) - > ThrowException ( exc ) ; <nl> DCHECK ( ! isolate_ - > thread_local_top ( ) - > rethrowing_message_ ) ; <nl> } else { <nl> v8 : : TryCatch : : ~ TryCatch ( ) { <nl> isolate_ - > CancelScheduledExceptionFromTryCatch ( this ) ; <nl> } <nl> isolate_ - > UnregisterTryCatchHandler ( this ) ; <nl> - v8 : : internal : : SimulatorStack : : UnregisterCTryCatch ( isolate_ ) ; <nl> + i : : SimulatorStack : : UnregisterCTryCatch ( isolate_ ) ; <nl> } <nl> } <nl> <nl> v8 : : Local < Value > Isolate : : ThrowException ( v8 : : Local < v8 : : Value > value ) { <nl> void Isolate : : SetObjectGroupId ( internal : : Object * * object , UniqueId id ) { <nl> i : : Isolate * internal_isolate = reinterpret_cast < i : : Isolate * > ( this ) ; <nl> internal_isolate - > global_handles ( ) - > SetObjectGroupId ( <nl> - v8 : : internal : : Handle < v8 : : internal : : Object > ( object ) . location ( ) , <nl> - id ) ; <nl> + i : : Handle < i : : Object > ( object ) . location ( ) , id ) ; <nl> } <nl> <nl> <nl> void Isolate : : SetReferenceFromGroup ( UniqueId id , internal : : Object * * object ) { <nl> i : : Isolate * internal_isolate = reinterpret_cast < i : : Isolate * > ( this ) ; <nl> internal_isolate - > global_handles ( ) - > SetReferenceFromGroup ( <nl> - id , <nl> - v8 : : internal : : Handle < v8 : : internal : : Object > ( object ) . location ( ) ) ; <nl> + id , i : : Handle < i : : Object > ( object ) . location ( ) ) ; <nl> } <nl> <nl> <nl> void Isolate : : SetReference ( internal : : Object * * parent , <nl> internal : : Object * * child ) { <nl> i : : Isolate * internal_isolate = reinterpret_cast < i : : Isolate * > ( this ) ; <nl> - i : : Object * * parent_location = <nl> - v8 : : internal : : Handle < v8 : : internal : : Object > ( parent ) . location ( ) ; <nl> + i : : Object * * parent_location = i : : Handle < i : : Object > ( parent ) . location ( ) ; <nl> internal_isolate - > global_handles ( ) - > SetReference ( <nl> reinterpret_cast < i : : HeapObject * * > ( parent_location ) , <nl> - v8 : : internal : : Handle < v8 : : internal : : Object > ( child ) . location ( ) ) ; <nl> + i : : Handle < i : : Object > ( child ) . location ( ) ) ; <nl> } <nl> <nl> <nl>
Minor cleanup . Use namespace i instead of v8 : : internal .
v8/v8
93358294af8bed5b9dcae671a659b868c6cb7389
2016-08-29T09:34:45Z
mmm a / src / openalpr / support / timing . cpp <nl> ppp b / src / openalpr / support / timing . cpp <nl> <nl> # include " timing . h " <nl> <nl> + # ifdef __MACH__ <nl> + # include < mach / clock . h > <nl> + # include < mach / mach . h > <nl> + # endif <nl> + <nl> # ifdef WINDOWS <nl> <nl> <nl> timespec diff ( timespec start , timespec end ) ; <nl> <nl> void getTime ( timespec * time ) <nl> { <nl> + <nl> + # ifdef __MACH__ / / OS X does not have clock_gettime , use clock_get_time <nl> + clock_serv_t cclock ; <nl> + mach_timespec_t mts ; <nl> + host_get_clock_service ( mach_host_self ( ) , CALENDAR_CLOCK , & cclock ) ; <nl> + clock_get_time ( cclock , & mts ) ; <nl> + mach_port_deallocate ( mach_task_self ( ) , cclock ) ; <nl> + time - > tv_sec = mts . tv_sec ; <nl> + time - > tv_nsec = mts . tv_nsec ; <nl> + # else <nl> clock_gettime ( CLOCK_PROCESS_CPUTIME_ID , time ) ; <nl> + # endif <nl> + <nl> } <nl> double diffclock ( timespec time1 , timespec time2 ) <nl> { <nl>
Added timing support for Mac OS X
openalpr/openalpr
09db5395897c104f2a2d5e5adc8592ef4000c3b9
2014-02-11T12:10:06Z
mmm a / include / swoole . h <nl> ppp b / include / swoole . h <nl> typedef unsigned long ulong_t ; <nl> # endif <nl> <nl> # define SW_START_LINE " mmmmmmmmmmmmmmmmmmmmmmmm - STARTmmmmmmmmmmmmmmmmmmmmmmmmmmm - " <nl> - # define SW_END_LINE " mmmmmmmmmmmmmmmmmmmmmmmm - ENDmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm " <nl> + # define SW_END_LINE " mmmmmmmmmmmmmmmmmmmmmmmm - - ENDmmmmmmmmmmmmmmmmmmmmmmmmmmm - - " <nl> # define SW_ECHO_RED " \ e [ 31m % s \ e [ 0m " <nl> # define SW_ECHO_GREEN " \ e [ 32m % s \ e [ 0m " <nl> # define SW_ECHO_YELLOW " \ e [ 33m % s \ e [ 0m " <nl> typedef unsigned long ulong_t ; <nl> # include " array . h " <nl> # include " error . h " <nl> <nl> - # define SW_MAX_UINT UINT_MAX <nl> - # define SW_MAX_INT INT_MAX <nl> - <nl> # ifndef MAX <nl> # define MAX ( A , B ) ( ( A ) > ( B ) ? ( A ) : ( B ) ) <nl> # endif <nl> typedef unsigned long ulong_t ; <nl> # else <nl> # define SW_ASSERT ( e ) <nl> # endif <nl> - # define SW_STRS ( s ) s , sizeof ( s ) <nl> - # define SW_STRL ( s ) s , sizeof ( s ) - 1 <nl> # define SW_START_SLEEP usleep ( 100000 ) / / sleep 1s , wait fork and pthread_create <nl> <nl> + / * mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - Memorymmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm * / <nl> + <nl> + # define SW_MEM_ALIGNED_SIZE ( size ) \ <nl> + SW_MM_ALIGNED_SIZE_EX ( size , 8 ) <nl> + # define SW_MEM_ALIGNED_SIZE_EX ( size , alignment ) \ <nl> + ( ( ( size ) + ( ( alignment ) - 1LL ) ) & ~ ( ( alignment ) - 1LL ) ) <nl> + <nl> # ifdef SW_USE_EMALLOC <nl> # define sw_malloc emalloc <nl> # define sw_free efree <nl> typedef unsigned long ulong_t ; <nl> # endif <nl> # endif <nl> <nl> - / * * <nl> - * always return less than size <nl> - * / <nl> - size_t sw_snprintf ( char * buf , size_t s , const char * format , . . . ) ; <nl> + / * mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - Stringmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - * / <nl> + <nl> + # define SW_STRS ( s ) s , sizeof ( s ) <nl> + # define SW_STRL ( s ) s , sizeof ( s ) - 1 <nl> + <nl> + # if defined ( SW_USE_JEMALLOC ) | | defined ( SW_USE_TCMALLOC ) <nl> + # define sw_strdup swoole_strdup <nl> + # define sw_strndup swoole_strndup <nl> + # else <nl> + # define sw_strdup strdup <nl> + # define sw_strndup strndup <nl> + # endif <nl> <nl> - # define SW_MEM_ALIGNED_SIZE ( size ) SW_MM_ALIGNED_SIZE_EX ( size , 8 ) <nl> - # define SW_MEM_ALIGNED_SIZE_EX ( size , alignment ) ( ( ( size ) + ( ( alignment ) - 1LL ) ) & ~ ( ( alignment ) - 1LL ) ) <nl> + / * * always return less than size * / <nl> + size_t sw_snprintf ( char * buf , size_t s , const char * format , . . . ) ; <nl> <nl> static sw_inline char * swoole_strdup ( const char * s ) <nl> { <nl> static sw_inline char * swoole_strndup ( const char * s , size_t n ) <nl> return p ; <nl> } <nl> <nl> - # if defined ( SW_USE_JEMALLOC ) | | defined ( SW_USE_TCMALLOC ) <nl> - # define sw_strdup swoole_strdup <nl> - # define sw_strndup swoole_strndup <nl> - # else <nl> - # define sw_strdup strdup <nl> - # define sw_strndup strndup <nl> - # endif <nl> + / * mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - Constantsmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm * / <nl> <nl> - # define METHOD_DEF ( class , name , . . . ) class # # _ # # name ( class * object , # # __VA_ARGS__ ) <nl> - # define METHOD ( class , name , . . . ) class # # _ # # name ( object , # # __VA_ARGS__ ) <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> # define SW_OK 0 <nl> # define SW_ERR - 1 <nl> # define SW_AGAIN - 2 <nl> mmm a / src / network / manager . c <nl> ppp b / src / network / manager . c <nl> static int swManager_loop ( swFactory * factory ) <nl> new_pid = swManager_spawn_worker ( factory , i ) ; <nl> if ( new_pid < 0 ) <nl> { <nl> - usleep ( 100000 ) ; <nl> + SW_START_SLEEP ; <nl> continue ; <nl> } <nl> else <nl> mmm a / src / network / task_worker . c <nl> ppp b / src / network / task_worker . c <nl> static int swTaskWorker_loop_async ( swProcessPool * pool , swWorker * worker ) <nl> { <nl> worker = swServer_get_worker ( serv , i ) ; <nl> pipe_socket = swReactor_get ( SwooleG . main_reactor , worker - > pipe_master ) ; <nl> - pipe_socket - > buffer_size = SW_MAX_INT ; <nl> + pipe_socket - > buffer_size = INT_MAX ; <nl> pipe_socket = swReactor_get ( SwooleG . main_reactor , worker - > pipe_worker ) ; <nl> - pipe_socket - > buffer_size = SW_MAX_INT ; <nl> + pipe_socket - > buffer_size = INT_MAX ; <nl> } <nl> <nl> # ifdef HAVE_SIGNALFD <nl> mmm a / src / network / worker . c <nl> ppp b / src / network / worker . c <nl> int swWorker_loop ( swFactory * factory , int worker_id ) <nl> { <nl> worker = swServer_get_worker ( serv , i ) ; <nl> pipe_socket = swReactor_get ( SwooleG . main_reactor , worker - > pipe_master ) ; <nl> - pipe_socket - > buffer_size = SW_MAX_INT ; <nl> + pipe_socket - > buffer_size = INT_MAX ; <nl> pipe_socket = swReactor_get ( SwooleG . main_reactor , worker - > pipe_worker ) ; <nl> - pipe_socket - > buffer_size = SW_MAX_INT ; <nl> + pipe_socket - > buffer_size = INT_MAX ; <nl> } <nl> <nl> if ( serv - > dispatch_mode = = SW_DISPATCH_STREAM ) <nl> int swWorker_loop ( swFactory * factory , int worker_id ) <nl> SwooleG . main_reactor - > setHandle ( SwooleG . main_reactor , SW_FD_LISTEN , swWorker_onStreamAccept ) ; <nl> SwooleG . main_reactor - > setHandle ( SwooleG . main_reactor , SW_FD_STREAM , swWorker_onStreamRead ) ; <nl> swStream_set_protocol ( & serv - > stream_protocol ) ; <nl> - serv - > stream_protocol . package_max_length = SW_MAX_INT ; <nl> + serv - > stream_protocol . package_max_length = INT_MAX ; <nl> serv - > stream_protocol . onPackage = swWorker_onStreamPackage ; <nl> serv - > buffer_pool = swLinkedList_new ( 0 , NULL ) ; <nl> } <nl> mmm a / src / reactor / select . c <nl> ppp b / src / reactor / select . c <nl> int swReactorSelect_wait ( swReactor * reactor , struct timeval * timeo ) <nl> <nl> if ( reactor - > timeout_msec < 0 ) <nl> { <nl> - timeout . tv_sec = SW_MAX_UINT ; <nl> + timeout . tv_sec = UINT_MAX ; <nl> timeout . tv_usec = 0 ; <nl> } <nl> else <nl> mmm a / swoole_async . cc <nl> ppp b / swoole_async . cc <nl> PHP_FUNCTION ( swoole_async_set ) <nl> { <nl> convert_to_long ( v ) ; <nl> SwooleG . socket_buffer_size = Z_LVAL_P ( v ) ; <nl> - if ( SwooleG . socket_buffer_size < = 0 | | SwooleG . socket_buffer_size > SW_MAX_INT ) <nl> + if ( SwooleG . socket_buffer_size < = 0 | | SwooleG . socket_buffer_size > INT_MAX ) <nl> { <nl> - SwooleG . socket_buffer_size = SW_MAX_INT ; <nl> + SwooleG . socket_buffer_size = INT_MAX ; <nl> } <nl> } <nl> if ( php_swoole_array_get_value ( vht , " log_level " , v ) ) <nl> mmm a / swoole_atomic . c <nl> ppp b / swoole_atomic . c <nl> PHP_METHOD ( swoole_atomic , wait ) <nl> # ifdef HAVE_FUTEX <nl> SW_CHECK_RETURN ( swoole_futex_wait ( atomic , timeout ) ) ; <nl> # else <nl> - timeout = timeout < = 0 ? SW_MAX_INT : timeout ; <nl> + timeout = timeout < = 0 ? INT_MAX : timeout ; <nl> int32_t i = ( int32_t ) sw_atomic_add_fetch ( atomic , 1 ) ; <nl> while ( timeout > 0 ) <nl> { <nl> mmm a / swoole_client . cc <nl> ppp b / swoole_client . cc <nl> void php_swoole_client_check_setting ( swClient * cli , zval * zset ) <nl> value = ( int ) Z_LVAL_P ( v ) ; <nl> if ( value < = 0 ) <nl> { <nl> - value = SW_MAX_INT ; <nl> + value = INT_MAX ; <nl> } <nl> swSocket_set_buffer_size ( cli - > socket - > fd , value ) ; <nl> cli - > socket - > buffer_size = value ; <nl> mmm a / swoole_client_coro . cc <nl> ppp b / swoole_client_coro . cc <nl> void sw_coro_socket_set ( Socket * cli , zval * zset ) <nl> value = ( int ) Z_LVAL_P ( v ) ; <nl> if ( value < = 0 ) <nl> { <nl> - value = SW_MAX_INT ; <nl> + value = INT_MAX ; <nl> } <nl> swSocket_set_buffer_size ( cli - > socket - > fd , value ) ; <nl> cli - > socket - > buffer_size = value ; <nl> mmm a / swoole_server . cc <nl> ppp b / swoole_server . cc <nl> int php_swoole_task_pack ( swEventData * task , zval * data ) <nl> task - > info . type = SW_EVENT_TASK ; <nl> / / field fd save task_id <nl> task - > info . fd = php_swoole_task_id + + ; <nl> - if ( unlikely ( php_swoole_task_id > = SW_MAX_INT ) ) <nl> + if ( unlikely ( php_swoole_task_id > = INT_MAX ) ) <nl> { <nl> php_swoole_task_id = 0 ; <nl> } <nl> mmm a / swoole_server_port . cc <nl> ppp b / swoole_server_port . cc <nl> static PHP_METHOD ( swoole_server_port , set ) <nl> port - > socket_buffer_size = ( int ) Z_LVAL_P ( v ) ; <nl> if ( port - > socket_buffer_size < = 0 ) <nl> { <nl> - port - > socket_buffer_size = SW_MAX_INT ; <nl> + port - > socket_buffer_size = INT_MAX ; <nl> } <nl> } <nl> / * * <nl> static PHP_METHOD ( swoole_server_port , set ) <nl> port - > kernel_socket_recv_buffer_size = ( int ) Z_LVAL_P ( v ) ; <nl> if ( port - > kernel_socket_recv_buffer_size < = 0 ) <nl> { <nl> - port - > kernel_socket_recv_buffer_size = SW_MAX_INT ; <nl> + port - > kernel_socket_recv_buffer_size = INT_MAX ; <nl> } <nl> } <nl> / * * <nl> static PHP_METHOD ( swoole_server_port , set ) <nl> port - > kernel_socket_send_buffer_size = ( int ) Z_LVAL_P ( v ) ; <nl> if ( port - > kernel_socket_send_buffer_size < = 0 ) <nl> { <nl> - port - > kernel_socket_send_buffer_size = SW_MAX_INT ; <nl> + port - > kernel_socket_send_buffer_size = INT_MAX ; <nl> } <nl> } <nl> if ( php_swoole_array_get_value ( vht , " buffer_high_watermark " , v ) ) <nl>
Codes sort , replace SW_MAX_INT to INT_MAX , replace usleep to SW_START_SLEEP , remove useless macros .
swoole/swoole-src
d80324fcbc7331a09baf0a672417f2d47706a0be
2019-01-16T05:54:53Z
mmm a / Makefile <nl> ppp b / Makefile <nl> chttp2_fake_security_request_response_with_payload_and_call_creds_test : $ ( BINDIR <nl> chttp2_fake_security_request_response_with_trailing_metadata_and_payload_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_request_response_with_trailing_metadata_and_payload_test <nl> chttp2_fake_security_request_with_large_metadata_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_request_with_large_metadata_test <nl> chttp2_fake_security_request_with_payload_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_request_with_payload_test <nl> + chttp2_fake_security_server_finishes_request_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_server_finishes_request_test <nl> chttp2_fake_security_simple_delayed_request_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_simple_delayed_request_test <nl> chttp2_fake_security_simple_request_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_simple_request_test <nl> chttp2_fake_security_simple_request_with_high_initial_sequence_number_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_simple_request_with_high_initial_sequence_number_test <nl> chttp2_fullstack_request_response_with_payload_and_call_creds_test : $ ( BINDIR ) / $ ( <nl> chttp2_fullstack_request_response_with_trailing_metadata_and_payload_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_request_response_with_trailing_metadata_and_payload_test <nl> chttp2_fullstack_request_with_large_metadata_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_request_with_large_metadata_test <nl> chttp2_fullstack_request_with_payload_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_request_with_payload_test <nl> + chttp2_fullstack_server_finishes_request_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_server_finishes_request_test <nl> chttp2_fullstack_simple_delayed_request_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_simple_delayed_request_test <nl> chttp2_fullstack_simple_request_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_simple_request_test <nl> chttp2_fullstack_simple_request_with_high_initial_sequence_number_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_simple_request_with_high_initial_sequence_number_test <nl> chttp2_fullstack_uds_posix_request_response_with_payload_and_call_creds_test : $ ( <nl> chttp2_fullstack_uds_posix_request_response_with_trailing_metadata_and_payload_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_request_response_with_trailing_metadata_and_payload_test <nl> chttp2_fullstack_uds_posix_request_with_large_metadata_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_request_with_large_metadata_test <nl> chttp2_fullstack_uds_posix_request_with_payload_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_request_with_payload_test <nl> + chttp2_fullstack_uds_posix_server_finishes_request_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_server_finishes_request_test <nl> chttp2_fullstack_uds_posix_simple_delayed_request_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_simple_delayed_request_test <nl> chttp2_fullstack_uds_posix_simple_request_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_simple_request_test <nl> chttp2_fullstack_uds_posix_simple_request_with_high_initial_sequence_number_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_simple_request_with_high_initial_sequence_number_test <nl> chttp2_simple_ssl_fullstack_request_response_with_payload_and_call_creds_test : $ <nl> chttp2_simple_ssl_fullstack_request_response_with_trailing_metadata_and_payload_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_request_response_with_trailing_metadata_and_payload_test <nl> chttp2_simple_ssl_fullstack_request_with_large_metadata_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_request_with_large_metadata_test <nl> chttp2_simple_ssl_fullstack_request_with_payload_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_request_with_payload_test <nl> + chttp2_simple_ssl_fullstack_server_finishes_request_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_server_finishes_request_test <nl> chttp2_simple_ssl_fullstack_simple_delayed_request_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_simple_delayed_request_test <nl> chttp2_simple_ssl_fullstack_simple_request_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_simple_request_test <nl> chttp2_simple_ssl_fullstack_simple_request_with_high_initial_sequence_number_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_simple_request_with_high_initial_sequence_number_test <nl> chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_payload_and_call_c <nl> chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_trailing_metadata_and_payload_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_trailing_metadata_and_payload_test <nl> chttp2_simple_ssl_with_oauth2_fullstack_request_with_large_metadata_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_request_with_large_metadata_test <nl> chttp2_simple_ssl_with_oauth2_fullstack_request_with_payload_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_request_with_payload_test <nl> + chttp2_simple_ssl_with_oauth2_fullstack_server_finishes_request_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_server_finishes_request_test <nl> chttp2_simple_ssl_with_oauth2_fullstack_simple_delayed_request_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_simple_delayed_request_test <nl> chttp2_simple_ssl_with_oauth2_fullstack_simple_request_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_simple_request_test <nl> chttp2_simple_ssl_with_oauth2_fullstack_simple_request_with_high_initial_sequence_number_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_simple_request_with_high_initial_sequence_number_test <nl> chttp2_socket_pair_request_response_with_payload_and_call_creds_test : $ ( BINDIR ) / <nl> chttp2_socket_pair_request_response_with_trailing_metadata_and_payload_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_request_response_with_trailing_metadata_and_payload_test <nl> chttp2_socket_pair_request_with_large_metadata_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_request_with_large_metadata_test <nl> chttp2_socket_pair_request_with_payload_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_request_with_payload_test <nl> + chttp2_socket_pair_server_finishes_request_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_server_finishes_request_test <nl> chttp2_socket_pair_simple_delayed_request_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_simple_delayed_request_test <nl> chttp2_socket_pair_simple_request_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_simple_request_test <nl> chttp2_socket_pair_simple_request_with_high_initial_sequence_number_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_simple_request_with_high_initial_sequence_number_test <nl> chttp2_socket_pair_one_byte_at_a_time_request_response_with_payload_and_call_cre <nl> chttp2_socket_pair_one_byte_at_a_time_request_response_with_trailing_metadata_and_payload_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_request_response_with_trailing_metadata_and_payload_test <nl> chttp2_socket_pair_one_byte_at_a_time_request_with_large_metadata_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_request_with_large_metadata_test <nl> chttp2_socket_pair_one_byte_at_a_time_request_with_payload_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_request_with_payload_test <nl> + chttp2_socket_pair_one_byte_at_a_time_server_finishes_request_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_server_finishes_request_test <nl> chttp2_socket_pair_one_byte_at_a_time_simple_delayed_request_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_simple_delayed_request_test <nl> chttp2_socket_pair_one_byte_at_a_time_simple_request_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_simple_request_test <nl> chttp2_socket_pair_one_byte_at_a_time_simple_request_with_high_initial_sequence_number_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_simple_request_with_high_initial_sequence_number_test <nl> chttp2_socket_pair_with_grpc_trace_request_response_with_payload_and_call_creds_ <nl> chttp2_socket_pair_with_grpc_trace_request_response_with_trailing_metadata_and_payload_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_request_response_with_trailing_metadata_and_payload_test <nl> chttp2_socket_pair_with_grpc_trace_request_with_large_metadata_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_request_with_large_metadata_test <nl> chttp2_socket_pair_with_grpc_trace_request_with_payload_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_request_with_payload_test <nl> + chttp2_socket_pair_with_grpc_trace_server_finishes_request_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_server_finishes_request_test <nl> chttp2_socket_pair_with_grpc_trace_simple_delayed_request_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_simple_delayed_request_test <nl> chttp2_socket_pair_with_grpc_trace_simple_request_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_simple_request_test <nl> chttp2_socket_pair_with_grpc_trace_simple_request_with_high_initial_sequence_number_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_simple_request_with_high_initial_sequence_number_test <nl> chttp2_fullstack_request_response_with_payload_unsecure_test : $ ( BINDIR ) / $ ( CONFIG <nl> chttp2_fullstack_request_response_with_trailing_metadata_and_payload_unsecure_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_request_response_with_trailing_metadata_and_payload_unsecure_test <nl> chttp2_fullstack_request_with_large_metadata_unsecure_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_request_with_large_metadata_unsecure_test <nl> chttp2_fullstack_request_with_payload_unsecure_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_request_with_payload_unsecure_test <nl> + chttp2_fullstack_server_finishes_request_unsecure_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_server_finishes_request_unsecure_test <nl> chttp2_fullstack_simple_delayed_request_unsecure_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_simple_delayed_request_unsecure_test <nl> chttp2_fullstack_simple_request_unsecure_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_simple_request_unsecure_test <nl> chttp2_fullstack_simple_request_with_high_initial_sequence_number_unsecure_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_simple_request_with_high_initial_sequence_number_unsecure_test <nl> chttp2_fullstack_uds_posix_request_response_with_payload_unsecure_test : $ ( BINDIR <nl> chttp2_fullstack_uds_posix_request_response_with_trailing_metadata_and_payload_unsecure_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_request_response_with_trailing_metadata_and_payload_unsecure_test <nl> chttp2_fullstack_uds_posix_request_with_large_metadata_unsecure_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_request_with_large_metadata_unsecure_test <nl> chttp2_fullstack_uds_posix_request_with_payload_unsecure_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_request_with_payload_unsecure_test <nl> + chttp2_fullstack_uds_posix_server_finishes_request_unsecure_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_server_finishes_request_unsecure_test <nl> chttp2_fullstack_uds_posix_simple_delayed_request_unsecure_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_simple_delayed_request_unsecure_test <nl> chttp2_fullstack_uds_posix_simple_request_unsecure_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_simple_request_unsecure_test <nl> chttp2_fullstack_uds_posix_simple_request_with_high_initial_sequence_number_unsecure_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_simple_request_with_high_initial_sequence_number_unsecure_test <nl> chttp2_socket_pair_request_response_with_payload_unsecure_test : $ ( BINDIR ) / $ ( CONF <nl> chttp2_socket_pair_request_response_with_trailing_metadata_and_payload_unsecure_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_request_response_with_trailing_metadata_and_payload_unsecure_test <nl> chttp2_socket_pair_request_with_large_metadata_unsecure_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_request_with_large_metadata_unsecure_test <nl> chttp2_socket_pair_request_with_payload_unsecure_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_request_with_payload_unsecure_test <nl> + chttp2_socket_pair_server_finishes_request_unsecure_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_server_finishes_request_unsecure_test <nl> chttp2_socket_pair_simple_delayed_request_unsecure_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_simple_delayed_request_unsecure_test <nl> chttp2_socket_pair_simple_request_unsecure_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_simple_request_unsecure_test <nl> chttp2_socket_pair_simple_request_with_high_initial_sequence_number_unsecure_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_simple_request_with_high_initial_sequence_number_unsecure_test <nl> chttp2_socket_pair_one_byte_at_a_time_request_response_with_payload_unsecure_tes <nl> chttp2_socket_pair_one_byte_at_a_time_request_response_with_trailing_metadata_and_payload_unsecure_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_request_response_with_trailing_metadata_and_payload_unsecure_test <nl> chttp2_socket_pair_one_byte_at_a_time_request_with_large_metadata_unsecure_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_request_with_large_metadata_unsecure_test <nl> chttp2_socket_pair_one_byte_at_a_time_request_with_payload_unsecure_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_request_with_payload_unsecure_test <nl> + chttp2_socket_pair_one_byte_at_a_time_server_finishes_request_unsecure_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_server_finishes_request_unsecure_test <nl> chttp2_socket_pair_one_byte_at_a_time_simple_delayed_request_unsecure_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_simple_delayed_request_unsecure_test <nl> chttp2_socket_pair_one_byte_at_a_time_simple_request_unsecure_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_simple_request_unsecure_test <nl> chttp2_socket_pair_one_byte_at_a_time_simple_request_with_high_initial_sequence_number_unsecure_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_simple_request_with_high_initial_sequence_number_unsecure_test <nl> chttp2_socket_pair_with_grpc_trace_request_response_with_payload_unsecure_test : <nl> chttp2_socket_pair_with_grpc_trace_request_response_with_trailing_metadata_and_payload_unsecure_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_request_response_with_trailing_metadata_and_payload_unsecure_test <nl> chttp2_socket_pair_with_grpc_trace_request_with_large_metadata_unsecure_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_request_with_large_metadata_unsecure_test <nl> chttp2_socket_pair_with_grpc_trace_request_with_payload_unsecure_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_request_with_payload_unsecure_test <nl> + chttp2_socket_pair_with_grpc_trace_server_finishes_request_unsecure_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_server_finishes_request_unsecure_test <nl> chttp2_socket_pair_with_grpc_trace_simple_delayed_request_unsecure_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_simple_delayed_request_unsecure_test <nl> chttp2_socket_pair_with_grpc_trace_simple_request_unsecure_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_simple_request_unsecure_test <nl> chttp2_socket_pair_with_grpc_trace_simple_request_with_high_initial_sequence_number_unsecure_test : $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_simple_request_with_high_initial_sequence_number_unsecure_test <nl> plugins : $ ( PROTOC_PLUGINS ) <nl> <nl> privatelibs : privatelibs_c privatelibs_cxx <nl> <nl> - privatelibs_c : $ ( LIBDIR ) / $ ( CONFIG ) / libgpr_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_test_util_unsecure . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_fake_security . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_fullstack . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_fullstack_uds_posix . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_simple_ssl_fullstack . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_socket_pair . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_socket_pair_one_byte_at_a_time . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_socket_pair_with_grpc_trace . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_bad_hostname . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_cancel_after_accept . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_cancel_after_accept_and_writes_closed . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_cancel_after_invoke . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_cancel_before_invoke . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_cancel_in_a_vacuum . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_census_simple_request . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_disappearing_server . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_early_server_shutdown_finishes_inflight_calls . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_early_server_shutdown_finishes_tags . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_empty_batch . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_graceful_server_shutdown . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_invoke_large_request . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_max_concurrent_streams . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_max_message_length . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_no_op . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_ping_pong_streaming . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_registered_call . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_request_response_with_binary_metadata_and_payload . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_request_response_with_metadata_and_payload . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_request_response_with_payload . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_request_response_with_payload_and_call_creds . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_request_response_with_trailing_metadata_and_payload . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_request_with_large_metadata . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_request_with_payload . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_simple_delayed_request . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_simple_request . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_simple_request_with_high_initial_sequence_number . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_certs . a <nl> + privatelibs_c : $ ( LIBDIR ) / $ ( CONFIG ) / libgpr_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_test_util_unsecure . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_fake_security . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_fullstack . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_fullstack_uds_posix . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_simple_ssl_fullstack . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_socket_pair . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_socket_pair_one_byte_at_a_time . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_socket_pair_with_grpc_trace . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_bad_hostname . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_cancel_after_accept . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_cancel_after_accept_and_writes_closed . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_cancel_after_invoke . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_cancel_before_invoke . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_cancel_in_a_vacuum . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_census_simple_request . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_disappearing_server . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_early_server_shutdown_finishes_inflight_calls . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_early_server_shutdown_finishes_tags . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_empty_batch . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_graceful_server_shutdown . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_invoke_large_request . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_max_concurrent_streams . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_max_message_length . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_no_op . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_ping_pong_streaming . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_registered_call . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_request_response_with_binary_metadata_and_payload . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_request_response_with_metadata_and_payload . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_request_response_with_payload . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_request_response_with_payload_and_call_creds . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_request_response_with_trailing_metadata_and_payload . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_request_with_large_metadata . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_request_with_payload . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_server_finishes_request . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_simple_delayed_request . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_simple_request . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_simple_request_with_high_initial_sequence_number . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_certs . a <nl> <nl> privatelibs_cxx : $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc + + _test_config . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc + + _test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libinterop_client_helper . a $ ( LIBDIR ) / $ ( CONFIG ) / libinterop_client_main . a $ ( LIBDIR ) / $ ( CONFIG ) / libinterop_server_helper . a $ ( LIBDIR ) / $ ( CONFIG ) / libinterop_server_main . a $ ( LIBDIR ) / $ ( CONFIG ) / libqps . a <nl> <nl> buildtests : buildtests_c buildtests_cxx <nl> <nl> - buildtests_c : privatelibs_c $ ( BINDIR ) / $ ( CONFIG ) / alarm_heap_test $ ( BINDIR ) / $ ( CONFIG ) / alarm_list_test $ ( BINDIR ) / $ ( CONFIG ) / alarm_test $ ( BINDIR ) / $ ( CONFIG ) / alpn_test $ ( BINDIR ) / $ ( CONFIG ) / bin_encoder_test $ ( BINDIR ) / $ ( CONFIG ) / census_hash_table_test $ ( BINDIR ) / $ ( CONFIG ) / census_statistics_multiple_writers_circular_buffer_test $ ( BINDIR ) / $ ( CONFIG ) / census_statistics_multiple_writers_test $ ( BINDIR ) / $ ( CONFIG ) / census_statistics_performance_test $ ( BINDIR ) / $ ( CONFIG ) / census_statistics_quick_test $ ( BINDIR ) / $ ( CONFIG ) / census_statistics_small_log_test $ ( BINDIR ) / $ ( CONFIG ) / census_stub_test $ ( BINDIR ) / $ ( CONFIG ) / census_window_stats_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_status_conversion_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_stream_encoder_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_stream_map_test $ ( BINDIR ) / $ ( CONFIG ) / dualstack_socket_test $ ( BINDIR ) / $ ( CONFIG ) / fd_posix_test $ ( BINDIR ) / $ ( CONFIG ) / fling_client $ ( BINDIR ) / $ ( CONFIG ) / fling_server $ ( BINDIR ) / $ ( CONFIG ) / fling_stream_test $ ( BINDIR ) / $ ( CONFIG ) / fling_test $ ( BINDIR ) / $ ( CONFIG ) / gpr_cancellable_test $ ( BINDIR ) / $ ( CONFIG ) / gpr_cmdline_test $ ( BINDIR ) / $ ( CONFIG ) / gpr_env_test $ ( BINDIR ) / $ ( CONFIG ) / gpr_file_test $ ( BINDIR ) / $ ( CONFIG ) / gpr_histogram_test $ ( BINDIR ) / $ ( CONFIG ) / gpr_host_port_test $ ( BINDIR ) / $ ( CONFIG ) / gpr_log_test $ ( BINDIR ) / $ ( CONFIG ) / gpr_slice_buffer_test $ ( BINDIR ) / $ ( CONFIG ) / gpr_slice_test $ ( BINDIR ) / $ ( CONFIG ) / gpr_string_test $ ( BINDIR ) / $ ( CONFIG ) / gpr_sync_test $ ( BINDIR ) / $ ( CONFIG ) / gpr_thd_test $ ( BINDIR ) / $ ( CONFIG ) / gpr_time_test $ ( BINDIR ) / $ ( CONFIG ) / gpr_tls_test $ ( BINDIR ) / $ ( CONFIG ) / gpr_useful_test $ ( BINDIR ) / $ ( CONFIG ) / grpc_base64_test $ ( BINDIR ) / $ ( CONFIG ) / grpc_byte_buffer_reader_test $ ( BINDIR ) / $ ( CONFIG ) / grpc_channel_stack_test $ ( BINDIR ) / $ ( CONFIG ) / grpc_completion_queue_test $ ( BINDIR ) / $ ( CONFIG ) / grpc_credentials_test $ ( BINDIR ) / $ ( CONFIG ) / grpc_json_token_test $ ( BINDIR ) / $ ( CONFIG ) / grpc_stream_op_test $ ( BINDIR ) / $ ( CONFIG ) / hpack_parser_test $ ( BINDIR ) / $ ( CONFIG ) / hpack_table_test $ ( BINDIR ) / $ ( CONFIG ) / httpcli_format_request_test $ ( BINDIR ) / $ ( CONFIG ) / httpcli_parser_test $ ( BINDIR ) / $ ( CONFIG ) / httpcli_test $ ( BINDIR ) / $ ( CONFIG ) / json_rewrite $ ( BINDIR ) / $ ( CONFIG ) / json_rewrite_test $ ( BINDIR ) / $ ( CONFIG ) / json_test $ ( BINDIR ) / $ ( CONFIG ) / lame_client_test $ ( BINDIR ) / $ ( CONFIG ) / message_compress_test $ ( BINDIR ) / $ ( CONFIG ) / multi_init_test $ ( BINDIR ) / $ ( CONFIG ) / murmur_hash_test $ ( BINDIR ) / $ ( CONFIG ) / no_server_test $ ( BINDIR ) / $ ( CONFIG ) / poll_kick_posix_test $ ( BINDIR ) / $ ( CONFIG ) / resolve_address_test $ ( BINDIR ) / $ ( CONFIG ) / secure_endpoint_test $ ( BINDIR ) / $ ( CONFIG ) / sockaddr_utils_test $ ( BINDIR ) / $ ( CONFIG ) / tcp_client_posix_test $ ( BINDIR ) / $ ( CONFIG ) / tcp_posix_test $ ( BINDIR ) / $ ( CONFIG ) / tcp_server_posix_test $ ( BINDIR ) / $ ( CONFIG ) / time_averaged_stats_test $ ( BINDIR ) / $ ( CONFIG ) / time_test $ ( BINDIR ) / $ ( CONFIG ) / timeout_encoding_test $ ( BINDIR ) / $ ( CONFIG ) / timers_test $ ( BINDIR ) / $ ( CONFIG ) / transport_metadata_test $ ( BINDIR ) / $ ( CONFIG ) / transport_security_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_bad_hostname_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_cancel_after_accept_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_cancel_after_accept_and_writes_closed_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_cancel_after_invoke_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_cancel_before_invoke_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_cancel_in_a_vacuum_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_census_simple_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_disappearing_server_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_early_server_shutdown_finishes_inflight_calls_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_early_server_shutdown_finishes_tags_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_empty_batch_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_graceful_server_shutdown_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_invoke_large_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_max_concurrent_streams_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_max_message_length_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_no_op_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_ping_pong_streaming_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_registered_call_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_request_response_with_binary_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_request_response_with_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_request_response_with_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_request_response_with_payload_and_call_creds_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_request_response_with_trailing_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_request_with_large_metadata_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_request_with_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_simple_delayed_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_simple_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_simple_request_with_high_initial_sequence_number_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_bad_hostname_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_cancel_after_accept_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_cancel_after_accept_and_writes_closed_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_cancel_after_invoke_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_cancel_before_invoke_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_cancel_in_a_vacuum_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_census_simple_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_disappearing_server_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_early_server_shutdown_finishes_inflight_calls_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_early_server_shutdown_finishes_tags_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_empty_batch_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_graceful_server_shutdown_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_invoke_large_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_max_concurrent_streams_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_max_message_length_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_no_op_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_ping_pong_streaming_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_registered_call_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_request_response_with_binary_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_request_response_with_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_request_response_with_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_request_response_with_payload_and_call_creds_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_request_response_with_trailing_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_request_with_large_metadata_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_request_with_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_simple_delayed_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_simple_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_simple_request_with_high_initial_sequence_number_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_bad_hostname_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_cancel_after_accept_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_cancel_after_accept_and_writes_closed_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_cancel_after_invoke_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_cancel_before_invoke_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_cancel_in_a_vacuum_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_census_simple_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_disappearing_server_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_early_server_shutdown_finishes_inflight_calls_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_early_server_shutdown_finishes_tags_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_empty_batch_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_graceful_server_shutdown_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_invoke_large_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_max_concurrent_streams_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_max_message_length_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_no_op_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_ping_pong_streaming_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_registered_call_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_request_response_with_binary_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_request_response_with_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_request_response_with_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_request_response_with_payload_and_call_creds_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_request_response_with_trailing_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_request_with_large_metadata_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_request_with_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_simple_delayed_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_simple_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_simple_request_with_high_initial_sequence_number_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_bad_hostname_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_cancel_after_accept_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_cancel_after_accept_and_writes_closed_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_cancel_after_invoke_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_cancel_before_invoke_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_cancel_in_a_vacuum_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_census_simple_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_disappearing_server_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_early_server_shutdown_finishes_inflight_calls_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_early_server_shutdown_finishes_tags_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_empty_batch_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_graceful_server_shutdown_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_invoke_large_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_max_concurrent_streams_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_max_message_length_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_no_op_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_ping_pong_streaming_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_registered_call_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_request_response_with_binary_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_request_response_with_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_request_response_with_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_request_response_with_payload_and_call_creds_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_request_response_with_trailing_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_request_with_large_metadata_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_request_with_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_simple_delayed_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_simple_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_simple_request_with_high_initial_sequence_number_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_bad_hostname_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_and_writes_closed_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_invoke_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_cancel_before_invoke_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_cancel_in_a_vacuum_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_census_simple_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_disappearing_server_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_early_server_shutdown_finishes_inflight_calls_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_early_server_shutdown_finishes_tags_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_empty_batch_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_graceful_server_shutdown_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_invoke_large_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_max_concurrent_streams_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_max_message_length_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_no_op_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_ping_pong_streaming_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_registered_call_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_binary_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_payload_and_call_creds_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_trailing_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_request_with_large_metadata_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_request_with_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_simple_delayed_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_simple_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_simple_request_with_high_initial_sequence_number_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_bad_hostname_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_cancel_after_accept_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_cancel_after_accept_and_writes_closed_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_cancel_after_invoke_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_cancel_before_invoke_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_cancel_in_a_vacuum_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_census_simple_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_disappearing_server_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_early_server_shutdown_finishes_inflight_calls_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_early_server_shutdown_finishes_tags_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_empty_batch_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_graceful_server_shutdown_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_invoke_large_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_max_concurrent_streams_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_max_message_length_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_no_op_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_ping_pong_streaming_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_registered_call_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_request_response_with_binary_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_request_response_with_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_request_response_with_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_request_response_with_payload_and_call_creds_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_request_response_with_trailing_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_request_with_large_metadata_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_request_with_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_simple_delayed_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_simple_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_simple_request_with_high_initial_sequence_number_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_bad_hostname_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_and_writes_closed_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_cancel_after_invoke_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_cancel_before_invoke_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_cancel_in_a_vacuum_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_census_simple_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_disappearing_server_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_inflight_calls_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_tags_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_empty_batch_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_graceful_server_shutdown_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_max_concurrent_streams_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_max_message_length_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_no_op_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_ping_pong_streaming_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_registered_call_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_request_response_with_binary_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_request_response_with_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_request_response_with_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_request_response_with_payload_and_call_creds_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_request_response_with_trailing_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_request_with_large_metadata_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_request_with_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_simple_delayed_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_simple_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_simple_request_with_high_initial_sequence_number_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_bad_hostname_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_cancel_after_accept_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_cancel_after_accept_and_writes_closed_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_cancel_after_invoke_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_cancel_before_invoke_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_cancel_in_a_vacuum_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_census_simple_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_disappearing_server_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_early_server_shutdown_finishes_inflight_calls_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_early_server_shutdown_finishes_tags_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_empty_batch_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_graceful_server_shutdown_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_invoke_large_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_max_concurrent_streams_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_max_message_length_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_no_op_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_ping_pong_streaming_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_registered_call_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_request_response_with_binary_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_request_response_with_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_request_response_with_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_request_response_with_payload_and_call_creds_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_request_response_with_trailing_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_request_with_large_metadata_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_request_with_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_simple_delayed_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_simple_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_simple_request_with_high_initial_sequence_number_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_bad_hostname_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_cancel_after_accept_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_cancel_after_accept_and_writes_closed_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_cancel_after_invoke_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_cancel_before_invoke_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_cancel_in_a_vacuum_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_census_simple_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_disappearing_server_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_early_server_shutdown_finishes_inflight_calls_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_early_server_shutdown_finishes_tags_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_empty_batch_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_graceful_server_shutdown_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_invoke_large_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_max_concurrent_streams_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_max_message_length_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_no_op_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_ping_pong_streaming_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_registered_call_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_request_response_with_binary_metadata_and_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_request_response_with_metadata_and_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_request_response_with_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_request_response_with_trailing_metadata_and_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_request_with_large_metadata_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_request_with_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_simple_delayed_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_simple_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_simple_request_with_high_initial_sequence_number_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_bad_hostname_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_cancel_after_accept_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_cancel_after_accept_and_writes_closed_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_cancel_after_invoke_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_cancel_before_invoke_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_cancel_in_a_vacuum_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_census_simple_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_disappearing_server_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_early_server_shutdown_finishes_inflight_calls_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_early_server_shutdown_finishes_tags_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_empty_batch_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_graceful_server_shutdown_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_invoke_large_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_max_concurrent_streams_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_max_message_length_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_no_op_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_ping_pong_streaming_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_registered_call_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_request_response_with_binary_metadata_and_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_request_response_with_metadata_and_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_request_response_with_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_request_response_with_trailing_metadata_and_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_request_with_large_metadata_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_request_with_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_simple_delayed_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_simple_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_simple_request_with_high_initial_sequence_number_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_bad_hostname_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_cancel_after_accept_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_cancel_after_accept_and_writes_closed_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_cancel_after_invoke_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_cancel_before_invoke_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_cancel_in_a_vacuum_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_census_simple_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_disappearing_server_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_early_server_shutdown_finishes_inflight_calls_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_early_server_shutdown_finishes_tags_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_empty_batch_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_graceful_server_shutdown_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_invoke_large_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_max_concurrent_streams_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_max_message_length_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_no_op_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_ping_pong_streaming_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_registered_call_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_request_response_with_binary_metadata_and_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_request_response_with_metadata_and_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_request_response_with_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_request_response_with_trailing_metadata_and_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_request_with_large_metadata_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_request_with_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_simple_delayed_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_simple_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_simple_request_with_high_initial_sequence_number_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_bad_hostname_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_and_writes_closed_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_cancel_after_invoke_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_cancel_before_invoke_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_cancel_in_a_vacuum_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_census_simple_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_disappearing_server_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_inflight_calls_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_tags_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_empty_batch_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_graceful_server_shutdown_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_max_concurrent_streams_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_max_message_length_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_no_op_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_ping_pong_streaming_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_registered_call_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_request_response_with_binary_metadata_and_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_request_response_with_metadata_and_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_request_response_with_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_request_response_with_trailing_metadata_and_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_request_with_large_metadata_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_request_with_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_simple_delayed_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_simple_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_simple_request_with_high_initial_sequence_number_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_bad_hostname_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_cancel_after_accept_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_cancel_after_accept_and_writes_closed_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_cancel_after_invoke_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_cancel_before_invoke_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_cancel_in_a_vacuum_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_census_simple_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_disappearing_server_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_early_server_shutdown_finishes_inflight_calls_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_early_server_shutdown_finishes_tags_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_empty_batch_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_graceful_server_shutdown_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_invoke_large_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_max_concurrent_streams_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_max_message_length_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_no_op_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_ping_pong_streaming_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_registered_call_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_request_response_with_binary_metadata_and_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_request_response_with_metadata_and_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_request_response_with_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_request_response_with_trailing_metadata_and_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_request_with_large_metadata_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_request_with_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_simple_delayed_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_simple_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_simple_request_with_high_initial_sequence_number_unsecure_test <nl> + buildtests_c : privatelibs_c $ ( BINDIR ) / $ ( CONFIG ) / alarm_heap_test $ ( BINDIR ) / $ ( CONFIG ) / alarm_list_test $ ( BINDIR ) / $ ( CONFIG ) / alarm_test $ ( BINDIR ) / $ ( CONFIG ) / alpn_test $ ( BINDIR ) / $ ( CONFIG ) / bin_encoder_test $ ( BINDIR ) / $ ( CONFIG ) / census_hash_table_test $ ( BINDIR ) / $ ( CONFIG ) / census_statistics_multiple_writers_circular_buffer_test $ ( BINDIR ) / $ ( CONFIG ) / census_statistics_multiple_writers_test $ ( BINDIR ) / $ ( CONFIG ) / census_statistics_performance_test $ ( BINDIR ) / $ ( CONFIG ) / census_statistics_quick_test $ ( BINDIR ) / $ ( CONFIG ) / census_statistics_small_log_test $ ( BINDIR ) / $ ( CONFIG ) / census_stub_test $ ( BINDIR ) / $ ( CONFIG ) / census_window_stats_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_status_conversion_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_stream_encoder_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_stream_map_test $ ( BINDIR ) / $ ( CONFIG ) / dualstack_socket_test $ ( BINDIR ) / $ ( CONFIG ) / fd_posix_test $ ( BINDIR ) / $ ( CONFIG ) / fling_client $ ( BINDIR ) / $ ( CONFIG ) / fling_server $ ( BINDIR ) / $ ( CONFIG ) / fling_stream_test $ ( BINDIR ) / $ ( CONFIG ) / fling_test $ ( BINDIR ) / $ ( CONFIG ) / gpr_cancellable_test $ ( BINDIR ) / $ ( CONFIG ) / gpr_cmdline_test $ ( BINDIR ) / $ ( CONFIG ) / gpr_env_test $ ( BINDIR ) / $ ( CONFIG ) / gpr_file_test $ ( BINDIR ) / $ ( CONFIG ) / gpr_histogram_test $ ( BINDIR ) / $ ( CONFIG ) / gpr_host_port_test $ ( BINDIR ) / $ ( CONFIG ) / gpr_log_test $ ( BINDIR ) / $ ( CONFIG ) / gpr_slice_buffer_test $ ( BINDIR ) / $ ( CONFIG ) / gpr_slice_test $ ( BINDIR ) / $ ( CONFIG ) / gpr_string_test $ ( BINDIR ) / $ ( CONFIG ) / gpr_sync_test $ ( BINDIR ) / $ ( CONFIG ) / gpr_thd_test $ ( BINDIR ) / $ ( CONFIG ) / gpr_time_test $ ( BINDIR ) / $ ( CONFIG ) / gpr_tls_test $ ( BINDIR ) / $ ( CONFIG ) / gpr_useful_test $ ( BINDIR ) / $ ( CONFIG ) / grpc_base64_test $ ( BINDIR ) / $ ( CONFIG ) / grpc_byte_buffer_reader_test $ ( BINDIR ) / $ ( CONFIG ) / grpc_channel_stack_test $ ( BINDIR ) / $ ( CONFIG ) / grpc_completion_queue_test $ ( BINDIR ) / $ ( CONFIG ) / grpc_credentials_test $ ( BINDIR ) / $ ( CONFIG ) / grpc_json_token_test $ ( BINDIR ) / $ ( CONFIG ) / grpc_stream_op_test $ ( BINDIR ) / $ ( CONFIG ) / hpack_parser_test $ ( BINDIR ) / $ ( CONFIG ) / hpack_table_test $ ( BINDIR ) / $ ( CONFIG ) / httpcli_format_request_test $ ( BINDIR ) / $ ( CONFIG ) / httpcli_parser_test $ ( BINDIR ) / $ ( CONFIG ) / httpcli_test $ ( BINDIR ) / $ ( CONFIG ) / json_rewrite $ ( BINDIR ) / $ ( CONFIG ) / json_rewrite_test $ ( BINDIR ) / $ ( CONFIG ) / json_test $ ( BINDIR ) / $ ( CONFIG ) / lame_client_test $ ( BINDIR ) / $ ( CONFIG ) / message_compress_test $ ( BINDIR ) / $ ( CONFIG ) / multi_init_test $ ( BINDIR ) / $ ( CONFIG ) / murmur_hash_test $ ( BINDIR ) / $ ( CONFIG ) / no_server_test $ ( BINDIR ) / $ ( CONFIG ) / poll_kick_posix_test $ ( BINDIR ) / $ ( CONFIG ) / resolve_address_test $ ( BINDIR ) / $ ( CONFIG ) / secure_endpoint_test $ ( BINDIR ) / $ ( CONFIG ) / sockaddr_utils_test $ ( BINDIR ) / $ ( CONFIG ) / tcp_client_posix_test $ ( BINDIR ) / $ ( CONFIG ) / tcp_posix_test $ ( BINDIR ) / $ ( CONFIG ) / tcp_server_posix_test $ ( BINDIR ) / $ ( CONFIG ) / time_averaged_stats_test $ ( BINDIR ) / $ ( CONFIG ) / time_test $ ( BINDIR ) / $ ( CONFIG ) / timeout_encoding_test $ ( BINDIR ) / $ ( CONFIG ) / timers_test $ ( BINDIR ) / $ ( CONFIG ) / transport_metadata_test $ ( BINDIR ) / $ ( CONFIG ) / transport_security_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_bad_hostname_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_cancel_after_accept_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_cancel_after_accept_and_writes_closed_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_cancel_after_invoke_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_cancel_before_invoke_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_cancel_in_a_vacuum_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_census_simple_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_disappearing_server_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_early_server_shutdown_finishes_inflight_calls_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_early_server_shutdown_finishes_tags_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_empty_batch_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_graceful_server_shutdown_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_invoke_large_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_max_concurrent_streams_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_max_message_length_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_no_op_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_ping_pong_streaming_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_registered_call_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_request_response_with_binary_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_request_response_with_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_request_response_with_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_request_response_with_payload_and_call_creds_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_request_response_with_trailing_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_request_with_large_metadata_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_request_with_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_server_finishes_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_simple_delayed_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_simple_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_simple_request_with_high_initial_sequence_number_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_bad_hostname_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_cancel_after_accept_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_cancel_after_accept_and_writes_closed_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_cancel_after_invoke_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_cancel_before_invoke_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_cancel_in_a_vacuum_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_census_simple_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_disappearing_server_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_early_server_shutdown_finishes_inflight_calls_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_early_server_shutdown_finishes_tags_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_empty_batch_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_graceful_server_shutdown_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_invoke_large_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_max_concurrent_streams_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_max_message_length_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_no_op_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_ping_pong_streaming_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_registered_call_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_request_response_with_binary_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_request_response_with_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_request_response_with_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_request_response_with_payload_and_call_creds_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_request_response_with_trailing_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_request_with_large_metadata_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_request_with_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_server_finishes_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_simple_delayed_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_simple_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_simple_request_with_high_initial_sequence_number_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_bad_hostname_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_cancel_after_accept_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_cancel_after_accept_and_writes_closed_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_cancel_after_invoke_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_cancel_before_invoke_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_cancel_in_a_vacuum_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_census_simple_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_disappearing_server_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_early_server_shutdown_finishes_inflight_calls_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_early_server_shutdown_finishes_tags_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_empty_batch_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_graceful_server_shutdown_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_invoke_large_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_max_concurrent_streams_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_max_message_length_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_no_op_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_ping_pong_streaming_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_registered_call_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_request_response_with_binary_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_request_response_with_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_request_response_with_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_request_response_with_payload_and_call_creds_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_request_response_with_trailing_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_request_with_large_metadata_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_request_with_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_server_finishes_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_simple_delayed_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_simple_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_simple_request_with_high_initial_sequence_number_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_bad_hostname_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_cancel_after_accept_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_cancel_after_accept_and_writes_closed_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_cancel_after_invoke_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_cancel_before_invoke_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_cancel_in_a_vacuum_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_census_simple_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_disappearing_server_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_early_server_shutdown_finishes_inflight_calls_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_early_server_shutdown_finishes_tags_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_empty_batch_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_graceful_server_shutdown_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_invoke_large_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_max_concurrent_streams_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_max_message_length_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_no_op_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_ping_pong_streaming_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_registered_call_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_request_response_with_binary_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_request_response_with_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_request_response_with_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_request_response_with_payload_and_call_creds_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_request_response_with_trailing_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_request_with_large_metadata_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_request_with_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_server_finishes_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_simple_delayed_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_simple_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_simple_request_with_high_initial_sequence_number_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_bad_hostname_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_and_writes_closed_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_invoke_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_cancel_before_invoke_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_cancel_in_a_vacuum_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_census_simple_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_disappearing_server_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_early_server_shutdown_finishes_inflight_calls_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_early_server_shutdown_finishes_tags_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_empty_batch_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_graceful_server_shutdown_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_invoke_large_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_max_concurrent_streams_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_max_message_length_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_no_op_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_ping_pong_streaming_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_registered_call_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_binary_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_payload_and_call_creds_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_trailing_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_request_with_large_metadata_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_request_with_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_server_finishes_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_simple_delayed_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_simple_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_simple_request_with_high_initial_sequence_number_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_bad_hostname_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_cancel_after_accept_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_cancel_after_accept_and_writes_closed_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_cancel_after_invoke_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_cancel_before_invoke_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_cancel_in_a_vacuum_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_census_simple_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_disappearing_server_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_early_server_shutdown_finishes_inflight_calls_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_early_server_shutdown_finishes_tags_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_empty_batch_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_graceful_server_shutdown_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_invoke_large_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_max_concurrent_streams_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_max_message_length_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_no_op_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_ping_pong_streaming_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_registered_call_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_request_response_with_binary_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_request_response_with_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_request_response_with_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_request_response_with_payload_and_call_creds_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_request_response_with_trailing_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_request_with_large_metadata_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_request_with_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_server_finishes_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_simple_delayed_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_simple_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_simple_request_with_high_initial_sequence_number_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_bad_hostname_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_and_writes_closed_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_cancel_after_invoke_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_cancel_before_invoke_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_cancel_in_a_vacuum_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_census_simple_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_disappearing_server_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_inflight_calls_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_tags_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_empty_batch_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_graceful_server_shutdown_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_max_concurrent_streams_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_max_message_length_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_no_op_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_ping_pong_streaming_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_registered_call_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_request_response_with_binary_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_request_response_with_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_request_response_with_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_request_response_with_payload_and_call_creds_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_request_response_with_trailing_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_request_with_large_metadata_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_request_with_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_server_finishes_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_simple_delayed_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_simple_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_simple_request_with_high_initial_sequence_number_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_bad_hostname_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_cancel_after_accept_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_cancel_after_accept_and_writes_closed_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_cancel_after_invoke_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_cancel_before_invoke_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_cancel_in_a_vacuum_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_census_simple_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_disappearing_server_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_early_server_shutdown_finishes_inflight_calls_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_early_server_shutdown_finishes_tags_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_empty_batch_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_graceful_server_shutdown_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_invoke_large_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_max_concurrent_streams_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_max_message_length_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_no_op_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_ping_pong_streaming_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_registered_call_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_request_response_with_binary_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_request_response_with_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_request_response_with_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_request_response_with_payload_and_call_creds_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_request_response_with_trailing_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_request_with_large_metadata_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_request_with_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_server_finishes_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_simple_delayed_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_simple_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_simple_request_with_high_initial_sequence_number_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_bad_hostname_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_cancel_after_accept_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_cancel_after_accept_and_writes_closed_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_cancel_after_invoke_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_cancel_before_invoke_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_cancel_in_a_vacuum_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_census_simple_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_disappearing_server_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_early_server_shutdown_finishes_inflight_calls_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_early_server_shutdown_finishes_tags_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_empty_batch_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_graceful_server_shutdown_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_invoke_large_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_max_concurrent_streams_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_max_message_length_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_no_op_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_ping_pong_streaming_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_registered_call_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_request_response_with_binary_metadata_and_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_request_response_with_metadata_and_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_request_response_with_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_request_response_with_trailing_metadata_and_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_request_with_large_metadata_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_request_with_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_server_finishes_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_simple_delayed_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_simple_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_simple_request_with_high_initial_sequence_number_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_bad_hostname_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_cancel_after_accept_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_cancel_after_accept_and_writes_closed_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_cancel_after_invoke_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_cancel_before_invoke_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_cancel_in_a_vacuum_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_census_simple_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_disappearing_server_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_early_server_shutdown_finishes_inflight_calls_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_early_server_shutdown_finishes_tags_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_empty_batch_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_graceful_server_shutdown_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_invoke_large_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_max_concurrent_streams_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_max_message_length_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_no_op_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_ping_pong_streaming_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_registered_call_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_request_response_with_binary_metadata_and_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_request_response_with_metadata_and_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_request_response_with_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_request_response_with_trailing_metadata_and_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_request_with_large_metadata_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_request_with_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_server_finishes_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_simple_delayed_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_simple_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_simple_request_with_high_initial_sequence_number_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_bad_hostname_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_cancel_after_accept_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_cancel_after_accept_and_writes_closed_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_cancel_after_invoke_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_cancel_before_invoke_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_cancel_in_a_vacuum_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_census_simple_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_disappearing_server_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_early_server_shutdown_finishes_inflight_calls_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_early_server_shutdown_finishes_tags_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_empty_batch_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_graceful_server_shutdown_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_invoke_large_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_max_concurrent_streams_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_max_message_length_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_no_op_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_ping_pong_streaming_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_registered_call_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_request_response_with_binary_metadata_and_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_request_response_with_metadata_and_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_request_response_with_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_request_response_with_trailing_metadata_and_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_request_with_large_metadata_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_request_with_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_server_finishes_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_simple_delayed_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_simple_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_simple_request_with_high_initial_sequence_number_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_bad_hostname_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_and_writes_closed_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_cancel_after_invoke_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_cancel_before_invoke_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_cancel_in_a_vacuum_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_census_simple_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_disappearing_server_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_inflight_calls_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_tags_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_empty_batch_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_graceful_server_shutdown_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_max_concurrent_streams_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_max_message_length_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_no_op_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_ping_pong_streaming_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_registered_call_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_request_response_with_binary_metadata_and_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_request_response_with_metadata_and_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_request_response_with_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_request_response_with_trailing_metadata_and_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_request_with_large_metadata_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_request_with_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_server_finishes_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_simple_delayed_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_simple_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_simple_request_with_high_initial_sequence_number_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_bad_hostname_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_cancel_after_accept_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_cancel_after_accept_and_writes_closed_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_cancel_after_invoke_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_cancel_before_invoke_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_cancel_in_a_vacuum_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_census_simple_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_disappearing_server_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_early_server_shutdown_finishes_inflight_calls_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_early_server_shutdown_finishes_tags_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_empty_batch_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_graceful_server_shutdown_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_invoke_large_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_max_concurrent_streams_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_max_message_length_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_no_op_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_ping_pong_streaming_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_registered_call_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_request_response_with_binary_metadata_and_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_request_response_with_metadata_and_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_request_response_with_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_request_response_with_trailing_metadata_and_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_request_with_large_metadata_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_request_with_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_server_finishes_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_simple_delayed_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_simple_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_simple_request_with_high_initial_sequence_number_unsecure_test <nl> <nl> buildtests_cxx : privatelibs_cxx $ ( BINDIR ) / $ ( CONFIG ) / async_end2end_test $ ( BINDIR ) / $ ( CONFIG ) / async_streaming_ping_pong_test $ ( BINDIR ) / $ ( CONFIG ) / async_unary_ping_pong_test $ ( BINDIR ) / $ ( CONFIG ) / channel_arguments_test $ ( BINDIR ) / $ ( CONFIG ) / cli_call_test $ ( BINDIR ) / $ ( CONFIG ) / credentials_test $ ( BINDIR ) / $ ( CONFIG ) / cxx_time_test $ ( BINDIR ) / $ ( CONFIG ) / end2end_test $ ( BINDIR ) / $ ( CONFIG ) / generic_end2end_test $ ( BINDIR ) / $ ( CONFIG ) / grpc_cli $ ( BINDIR ) / $ ( CONFIG ) / interop_client $ ( BINDIR ) / $ ( CONFIG ) / interop_server $ ( BINDIR ) / $ ( CONFIG ) / interop_test $ ( BINDIR ) / $ ( CONFIG ) / mock_test $ ( BINDIR ) / $ ( CONFIG ) / status_test $ ( BINDIR ) / $ ( CONFIG ) / sync_streaming_ping_pong_test $ ( BINDIR ) / $ ( CONFIG ) / sync_unary_ping_pong_test $ ( BINDIR ) / $ ( CONFIG ) / thread_pool_test $ ( BINDIR ) / $ ( CONFIG ) / thread_stress_test <nl> <nl> test_c : buildtests_c <nl> $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_request_with_large_metadata_test | | ( echo test chttp2_fake_security_request_with_large_metadata_test failed ; exit 1 ) <nl> $ ( E ) " [ RUN ] Testing chttp2_fake_security_request_with_payload_test " <nl> $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_request_with_payload_test | | ( echo test chttp2_fake_security_request_with_payload_test failed ; exit 1 ) <nl> + $ ( E ) " [ RUN ] Testing chttp2_fake_security_server_finishes_request_test " <nl> + $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_server_finishes_request_test | | ( echo test chttp2_fake_security_server_finishes_request_test failed ; exit 1 ) <nl> $ ( E ) " [ RUN ] Testing chttp2_fake_security_simple_delayed_request_test " <nl> $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_simple_delayed_request_test | | ( echo test chttp2_fake_security_simple_delayed_request_test failed ; exit 1 ) <nl> $ ( E ) " [ RUN ] Testing chttp2_fake_security_simple_request_test " <nl> test_c : buildtests_c <nl> $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_request_with_large_metadata_test | | ( echo test chttp2_fullstack_request_with_large_metadata_test failed ; exit 1 ) <nl> $ ( E ) " [ RUN ] Testing chttp2_fullstack_request_with_payload_test " <nl> $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_request_with_payload_test | | ( echo test chttp2_fullstack_request_with_payload_test failed ; exit 1 ) <nl> + $ ( E ) " [ RUN ] Testing chttp2_fullstack_server_finishes_request_test " <nl> + $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_server_finishes_request_test | | ( echo test chttp2_fullstack_server_finishes_request_test failed ; exit 1 ) <nl> $ ( E ) " [ RUN ] Testing chttp2_fullstack_simple_delayed_request_test " <nl> $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_simple_delayed_request_test | | ( echo test chttp2_fullstack_simple_delayed_request_test failed ; exit 1 ) <nl> $ ( E ) " [ RUN ] Testing chttp2_fullstack_simple_request_test " <nl> test_c : buildtests_c <nl> $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_request_with_large_metadata_test | | ( echo test chttp2_fullstack_uds_posix_request_with_large_metadata_test failed ; exit 1 ) <nl> $ ( E ) " [ RUN ] Testing chttp2_fullstack_uds_posix_request_with_payload_test " <nl> $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_request_with_payload_test | | ( echo test chttp2_fullstack_uds_posix_request_with_payload_test failed ; exit 1 ) <nl> + $ ( E ) " [ RUN ] Testing chttp2_fullstack_uds_posix_server_finishes_request_test " <nl> + $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_server_finishes_request_test | | ( echo test chttp2_fullstack_uds_posix_server_finishes_request_test failed ; exit 1 ) <nl> $ ( E ) " [ RUN ] Testing chttp2_fullstack_uds_posix_simple_delayed_request_test " <nl> $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_simple_delayed_request_test | | ( echo test chttp2_fullstack_uds_posix_simple_delayed_request_test failed ; exit 1 ) <nl> $ ( E ) " [ RUN ] Testing chttp2_fullstack_uds_posix_simple_request_test " <nl> test_c : buildtests_c <nl> $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_request_with_large_metadata_test | | ( echo test chttp2_simple_ssl_fullstack_request_with_large_metadata_test failed ; exit 1 ) <nl> $ ( E ) " [ RUN ] Testing chttp2_simple_ssl_fullstack_request_with_payload_test " <nl> $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_request_with_payload_test | | ( echo test chttp2_simple_ssl_fullstack_request_with_payload_test failed ; exit 1 ) <nl> + $ ( E ) " [ RUN ] Testing chttp2_simple_ssl_fullstack_server_finishes_request_test " <nl> + $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_server_finishes_request_test | | ( echo test chttp2_simple_ssl_fullstack_server_finishes_request_test failed ; exit 1 ) <nl> $ ( E ) " [ RUN ] Testing chttp2_simple_ssl_fullstack_simple_delayed_request_test " <nl> $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_simple_delayed_request_test | | ( echo test chttp2_simple_ssl_fullstack_simple_delayed_request_test failed ; exit 1 ) <nl> $ ( E ) " [ RUN ] Testing chttp2_simple_ssl_fullstack_simple_request_test " <nl> test_c : buildtests_c <nl> $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_request_with_large_metadata_test | | ( echo test chttp2_simple_ssl_with_oauth2_fullstack_request_with_large_metadata_test failed ; exit 1 ) <nl> $ ( E ) " [ RUN ] Testing chttp2_simple_ssl_with_oauth2_fullstack_request_with_payload_test " <nl> $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_request_with_payload_test | | ( echo test chttp2_simple_ssl_with_oauth2_fullstack_request_with_payload_test failed ; exit 1 ) <nl> + $ ( E ) " [ RUN ] Testing chttp2_simple_ssl_with_oauth2_fullstack_server_finishes_request_test " <nl> + $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_server_finishes_request_test | | ( echo test chttp2_simple_ssl_with_oauth2_fullstack_server_finishes_request_test failed ; exit 1 ) <nl> $ ( E ) " [ RUN ] Testing chttp2_simple_ssl_with_oauth2_fullstack_simple_delayed_request_test " <nl> $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_simple_delayed_request_test | | ( echo test chttp2_simple_ssl_with_oauth2_fullstack_simple_delayed_request_test failed ; exit 1 ) <nl> $ ( E ) " [ RUN ] Testing chttp2_simple_ssl_with_oauth2_fullstack_simple_request_test " <nl> test_c : buildtests_c <nl> $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_request_with_large_metadata_test | | ( echo test chttp2_socket_pair_request_with_large_metadata_test failed ; exit 1 ) <nl> $ ( E ) " [ RUN ] Testing chttp2_socket_pair_request_with_payload_test " <nl> $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_request_with_payload_test | | ( echo test chttp2_socket_pair_request_with_payload_test failed ; exit 1 ) <nl> + $ ( E ) " [ RUN ] Testing chttp2_socket_pair_server_finishes_request_test " <nl> + $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_server_finishes_request_test | | ( echo test chttp2_socket_pair_server_finishes_request_test failed ; exit 1 ) <nl> $ ( E ) " [ RUN ] Testing chttp2_socket_pair_simple_delayed_request_test " <nl> $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_simple_delayed_request_test | | ( echo test chttp2_socket_pair_simple_delayed_request_test failed ; exit 1 ) <nl> $ ( E ) " [ RUN ] Testing chttp2_socket_pair_simple_request_test " <nl> test_c : buildtests_c <nl> $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_request_with_large_metadata_test | | ( echo test chttp2_socket_pair_one_byte_at_a_time_request_with_large_metadata_test failed ; exit 1 ) <nl> $ ( E ) " [ RUN ] Testing chttp2_socket_pair_one_byte_at_a_time_request_with_payload_test " <nl> $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_request_with_payload_test | | ( echo test chttp2_socket_pair_one_byte_at_a_time_request_with_payload_test failed ; exit 1 ) <nl> + $ ( E ) " [ RUN ] Testing chttp2_socket_pair_one_byte_at_a_time_server_finishes_request_test " <nl> + $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_server_finishes_request_test | | ( echo test chttp2_socket_pair_one_byte_at_a_time_server_finishes_request_test failed ; exit 1 ) <nl> $ ( E ) " [ RUN ] Testing chttp2_socket_pair_one_byte_at_a_time_simple_delayed_request_test " <nl> $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_simple_delayed_request_test | | ( echo test chttp2_socket_pair_one_byte_at_a_time_simple_delayed_request_test failed ; exit 1 ) <nl> $ ( E ) " [ RUN ] Testing chttp2_socket_pair_one_byte_at_a_time_simple_request_test " <nl> test_c : buildtests_c <nl> $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_request_with_large_metadata_test | | ( echo test chttp2_socket_pair_with_grpc_trace_request_with_large_metadata_test failed ; exit 1 ) <nl> $ ( E ) " [ RUN ] Testing chttp2_socket_pair_with_grpc_trace_request_with_payload_test " <nl> $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_request_with_payload_test | | ( echo test chttp2_socket_pair_with_grpc_trace_request_with_payload_test failed ; exit 1 ) <nl> + $ ( E ) " [ RUN ] Testing chttp2_socket_pair_with_grpc_trace_server_finishes_request_test " <nl> + $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_server_finishes_request_test | | ( echo test chttp2_socket_pair_with_grpc_trace_server_finishes_request_test failed ; exit 1 ) <nl> $ ( E ) " [ RUN ] Testing chttp2_socket_pair_with_grpc_trace_simple_delayed_request_test " <nl> $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_simple_delayed_request_test | | ( echo test chttp2_socket_pair_with_grpc_trace_simple_delayed_request_test failed ; exit 1 ) <nl> $ ( E ) " [ RUN ] Testing chttp2_socket_pair_with_grpc_trace_simple_request_test " <nl> test_c : buildtests_c <nl> $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_request_with_large_metadata_unsecure_test | | ( echo test chttp2_fullstack_request_with_large_metadata_unsecure_test failed ; exit 1 ) <nl> $ ( E ) " [ RUN ] Testing chttp2_fullstack_request_with_payload_unsecure_test " <nl> $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_request_with_payload_unsecure_test | | ( echo test chttp2_fullstack_request_with_payload_unsecure_test failed ; exit 1 ) <nl> + $ ( E ) " [ RUN ] Testing chttp2_fullstack_server_finishes_request_unsecure_test " <nl> + $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_server_finishes_request_unsecure_test | | ( echo test chttp2_fullstack_server_finishes_request_unsecure_test failed ; exit 1 ) <nl> $ ( E ) " [ RUN ] Testing chttp2_fullstack_simple_delayed_request_unsecure_test " <nl> $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_simple_delayed_request_unsecure_test | | ( echo test chttp2_fullstack_simple_delayed_request_unsecure_test failed ; exit 1 ) <nl> $ ( E ) " [ RUN ] Testing chttp2_fullstack_simple_request_unsecure_test " <nl> test_c : buildtests_c <nl> $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_request_with_large_metadata_unsecure_test | | ( echo test chttp2_fullstack_uds_posix_request_with_large_metadata_unsecure_test failed ; exit 1 ) <nl> $ ( E ) " [ RUN ] Testing chttp2_fullstack_uds_posix_request_with_payload_unsecure_test " <nl> $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_request_with_payload_unsecure_test | | ( echo test chttp2_fullstack_uds_posix_request_with_payload_unsecure_test failed ; exit 1 ) <nl> + $ ( E ) " [ RUN ] Testing chttp2_fullstack_uds_posix_server_finishes_request_unsecure_test " <nl> + $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_server_finishes_request_unsecure_test | | ( echo test chttp2_fullstack_uds_posix_server_finishes_request_unsecure_test failed ; exit 1 ) <nl> $ ( E ) " [ RUN ] Testing chttp2_fullstack_uds_posix_simple_delayed_request_unsecure_test " <nl> $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_simple_delayed_request_unsecure_test | | ( echo test chttp2_fullstack_uds_posix_simple_delayed_request_unsecure_test failed ; exit 1 ) <nl> $ ( E ) " [ RUN ] Testing chttp2_fullstack_uds_posix_simple_request_unsecure_test " <nl> test_c : buildtests_c <nl> $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_request_with_large_metadata_unsecure_test | | ( echo test chttp2_socket_pair_request_with_large_metadata_unsecure_test failed ; exit 1 ) <nl> $ ( E ) " [ RUN ] Testing chttp2_socket_pair_request_with_payload_unsecure_test " <nl> $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_request_with_payload_unsecure_test | | ( echo test chttp2_socket_pair_request_with_payload_unsecure_test failed ; exit 1 ) <nl> + $ ( E ) " [ RUN ] Testing chttp2_socket_pair_server_finishes_request_unsecure_test " <nl> + $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_server_finishes_request_unsecure_test | | ( echo test chttp2_socket_pair_server_finishes_request_unsecure_test failed ; exit 1 ) <nl> $ ( E ) " [ RUN ] Testing chttp2_socket_pair_simple_delayed_request_unsecure_test " <nl> $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_simple_delayed_request_unsecure_test | | ( echo test chttp2_socket_pair_simple_delayed_request_unsecure_test failed ; exit 1 ) <nl> $ ( E ) " [ RUN ] Testing chttp2_socket_pair_simple_request_unsecure_test " <nl> test_c : buildtests_c <nl> $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_request_with_large_metadata_unsecure_test | | ( echo test chttp2_socket_pair_one_byte_at_a_time_request_with_large_metadata_unsecure_test failed ; exit 1 ) <nl> $ ( E ) " [ RUN ] Testing chttp2_socket_pair_one_byte_at_a_time_request_with_payload_unsecure_test " <nl> $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_request_with_payload_unsecure_test | | ( echo test chttp2_socket_pair_one_byte_at_a_time_request_with_payload_unsecure_test failed ; exit 1 ) <nl> + $ ( E ) " [ RUN ] Testing chttp2_socket_pair_one_byte_at_a_time_server_finishes_request_unsecure_test " <nl> + $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_server_finishes_request_unsecure_test | | ( echo test chttp2_socket_pair_one_byte_at_a_time_server_finishes_request_unsecure_test failed ; exit 1 ) <nl> $ ( E ) " [ RUN ] Testing chttp2_socket_pair_one_byte_at_a_time_simple_delayed_request_unsecure_test " <nl> $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_simple_delayed_request_unsecure_test | | ( echo test chttp2_socket_pair_one_byte_at_a_time_simple_delayed_request_unsecure_test failed ; exit 1 ) <nl> $ ( E ) " [ RUN ] Testing chttp2_socket_pair_one_byte_at_a_time_simple_request_unsecure_test " <nl> test_c : buildtests_c <nl> $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_request_with_large_metadata_unsecure_test | | ( echo test chttp2_socket_pair_with_grpc_trace_request_with_large_metadata_unsecure_test failed ; exit 1 ) <nl> $ ( E ) " [ RUN ] Testing chttp2_socket_pair_with_grpc_trace_request_with_payload_unsecure_test " <nl> $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_request_with_payload_unsecure_test | | ( echo test chttp2_socket_pair_with_grpc_trace_request_with_payload_unsecure_test failed ; exit 1 ) <nl> + $ ( E ) " [ RUN ] Testing chttp2_socket_pair_with_grpc_trace_server_finishes_request_unsecure_test " <nl> + $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_server_finishes_request_unsecure_test | | ( echo test chttp2_socket_pair_with_grpc_trace_server_finishes_request_unsecure_test failed ; exit 1 ) <nl> $ ( E ) " [ RUN ] Testing chttp2_socket_pair_with_grpc_trace_simple_delayed_request_unsecure_test " <nl> $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_simple_delayed_request_unsecure_test | | ( echo test chttp2_socket_pair_with_grpc_trace_simple_delayed_request_unsecure_test failed ; exit 1 ) <nl> $ ( E ) " [ RUN ] Testing chttp2_socket_pair_with_grpc_trace_simple_request_unsecure_test " <nl> ifneq ( $ ( NO_DEPS ) , true ) <nl> endif <nl> <nl> <nl> + LIBEND2END_TEST_SERVER_FINISHES_REQUEST_SRC = \ <nl> + test / core / end2end / tests / server_finishes_request . c \ <nl> + <nl> + <nl> + LIBEND2END_TEST_SERVER_FINISHES_REQUEST_OBJS = $ ( addprefix $ ( OBJDIR ) / $ ( CONFIG ) / , $ ( addsuffix . o , $ ( basename $ ( LIBEND2END_TEST_SERVER_FINISHES_REQUEST_SRC ) ) ) ) <nl> + <nl> + $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_server_finishes_request . a : $ ( ZLIB_DEP ) $ ( LIBEND2END_TEST_SERVER_FINISHES_REQUEST_OBJS ) <nl> + $ ( E ) " [ AR ] Creating $ @ " <nl> + $ ( Q ) mkdir - p ` dirname $ @ ` <nl> + $ ( Q ) rm - f $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_server_finishes_request . a <nl> + $ ( Q ) $ ( AR ) rcs $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_server_finishes_request . a $ ( LIBEND2END_TEST_SERVER_FINISHES_REQUEST_OBJS ) <nl> + ifeq ( $ ( SYSTEM ) , Darwin ) <nl> + $ ( Q ) ranlib $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_server_finishes_request . a <nl> + endif <nl> + <nl> + <nl> + <nl> + <nl> + ifneq ( $ ( NO_DEPS ) , true ) <nl> + - include $ ( LIBEND2END_TEST_SERVER_FINISHES_REQUEST_OBJS : . o = . dep ) <nl> + endif <nl> + <nl> + <nl> LIBEND2END_TEST_SIMPLE_DELAYED_REQUEST_SRC = \ <nl> test / core / end2end / tests / simple_delayed_request . c \ <nl> <nl> endif <nl> <nl> <nl> <nl> + ifeq ( $ ( NO_SECURE ) , true ) <nl> + <nl> + # You can ' t build secure targets if you don ' t have OpenSSL with ALPN . <nl> + <nl> + $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_server_finishes_request_test : openssl_dep_error <nl> + <nl> + else <nl> + <nl> + $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_server_finishes_request_test : $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_fake_security . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_server_finishes_request . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_certs . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr . a <nl> + $ ( E ) " [ LD ] Linking $ @ " <nl> + $ ( Q ) mkdir - p ` dirname $ @ ` <nl> + $ ( Q ) $ ( LD ) $ ( LDFLAGS ) $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_fake_security . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_server_finishes_request . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_certs . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr . a $ ( LDLIBS ) $ ( LDLIBS_SECURE ) - o $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_server_finishes_request_test <nl> + <nl> + endif <nl> + <nl> + <nl> + <nl> + <nl> ifeq ( $ ( NO_SECURE ) , true ) <nl> <nl> # You can ' t build secure targets if you don ' t have OpenSSL with ALPN . <nl> endif <nl> <nl> <nl> <nl> + ifeq ( $ ( NO_SECURE ) , true ) <nl> + <nl> + # You can ' t build secure targets if you don ' t have OpenSSL with ALPN . <nl> + <nl> + $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_server_finishes_request_test : openssl_dep_error <nl> + <nl> + else <nl> + <nl> + $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_server_finishes_request_test : $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_fullstack . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_server_finishes_request . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_certs . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr . a <nl> + $ ( E ) " [ LD ] Linking $ @ " <nl> + $ ( Q ) mkdir - p ` dirname $ @ ` <nl> + $ ( Q ) $ ( LD ) $ ( LDFLAGS ) $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_fullstack . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_server_finishes_request . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_certs . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr . a $ ( LDLIBS ) $ ( LDLIBS_SECURE ) - o $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_server_finishes_request_test <nl> + <nl> + endif <nl> + <nl> + <nl> + <nl> + <nl> ifeq ( $ ( NO_SECURE ) , true ) <nl> <nl> # You can ' t build secure targets if you don ' t have OpenSSL with ALPN . <nl> endif <nl> <nl> <nl> <nl> + ifeq ( $ ( NO_SECURE ) , true ) <nl> + <nl> + # You can ' t build secure targets if you don ' t have OpenSSL with ALPN . <nl> + <nl> + $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_server_finishes_request_test : openssl_dep_error <nl> + <nl> + else <nl> + <nl> + $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_server_finishes_request_test : $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_fullstack_uds_posix . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_server_finishes_request . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_certs . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr . a <nl> + $ ( E ) " [ LD ] Linking $ @ " <nl> + $ ( Q ) mkdir - p ` dirname $ @ ` <nl> + $ ( Q ) $ ( LD ) $ ( LDFLAGS ) $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_fullstack_uds_posix . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_server_finishes_request . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_certs . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr . a $ ( LDLIBS ) $ ( LDLIBS_SECURE ) - o $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_server_finishes_request_test <nl> + <nl> + endif <nl> + <nl> + <nl> + <nl> + <nl> ifeq ( $ ( NO_SECURE ) , true ) <nl> <nl> # You can ' t build secure targets if you don ' t have OpenSSL with ALPN . <nl> endif <nl> <nl> <nl> <nl> + ifeq ( $ ( NO_SECURE ) , true ) <nl> + <nl> + # You can ' t build secure targets if you don ' t have OpenSSL with ALPN . <nl> + <nl> + $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_server_finishes_request_test : openssl_dep_error <nl> + <nl> + else <nl> + <nl> + $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_server_finishes_request_test : $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_simple_ssl_fullstack . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_server_finishes_request . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_certs . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr . a <nl> + $ ( E ) " [ LD ] Linking $ @ " <nl> + $ ( Q ) mkdir - p ` dirname $ @ ` <nl> + $ ( Q ) $ ( LD ) $ ( LDFLAGS ) $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_simple_ssl_fullstack . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_server_finishes_request . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_certs . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr . a $ ( LDLIBS ) $ ( LDLIBS_SECURE ) - o $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_server_finishes_request_test <nl> + <nl> + endif <nl> + <nl> + <nl> + <nl> + <nl> ifeq ( $ ( NO_SECURE ) , true ) <nl> <nl> # You can ' t build secure targets if you don ' t have OpenSSL with ALPN . <nl> endif <nl> <nl> <nl> <nl> + ifeq ( $ ( NO_SECURE ) , true ) <nl> + <nl> + # You can ' t build secure targets if you don ' t have OpenSSL with ALPN . <nl> + <nl> + $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_server_finishes_request_test : openssl_dep_error <nl> + <nl> + else <nl> + <nl> + $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_server_finishes_request_test : $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_server_finishes_request . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_certs . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr . a <nl> + $ ( E ) " [ LD ] Linking $ @ " <nl> + $ ( Q ) mkdir - p ` dirname $ @ ` <nl> + $ ( Q ) $ ( LD ) $ ( LDFLAGS ) $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_server_finishes_request . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_certs . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr . a $ ( LDLIBS ) $ ( LDLIBS_SECURE ) - o $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_with_oauth2_fullstack_server_finishes_request_test <nl> + <nl> + endif <nl> + <nl> + <nl> + <nl> + <nl> ifeq ( $ ( NO_SECURE ) , true ) <nl> <nl> # You can ' t build secure targets if you don ' t have OpenSSL with ALPN . <nl> endif <nl> <nl> <nl> <nl> + ifeq ( $ ( NO_SECURE ) , true ) <nl> + <nl> + # You can ' t build secure targets if you don ' t have OpenSSL with ALPN . <nl> + <nl> + $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_server_finishes_request_test : openssl_dep_error <nl> + <nl> + else <nl> + <nl> + $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_server_finishes_request_test : $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_socket_pair . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_server_finishes_request . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_certs . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr . a <nl> + $ ( E ) " [ LD ] Linking $ @ " <nl> + $ ( Q ) mkdir - p ` dirname $ @ ` <nl> + $ ( Q ) $ ( LD ) $ ( LDFLAGS ) $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_socket_pair . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_server_finishes_request . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_certs . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr . a $ ( LDLIBS ) $ ( LDLIBS_SECURE ) - o $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_server_finishes_request_test <nl> + <nl> + endif <nl> + <nl> + <nl> + <nl> + <nl> ifeq ( $ ( NO_SECURE ) , true ) <nl> <nl> # You can ' t build secure targets if you don ' t have OpenSSL with ALPN . <nl> endif <nl> <nl> <nl> <nl> + ifeq ( $ ( NO_SECURE ) , true ) <nl> + <nl> + # You can ' t build secure targets if you don ' t have OpenSSL with ALPN . <nl> + <nl> + $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_server_finishes_request_test : openssl_dep_error <nl> + <nl> + else <nl> + <nl> + $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_server_finishes_request_test : $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_socket_pair_one_byte_at_a_time . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_server_finishes_request . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_certs . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr . a <nl> + $ ( E ) " [ LD ] Linking $ @ " <nl> + $ ( Q ) mkdir - p ` dirname $ @ ` <nl> + $ ( Q ) $ ( LD ) $ ( LDFLAGS ) $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_socket_pair_one_byte_at_a_time . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_server_finishes_request . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_certs . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr . a $ ( LDLIBS ) $ ( LDLIBS_SECURE ) - o $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_server_finishes_request_test <nl> + <nl> + endif <nl> + <nl> + <nl> + <nl> + <nl> ifeq ( $ ( NO_SECURE ) , true ) <nl> <nl> # You can ' t build secure targets if you don ' t have OpenSSL with ALPN . <nl> endif <nl> <nl> <nl> <nl> + ifeq ( $ ( NO_SECURE ) , true ) <nl> + <nl> + # You can ' t build secure targets if you don ' t have OpenSSL with ALPN . <nl> + <nl> + $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_server_finishes_request_test : openssl_dep_error <nl> + <nl> + else <nl> + <nl> + $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_server_finishes_request_test : $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_socket_pair_with_grpc_trace . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_server_finishes_request . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_certs . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr . a <nl> + $ ( E ) " [ LD ] Linking $ @ " <nl> + $ ( Q ) mkdir - p ` dirname $ @ ` <nl> + $ ( Q ) $ ( LD ) $ ( LDFLAGS ) $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_socket_pair_with_grpc_trace . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_server_finishes_request . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_certs . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr . a $ ( LDLIBS ) $ ( LDLIBS_SECURE ) - o $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_server_finishes_request_test <nl> + <nl> + endif <nl> + <nl> + <nl> + <nl> + <nl> ifeq ( $ ( NO_SECURE ) , true ) <nl> <nl> # You can ' t build secure targets if you don ' t have OpenSSL with ALPN . <nl> $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_request_with_payload_unsecure_test : $ ( LIBD <nl> <nl> <nl> <nl> + $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_server_finishes_request_unsecure_test : $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_fullstack . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_server_finishes_request . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_test_util_unsecure . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_unsecure . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr . a <nl> + $ ( E ) " [ LD ] Linking $ @ " <nl> + $ ( Q ) mkdir - p ` dirname $ @ ` <nl> + $ ( Q ) $ ( LD ) $ ( LDFLAGS ) $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_fullstack . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_server_finishes_request . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_test_util_unsecure . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_unsecure . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr . a $ ( LDLIBS ) - o $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_server_finishes_request_unsecure_test <nl> + <nl> + <nl> + <nl> + <nl> $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_simple_delayed_request_unsecure_test : $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_fullstack . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_simple_delayed_request . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_test_util_unsecure . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_unsecure . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr . a <nl> $ ( E ) " [ LD ] Linking $ @ " <nl> $ ( Q ) mkdir - p ` dirname $ @ ` <nl> $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_request_with_payload_unsecure_tes <nl> <nl> <nl> <nl> + $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_server_finishes_request_unsecure_test : $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_fullstack_uds_posix . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_server_finishes_request . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_test_util_unsecure . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_unsecure . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr . a <nl> + $ ( E ) " [ LD ] Linking $ @ " <nl> + $ ( Q ) mkdir - p ` dirname $ @ ` <nl> + $ ( Q ) $ ( LD ) $ ( LDFLAGS ) $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_fullstack_uds_posix . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_server_finishes_request . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_test_util_unsecure . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_unsecure . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr . a $ ( LDLIBS ) - o $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_server_finishes_request_unsecure_test <nl> + <nl> + <nl> + <nl> + <nl> $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_uds_posix_simple_delayed_request_unsecure_test : $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_fullstack_uds_posix . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_simple_delayed_request . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_test_util_unsecure . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_unsecure . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr . a <nl> $ ( E ) " [ LD ] Linking $ @ " <nl> $ ( Q ) mkdir - p ` dirname $ @ ` <nl> $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_request_with_payload_unsecure_test : $ ( LI <nl> <nl> <nl> <nl> + $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_server_finishes_request_unsecure_test : $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_socket_pair . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_server_finishes_request . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_test_util_unsecure . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_unsecure . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr . a <nl> + $ ( E ) " [ LD ] Linking $ @ " <nl> + $ ( Q ) mkdir - p ` dirname $ @ ` <nl> + $ ( Q ) $ ( LD ) $ ( LDFLAGS ) $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_socket_pair . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_server_finishes_request . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_test_util_unsecure . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_unsecure . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr . a $ ( LDLIBS ) - o $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_server_finishes_request_unsecure_test <nl> + <nl> + <nl> + <nl> + <nl> $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_simple_delayed_request_unsecure_test : $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_socket_pair . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_simple_delayed_request . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_test_util_unsecure . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_unsecure . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr . a <nl> $ ( E ) " [ LD ] Linking $ @ " <nl> $ ( Q ) mkdir - p ` dirname $ @ ` <nl> $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_request_with_payload_u <nl> <nl> <nl> <nl> + $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_server_finishes_request_unsecure_test : $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_socket_pair_one_byte_at_a_time . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_server_finishes_request . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_test_util_unsecure . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_unsecure . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr . a <nl> + $ ( E ) " [ LD ] Linking $ @ " <nl> + $ ( Q ) mkdir - p ` dirname $ @ ` <nl> + $ ( Q ) $ ( LD ) $ ( LDFLAGS ) $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_socket_pair_one_byte_at_a_time . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_server_finishes_request . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_test_util_unsecure . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_unsecure . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr . a $ ( LDLIBS ) - o $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_server_finishes_request_unsecure_test <nl> + <nl> + <nl> + <nl> + <nl> $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_one_byte_at_a_time_simple_delayed_request_unsecure_test : $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_socket_pair_one_byte_at_a_time . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_simple_delayed_request . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_test_util_unsecure . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_unsecure . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr . a <nl> $ ( E ) " [ LD ] Linking $ @ " <nl> $ ( Q ) mkdir - p ` dirname $ @ ` <nl> $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_request_with_payload_unse <nl> <nl> <nl> <nl> + $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_server_finishes_request_unsecure_test : $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_socket_pair_with_grpc_trace . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_server_finishes_request . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_test_util_unsecure . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_unsecure . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr . a <nl> + $ ( E ) " [ LD ] Linking $ @ " <nl> + $ ( Q ) mkdir - p ` dirname $ @ ` <nl> + $ ( Q ) $ ( LD ) $ ( LDFLAGS ) $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_socket_pair_with_grpc_trace . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_server_finishes_request . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_test_util_unsecure . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_unsecure . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr . a $ ( LDLIBS ) - o $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_server_finishes_request_unsecure_test <nl> + <nl> + <nl> + <nl> + <nl> $ ( BINDIR ) / $ ( CONFIG ) / chttp2_socket_pair_with_grpc_trace_simple_delayed_request_unsecure_test : $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_fixture_chttp2_socket_pair_with_grpc_trace . a $ ( LIBDIR ) / $ ( CONFIG ) / libend2end_test_simple_delayed_request . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_test_util_unsecure . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_unsecure . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr . a <nl> $ ( E ) " [ LD ] Linking $ @ " <nl> $ ( Q ) mkdir - p ` dirname $ @ ` <nl> mmm a / src / core / transport / chttp2 / frame . h <nl> ppp b / src / core / transport / chttp2 / frame . h <nl> typedef struct { <nl> gpr_uint8 send_ping_ack ; <nl> gpr_uint8 process_ping_reply ; <nl> gpr_uint8 goaway ; <nl> + gpr_uint8 rst_stream ; <nl> <nl> gpr_int64 initial_window_update ; <nl> gpr_uint32 window_update ; <nl> gpr_uint32 goaway_last_stream_index ; <nl> gpr_uint32 goaway_error ; <nl> gpr_slice goaway_text ; <nl> + gpr_uint32 rst_stream_reason ; <nl> } grpc_chttp2_parse_state ; <nl> <nl> # define GRPC_CHTTP2_FRAME_DATA 0 <nl> mmm a / src / core / transport / chttp2 / frame_rst_stream . c <nl> ppp b / src / core / transport / chttp2 / frame_rst_stream . c <nl> <nl> * / <nl> <nl> # include " src / core / transport / chttp2 / frame_rst_stream . h " <nl> + <nl> + # include < grpc / support / log . h > <nl> + <nl> # include " src / core / transport / chttp2 / frame . h " <nl> <nl> gpr_slice grpc_chttp2_rst_stream_create ( gpr_uint32 id , gpr_uint32 code ) { <nl> gpr_slice grpc_chttp2_rst_stream_create ( gpr_uint32 id , gpr_uint32 code ) { <nl> <nl> return slice ; <nl> } <nl> + <nl> + grpc_chttp2_parse_error grpc_chttp2_rst_stream_parser_begin_frame ( <nl> + grpc_chttp2_rst_stream_parser * parser , gpr_uint32 length , gpr_uint8 flags ) { <nl> + if ( length ! = 4 ) { <nl> + gpr_log ( GPR_ERROR , " invalid rst_stream : length = % d , flags = % 02x " , length , flags ) ; <nl> + return GRPC_CHTTP2_CONNECTION_ERROR ; <nl> + } <nl> + parser - > byte = 0 ; <nl> + return GRPC_CHTTP2_PARSE_OK ; <nl> + } <nl> + <nl> + grpc_chttp2_parse_error grpc_chttp2_rst_stream_parser_parse ( <nl> + void * parser , grpc_chttp2_parse_state * state , gpr_slice slice , <nl> + int is_last ) { <nl> + gpr_uint8 * const beg = GPR_SLICE_START_PTR ( slice ) ; <nl> + gpr_uint8 * const end = GPR_SLICE_END_PTR ( slice ) ; <nl> + gpr_uint8 * cur = beg ; <nl> + grpc_chttp2_rst_stream_parser * p = parser ; <nl> + <nl> + while ( p - > byte ! = 4 & & cur ! = end ) { <nl> + p - > reason_bytes [ p - > byte ] = * cur ; <nl> + cur + + ; <nl> + p - > byte + + ; <nl> + } <nl> + <nl> + if ( p - > byte = = 4 ) { <nl> + GPR_ASSERT ( is_last ) ; <nl> + state - > rst_stream = 1 ; <nl> + state - > rst_stream_reason = <nl> + ( ( ( gpr_uint32 ) p - > reason_bytes [ 0 ] ) < < 24 ) | <nl> + ( ( ( gpr_uint32 ) p - > reason_bytes [ 1 ] ) < < 16 ) | <nl> + ( ( ( gpr_uint32 ) p - > reason_bytes [ 2 ] ) < < 8 ) | <nl> + ( ( ( gpr_uint32 ) p - > reason_bytes [ 3 ] ) ) ; <nl> + } <nl> + <nl> + return GRPC_CHTTP2_PARSE_OK ; <nl> + } <nl> mmm a / src / core / transport / chttp2 / frame_rst_stream . h <nl> ppp b / src / core / transport / chttp2 / frame_rst_stream . h <nl> <nl> # define GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_FRAME_RST_STREAM_H <nl> <nl> # include < grpc / support / slice . h > <nl> + # include " src / core / transport / chttp2 / frame . h " <nl> + <nl> + typedef struct { <nl> + gpr_uint8 byte ; <nl> + gpr_uint8 reason_bytes [ 4 ] ; <nl> + } grpc_chttp2_rst_stream_parser ; <nl> <nl> gpr_slice grpc_chttp2_rst_stream_create ( gpr_uint32 stream_id , gpr_uint32 code ) ; <nl> <nl> + grpc_chttp2_parse_error grpc_chttp2_rst_stream_parser_begin_frame ( <nl> + grpc_chttp2_rst_stream_parser * parser , gpr_uint32 length , gpr_uint8 flags ) ; <nl> + grpc_chttp2_parse_error grpc_chttp2_rst_stream_parser_parse ( <nl> + void * parser , grpc_chttp2_parse_state * state , gpr_slice slice , int is_last ) ; <nl> + <nl> # endif / * GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_FRAME_RST_STREAM_H * / <nl> mmm a / src / core / transport / chttp2_transport . c <nl> ppp b / src / core / transport / chttp2_transport . c <nl> typedef enum { <nl> WRITE_STATE_OPEN , <nl> WRITE_STATE_QUEUED_CLOSE , <nl> WRITE_STATE_SENT_CLOSE <nl> - } WRITE_STATE ; <nl> + } write_state ; <nl> + <nl> + typedef enum { <nl> + DONT_SEND_CLOSED = 0 , <nl> + SEND_CLOSED , <nl> + SEND_CLOSED_WITH_RST_STREAM <nl> + } send_closed ; <nl> <nl> typedef struct { <nl> stream * head ; <nl> struct transport { <nl> grpc_chttp2_window_update_parser window_update ; <nl> grpc_chttp2_settings_parser settings ; <nl> grpc_chttp2_ping_parser ping ; <nl> + grpc_chttp2_rst_stream_parser rst_stream ; <nl> } simple_parsers ; <nl> <nl> / * goaway * / <nl> struct stream { <nl> / * when the application requests writes be closed , the write_closed is <nl> ' queued ' ; when the close is flow controlled into the send path , we are <nl> ' sending ' it ; when the write has been performed it is ' sent ' * / <nl> - WRITE_STATE write_state ; <nl> - gpr_uint8 send_closed ; <nl> + write_state write_state ; <nl> + send_closed send_closed ; <nl> gpr_uint8 read_closed ; <nl> gpr_uint8 cancelled ; <nl> <nl> static int prepare_write ( transport * t ) { <nl> <nl> if ( s - > write_state = = WRITE_STATE_QUEUED_CLOSE & & <nl> s - > outgoing_sopb - > nops = = 0 ) { <nl> - s - > send_closed = 1 ; <nl> + if ( ! t - > is_client & & ! s - > read_closed ) { <nl> + s - > send_closed = SEND_CLOSED_WITH_RST_STREAM ; <nl> + } else { <nl> + s - > send_closed = SEND_CLOSED ; <nl> + } <nl> } <nl> if ( s - > writing_sopb . nops > 0 | | s - > send_closed ) { <nl> stream_list_join ( t , s , WRITING ) ; <nl> static void finalize_outbuf ( transport * t ) { <nl> <nl> while ( ( s = stream_list_remove_head ( t , WRITING ) ) ) { <nl> grpc_chttp2_encode ( s - > writing_sopb . ops , s - > writing_sopb . nops , <nl> - s - > send_closed , s - > id , & t - > hpack_compressor , & t - > outbuf ) ; <nl> + s - > send_closed ! = DONT_SEND_CLOSED , s - > id , & t - > hpack_compressor , & t - > outbuf ) ; <nl> s - > writing_sopb . nops = 0 ; <nl> - if ( s - > send_closed ) { <nl> + if ( s - > send_closed = = SEND_CLOSED_WITH_RST_STREAM ) { <nl> + gpr_slice_buffer_add ( & t - > outbuf , grpc_chttp2_rst_stream_create ( s - > id , GRPC_CHTTP2_NO_ERROR ) ) ; <nl> + } <nl> + if ( s - > send_closed ! = DONT_SEND_CLOSED ) { <nl> stream_list_join ( t , s , WRITTEN_CLOSED ) ; <nl> } <nl> } <nl> static void finish_write_common ( transport * t , int success ) { <nl> } <nl> while ( ( s = stream_list_remove_head ( t , WRITTEN_CLOSED ) ) ) { <nl> s - > write_state = WRITE_STATE_SENT_CLOSE ; <nl> - if ( 1 | | ! s - > cancelled ) { <nl> - maybe_finish_read ( t , s ) ; <nl> + if ( ! t - > is_client ) { <nl> + s - > read_closed = 1 ; <nl> } <nl> + maybe_finish_read ( t , s ) ; <nl> } <nl> t - > outbuf . count = 0 ; <nl> t - > outbuf . length = 0 ; <nl> static void cancel_stream_inner ( transport * t , stream * s , gpr_uint32 id , <nl> if ( s ) { <nl> / * clear out any unreported input & output : nobody cares anymore * / <nl> had_outgoing = s - > outgoing_sopb & & s - > outgoing_sopb - > nops ! = 0 ; <nl> - schedule_nuke_sopb ( t , & s - > parser . incoming_sopb ) ; <nl> - if ( s - > outgoing_sopb ) { <nl> - schedule_nuke_sopb ( t , s - > outgoing_sopb ) ; <nl> - s - > outgoing_sopb = NULL ; <nl> - stream_list_remove ( t , s , WRITABLE ) ; <nl> - schedule_cb ( t , s - > send_done_closure , 0 ) ; <nl> + if ( error_code ! = GRPC_CHTTP2_NO_ERROR ) { <nl> + schedule_nuke_sopb ( t , & s - > parser . incoming_sopb ) ; <nl> + if ( s - > outgoing_sopb ) { <nl> + schedule_nuke_sopb ( t , s - > outgoing_sopb ) ; <nl> + s - > outgoing_sopb = NULL ; <nl> + stream_list_remove ( t , s , WRITABLE ) ; <nl> + schedule_cb ( t , s - > send_done_closure , 0 ) ; <nl> + } <nl> } <nl> if ( s - > cancelled ) { <nl> send_rst = 0 ; <nl> static void cancel_stream_inner ( transport * t , stream * s , gpr_uint32 id , <nl> s - > cancelled = 1 ; <nl> stream_list_join ( t , s , CANCELLED ) ; <nl> <nl> - gpr_ltoa ( local_status , buffer ) ; <nl> - add_incoming_metadata ( <nl> - t , s , <nl> - grpc_mdelem_from_strings ( t - > metadata_context , " grpc - status " , buffer ) ) ; <nl> - if ( ! optional_message ) { <nl> - switch ( local_status ) { <nl> - case GRPC_STATUS_CANCELLED : <nl> - add_incoming_metadata ( <nl> - t , s , grpc_mdelem_from_strings ( t - > metadata_context , <nl> - " grpc - message " , " Cancelled " ) ) ; <nl> - break ; <nl> - default : <nl> - break ; <nl> - } <nl> - } else { <nl> + if ( error_code ! = GRPC_CHTTP2_NO_ERROR ) { <nl> + / * synthesize a status if we don ' t believe we ' ll get one * / <nl> + gpr_ltoa ( local_status , buffer ) ; <nl> add_incoming_metadata ( <nl> t , s , <nl> - grpc_mdelem_from_metadata_strings ( <nl> - t - > metadata_context , <nl> - grpc_mdstr_from_string ( t - > metadata_context , " grpc - message " ) , <nl> - grpc_mdstr_ref ( optional_message ) ) ) ; <nl> + grpc_mdelem_from_strings ( t - > metadata_context , " grpc - status " , buffer ) ) ; <nl> + if ( ! optional_message ) { <nl> + switch ( local_status ) { <nl> + case GRPC_STATUS_CANCELLED : <nl> + add_incoming_metadata ( <nl> + t , s , grpc_mdelem_from_strings ( t - > metadata_context , <nl> + " grpc - message " , " Cancelled " ) ) ; <nl> + break ; <nl> + default : <nl> + break ; <nl> + } <nl> + } else { <nl> + add_incoming_metadata ( <nl> + t , s , <nl> + grpc_mdelem_from_metadata_strings ( <nl> + t - > metadata_context , <nl> + grpc_mdstr_from_string ( t - > metadata_context , " grpc - message " ) , <nl> + grpc_mdstr_ref ( optional_message ) ) ) ; <nl> + } <nl> + add_metadata_batch ( t , s ) ; <nl> } <nl> - add_metadata_batch ( t , s ) ; <nl> - maybe_finish_read ( t , s ) ; <nl> } <nl> + maybe_finish_read ( t , s ) ; <nl> } <nl> if ( ! id ) send_rst = 0 ; <nl> if ( send_rst ) { <nl> static int init_ping_parser ( transport * t ) { <nl> return ok ; <nl> } <nl> <nl> + static int init_rst_stream_parser ( transport * t ) { <nl> + int ok = GRPC_CHTTP2_PARSE_OK = = <nl> + grpc_chttp2_rst_stream_parser_begin_frame ( & t - > simple_parsers . rst_stream , <nl> + t - > incoming_frame_size , <nl> + t - > incoming_frame_flags ) ; <nl> + if ( ! ok ) { <nl> + drop_connection ( t ) ; <nl> + } <nl> + t - > parser = grpc_chttp2_rst_stream_parser_parse ; <nl> + t - > parser_data = & t - > simple_parsers . rst_stream ; <nl> + return ok ; <nl> + } <nl> + <nl> static int init_goaway_parser ( transport * t ) { <nl> int ok = <nl> GRPC_CHTTP2_PARSE_OK = = <nl> static int init_frame_parser ( transport * t ) { <nl> gpr_log ( GPR_ERROR , " Unexpected CONTINUATION frame " ) ; <nl> return 0 ; <nl> case GRPC_CHTTP2_FRAME_RST_STREAM : <nl> - / * TODO ( ctiller ) : actually parse the reason * / <nl> - cancel_stream_id ( <nl> - t , t - > incoming_stream_id , <nl> - grpc_chttp2_http2_error_to_grpc_status ( GRPC_CHTTP2_CANCEL ) , <nl> - GRPC_CHTTP2_CANCEL , 0 ) ; <nl> - return init_skip_frame ( t , 0 ) ; <nl> + return init_rst_stream_parser ( t ) ; <nl> case GRPC_CHTTP2_FRAME_SETTINGS : <nl> return init_settings_frame_parser ( t ) ; <nl> case GRPC_CHTTP2_FRAME_WINDOW_UPDATE : <nl> static int parse_frame_slice ( transport * t , gpr_slice slice , int is_last ) { <nl> if ( st . goaway ) { <nl> add_goaway ( t , st . goaway_error , st . goaway_text ) ; <nl> } <nl> + if ( st . rst_stream ) { <nl> + cancel_stream_id ( <nl> + t , t - > incoming_stream_id , <nl> + grpc_chttp2_http2_error_to_grpc_status ( st . rst_stream_reason ) , <nl> + st . rst_stream_reason , 0 ) ; <nl> + } <nl> if ( st . process_ping_reply ) { <nl> for ( i = 0 ; i < t - > ping_count ; i + + ) { <nl> if ( 0 = = <nl> mmm a / src / node / test / end_to_end_test . js <nl> ppp b / src / node / test / end_to_end_test . js <nl> describe ( ' end - to - end ' , function ( ) { <nl> assert . ifError ( err ) ; <nl> assert ( response [ ' send metadata ' ] ) ; <nl> assert . strictEqual ( response . read . toString ( ) , requests [ 0 ] ) ; <nl> - var end_batch = { } ; <nl> - end_batch [ grpc . opType . RECV_CLOSE_ON_SERVER ] = true ; <nl> - end_batch [ grpc . opType . SEND_STATUS_FROM_SERVER ] = { <nl> - ' metadata ' : { } , <nl> - ' code ' : grpc . status . OK , <nl> - ' details ' : status_text <nl> - } ; <nl> - end_batch [ grpc . opType . RECV_MESSAGE ] = true ; <nl> - server_call . startBatch ( end_batch , function ( err , response ) { <nl> + var snd_batch = { } ; <nl> + snd_batch [ grpc . opType . RECV_MESSAGE ] = true ; <nl> + server_call . startBatch ( snd_batch , function ( err , response ) { <nl> assert . ifError ( err ) ; <nl> - assert ( response [ ' send status ' ] ) ; <nl> - assert ( ! response . cancelled ) ; <nl> assert . strictEqual ( response . read . toString ( ) , requests [ 1 ] ) ; <nl> - done ( ) ; <nl> + var end_batch = { } ; <nl> + end_batch [ grpc . opType . RECV_CLOSE_ON_SERVER ] = true ; <nl> + end_batch [ grpc . opType . SEND_STATUS_FROM_SERVER ] = { <nl> + ' metadata ' : { } , <nl> + ' code ' : grpc . status . OK , <nl> + ' details ' : status_text <nl> + } ; <nl> + server_call . startBatch ( end_batch , function ( err , response ) { <nl> + assert . ifError ( err ) ; <nl> + assert ( response [ ' send status ' ] ) ; <nl> + assert ( ! response . cancelled ) ; <nl> + done ( ) ; <nl> + } ) ; <nl> } ) ; <nl> } ) ; <nl> } ) ; <nl> mmm a / test / core / end2end / cq_verifier . c <nl> ppp b / test / core / end2end / cq_verifier . c <nl> static gpr_slice merge_slices ( gpr_slice * slices , size_t nslices ) { <nl> } <nl> <nl> static int byte_buffer_eq_slice ( grpc_byte_buffer * bb , gpr_slice b ) { <nl> - gpr_slice a = <nl> - merge_slices ( bb - > data . slice_buffer . slices , bb - > data . slice_buffer . count ) ; <nl> - int ok = GPR_SLICE_LENGTH ( a ) = = GPR_SLICE_LENGTH ( b ) & & <nl> - 0 = = memcmp ( GPR_SLICE_START_PTR ( a ) , GPR_SLICE_START_PTR ( b ) , <nl> - GPR_SLICE_LENGTH ( a ) ) ; <nl> + gpr_slice a ; <nl> + int ok ; <nl> + <nl> + if ( ! bb ) return 0 ; <nl> + <nl> + a = merge_slices ( bb - > data . slice_buffer . slices , bb - > data . slice_buffer . count ) ; <nl> + ok = GPR_SLICE_LENGTH ( a ) = = GPR_SLICE_LENGTH ( b ) & & <nl> + 0 = = memcmp ( GPR_SLICE_START_PTR ( a ) , GPR_SLICE_START_PTR ( b ) , <nl> + GPR_SLICE_LENGTH ( a ) ) ; <nl> gpr_slice_unref ( a ) ; <nl> gpr_slice_unref ( b ) ; <nl> return ok ; <nl> mmm a / test / core / end2end / gen_build_json . py <nl> ppp b / test / core / end2end / gen_build_json . py <nl> <nl> ' request_response_with_payload_and_call_creds ' : TestOptions ( flaky = False , secure = True ) , <nl> ' request_with_large_metadata ' : default_test_options , <nl> ' request_with_payload ' : default_test_options , <nl> + ' server_finishes_request ' : default_test_options , <nl> ' simple_delayed_request ' : default_test_options , <nl> ' simple_request ' : default_test_options , <nl> ' simple_request_with_high_initial_sequence_number ' : default_test_options , <nl> mmm a / test / core / end2end / tests / invoke_large_request . c <nl> ppp b / test / core / end2end / tests / invoke_large_request . c <nl> static void test_invoke_large_request ( grpc_end2end_test_config config ) { <nl> op - > op = GRPC_OP_SEND_INITIAL_METADATA ; <nl> op - > data . send_initial_metadata . count = 0 ; <nl> op + + ; <nl> + op - > op = GRPC_OP_RECV_MESSAGE ; <nl> + op - > data . recv_message = & request_payload_recv ; <nl> + op + + ; <nl> + GPR_ASSERT ( GRPC_CALL_OK = = grpc_call_start_batch ( s , ops , op - ops , tag ( 102 ) ) ) ; <nl> + <nl> + cq_expect_completion ( v_server , tag ( 102 ) , 1 ) ; <nl> + cq_verify ( v_server ) ; <nl> + <nl> + op = ops ; <nl> + op - > op = GRPC_OP_RECV_CLOSE_ON_SERVER ; <nl> + op - > data . recv_close_on_server . cancelled = & was_cancelled ; <nl> + op + + ; <nl> op - > op = GRPC_OP_SEND_MESSAGE ; <nl> op - > data . send_message = response_payload ; <nl> op + + ; <nl> + op = ops ; <nl> op - > op = GRPC_OP_SEND_STATUS_FROM_SERVER ; <nl> op - > data . send_status_from_server . trailing_metadata_count = 0 ; <nl> op - > data . send_status_from_server . status = GRPC_STATUS_UNIMPLEMENTED ; <nl> op - > data . send_status_from_server . status_details = " xyz " ; <nl> op + + ; <nl> - op - > op = GRPC_OP_RECV_MESSAGE ; <nl> - op - > data . recv_message = & request_payload_recv ; <nl> - op + + ; <nl> - op - > op = GRPC_OP_RECV_CLOSE_ON_SERVER ; <nl> - op - > data . recv_close_on_server . cancelled = & was_cancelled ; <nl> - op + + ; <nl> - GPR_ASSERT ( GRPC_CALL_OK = = grpc_call_start_batch ( s , ops , op - ops , tag ( 102 ) ) ) ; <nl> + GPR_ASSERT ( GRPC_CALL_OK = = grpc_call_start_batch ( s , ops , op - ops , tag ( 103 ) ) ) ; <nl> <nl> - cq_expect_completion ( v_server , tag ( 102 ) , 1 ) ; <nl> + cq_expect_completion ( v_server , tag ( 103 ) , 1 ) ; <nl> cq_verify ( v_server ) ; <nl> <nl> cq_expect_completion ( v_client , tag ( 1 ) , 1 ) ; <nl> mmm a / test / core / end2end / tests / max_message_length . c <nl> ppp b / test / core / end2end / tests / max_message_length . c <nl> static void test_max_message_length ( grpc_end2end_test_config config ) { <nl> cq_expect_completion ( v_client , tag ( 1 ) , 1 ) ; <nl> cq_verify ( v_client ) ; <nl> <nl> - GPR_ASSERT ( status = = GRPC_STATUS_CANCELLED ) ; <nl> - GPR_ASSERT ( 0 = = strcmp ( details , " Cancelled " ) ) ; <nl> + GPR_ASSERT ( status ! = GRPC_STATUS_OK ) ; <nl> GPR_ASSERT ( 0 = = strcmp ( call_details . method , " / foo " ) ) ; <nl> GPR_ASSERT ( 0 = = strcmp ( call_details . host , " foo . test . google . fr : 1234 " ) ) ; <nl> GPR_ASSERT ( was_cancelled = = 1 ) ; <nl> mmm a / test / core / end2end / tests / request_response_with_binary_metadata_and_payload . c <nl> ppp b / test / core / end2end / tests / request_response_with_binary_metadata_and_payload . c <nl> static void test_request_response_with_metadata_and_payload ( <nl> op - > data . send_initial_metadata . count = 2 ; <nl> op - > data . send_initial_metadata . metadata = meta_s ; <nl> op + + ; <nl> + op - > op = GRPC_OP_RECV_MESSAGE ; <nl> + op - > data . recv_message = & request_payload_recv ; <nl> + op + + ; <nl> + GPR_ASSERT ( GRPC_CALL_OK = = grpc_call_start_batch ( s , ops , op - ops , tag ( 102 ) ) ) ; <nl> + <nl> + cq_expect_completion ( v_server , tag ( 102 ) , 1 ) ; <nl> + cq_verify ( v_server ) ; <nl> + <nl> + op = ops ; <nl> + op - > op = GRPC_OP_RECV_CLOSE_ON_SERVER ; <nl> + op - > data . recv_close_on_server . cancelled = & was_cancelled ; <nl> + op + + ; <nl> op - > op = GRPC_OP_SEND_MESSAGE ; <nl> op - > data . send_message = response_payload ; <nl> op + + ; <nl> static void test_request_response_with_metadata_and_payload ( <nl> op - > data . send_status_from_server . status = GRPC_STATUS_OK ; <nl> op - > data . send_status_from_server . status_details = " xyz " ; <nl> op + + ; <nl> - op - > op = GRPC_OP_RECV_MESSAGE ; <nl> - op - > data . recv_message = & request_payload_recv ; <nl> - op + + ; <nl> - op - > op = GRPC_OP_RECV_CLOSE_ON_SERVER ; <nl> - op - > data . recv_close_on_server . cancelled = & was_cancelled ; <nl> - op + + ; <nl> - GPR_ASSERT ( GRPC_CALL_OK = = grpc_call_start_batch ( s , ops , op - ops , tag ( 102 ) ) ) ; <nl> + GPR_ASSERT ( GRPC_CALL_OK = = grpc_call_start_batch ( s , ops , op - ops , tag ( 103 ) ) ) ; <nl> <nl> - cq_expect_completion ( v_server , tag ( 102 ) , 1 ) ; <nl> + cq_expect_completion ( v_server , tag ( 103 ) , 1 ) ; <nl> cq_verify ( v_server ) ; <nl> <nl> cq_expect_completion ( v_client , tag ( 1 ) , 1 ) ; <nl> mmm a / test / core / end2end / tests / request_response_with_metadata_and_payload . c <nl> ppp b / test / core / end2end / tests / request_response_with_metadata_and_payload . c <nl> static void test_request_response_with_metadata_and_payload ( <nl> op - > data . send_initial_metadata . count = 2 ; <nl> op - > data . send_initial_metadata . metadata = meta_s ; <nl> op + + ; <nl> + op - > op = GRPC_OP_RECV_MESSAGE ; <nl> + op - > data . recv_message = & request_payload_recv ; <nl> + op + + ; <nl> + GPR_ASSERT ( GRPC_CALL_OK = = grpc_call_start_batch ( s , ops , op - ops , tag ( 102 ) ) ) ; <nl> + <nl> + cq_expect_completion ( v_server , tag ( 102 ) , 1 ) ; <nl> + cq_verify ( v_server ) ; <nl> + <nl> + op = ops ; <nl> + op - > op = GRPC_OP_RECV_CLOSE_ON_SERVER ; <nl> + op - > data . recv_close_on_server . cancelled = & was_cancelled ; <nl> + op + + ; <nl> op - > op = GRPC_OP_SEND_MESSAGE ; <nl> op - > data . send_message = response_payload ; <nl> op + + ; <nl> static void test_request_response_with_metadata_and_payload ( <nl> op - > data . send_status_from_server . status = GRPC_STATUS_OK ; <nl> op - > data . send_status_from_server . status_details = " xyz " ; <nl> op + + ; <nl> - op - > op = GRPC_OP_RECV_MESSAGE ; <nl> - op - > data . recv_message = & request_payload_recv ; <nl> - op + + ; <nl> - op - > op = GRPC_OP_RECV_CLOSE_ON_SERVER ; <nl> - op - > data . recv_close_on_server . cancelled = & was_cancelled ; <nl> - op + + ; <nl> - GPR_ASSERT ( GRPC_CALL_OK = = grpc_call_start_batch ( s , ops , op - ops , tag ( 102 ) ) ) ; <nl> + GPR_ASSERT ( GRPC_CALL_OK = = grpc_call_start_batch ( s , ops , op - ops , tag ( 103 ) ) ) ; <nl> <nl> - cq_expect_completion ( v_server , tag ( 102 ) , 1 ) ; <nl> + cq_expect_completion ( v_server , tag ( 103 ) , 1 ) ; <nl> cq_verify ( v_server ) ; <nl> <nl> cq_expect_completion ( v_client , tag ( 1 ) , 1 ) ; <nl> mmm a / test / core / end2end / tests / request_response_with_payload . c <nl> ppp b / test / core / end2end / tests / request_response_with_payload . c <nl> static void request_response_with_payload ( grpc_end2end_test_fixture f ) { <nl> op - > op = GRPC_OP_SEND_INITIAL_METADATA ; <nl> op - > data . send_initial_metadata . count = 0 ; <nl> op + + ; <nl> + op - > op = GRPC_OP_RECV_MESSAGE ; <nl> + op - > data . recv_message = & request_payload_recv ; <nl> + op + + ; <nl> + GPR_ASSERT ( GRPC_CALL_OK = = grpc_call_start_batch ( s , ops , op - ops , tag ( 102 ) ) ) ; <nl> + <nl> + cq_expect_completion ( v_server , tag ( 102 ) , 1 ) ; <nl> + cq_verify ( v_server ) ; <nl> + <nl> + op = ops ; <nl> + op - > op = GRPC_OP_RECV_CLOSE_ON_SERVER ; <nl> + op - > data . recv_close_on_server . cancelled = & was_cancelled ; <nl> + op + + ; <nl> op - > op = GRPC_OP_SEND_MESSAGE ; <nl> op - > data . send_message = response_payload ; <nl> op + + ; <nl> static void request_response_with_payload ( grpc_end2end_test_fixture f ) { <nl> op - > data . send_status_from_server . status = GRPC_STATUS_OK ; <nl> op - > data . send_status_from_server . status_details = " xyz " ; <nl> op + + ; <nl> - op - > op = GRPC_OP_RECV_MESSAGE ; <nl> - op - > data . recv_message = & request_payload_recv ; <nl> - op + + ; <nl> - op - > op = GRPC_OP_RECV_CLOSE_ON_SERVER ; <nl> - op - > data . recv_close_on_server . cancelled = & was_cancelled ; <nl> - op + + ; <nl> - GPR_ASSERT ( GRPC_CALL_OK = = grpc_call_start_batch ( s , ops , op - ops , tag ( 102 ) ) ) ; <nl> + GPR_ASSERT ( GRPC_CALL_OK = = grpc_call_start_batch ( s , ops , op - ops , tag ( 103 ) ) ) ; <nl> <nl> - cq_expect_completion ( v_server , tag ( 102 ) , 1 ) ; <nl> + cq_expect_completion ( v_server , tag ( 103 ) , 1 ) ; <nl> cq_verify ( v_server ) ; <nl> <nl> cq_expect_completion ( v_client , tag ( 1 ) , 1 ) ; <nl> mmm a / test / core / end2end / tests / request_response_with_payload_and_call_creds . c <nl> ppp b / test / core / end2end / tests / request_response_with_payload_and_call_creds . c <nl> static void request_response_with_payload_and_call_creds ( <nl> op - > op = GRPC_OP_SEND_INITIAL_METADATA ; <nl> op - > data . send_initial_metadata . count = 0 ; <nl> op + + ; <nl> + op - > op = GRPC_OP_RECV_MESSAGE ; <nl> + op - > data . recv_message = & request_payload_recv ; <nl> + op + + ; <nl> + GPR_ASSERT ( GRPC_CALL_OK = = grpc_call_start_batch ( s , ops , op - ops , tag ( 102 ) ) ) ; <nl> + <nl> + cq_expect_completion ( v_server , tag ( 102 ) , 1 ) ; <nl> + cq_verify ( v_server ) ; <nl> + <nl> + op = ops ; <nl> + op - > op = GRPC_OP_RECV_CLOSE_ON_SERVER ; <nl> + op - > data . recv_close_on_server . cancelled = & was_cancelled ; <nl> + op + + ; <nl> op - > op = GRPC_OP_SEND_MESSAGE ; <nl> op - > data . send_message = response_payload ; <nl> op + + ; <nl> static void request_response_with_payload_and_call_creds ( <nl> op - > data . send_status_from_server . status = GRPC_STATUS_OK ; <nl> op - > data . send_status_from_server . status_details = " xyz " ; <nl> op + + ; <nl> - op - > op = GRPC_OP_RECV_MESSAGE ; <nl> - op - > data . recv_message = & request_payload_recv ; <nl> - op + + ; <nl> - op - > op = GRPC_OP_RECV_CLOSE_ON_SERVER ; <nl> - op - > data . recv_close_on_server . cancelled = & was_cancelled ; <nl> - op + + ; <nl> - GPR_ASSERT ( GRPC_CALL_OK = = grpc_call_start_batch ( s , ops , op - ops , tag ( 102 ) ) ) ; <nl> + GPR_ASSERT ( GRPC_CALL_OK = = grpc_call_start_batch ( s , ops , op - ops , tag ( 103 ) ) ) ; <nl> <nl> - cq_expect_completion ( v_server , tag ( 102 ) , 1 ) ; <nl> + cq_expect_completion ( v_server , tag ( 103 ) , 1 ) ; <nl> cq_verify ( v_server ) ; <nl> <nl> cq_expect_completion ( v_client , tag ( 1 ) , 1 ) ; <nl> mmm a / test / core / end2end / tests / request_response_with_trailing_metadata_and_payload . c <nl> ppp b / test / core / end2end / tests / request_response_with_trailing_metadata_and_payload . c <nl> static void test_request_response_with_metadata_and_payload ( <nl> op - > data . send_initial_metadata . count = 2 ; <nl> op - > data . send_initial_metadata . metadata = meta_s ; <nl> op + + ; <nl> + op - > op = GRPC_OP_RECV_MESSAGE ; <nl> + op - > data . recv_message = & request_payload_recv ; <nl> + op + + ; <nl> + GPR_ASSERT ( GRPC_CALL_OK = = grpc_call_start_batch ( s , ops , op - ops , tag ( 102 ) ) ) ; <nl> + <nl> + cq_expect_completion ( v_server , tag ( 102 ) , 1 ) ; <nl> + cq_verify ( v_server ) ; <nl> + <nl> + op = ops ; <nl> + op - > op = GRPC_OP_RECV_CLOSE_ON_SERVER ; <nl> + op - > data . recv_close_on_server . cancelled = & was_cancelled ; <nl> + op + + ; <nl> op - > op = GRPC_OP_SEND_MESSAGE ; <nl> op - > data . send_message = response_payload ; <nl> op + + ; <nl> static void test_request_response_with_metadata_and_payload ( <nl> op - > data . send_status_from_server . status = GRPC_STATUS_OK ; <nl> op - > data . send_status_from_server . status_details = " xyz " ; <nl> op + + ; <nl> - op - > op = GRPC_OP_RECV_MESSAGE ; <nl> - op - > data . recv_message = & request_payload_recv ; <nl> - op + + ; <nl> - op - > op = GRPC_OP_RECV_CLOSE_ON_SERVER ; <nl> - op - > data . recv_close_on_server . cancelled = & was_cancelled ; <nl> - op + + ; <nl> - GPR_ASSERT ( GRPC_CALL_OK = = grpc_call_start_batch ( s , ops , op - ops , tag ( 102 ) ) ) ; <nl> + GPR_ASSERT ( GRPC_CALL_OK = = grpc_call_start_batch ( s , ops , op - ops , tag ( 103 ) ) ) ; <nl> <nl> - cq_expect_completion ( v_server , tag ( 102 ) , 1 ) ; <nl> + cq_expect_completion ( v_server , tag ( 103 ) , 1 ) ; <nl> cq_verify ( v_server ) ; <nl> <nl> cq_expect_completion ( v_client , tag ( 1 ) , 1 ) ; <nl> mmm a / test / core / end2end / tests / request_with_large_metadata . c <nl> ppp b / test / core / end2end / tests / request_with_large_metadata . c <nl> static void test_request_with_large_metadata ( grpc_end2end_test_config config ) { <nl> op - > op = GRPC_OP_SEND_INITIAL_METADATA ; <nl> op - > data . send_initial_metadata . count = 0 ; <nl> op + + ; <nl> - op - > op = GRPC_OP_SEND_STATUS_FROM_SERVER ; <nl> - op - > data . send_status_from_server . trailing_metadata_count = 0 ; <nl> - op - > data . send_status_from_server . status = GRPC_STATUS_OK ; <nl> - op - > data . send_status_from_server . status_details = " xyz " ; <nl> - op + + ; <nl> op - > op = GRPC_OP_RECV_MESSAGE ; <nl> op - > data . recv_message = & request_payload_recv ; <nl> op + + ; <nl> + GPR_ASSERT ( GRPC_CALL_OK = = grpc_call_start_batch ( s , ops , op - ops , tag ( 102 ) ) ) ; <nl> + <nl> + cq_expect_completion ( v_server , tag ( 102 ) , 1 ) ; <nl> + cq_verify ( v_server ) ; <nl> + <nl> + op = ops ; <nl> op - > op = GRPC_OP_RECV_CLOSE_ON_SERVER ; <nl> op - > data . recv_close_on_server . cancelled = & was_cancelled ; <nl> op + + ; <nl> - GPR_ASSERT ( GRPC_CALL_OK = = grpc_call_start_batch ( s , ops , op - ops , tag ( 102 ) ) ) ; <nl> + op - > op = GRPC_OP_SEND_STATUS_FROM_SERVER ; <nl> + op - > data . send_status_from_server . trailing_metadata_count = 0 ; <nl> + op - > data . send_status_from_server . status = GRPC_STATUS_OK ; <nl> + op - > data . send_status_from_server . status_details = " xyz " ; <nl> + op + + ; <nl> + GPR_ASSERT ( GRPC_CALL_OK = = grpc_call_start_batch ( s , ops , op - ops , tag ( 103 ) ) ) ; <nl> <nl> - cq_expect_completion ( v_server , tag ( 102 ) , 1 ) ; <nl> + cq_expect_completion ( v_server , tag ( 103 ) , 1 ) ; <nl> cq_verify ( v_server ) ; <nl> <nl> cq_expect_completion ( v_client , tag ( 1 ) , 1 ) ; <nl> mmm a / test / core / end2end / tests / request_with_payload . c <nl> ppp b / test / core / end2end / tests / request_with_payload . c <nl> static void test_invoke_request_with_payload ( grpc_end2end_test_config config ) { <nl> op - > op = GRPC_OP_SEND_INITIAL_METADATA ; <nl> op - > data . send_initial_metadata . count = 0 ; <nl> op + + ; <nl> - op - > op = GRPC_OP_SEND_STATUS_FROM_SERVER ; <nl> - op - > data . send_status_from_server . trailing_metadata_count = 0 ; <nl> - op - > data . send_status_from_server . status = GRPC_STATUS_OK ; <nl> - op - > data . send_status_from_server . status_details = " xyz " ; <nl> - op + + ; <nl> op - > op = GRPC_OP_RECV_MESSAGE ; <nl> op - > data . recv_message = & request_payload_recv ; <nl> op + + ; <nl> + GPR_ASSERT ( GRPC_CALL_OK = = grpc_call_start_batch ( s , ops , op - ops , tag ( 102 ) ) ) ; <nl> + <nl> + cq_expect_completion ( v_server , tag ( 102 ) , 1 ) ; <nl> + cq_verify ( v_server ) ; <nl> + <nl> + op = ops ; <nl> op - > op = GRPC_OP_RECV_CLOSE_ON_SERVER ; <nl> op - > data . recv_close_on_server . cancelled = & was_cancelled ; <nl> op + + ; <nl> - GPR_ASSERT ( GRPC_CALL_OK = = grpc_call_start_batch ( s , ops , op - ops , tag ( 102 ) ) ) ; <nl> + op - > op = GRPC_OP_SEND_STATUS_FROM_SERVER ; <nl> + op - > data . send_status_from_server . trailing_metadata_count = 0 ; <nl> + op - > data . send_status_from_server . status = GRPC_STATUS_OK ; <nl> + op - > data . send_status_from_server . status_details = " xyz " ; <nl> + op + + ; <nl> + GPR_ASSERT ( GRPC_CALL_OK = = grpc_call_start_batch ( s , ops , op - ops , tag ( 103 ) ) ) ; <nl> <nl> - cq_expect_completion ( v_server , tag ( 102 ) , 1 ) ; <nl> + cq_expect_completion ( v_server , tag ( 103 ) , 1 ) ; <nl> cq_verify ( v_server ) ; <nl> <nl> cq_expect_completion ( v_client , tag ( 1 ) , 1 ) ; <nl> new file mode 100644 <nl> index 00000000000 . . c19871c581d <nl> mmm / dev / null <nl> ppp b / test / core / end2end / tests / server_finishes_request . c <nl> <nl> + / * <nl> + * <nl> + * Copyright 2015 , Google Inc . <nl> + * All rights reserved . <nl> + * <nl> + * Redistribution and use in source and binary forms , with or without <nl> + * modification , are permitted provided that the following conditions are <nl> + * met : <nl> + * <nl> + * * Redistributions of source code must retain the above copyright <nl> + * notice , this list of conditions and the following disclaimer . <nl> + * * Redistributions in binary form must reproduce the above <nl> + * copyright notice , this list of conditions and the following disclaimer <nl> + * in the documentation and / or other materials provided with the <nl> + * distribution . <nl> + * * Neither the name of Google Inc . nor the names of its <nl> + * contributors may be used to endorse or promote products derived from <nl> + * this software without specific prior written permission . <nl> + * <nl> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> + * " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> + * LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> + * A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> + * SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> + * LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> + * DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> + * THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> + * ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> + * OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> + * <nl> + * / <nl> + <nl> + # include " test / core / end2end / end2end_tests . h " <nl> + <nl> + # include < stdio . h > <nl> + # include < string . h > <nl> + <nl> + # include " src / core / support / string . h " <nl> + # include < grpc / byte_buffer . h > <nl> + # include < grpc / grpc . h > <nl> + # include < grpc / support / alloc . h > <nl> + # include < grpc / support / log . h > <nl> + # include < grpc / support / time . h > <nl> + # include < grpc / support / useful . h > <nl> + # include " test / core / end2end / cq_verifier . h " <nl> + <nl> + enum { TIMEOUT = 200000 } ; <nl> + <nl> + static void * tag ( gpr_intptr t ) { return ( void * ) t ; } <nl> + <nl> + static grpc_end2end_test_fixture begin_test ( grpc_end2end_test_config config , <nl> + const char * test_name , <nl> + grpc_channel_args * client_args , <nl> + grpc_channel_args * server_args ) { <nl> + grpc_end2end_test_fixture f ; <nl> + gpr_log ( GPR_INFO , " % s / % s " , test_name , config . name ) ; <nl> + f = config . create_fixture ( client_args , server_args ) ; <nl> + config . init_client ( & f , client_args ) ; <nl> + config . init_server ( & f , server_args ) ; <nl> + return f ; <nl> + } <nl> + <nl> + static gpr_timespec n_seconds_time ( int n ) { <nl> + return GRPC_TIMEOUT_SECONDS_TO_DEADLINE ( n ) ; <nl> + } <nl> + <nl> + static gpr_timespec five_seconds_time ( void ) { return n_seconds_time ( 5 ) ; } <nl> + <nl> + static void drain_cq ( grpc_completion_queue * cq ) { <nl> + grpc_event ev ; <nl> + do { <nl> + ev = grpc_completion_queue_next ( cq , five_seconds_time ( ) ) ; <nl> + } while ( ev . type ! = GRPC_QUEUE_SHUTDOWN ) ; <nl> + } <nl> + <nl> + static void shutdown_server ( grpc_end2end_test_fixture * f ) { <nl> + if ( ! f - > server ) return ; <nl> + grpc_server_shutdown ( f - > server ) ; <nl> + grpc_server_destroy ( f - > server ) ; <nl> + f - > server = NULL ; <nl> + } <nl> + <nl> + static void shutdown_client ( grpc_end2end_test_fixture * f ) { <nl> + if ( ! f - > client ) return ; <nl> + grpc_channel_destroy ( f - > client ) ; <nl> + f - > client = NULL ; <nl> + } <nl> + <nl> + static void end_test ( grpc_end2end_test_fixture * f ) { <nl> + shutdown_server ( f ) ; <nl> + shutdown_client ( f ) ; <nl> + <nl> + grpc_completion_queue_shutdown ( f - > server_cq ) ; <nl> + drain_cq ( f - > server_cq ) ; <nl> + grpc_completion_queue_destroy ( f - > server_cq ) ; <nl> + grpc_completion_queue_shutdown ( f - > client_cq ) ; <nl> + drain_cq ( f - > client_cq ) ; <nl> + grpc_completion_queue_destroy ( f - > client_cq ) ; <nl> + } <nl> + <nl> + static void simple_request_body ( grpc_end2end_test_fixture f ) { <nl> + grpc_call * c ; <nl> + grpc_call * s ; <nl> + gpr_timespec deadline = five_seconds_time ( ) ; <nl> + cq_verifier * v_client = cq_verifier_create ( f . client_cq ) ; <nl> + cq_verifier * v_server = cq_verifier_create ( f . server_cq ) ; <nl> + grpc_op ops [ 6 ] ; <nl> + grpc_op * op ; <nl> + grpc_metadata_array initial_metadata_recv ; <nl> + grpc_metadata_array trailing_metadata_recv ; <nl> + grpc_metadata_array request_metadata_recv ; <nl> + grpc_call_details call_details ; <nl> + grpc_status_code status ; <nl> + char * details = NULL ; <nl> + size_t details_capacity = 0 ; <nl> + int was_cancelled = 2 ; <nl> + <nl> + c = grpc_channel_create_call ( f . client , f . client_cq , " / foo " , <nl> + " foo . test . google . fr : 1234 " , deadline ) ; <nl> + GPR_ASSERT ( c ) ; <nl> + <nl> + grpc_metadata_array_init ( & initial_metadata_recv ) ; <nl> + grpc_metadata_array_init ( & trailing_metadata_recv ) ; <nl> + grpc_metadata_array_init ( & request_metadata_recv ) ; <nl> + grpc_call_details_init ( & call_details ) ; <nl> + <nl> + op = ops ; <nl> + op - > op = GRPC_OP_SEND_INITIAL_METADATA ; <nl> + op - > data . send_initial_metadata . count = 0 ; <nl> + op + + ; <nl> + op - > op = GRPC_OP_RECV_INITIAL_METADATA ; <nl> + op - > data . recv_initial_metadata = & initial_metadata_recv ; <nl> + op + + ; <nl> + op - > op = GRPC_OP_RECV_STATUS_ON_CLIENT ; <nl> + op - > data . recv_status_on_client . trailing_metadata = & trailing_metadata_recv ; <nl> + op - > data . recv_status_on_client . status = & status ; <nl> + op - > data . recv_status_on_client . status_details = & details ; <nl> + op - > data . recv_status_on_client . status_details_capacity = & details_capacity ; <nl> + op + + ; <nl> + GPR_ASSERT ( GRPC_CALL_OK = = grpc_call_start_batch ( c , ops , op - ops , tag ( 1 ) ) ) ; <nl> + <nl> + GPR_ASSERT ( GRPC_CALL_OK = = <nl> + grpc_server_request_call ( f . server , & s , & call_details , <nl> + & request_metadata_recv , f . server_cq , <nl> + f . server_cq , tag ( 101 ) ) ) ; <nl> + cq_expect_completion ( v_server , tag ( 101 ) , 1 ) ; <nl> + cq_verify ( v_server ) ; <nl> + <nl> + op = ops ; <nl> + op - > op = GRPC_OP_SEND_INITIAL_METADATA ; <nl> + op - > data . send_initial_metadata . count = 0 ; <nl> + op + + ; <nl> + op - > op = GRPC_OP_SEND_STATUS_FROM_SERVER ; <nl> + op - > data . send_status_from_server . trailing_metadata_count = 0 ; <nl> + op - > data . send_status_from_server . status = GRPC_STATUS_UNIMPLEMENTED ; <nl> + op - > data . send_status_from_server . status_details = " xyz " ; <nl> + op + + ; <nl> + op - > op = GRPC_OP_RECV_CLOSE_ON_SERVER ; <nl> + op - > data . recv_close_on_server . cancelled = & was_cancelled ; <nl> + op + + ; <nl> + GPR_ASSERT ( GRPC_CALL_OK = = grpc_call_start_batch ( s , ops , op - ops , tag ( 102 ) ) ) ; <nl> + <nl> + cq_expect_completion ( v_server , tag ( 102 ) , 1 ) ; <nl> + cq_verify ( v_server ) ; <nl> + <nl> + cq_expect_completion ( v_client , tag ( 1 ) , 1 ) ; <nl> + cq_verify ( v_client ) ; <nl> + <nl> + GPR_ASSERT ( status = = GRPC_STATUS_UNIMPLEMENTED ) ; <nl> + GPR_ASSERT ( 0 = = strcmp ( details , " xyz " ) ) ; <nl> + GPR_ASSERT ( 0 = = strcmp ( call_details . method , " / foo " ) ) ; <nl> + GPR_ASSERT ( 0 = = strcmp ( call_details . host , " foo . test . google . fr : 1234 " ) ) ; <nl> + GPR_ASSERT ( was_cancelled = = 0 ) ; <nl> + <nl> + gpr_free ( details ) ; <nl> + grpc_metadata_array_destroy ( & initial_metadata_recv ) ; <nl> + grpc_metadata_array_destroy ( & trailing_metadata_recv ) ; <nl> + grpc_metadata_array_destroy ( & request_metadata_recv ) ; <nl> + grpc_call_details_destroy ( & call_details ) ; <nl> + <nl> + grpc_call_destroy ( c ) ; <nl> + grpc_call_destroy ( s ) ; <nl> + <nl> + cq_verifier_destroy ( v_client ) ; <nl> + cq_verifier_destroy ( v_server ) ; <nl> + } <nl> + <nl> + static void test_invoke_simple_request ( grpc_end2end_test_config config ) { <nl> + grpc_end2end_test_fixture f ; <nl> + <nl> + f = begin_test ( config , __FUNCTION__ , NULL , NULL ) ; <nl> + simple_request_body ( f ) ; <nl> + end_test ( & f ) ; <nl> + config . tear_down_data ( & f ) ; <nl> + } <nl> + <nl> + void grpc_end2end_tests ( grpc_end2end_test_config config ) { <nl> + test_invoke_simple_request ( config ) ; <nl> + } <nl> mmm a / tools / run_tests / jobset . py <nl> ppp b / tools / run_tests / jobset . py <nl> def state ( self , update_cache ) : <nl> self . _state = _FAILURE <nl> self . _tempfile . seek ( 0 ) <nl> stdout = self . _tempfile . read ( ) <nl> - message ( ' FAILED ' , ' % s [ ret = % d ] ' % ( <nl> - self . _spec . shortname , self . _process . returncode ) , stdout , do_newline = True ) <nl> + message ( ' FAILED ' , ' % s [ ret = % d , pid = % d ] ' % ( <nl> + self . _spec . shortname , self . _process . returncode , self . _process . pid ) , <nl> + stdout , do_newline = True ) <nl> else : <nl> self . _state = _SUCCESS <nl> message ( ' PASSED ' , ' % s [ time = % . 1fsec ] ' % ( self . _spec . shortname , elapsed ) , <nl> mmm a / tools / run_tests / tests . json <nl> ppp b / tools / run_tests / tests . json <nl> <nl> " posix " <nl> ] <nl> } , <nl> + { <nl> + " flaky " : false , <nl> + " language " : " c " , <nl> + " name " : " chttp2_fake_security_server_finishes_request_test " , <nl> + " platforms " : [ <nl> + " windows " , <nl> + " posix " <nl> + ] <nl> + } , <nl> { <nl> " flaky " : false , <nl> " language " : " c " , <nl> <nl> " posix " <nl> ] <nl> } , <nl> + { <nl> + " flaky " : false , <nl> + " language " : " c " , <nl> + " name " : " chttp2_fullstack_server_finishes_request_test " , <nl> + " platforms " : [ <nl> + " windows " , <nl> + " posix " <nl> + ] <nl> + } , <nl> { <nl> " flaky " : false , <nl> " language " : " c " , <nl> <nl> " posix " <nl> ] <nl> } , <nl> + { <nl> + " flaky " : false , <nl> + " language " : " c " , <nl> + " name " : " chttp2_fullstack_uds_posix_server_finishes_request_test " , <nl> + " platforms " : [ <nl> + " posix " <nl> + ] <nl> + } , <nl> { <nl> " flaky " : false , <nl> " language " : " c " , <nl> <nl> " posix " <nl> ] <nl> } , <nl> + { <nl> + " flaky " : false , <nl> + " language " : " c " , <nl> + " name " : " chttp2_simple_ssl_fullstack_server_finishes_request_test " , <nl> + " platforms " : [ <nl> + " windows " , <nl> + " posix " <nl> + ] <nl> + } , <nl> { <nl> " flaky " : false , <nl> " language " : " c " , <nl> <nl> " posix " <nl> ] <nl> } , <nl> + { <nl> + " flaky " : false , <nl> + " language " : " c " , <nl> + " name " : " chttp2_simple_ssl_with_oauth2_fullstack_server_finishes_request_test " , <nl> + " platforms " : [ <nl> + " windows " , <nl> + " posix " <nl> + ] <nl> + } , <nl> { <nl> " flaky " : false , <nl> " language " : " c " , <nl> <nl> " posix " <nl> ] <nl> } , <nl> + { <nl> + " flaky " : false , <nl> + " language " : " c " , <nl> + " name " : " chttp2_socket_pair_server_finishes_request_test " , <nl> + " platforms " : [ <nl> + " windows " , <nl> + " posix " <nl> + ] <nl> + } , <nl> { <nl> " flaky " : false , <nl> " language " : " c " , <nl> <nl> " posix " <nl> ] <nl> } , <nl> + { <nl> + " flaky " : false , <nl> + " language " : " c " , <nl> + " name " : " chttp2_socket_pair_one_byte_at_a_time_server_finishes_request_test " , <nl> + " platforms " : [ <nl> + " windows " , <nl> + " posix " <nl> + ] <nl> + } , <nl> { <nl> " flaky " : false , <nl> " language " : " c " , <nl> <nl> " posix " <nl> ] <nl> } , <nl> + { <nl> + " flaky " : false , <nl> + " language " : " c " , <nl> + " name " : " chttp2_socket_pair_with_grpc_trace_server_finishes_request_test " , <nl> + " platforms " : [ <nl> + " windows " , <nl> + " posix " <nl> + ] <nl> + } , <nl> { <nl> " flaky " : false , <nl> " language " : " c " , <nl> <nl> " posix " <nl> ] <nl> } , <nl> + { <nl> + " flaky " : false , <nl> + " language " : " c " , <nl> + " name " : " chttp2_fullstack_server_finishes_request_unsecure_test " , <nl> + " platforms " : [ <nl> + " windows " , <nl> + " posix " <nl> + ] <nl> + } , <nl> { <nl> " flaky " : false , <nl> " language " : " c " , <nl> <nl> " posix " <nl> ] <nl> } , <nl> + { <nl> + " flaky " : false , <nl> + " language " : " c " , <nl> + " name " : " chttp2_fullstack_uds_posix_server_finishes_request_unsecure_test " , <nl> + " platforms " : [ <nl> + " posix " <nl> + ] <nl> + } , <nl> { <nl> " flaky " : false , <nl> " language " : " c " , <nl> <nl> " posix " <nl> ] <nl> } , <nl> + { <nl> + " flaky " : false , <nl> + " language " : " c " , <nl> + " name " : " chttp2_socket_pair_server_finishes_request_unsecure_test " , <nl> + " platforms " : [ <nl> + " windows " , <nl> + " posix " <nl> + ] <nl> + } , <nl> { <nl> " flaky " : false , <nl> " language " : " c " , <nl> <nl> " posix " <nl> ] <nl> } , <nl> + { <nl> + " flaky " : false , <nl> + " language " : " c " , <nl> + " name " : " chttp2_socket_pair_one_byte_at_a_time_server_finishes_request_unsecure_test " , <nl> + " platforms " : [ <nl> + " windows " , <nl> + " posix " <nl> + ] <nl> + } , <nl> { <nl> " flaky " : false , <nl> " language " : " c " , <nl> <nl> " posix " <nl> ] <nl> } , <nl> + { <nl> + " flaky " : false , <nl> + " language " : " c " , <nl> + " name " : " chttp2_socket_pair_with_grpc_trace_server_finishes_request_unsecure_test " , <nl> + " platforms " : [ <nl> + " windows " , <nl> + " posix " <nl> + ] <nl> + } , <nl> { <nl> " flaky " : false , <nl> " language " : " c " , <nl> mmm a / vsprojects / Grpc . mak <nl> ppp b / vsprojects / Grpc . mak <nl> all : buildtests <nl> $ ( OUT_DIR ) : <nl> mkdir $ ( OUT_DIR ) <nl> <nl> - build_libs : build_gpr build_gpr_test_util build_grpc build_grpc_test_util build_grpc_test_util_unsecure build_grpc_unsecure Debug \ end2end_fixture_chttp2_fake_security . lib Debug \ end2end_fixture_chttp2_fullstack . lib Debug \ end2end_fixture_chttp2_simple_ssl_fullstack . lib Debug \ end2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack . lib Debug \ end2end_fixture_chttp2_socket_pair . lib Debug \ end2end_fixture_chttp2_socket_pair_one_byte_at_a_time . lib Debug \ end2end_fixture_chttp2_socket_pair_with_grpc_trace . lib Debug \ end2end_test_bad_hostname . lib Debug \ end2end_test_cancel_after_accept . lib Debug \ end2end_test_cancel_after_accept_and_writes_closed . lib Debug \ end2end_test_cancel_after_invoke . lib Debug \ end2end_test_cancel_before_invoke . lib Debug \ end2end_test_cancel_in_a_vacuum . lib Debug \ end2end_test_census_simple_request . lib Debug \ end2end_test_disappearing_server . lib Debug \ end2end_test_early_server_shutdown_finishes_inflight_calls . lib Debug \ end2end_test_early_server_shutdown_finishes_tags . lib Debug \ end2end_test_empty_batch . lib Debug \ end2end_test_graceful_server_shutdown . lib Debug \ end2end_test_invoke_large_request . lib Debug \ end2end_test_max_concurrent_streams . lib Debug \ end2end_test_max_message_length . lib Debug \ end2end_test_no_op . lib Debug \ end2end_test_ping_pong_streaming . lib Debug \ end2end_test_registered_call . lib Debug \ end2end_test_request_response_with_binary_metadata_and_payload . lib Debug \ end2end_test_request_response_with_metadata_and_payload . lib Debug \ end2end_test_request_response_with_payload . lib Debug \ end2end_test_request_response_with_payload_and_call_creds . lib Debug \ end2end_test_request_response_with_trailing_metadata_and_payload . lib Debug \ end2end_test_request_with_large_metadata . lib Debug \ end2end_test_request_with_payload . lib Debug \ end2end_test_simple_delayed_request . lib Debug \ end2end_test_simple_request . lib Debug \ end2end_test_simple_request_with_high_initial_sequence_number . lib Debug \ end2end_certs . lib <nl> + build_libs : build_gpr build_gpr_test_util build_grpc build_grpc_test_util build_grpc_test_util_unsecure build_grpc_unsecure Debug \ end2end_fixture_chttp2_fake_security . lib Debug \ end2end_fixture_chttp2_fullstack . lib Debug \ end2end_fixture_chttp2_simple_ssl_fullstack . lib Debug \ end2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack . lib Debug \ end2end_fixture_chttp2_socket_pair . lib Debug \ end2end_fixture_chttp2_socket_pair_one_byte_at_a_time . lib Debug \ end2end_fixture_chttp2_socket_pair_with_grpc_trace . lib Debug \ end2end_test_bad_hostname . lib Debug \ end2end_test_cancel_after_accept . lib Debug \ end2end_test_cancel_after_accept_and_writes_closed . lib Debug \ end2end_test_cancel_after_invoke . lib Debug \ end2end_test_cancel_before_invoke . lib Debug \ end2end_test_cancel_in_a_vacuum . lib Debug \ end2end_test_census_simple_request . lib Debug \ end2end_test_disappearing_server . lib Debug \ end2end_test_early_server_shutdown_finishes_inflight_calls . lib Debug \ end2end_test_early_server_shutdown_finishes_tags . lib Debug \ end2end_test_empty_batch . lib Debug \ end2end_test_graceful_server_shutdown . lib Debug \ end2end_test_invoke_large_request . lib Debug \ end2end_test_max_concurrent_streams . lib Debug \ end2end_test_max_message_length . lib Debug \ end2end_test_no_op . lib Debug \ end2end_test_ping_pong_streaming . lib Debug \ end2end_test_registered_call . lib Debug \ end2end_test_request_response_with_binary_metadata_and_payload . lib Debug \ end2end_test_request_response_with_metadata_and_payload . lib Debug \ end2end_test_request_response_with_payload . lib Debug \ end2end_test_request_response_with_payload_and_call_creds . lib Debug \ end2end_test_request_response_with_trailing_metadata_and_payload . lib Debug \ end2end_test_request_with_large_metadata . lib Debug \ end2end_test_request_with_payload . lib Debug \ end2end_test_server_finishes_request . lib Debug \ end2end_test_simple_delayed_request . lib Debug \ end2end_test_simple_request . lib Debug \ end2end_test_simple_request_with_high_initial_sequence_number . lib Debug \ end2end_certs . lib <nl> buildtests : buildtests_c buildtests_cxx <nl> <nl> - buildtests_c : alarm_heap_test . exe alarm_list_test . exe alarm_test . exe alpn_test . exe bin_encoder_test . exe census_hash_table_test . exe census_statistics_multiple_writers_circular_buffer_test . exe census_statistics_multiple_writers_test . exe census_statistics_performance_test . exe census_statistics_quick_test . exe census_statistics_small_log_test . exe census_stub_test . exe census_window_stats_test . exe chttp2_status_conversion_test . exe chttp2_stream_encoder_test . exe chttp2_stream_map_test . exe fling_client . exe fling_server . exe gpr_cancellable_test . exe gpr_cmdline_test . exe gpr_env_test . exe gpr_file_test . exe gpr_histogram_test . exe gpr_host_port_test . exe gpr_log_test . exe gpr_slice_buffer_test . exe gpr_slice_test . exe gpr_string_test . exe gpr_sync_test . exe gpr_thd_test . exe gpr_time_test . exe gpr_tls_test . exe gpr_useful_test . exe grpc_base64_test . exe grpc_byte_buffer_reader_test . exe grpc_channel_stack_test . exe grpc_completion_queue_test . exe grpc_credentials_test . exe grpc_json_token_test . exe grpc_stream_op_test . exe hpack_parser_test . exe hpack_table_test . exe httpcli_format_request_test . exe httpcli_parser_test . exe httpcli_test . exe json_rewrite . exe json_rewrite_test . exe json_test . exe lame_client_test . exe message_compress_test . exe multi_init_test . exe murmur_hash_test . exe no_server_test . exe resolve_address_test . exe secure_endpoint_test . exe sockaddr_utils_test . exe time_averaged_stats_test . exe time_test . exe timeout_encoding_test . exe timers_test . exe transport_metadata_test . exe transport_security_test . exe chttp2_fake_security_bad_hostname_test . exe chttp2_fake_security_cancel_after_accept_test . exe chttp2_fake_security_cancel_after_accept_and_writes_closed_test . exe chttp2_fake_security_cancel_after_invoke_test . exe chttp2_fake_security_cancel_before_invoke_test . exe chttp2_fake_security_cancel_in_a_vacuum_test . exe chttp2_fake_security_census_simple_request_test . exe chttp2_fake_security_disappearing_server_test . exe chttp2_fake_security_early_server_shutdown_finishes_inflight_calls_test . exe chttp2_fake_security_early_server_shutdown_finishes_tags_test . exe chttp2_fake_security_empty_batch_test . exe chttp2_fake_security_graceful_server_shutdown_test . exe chttp2_fake_security_invoke_large_request_test . exe chttp2_fake_security_max_concurrent_streams_test . exe chttp2_fake_security_max_message_length_test . exe chttp2_fake_security_no_op_test . exe chttp2_fake_security_ping_pong_streaming_test . exe chttp2_fake_security_registered_call_test . exe chttp2_fake_security_request_response_with_binary_metadata_and_payload_test . exe chttp2_fake_security_request_response_with_metadata_and_payload_test . exe chttp2_fake_security_request_response_with_payload_test . exe chttp2_fake_security_request_response_with_payload_and_call_creds_test . exe chttp2_fake_security_request_response_with_trailing_metadata_and_payload_test . exe chttp2_fake_security_request_with_large_metadata_test . exe chttp2_fake_security_request_with_payload_test . exe chttp2_fake_security_simple_delayed_request_test . exe chttp2_fake_security_simple_request_test . exe chttp2_fake_security_simple_request_with_high_initial_sequence_number_test . exe chttp2_fullstack_bad_hostname_test . exe chttp2_fullstack_cancel_after_accept_test . exe chttp2_fullstack_cancel_after_accept_and_writes_closed_test . exe chttp2_fullstack_cancel_after_invoke_test . exe chttp2_fullstack_cancel_before_invoke_test . exe chttp2_fullstack_cancel_in_a_vacuum_test . exe chttp2_fullstack_census_simple_request_test . exe chttp2_fullstack_disappearing_server_test . exe chttp2_fullstack_early_server_shutdown_finishes_inflight_calls_test . exe chttp2_fullstack_early_server_shutdown_finishes_tags_test . exe chttp2_fullstack_empty_batch_test . exe chttp2_fullstack_graceful_server_shutdown_test . exe chttp2_fullstack_invoke_large_request_test . exe chttp2_fullstack_max_concurrent_streams_test . exe chttp2_fullstack_max_message_length_test . exe chttp2_fullstack_no_op_test . exe chttp2_fullstack_ping_pong_streaming_test . exe chttp2_fullstack_registered_call_test . exe chttp2_fullstack_request_response_with_binary_metadata_and_payload_test . exe chttp2_fullstack_request_response_with_metadata_and_payload_test . exe chttp2_fullstack_request_response_with_payload_test . exe chttp2_fullstack_request_response_with_payload_and_call_creds_test . exe chttp2_fullstack_request_response_with_trailing_metadata_and_payload_test . exe chttp2_fullstack_request_with_large_metadata_test . exe chttp2_fullstack_request_with_payload_test . exe chttp2_fullstack_simple_delayed_request_test . exe chttp2_fullstack_simple_request_test . exe chttp2_fullstack_simple_request_with_high_initial_sequence_number_test . exe chttp2_simple_ssl_fullstack_bad_hostname_test . exe chttp2_simple_ssl_fullstack_cancel_after_accept_test . exe chttp2_simple_ssl_fullstack_cancel_after_accept_and_writes_closed_test . exe chttp2_simple_ssl_fullstack_cancel_after_invoke_test . exe chttp2_simple_ssl_fullstack_cancel_before_invoke_test . exe chttp2_simple_ssl_fullstack_cancel_in_a_vacuum_test . exe chttp2_simple_ssl_fullstack_census_simple_request_test . exe chttp2_simple_ssl_fullstack_disappearing_server_test . exe chttp2_simple_ssl_fullstack_early_server_shutdown_finishes_inflight_calls_test . exe chttp2_simple_ssl_fullstack_early_server_shutdown_finishes_tags_test . exe chttp2_simple_ssl_fullstack_empty_batch_test . exe chttp2_simple_ssl_fullstack_graceful_server_shutdown_test . exe chttp2_simple_ssl_fullstack_invoke_large_request_test . exe chttp2_simple_ssl_fullstack_max_concurrent_streams_test . exe chttp2_simple_ssl_fullstack_max_message_length_test . exe chttp2_simple_ssl_fullstack_no_op_test . exe chttp2_simple_ssl_fullstack_ping_pong_streaming_test . exe chttp2_simple_ssl_fullstack_registered_call_test . exe chttp2_simple_ssl_fullstack_request_response_with_binary_metadata_and_payload_test . exe chttp2_simple_ssl_fullstack_request_response_with_metadata_and_payload_test . exe chttp2_simple_ssl_fullstack_request_response_with_payload_test . exe chttp2_simple_ssl_fullstack_request_response_with_payload_and_call_creds_test . exe chttp2_simple_ssl_fullstack_request_response_with_trailing_metadata_and_payload_test . exe chttp2_simple_ssl_fullstack_request_with_large_metadata_test . exe chttp2_simple_ssl_fullstack_request_with_payload_test . exe chttp2_simple_ssl_fullstack_simple_delayed_request_test . exe chttp2_simple_ssl_fullstack_simple_request_test . exe chttp2_simple_ssl_fullstack_simple_request_with_high_initial_sequence_number_test . exe chttp2_simple_ssl_with_oauth2_fullstack_bad_hostname_test . exe chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_test . exe chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_and_writes_closed_test . exe chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_invoke_test . exe chttp2_simple_ssl_with_oauth2_fullstack_cancel_before_invoke_test . exe chttp2_simple_ssl_with_oauth2_fullstack_cancel_in_a_vacuum_test . exe chttp2_simple_ssl_with_oauth2_fullstack_census_simple_request_test . exe chttp2_simple_ssl_with_oauth2_fullstack_disappearing_server_test . exe chttp2_simple_ssl_with_oauth2_fullstack_early_server_shutdown_finishes_inflight_calls_test . exe chttp2_simple_ssl_with_oauth2_fullstack_early_server_shutdown_finishes_tags_test . exe chttp2_simple_ssl_with_oauth2_fullstack_empty_batch_test . exe chttp2_simple_ssl_with_oauth2_fullstack_graceful_server_shutdown_test . exe chttp2_simple_ssl_with_oauth2_fullstack_invoke_large_request_test . exe chttp2_simple_ssl_with_oauth2_fullstack_max_concurrent_streams_test . exe chttp2_simple_ssl_with_oauth2_fullstack_max_message_length_test . exe chttp2_simple_ssl_with_oauth2_fullstack_no_op_test . exe chttp2_simple_ssl_with_oauth2_fullstack_ping_pong_streaming_test . exe chttp2_simple_ssl_with_oauth2_fullstack_registered_call_test . exe chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_binary_metadata_and_payload_test . exe chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_metadata_and_payload_test . exe chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_payload_test . exe chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_payload_and_call_creds_test . exe chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_trailing_metadata_and_payload_test . exe chttp2_simple_ssl_with_oauth2_fullstack_request_with_large_metadata_test . exe chttp2_simple_ssl_with_oauth2_fullstack_request_with_payload_test . exe chttp2_simple_ssl_with_oauth2_fullstack_simple_delayed_request_test . exe chttp2_simple_ssl_with_oauth2_fullstack_simple_request_test . exe chttp2_simple_ssl_with_oauth2_fullstack_simple_request_with_high_initial_sequence_number_test . exe chttp2_socket_pair_bad_hostname_test . exe chttp2_socket_pair_cancel_after_accept_test . exe chttp2_socket_pair_cancel_after_accept_and_writes_closed_test . exe chttp2_socket_pair_cancel_after_invoke_test . exe chttp2_socket_pair_cancel_before_invoke_test . exe chttp2_socket_pair_cancel_in_a_vacuum_test . exe chttp2_socket_pair_census_simple_request_test . exe chttp2_socket_pair_disappearing_server_test . exe chttp2_socket_pair_early_server_shutdown_finishes_inflight_calls_test . exe chttp2_socket_pair_early_server_shutdown_finishes_tags_test . exe chttp2_socket_pair_empty_batch_test . exe chttp2_socket_pair_graceful_server_shutdown_test . exe chttp2_socket_pair_invoke_large_request_test . exe chttp2_socket_pair_max_concurrent_streams_test . exe chttp2_socket_pair_max_message_length_test . exe chttp2_socket_pair_no_op_test . exe chttp2_socket_pair_ping_pong_streaming_test . exe chttp2_socket_pair_registered_call_test . exe chttp2_socket_pair_request_response_with_binary_metadata_and_payload_test . exe chttp2_socket_pair_request_response_with_metadata_and_payload_test . exe chttp2_socket_pair_request_response_with_payload_test . exe chttp2_socket_pair_request_response_with_payload_and_call_creds_test . exe chttp2_socket_pair_request_response_with_trailing_metadata_and_payload_test . exe chttp2_socket_pair_request_with_large_metadata_test . exe chttp2_socket_pair_request_with_payload_test . exe chttp2_socket_pair_simple_delayed_request_test . exe chttp2_socket_pair_simple_request_test . exe chttp2_socket_pair_simple_request_with_high_initial_sequence_number_test . exe chttp2_socket_pair_one_byte_at_a_time_bad_hostname_test . exe chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_test . exe chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_and_writes_closed_test . exe chttp2_socket_pair_one_byte_at_a_time_cancel_after_invoke_test . exe chttp2_socket_pair_one_byte_at_a_time_cancel_before_invoke_test . exe chttp2_socket_pair_one_byte_at_a_time_cancel_in_a_vacuum_test . exe chttp2_socket_pair_one_byte_at_a_time_census_simple_request_test . exe chttp2_socket_pair_one_byte_at_a_time_disappearing_server_test . exe chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_inflight_calls_test . exe chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_tags_test . exe chttp2_socket_pair_one_byte_at_a_time_empty_batch_test . exe chttp2_socket_pair_one_byte_at_a_time_graceful_server_shutdown_test . exe chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_test . exe chttp2_socket_pair_one_byte_at_a_time_max_concurrent_streams_test . exe chttp2_socket_pair_one_byte_at_a_time_max_message_length_test . exe chttp2_socket_pair_one_byte_at_a_time_no_op_test . exe chttp2_socket_pair_one_byte_at_a_time_ping_pong_streaming_test . exe chttp2_socket_pair_one_byte_at_a_time_registered_call_test . exe chttp2_socket_pair_one_byte_at_a_time_request_response_with_binary_metadata_and_payload_test . exe chttp2_socket_pair_one_byte_at_a_time_request_response_with_metadata_and_payload_test . exe chttp2_socket_pair_one_byte_at_a_time_request_response_with_payload_test . exe chttp2_socket_pair_one_byte_at_a_time_request_response_with_payload_and_call_creds_test . exe chttp2_socket_pair_one_byte_at_a_time_request_response_with_trailing_metadata_and_payload_test . exe chttp2_socket_pair_one_byte_at_a_time_request_with_large_metadata_test . exe chttp2_socket_pair_one_byte_at_a_time_request_with_payload_test . exe chttp2_socket_pair_one_byte_at_a_time_simple_delayed_request_test . exe chttp2_socket_pair_one_byte_at_a_time_simple_request_test . exe chttp2_socket_pair_one_byte_at_a_time_simple_request_with_high_initial_sequence_number_test . exe chttp2_socket_pair_with_grpc_trace_bad_hostname_test . exe chttp2_socket_pair_with_grpc_trace_cancel_after_accept_test . exe chttp2_socket_pair_with_grpc_trace_cancel_after_accept_and_writes_closed_test . exe chttp2_socket_pair_with_grpc_trace_cancel_after_invoke_test . exe chttp2_socket_pair_with_grpc_trace_cancel_before_invoke_test . exe chttp2_socket_pair_with_grpc_trace_cancel_in_a_vacuum_test . exe chttp2_socket_pair_with_grpc_trace_census_simple_request_test . exe chttp2_socket_pair_with_grpc_trace_disappearing_server_test . exe chttp2_socket_pair_with_grpc_trace_early_server_shutdown_finishes_inflight_calls_test . exe chttp2_socket_pair_with_grpc_trace_early_server_shutdown_finishes_tags_test . exe chttp2_socket_pair_with_grpc_trace_empty_batch_test . exe chttp2_socket_pair_with_grpc_trace_graceful_server_shutdown_test . exe chttp2_socket_pair_with_grpc_trace_invoke_large_request_test . exe chttp2_socket_pair_with_grpc_trace_max_concurrent_streams_test . exe chttp2_socket_pair_with_grpc_trace_max_message_length_test . exe chttp2_socket_pair_with_grpc_trace_no_op_test . exe chttp2_socket_pair_with_grpc_trace_ping_pong_streaming_test . exe chttp2_socket_pair_with_grpc_trace_registered_call_test . exe chttp2_socket_pair_with_grpc_trace_request_response_with_binary_metadata_and_payload_test . exe chttp2_socket_pair_with_grpc_trace_request_response_with_metadata_and_payload_test . exe chttp2_socket_pair_with_grpc_trace_request_response_with_payload_test . exe chttp2_socket_pair_with_grpc_trace_request_response_with_payload_and_call_creds_test . exe chttp2_socket_pair_with_grpc_trace_request_response_with_trailing_metadata_and_payload_test . exe chttp2_socket_pair_with_grpc_trace_request_with_large_metadata_test . exe chttp2_socket_pair_with_grpc_trace_request_with_payload_test . exe chttp2_socket_pair_with_grpc_trace_simple_delayed_request_test . exe chttp2_socket_pair_with_grpc_trace_simple_request_test . exe chttp2_socket_pair_with_grpc_trace_simple_request_with_high_initial_sequence_number_test . exe chttp2_fullstack_bad_hostname_unsecure_test . exe chttp2_fullstack_cancel_after_accept_unsecure_test . exe chttp2_fullstack_cancel_after_accept_and_writes_closed_unsecure_test . exe chttp2_fullstack_cancel_after_invoke_unsecure_test . exe chttp2_fullstack_cancel_before_invoke_unsecure_test . exe chttp2_fullstack_cancel_in_a_vacuum_unsecure_test . exe chttp2_fullstack_census_simple_request_unsecure_test . exe chttp2_fullstack_disappearing_server_unsecure_test . exe chttp2_fullstack_early_server_shutdown_finishes_inflight_calls_unsecure_test . exe chttp2_fullstack_early_server_shutdown_finishes_tags_unsecure_test . exe chttp2_fullstack_empty_batch_unsecure_test . exe chttp2_fullstack_graceful_server_shutdown_unsecure_test . exe chttp2_fullstack_invoke_large_request_unsecure_test . exe chttp2_fullstack_max_concurrent_streams_unsecure_test . exe chttp2_fullstack_max_message_length_unsecure_test . exe chttp2_fullstack_no_op_unsecure_test . exe chttp2_fullstack_ping_pong_streaming_unsecure_test . exe chttp2_fullstack_registered_call_unsecure_test . exe chttp2_fullstack_request_response_with_binary_metadata_and_payload_unsecure_test . exe chttp2_fullstack_request_response_with_metadata_and_payload_unsecure_test . exe chttp2_fullstack_request_response_with_payload_unsecure_test . exe chttp2_fullstack_request_response_with_trailing_metadata_and_payload_unsecure_test . exe chttp2_fullstack_request_with_large_metadata_unsecure_test . exe chttp2_fullstack_request_with_payload_unsecure_test . exe chttp2_fullstack_simple_delayed_request_unsecure_test . exe chttp2_fullstack_simple_request_unsecure_test . exe chttp2_fullstack_simple_request_with_high_initial_sequence_number_unsecure_test . exe chttp2_socket_pair_bad_hostname_unsecure_test . exe chttp2_socket_pair_cancel_after_accept_unsecure_test . exe chttp2_socket_pair_cancel_after_accept_and_writes_closed_unsecure_test . exe chttp2_socket_pair_cancel_after_invoke_unsecure_test . exe chttp2_socket_pair_cancel_before_invoke_unsecure_test . exe chttp2_socket_pair_cancel_in_a_vacuum_unsecure_test . exe chttp2_socket_pair_census_simple_request_unsecure_test . exe chttp2_socket_pair_disappearing_server_unsecure_test . exe chttp2_socket_pair_early_server_shutdown_finishes_inflight_calls_unsecure_test . exe chttp2_socket_pair_early_server_shutdown_finishes_tags_unsecure_test . exe chttp2_socket_pair_empty_batch_unsecure_test . exe chttp2_socket_pair_graceful_server_shutdown_unsecure_test . exe chttp2_socket_pair_invoke_large_request_unsecure_test . exe chttp2_socket_pair_max_concurrent_streams_unsecure_test . exe chttp2_socket_pair_max_message_length_unsecure_test . exe chttp2_socket_pair_no_op_unsecure_test . exe chttp2_socket_pair_ping_pong_streaming_unsecure_test . exe chttp2_socket_pair_registered_call_unsecure_test . exe chttp2_socket_pair_request_response_with_binary_metadata_and_payload_unsecure_test . exe chttp2_socket_pair_request_response_with_metadata_and_payload_unsecure_test . exe chttp2_socket_pair_request_response_with_payload_unsecure_test . exe chttp2_socket_pair_request_response_with_trailing_metadata_and_payload_unsecure_test . exe chttp2_socket_pair_request_with_large_metadata_unsecure_test . exe chttp2_socket_pair_request_with_payload_unsecure_test . exe chttp2_socket_pair_simple_delayed_request_unsecure_test . exe chttp2_socket_pair_simple_request_unsecure_test . exe chttp2_socket_pair_simple_request_with_high_initial_sequence_number_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_bad_hostname_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_and_writes_closed_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_cancel_after_invoke_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_cancel_before_invoke_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_cancel_in_a_vacuum_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_census_simple_request_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_disappearing_server_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_inflight_calls_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_tags_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_empty_batch_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_graceful_server_shutdown_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_max_concurrent_streams_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_max_message_length_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_no_op_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_ping_pong_streaming_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_registered_call_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_request_response_with_binary_metadata_and_payload_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_request_response_with_metadata_and_payload_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_request_response_with_payload_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_request_response_with_trailing_metadata_and_payload_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_request_with_large_metadata_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_request_with_payload_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_simple_delayed_request_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_simple_request_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_simple_request_with_high_initial_sequence_number_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_bad_hostname_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_cancel_after_accept_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_cancel_after_accept_and_writes_closed_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_cancel_after_invoke_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_cancel_before_invoke_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_cancel_in_a_vacuum_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_census_simple_request_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_disappearing_server_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_early_server_shutdown_finishes_inflight_calls_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_early_server_shutdown_finishes_tags_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_empty_batch_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_graceful_server_shutdown_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_invoke_large_request_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_max_concurrent_streams_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_max_message_length_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_no_op_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_ping_pong_streaming_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_registered_call_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_request_response_with_binary_metadata_and_payload_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_request_response_with_metadata_and_payload_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_request_response_with_payload_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_request_response_with_trailing_metadata_and_payload_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_request_with_large_metadata_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_request_with_payload_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_simple_delayed_request_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_simple_request_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_simple_request_with_high_initial_sequence_number_unsecure_test . exe <nl> + buildtests_c : alarm_heap_test . exe alarm_list_test . exe alarm_test . exe alpn_test . exe bin_encoder_test . exe census_hash_table_test . exe census_statistics_multiple_writers_circular_buffer_test . exe census_statistics_multiple_writers_test . exe census_statistics_performance_test . exe census_statistics_quick_test . exe census_statistics_small_log_test . exe census_stub_test . exe census_window_stats_test . exe chttp2_status_conversion_test . exe chttp2_stream_encoder_test . exe chttp2_stream_map_test . exe fling_client . exe fling_server . exe gpr_cancellable_test . exe gpr_cmdline_test . exe gpr_env_test . exe gpr_file_test . exe gpr_histogram_test . exe gpr_host_port_test . exe gpr_log_test . exe gpr_slice_buffer_test . exe gpr_slice_test . exe gpr_string_test . exe gpr_sync_test . exe gpr_thd_test . exe gpr_time_test . exe gpr_tls_test . exe gpr_useful_test . exe grpc_base64_test . exe grpc_byte_buffer_reader_test . exe grpc_channel_stack_test . exe grpc_completion_queue_test . exe grpc_credentials_test . exe grpc_json_token_test . exe grpc_stream_op_test . exe hpack_parser_test . exe hpack_table_test . exe httpcli_format_request_test . exe httpcli_parser_test . exe httpcli_test . exe json_rewrite . exe json_rewrite_test . exe json_test . exe lame_client_test . exe message_compress_test . exe multi_init_test . exe murmur_hash_test . exe no_server_test . exe resolve_address_test . exe secure_endpoint_test . exe sockaddr_utils_test . exe time_averaged_stats_test . exe time_test . exe timeout_encoding_test . exe timers_test . exe transport_metadata_test . exe transport_security_test . exe chttp2_fake_security_bad_hostname_test . exe chttp2_fake_security_cancel_after_accept_test . exe chttp2_fake_security_cancel_after_accept_and_writes_closed_test . exe chttp2_fake_security_cancel_after_invoke_test . exe chttp2_fake_security_cancel_before_invoke_test . exe chttp2_fake_security_cancel_in_a_vacuum_test . exe chttp2_fake_security_census_simple_request_test . exe chttp2_fake_security_disappearing_server_test . exe chttp2_fake_security_early_server_shutdown_finishes_inflight_calls_test . exe chttp2_fake_security_early_server_shutdown_finishes_tags_test . exe chttp2_fake_security_empty_batch_test . exe chttp2_fake_security_graceful_server_shutdown_test . exe chttp2_fake_security_invoke_large_request_test . exe chttp2_fake_security_max_concurrent_streams_test . exe chttp2_fake_security_max_message_length_test . exe chttp2_fake_security_no_op_test . exe chttp2_fake_security_ping_pong_streaming_test . exe chttp2_fake_security_registered_call_test . exe chttp2_fake_security_request_response_with_binary_metadata_and_payload_test . exe chttp2_fake_security_request_response_with_metadata_and_payload_test . exe chttp2_fake_security_request_response_with_payload_test . exe chttp2_fake_security_request_response_with_payload_and_call_creds_test . exe chttp2_fake_security_request_response_with_trailing_metadata_and_payload_test . exe chttp2_fake_security_request_with_large_metadata_test . exe chttp2_fake_security_request_with_payload_test . exe chttp2_fake_security_server_finishes_request_test . exe chttp2_fake_security_simple_delayed_request_test . exe chttp2_fake_security_simple_request_test . exe chttp2_fake_security_simple_request_with_high_initial_sequence_number_test . exe chttp2_fullstack_bad_hostname_test . exe chttp2_fullstack_cancel_after_accept_test . exe chttp2_fullstack_cancel_after_accept_and_writes_closed_test . exe chttp2_fullstack_cancel_after_invoke_test . exe chttp2_fullstack_cancel_before_invoke_test . exe chttp2_fullstack_cancel_in_a_vacuum_test . exe chttp2_fullstack_census_simple_request_test . exe chttp2_fullstack_disappearing_server_test . exe chttp2_fullstack_early_server_shutdown_finishes_inflight_calls_test . exe chttp2_fullstack_early_server_shutdown_finishes_tags_test . exe chttp2_fullstack_empty_batch_test . exe chttp2_fullstack_graceful_server_shutdown_test . exe chttp2_fullstack_invoke_large_request_test . exe chttp2_fullstack_max_concurrent_streams_test . exe chttp2_fullstack_max_message_length_test . exe chttp2_fullstack_no_op_test . exe chttp2_fullstack_ping_pong_streaming_test . exe chttp2_fullstack_registered_call_test . exe chttp2_fullstack_request_response_with_binary_metadata_and_payload_test . exe chttp2_fullstack_request_response_with_metadata_and_payload_test . exe chttp2_fullstack_request_response_with_payload_test . exe chttp2_fullstack_request_response_with_payload_and_call_creds_test . exe chttp2_fullstack_request_response_with_trailing_metadata_and_payload_test . exe chttp2_fullstack_request_with_large_metadata_test . exe chttp2_fullstack_request_with_payload_test . exe chttp2_fullstack_server_finishes_request_test . exe chttp2_fullstack_simple_delayed_request_test . exe chttp2_fullstack_simple_request_test . exe chttp2_fullstack_simple_request_with_high_initial_sequence_number_test . exe chttp2_simple_ssl_fullstack_bad_hostname_test . exe chttp2_simple_ssl_fullstack_cancel_after_accept_test . exe chttp2_simple_ssl_fullstack_cancel_after_accept_and_writes_closed_test . exe chttp2_simple_ssl_fullstack_cancel_after_invoke_test . exe chttp2_simple_ssl_fullstack_cancel_before_invoke_test . exe chttp2_simple_ssl_fullstack_cancel_in_a_vacuum_test . exe chttp2_simple_ssl_fullstack_census_simple_request_test . exe chttp2_simple_ssl_fullstack_disappearing_server_test . exe chttp2_simple_ssl_fullstack_early_server_shutdown_finishes_inflight_calls_test . exe chttp2_simple_ssl_fullstack_early_server_shutdown_finishes_tags_test . exe chttp2_simple_ssl_fullstack_empty_batch_test . exe chttp2_simple_ssl_fullstack_graceful_server_shutdown_test . exe chttp2_simple_ssl_fullstack_invoke_large_request_test . exe chttp2_simple_ssl_fullstack_max_concurrent_streams_test . exe chttp2_simple_ssl_fullstack_max_message_length_test . exe chttp2_simple_ssl_fullstack_no_op_test . exe chttp2_simple_ssl_fullstack_ping_pong_streaming_test . exe chttp2_simple_ssl_fullstack_registered_call_test . exe chttp2_simple_ssl_fullstack_request_response_with_binary_metadata_and_payload_test . exe chttp2_simple_ssl_fullstack_request_response_with_metadata_and_payload_test . exe chttp2_simple_ssl_fullstack_request_response_with_payload_test . exe chttp2_simple_ssl_fullstack_request_response_with_payload_and_call_creds_test . exe chttp2_simple_ssl_fullstack_request_response_with_trailing_metadata_and_payload_test . exe chttp2_simple_ssl_fullstack_request_with_large_metadata_test . exe chttp2_simple_ssl_fullstack_request_with_payload_test . exe chttp2_simple_ssl_fullstack_server_finishes_request_test . exe chttp2_simple_ssl_fullstack_simple_delayed_request_test . exe chttp2_simple_ssl_fullstack_simple_request_test . exe chttp2_simple_ssl_fullstack_simple_request_with_high_initial_sequence_number_test . exe chttp2_simple_ssl_with_oauth2_fullstack_bad_hostname_test . exe chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_test . exe chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_accept_and_writes_closed_test . exe chttp2_simple_ssl_with_oauth2_fullstack_cancel_after_invoke_test . exe chttp2_simple_ssl_with_oauth2_fullstack_cancel_before_invoke_test . exe chttp2_simple_ssl_with_oauth2_fullstack_cancel_in_a_vacuum_test . exe chttp2_simple_ssl_with_oauth2_fullstack_census_simple_request_test . exe chttp2_simple_ssl_with_oauth2_fullstack_disappearing_server_test . exe chttp2_simple_ssl_with_oauth2_fullstack_early_server_shutdown_finishes_inflight_calls_test . exe chttp2_simple_ssl_with_oauth2_fullstack_early_server_shutdown_finishes_tags_test . exe chttp2_simple_ssl_with_oauth2_fullstack_empty_batch_test . exe chttp2_simple_ssl_with_oauth2_fullstack_graceful_server_shutdown_test . exe chttp2_simple_ssl_with_oauth2_fullstack_invoke_large_request_test . exe chttp2_simple_ssl_with_oauth2_fullstack_max_concurrent_streams_test . exe chttp2_simple_ssl_with_oauth2_fullstack_max_message_length_test . exe chttp2_simple_ssl_with_oauth2_fullstack_no_op_test . exe chttp2_simple_ssl_with_oauth2_fullstack_ping_pong_streaming_test . exe chttp2_simple_ssl_with_oauth2_fullstack_registered_call_test . exe chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_binary_metadata_and_payload_test . exe chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_metadata_and_payload_test . exe chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_payload_test . exe chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_payload_and_call_creds_test . exe chttp2_simple_ssl_with_oauth2_fullstack_request_response_with_trailing_metadata_and_payload_test . exe chttp2_simple_ssl_with_oauth2_fullstack_request_with_large_metadata_test . exe chttp2_simple_ssl_with_oauth2_fullstack_request_with_payload_test . exe chttp2_simple_ssl_with_oauth2_fullstack_server_finishes_request_test . exe chttp2_simple_ssl_with_oauth2_fullstack_simple_delayed_request_test . exe chttp2_simple_ssl_with_oauth2_fullstack_simple_request_test . exe chttp2_simple_ssl_with_oauth2_fullstack_simple_request_with_high_initial_sequence_number_test . exe chttp2_socket_pair_bad_hostname_test . exe chttp2_socket_pair_cancel_after_accept_test . exe chttp2_socket_pair_cancel_after_accept_and_writes_closed_test . exe chttp2_socket_pair_cancel_after_invoke_test . exe chttp2_socket_pair_cancel_before_invoke_test . exe chttp2_socket_pair_cancel_in_a_vacuum_test . exe chttp2_socket_pair_census_simple_request_test . exe chttp2_socket_pair_disappearing_server_test . exe chttp2_socket_pair_early_server_shutdown_finishes_inflight_calls_test . exe chttp2_socket_pair_early_server_shutdown_finishes_tags_test . exe chttp2_socket_pair_empty_batch_test . exe chttp2_socket_pair_graceful_server_shutdown_test . exe chttp2_socket_pair_invoke_large_request_test . exe chttp2_socket_pair_max_concurrent_streams_test . exe chttp2_socket_pair_max_message_length_test . exe chttp2_socket_pair_no_op_test . exe chttp2_socket_pair_ping_pong_streaming_test . exe chttp2_socket_pair_registered_call_test . exe chttp2_socket_pair_request_response_with_binary_metadata_and_payload_test . exe chttp2_socket_pair_request_response_with_metadata_and_payload_test . exe chttp2_socket_pair_request_response_with_payload_test . exe chttp2_socket_pair_request_response_with_payload_and_call_creds_test . exe chttp2_socket_pair_request_response_with_trailing_metadata_and_payload_test . exe chttp2_socket_pair_request_with_large_metadata_test . exe chttp2_socket_pair_request_with_payload_test . exe chttp2_socket_pair_server_finishes_request_test . exe chttp2_socket_pair_simple_delayed_request_test . exe chttp2_socket_pair_simple_request_test . exe chttp2_socket_pair_simple_request_with_high_initial_sequence_number_test . exe chttp2_socket_pair_one_byte_at_a_time_bad_hostname_test . exe chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_test . exe chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_and_writes_closed_test . exe chttp2_socket_pair_one_byte_at_a_time_cancel_after_invoke_test . exe chttp2_socket_pair_one_byte_at_a_time_cancel_before_invoke_test . exe chttp2_socket_pair_one_byte_at_a_time_cancel_in_a_vacuum_test . exe chttp2_socket_pair_one_byte_at_a_time_census_simple_request_test . exe chttp2_socket_pair_one_byte_at_a_time_disappearing_server_test . exe chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_inflight_calls_test . exe chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_tags_test . exe chttp2_socket_pair_one_byte_at_a_time_empty_batch_test . exe chttp2_socket_pair_one_byte_at_a_time_graceful_server_shutdown_test . exe chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_test . exe chttp2_socket_pair_one_byte_at_a_time_max_concurrent_streams_test . exe chttp2_socket_pair_one_byte_at_a_time_max_message_length_test . exe chttp2_socket_pair_one_byte_at_a_time_no_op_test . exe chttp2_socket_pair_one_byte_at_a_time_ping_pong_streaming_test . exe chttp2_socket_pair_one_byte_at_a_time_registered_call_test . exe chttp2_socket_pair_one_byte_at_a_time_request_response_with_binary_metadata_and_payload_test . exe chttp2_socket_pair_one_byte_at_a_time_request_response_with_metadata_and_payload_test . exe chttp2_socket_pair_one_byte_at_a_time_request_response_with_payload_test . exe chttp2_socket_pair_one_byte_at_a_time_request_response_with_payload_and_call_creds_test . exe chttp2_socket_pair_one_byte_at_a_time_request_response_with_trailing_metadata_and_payload_test . exe chttp2_socket_pair_one_byte_at_a_time_request_with_large_metadata_test . exe chttp2_socket_pair_one_byte_at_a_time_request_with_payload_test . exe chttp2_socket_pair_one_byte_at_a_time_server_finishes_request_test . exe chttp2_socket_pair_one_byte_at_a_time_simple_delayed_request_test . exe chttp2_socket_pair_one_byte_at_a_time_simple_request_test . exe chttp2_socket_pair_one_byte_at_a_time_simple_request_with_high_initial_sequence_number_test . exe chttp2_socket_pair_with_grpc_trace_bad_hostname_test . exe chttp2_socket_pair_with_grpc_trace_cancel_after_accept_test . exe chttp2_socket_pair_with_grpc_trace_cancel_after_accept_and_writes_closed_test . exe chttp2_socket_pair_with_grpc_trace_cancel_after_invoke_test . exe chttp2_socket_pair_with_grpc_trace_cancel_before_invoke_test . exe chttp2_socket_pair_with_grpc_trace_cancel_in_a_vacuum_test . exe chttp2_socket_pair_with_grpc_trace_census_simple_request_test . exe chttp2_socket_pair_with_grpc_trace_disappearing_server_test . exe chttp2_socket_pair_with_grpc_trace_early_server_shutdown_finishes_inflight_calls_test . exe chttp2_socket_pair_with_grpc_trace_early_server_shutdown_finishes_tags_test . exe chttp2_socket_pair_with_grpc_trace_empty_batch_test . exe chttp2_socket_pair_with_grpc_trace_graceful_server_shutdown_test . exe chttp2_socket_pair_with_grpc_trace_invoke_large_request_test . exe chttp2_socket_pair_with_grpc_trace_max_concurrent_streams_test . exe chttp2_socket_pair_with_grpc_trace_max_message_length_test . exe chttp2_socket_pair_with_grpc_trace_no_op_test . exe chttp2_socket_pair_with_grpc_trace_ping_pong_streaming_test . exe chttp2_socket_pair_with_grpc_trace_registered_call_test . exe chttp2_socket_pair_with_grpc_trace_request_response_with_binary_metadata_and_payload_test . exe chttp2_socket_pair_with_grpc_trace_request_response_with_metadata_and_payload_test . exe chttp2_socket_pair_with_grpc_trace_request_response_with_payload_test . exe chttp2_socket_pair_with_grpc_trace_request_response_with_payload_and_call_creds_test . exe chttp2_socket_pair_with_grpc_trace_request_response_with_trailing_metadata_and_payload_test . exe chttp2_socket_pair_with_grpc_trace_request_with_large_metadata_test . exe chttp2_socket_pair_with_grpc_trace_request_with_payload_test . exe chttp2_socket_pair_with_grpc_trace_server_finishes_request_test . exe chttp2_socket_pair_with_grpc_trace_simple_delayed_request_test . exe chttp2_socket_pair_with_grpc_trace_simple_request_test . exe chttp2_socket_pair_with_grpc_trace_simple_request_with_high_initial_sequence_number_test . exe chttp2_fullstack_bad_hostname_unsecure_test . exe chttp2_fullstack_cancel_after_accept_unsecure_test . exe chttp2_fullstack_cancel_after_accept_and_writes_closed_unsecure_test . exe chttp2_fullstack_cancel_after_invoke_unsecure_test . exe chttp2_fullstack_cancel_before_invoke_unsecure_test . exe chttp2_fullstack_cancel_in_a_vacuum_unsecure_test . exe chttp2_fullstack_census_simple_request_unsecure_test . exe chttp2_fullstack_disappearing_server_unsecure_test . exe chttp2_fullstack_early_server_shutdown_finishes_inflight_calls_unsecure_test . exe chttp2_fullstack_early_server_shutdown_finishes_tags_unsecure_test . exe chttp2_fullstack_empty_batch_unsecure_test . exe chttp2_fullstack_graceful_server_shutdown_unsecure_test . exe chttp2_fullstack_invoke_large_request_unsecure_test . exe chttp2_fullstack_max_concurrent_streams_unsecure_test . exe chttp2_fullstack_max_message_length_unsecure_test . exe chttp2_fullstack_no_op_unsecure_test . exe chttp2_fullstack_ping_pong_streaming_unsecure_test . exe chttp2_fullstack_registered_call_unsecure_test . exe chttp2_fullstack_request_response_with_binary_metadata_and_payload_unsecure_test . exe chttp2_fullstack_request_response_with_metadata_and_payload_unsecure_test . exe chttp2_fullstack_request_response_with_payload_unsecure_test . exe chttp2_fullstack_request_response_with_trailing_metadata_and_payload_unsecure_test . exe chttp2_fullstack_request_with_large_metadata_unsecure_test . exe chttp2_fullstack_request_with_payload_unsecure_test . exe chttp2_fullstack_server_finishes_request_unsecure_test . exe chttp2_fullstack_simple_delayed_request_unsecure_test . exe chttp2_fullstack_simple_request_unsecure_test . exe chttp2_fullstack_simple_request_with_high_initial_sequence_number_unsecure_test . exe chttp2_socket_pair_bad_hostname_unsecure_test . exe chttp2_socket_pair_cancel_after_accept_unsecure_test . exe chttp2_socket_pair_cancel_after_accept_and_writes_closed_unsecure_test . exe chttp2_socket_pair_cancel_after_invoke_unsecure_test . exe chttp2_socket_pair_cancel_before_invoke_unsecure_test . exe chttp2_socket_pair_cancel_in_a_vacuum_unsecure_test . exe chttp2_socket_pair_census_simple_request_unsecure_test . exe chttp2_socket_pair_disappearing_server_unsecure_test . exe chttp2_socket_pair_early_server_shutdown_finishes_inflight_calls_unsecure_test . exe chttp2_socket_pair_early_server_shutdown_finishes_tags_unsecure_test . exe chttp2_socket_pair_empty_batch_unsecure_test . exe chttp2_socket_pair_graceful_server_shutdown_unsecure_test . exe chttp2_socket_pair_invoke_large_request_unsecure_test . exe chttp2_socket_pair_max_concurrent_streams_unsecure_test . exe chttp2_socket_pair_max_message_length_unsecure_test . exe chttp2_socket_pair_no_op_unsecure_test . exe chttp2_socket_pair_ping_pong_streaming_unsecure_test . exe chttp2_socket_pair_registered_call_unsecure_test . exe chttp2_socket_pair_request_response_with_binary_metadata_and_payload_unsecure_test . exe chttp2_socket_pair_request_response_with_metadata_and_payload_unsecure_test . exe chttp2_socket_pair_request_response_with_payload_unsecure_test . exe chttp2_socket_pair_request_response_with_trailing_metadata_and_payload_unsecure_test . exe chttp2_socket_pair_request_with_large_metadata_unsecure_test . exe chttp2_socket_pair_request_with_payload_unsecure_test . exe chttp2_socket_pair_server_finishes_request_unsecure_test . exe chttp2_socket_pair_simple_delayed_request_unsecure_test . exe chttp2_socket_pair_simple_request_unsecure_test . exe chttp2_socket_pair_simple_request_with_high_initial_sequence_number_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_bad_hostname_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_cancel_after_accept_and_writes_closed_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_cancel_after_invoke_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_cancel_before_invoke_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_cancel_in_a_vacuum_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_census_simple_request_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_disappearing_server_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_inflight_calls_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_early_server_shutdown_finishes_tags_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_empty_batch_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_graceful_server_shutdown_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_invoke_large_request_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_max_concurrent_streams_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_max_message_length_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_no_op_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_ping_pong_streaming_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_registered_call_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_request_response_with_binary_metadata_and_payload_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_request_response_with_metadata_and_payload_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_request_response_with_payload_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_request_response_with_trailing_metadata_and_payload_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_request_with_large_metadata_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_request_with_payload_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_server_finishes_request_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_simple_delayed_request_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_simple_request_unsecure_test . exe chttp2_socket_pair_one_byte_at_a_time_simple_request_with_high_initial_sequence_number_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_bad_hostname_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_cancel_after_accept_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_cancel_after_accept_and_writes_closed_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_cancel_after_invoke_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_cancel_before_invoke_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_cancel_in_a_vacuum_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_census_simple_request_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_disappearing_server_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_early_server_shutdown_finishes_inflight_calls_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_early_server_shutdown_finishes_tags_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_empty_batch_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_graceful_server_shutdown_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_invoke_large_request_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_max_concurrent_streams_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_max_message_length_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_no_op_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_ping_pong_streaming_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_registered_call_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_request_response_with_binary_metadata_and_payload_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_request_response_with_metadata_and_payload_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_request_response_with_payload_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_request_response_with_trailing_metadata_and_payload_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_request_with_large_metadata_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_request_with_payload_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_server_finishes_request_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_simple_delayed_request_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_simple_request_unsecure_test . exe chttp2_socket_pair_with_grpc_trace_simple_request_with_high_initial_sequence_number_unsecure_test . exe <nl> echo All tests built . <nl> <nl> buildtests_cxx : interop_client . exe interop_server . exe <nl> chttp2_fake_security_request_with_payload_test . exe : build_libs $ ( OUT_DIR ) <nl> chttp2_fake_security_request_with_payload_test : chttp2_fake_security_request_with_payload_test . exe <nl> echo Running chttp2_fake_security_request_with_payload_test <nl> $ ( OUT_DIR ) \ chttp2_fake_security_request_with_payload_test . exe <nl> + chttp2_fake_security_server_finishes_request_test . exe : build_libs $ ( OUT_DIR ) <nl> + echo Building chttp2_fake_security_server_finishes_request_test <nl> + $ ( CC ) $ ( CFLAGS ) / Fo : $ ( OUT_DIR ) \ $ ( REPO_ROOT ) \ vsprojects \ dummy . c <nl> + $ ( LINK ) $ ( LFLAGS ) / OUT : " $ ( OUT_DIR ) \ chttp2_fake_security_server_finishes_request_test . exe " Debug \ end2end_fixture_chttp2_fake_security . lib Debug \ end2end_test_server_finishes_request . lib Debug \ end2end_certs . lib Debug \ grpc_test_util . lib Debug \ grpc . lib Debug \ gpr_test_util . lib Debug \ gpr . lib $ ( LIBS ) $ ( OUT_DIR ) \ dummy . obj <nl> + chttp2_fake_security_server_finishes_request_test : chttp2_fake_security_server_finishes_request_test . exe <nl> + echo Running chttp2_fake_security_server_finishes_request_test <nl> + $ ( OUT_DIR ) \ chttp2_fake_security_server_finishes_request_test . exe <nl> chttp2_fake_security_simple_delayed_request_test . exe : build_libs $ ( OUT_DIR ) <nl> echo Building chttp2_fake_security_simple_delayed_request_test <nl> $ ( CC ) $ ( CFLAGS ) / Fo : $ ( OUT_DIR ) \ $ ( REPO_ROOT ) \ vsprojects \ dummy . c <nl> chttp2_fullstack_request_with_payload_test . exe : build_libs $ ( OUT_DIR ) <nl> chttp2_fullstack_request_with_payload_test : chttp2_fullstack_request_with_payload_test . exe <nl> echo Running chttp2_fullstack_request_with_payload_test <nl> $ ( OUT_DIR ) \ chttp2_fullstack_request_with_payload_test . exe <nl> + chttp2_fullstack_server_finishes_request_test . exe : build_libs $ ( OUT_DIR ) <nl> + echo Building chttp2_fullstack_server_finishes_request_test <nl> + $ ( CC ) $ ( CFLAGS ) / Fo : $ ( OUT_DIR ) \ $ ( REPO_ROOT ) \ vsprojects \ dummy . c <nl> + $ ( LINK ) $ ( LFLAGS ) / OUT : " $ ( OUT_DIR ) \ chttp2_fullstack_server_finishes_request_test . exe " Debug \ end2end_fixture_chttp2_fullstack . lib Debug \ end2end_test_server_finishes_request . lib Debug \ end2end_certs . lib Debug \ grpc_test_util . lib Debug \ grpc . lib Debug \ gpr_test_util . lib Debug \ gpr . lib $ ( LIBS ) $ ( OUT_DIR ) \ dummy . obj <nl> + chttp2_fullstack_server_finishes_request_test : chttp2_fullstack_server_finishes_request_test . exe <nl> + echo Running chttp2_fullstack_server_finishes_request_test <nl> + $ ( OUT_DIR ) \ chttp2_fullstack_server_finishes_request_test . exe <nl> chttp2_fullstack_simple_delayed_request_test . exe : build_libs $ ( OUT_DIR ) <nl> echo Building chttp2_fullstack_simple_delayed_request_test <nl> $ ( CC ) $ ( CFLAGS ) / Fo : $ ( OUT_DIR ) \ $ ( REPO_ROOT ) \ vsprojects \ dummy . c <nl> chttp2_simple_ssl_fullstack_request_with_payload_test . exe : build_libs $ ( OUT_DIR ) <nl> chttp2_simple_ssl_fullstack_request_with_payload_test : chttp2_simple_ssl_fullstack_request_with_payload_test . exe <nl> echo Running chttp2_simple_ssl_fullstack_request_with_payload_test <nl> $ ( OUT_DIR ) \ chttp2_simple_ssl_fullstack_request_with_payload_test . exe <nl> + chttp2_simple_ssl_fullstack_server_finishes_request_test . exe : build_libs $ ( OUT_DIR ) <nl> + echo Building chttp2_simple_ssl_fullstack_server_finishes_request_test <nl> + $ ( CC ) $ ( CFLAGS ) / Fo : $ ( OUT_DIR ) \ $ ( REPO_ROOT ) \ vsprojects \ dummy . c <nl> + $ ( LINK ) $ ( LFLAGS ) / OUT : " $ ( OUT_DIR ) \ chttp2_simple_ssl_fullstack_server_finishes_request_test . exe " Debug \ end2end_fixture_chttp2_simple_ssl_fullstack . lib Debug \ end2end_test_server_finishes_request . lib Debug \ end2end_certs . lib Debug \ grpc_test_util . lib Debug \ grpc . lib Debug \ gpr_test_util . lib Debug \ gpr . lib $ ( LIBS ) $ ( OUT_DIR ) \ dummy . obj <nl> + chttp2_simple_ssl_fullstack_server_finishes_request_test : chttp2_simple_ssl_fullstack_server_finishes_request_test . exe <nl> + echo Running chttp2_simple_ssl_fullstack_server_finishes_request_test <nl> + $ ( OUT_DIR ) \ chttp2_simple_ssl_fullstack_server_finishes_request_test . exe <nl> chttp2_simple_ssl_fullstack_simple_delayed_request_test . exe : build_libs $ ( OUT_DIR ) <nl> echo Building chttp2_simple_ssl_fullstack_simple_delayed_request_test <nl> $ ( CC ) $ ( CFLAGS ) / Fo : $ ( OUT_DIR ) \ $ ( REPO_ROOT ) \ vsprojects \ dummy . c <nl> chttp2_simple_ssl_with_oauth2_fullstack_request_with_payload_test . exe : build_lib <nl> chttp2_simple_ssl_with_oauth2_fullstack_request_with_payload_test : chttp2_simple_ssl_with_oauth2_fullstack_request_with_payload_test . exe <nl> echo Running chttp2_simple_ssl_with_oauth2_fullstack_request_with_payload_test <nl> $ ( OUT_DIR ) \ chttp2_simple_ssl_with_oauth2_fullstack_request_with_payload_test . exe <nl> + chttp2_simple_ssl_with_oauth2_fullstack_server_finishes_request_test . exe : build_libs $ ( OUT_DIR ) <nl> + echo Building chttp2_simple_ssl_with_oauth2_fullstack_server_finishes_request_test <nl> + $ ( CC ) $ ( CFLAGS ) / Fo : $ ( OUT_DIR ) \ $ ( REPO_ROOT ) \ vsprojects \ dummy . c <nl> + $ ( LINK ) $ ( LFLAGS ) / OUT : " $ ( OUT_DIR ) \ chttp2_simple_ssl_with_oauth2_fullstack_server_finishes_request_test . exe " Debug \ end2end_fixture_chttp2_simple_ssl_with_oauth2_fullstack . lib Debug \ end2end_test_server_finishes_request . lib Debug \ end2end_certs . lib Debug \ grpc_test_util . lib Debug \ grpc . lib Debug \ gpr_test_util . lib Debug \ gpr . lib $ ( LIBS ) $ ( OUT_DIR ) \ dummy . obj <nl> + chttp2_simple_ssl_with_oauth2_fullstack_server_finishes_request_test : chttp2_simple_ssl_with_oauth2_fullstack_server_finishes_request_test . exe <nl> + echo Running chttp2_simple_ssl_with_oauth2_fullstack_server_finishes_request_test <nl> + $ ( OUT_DIR ) \ chttp2_simple_ssl_with_oauth2_fullstack_server_finishes_request_test . exe <nl> chttp2_simple_ssl_with_oauth2_fullstack_simple_delayed_request_test . exe : build_libs $ ( OUT_DIR ) <nl> echo Building chttp2_simple_ssl_with_oauth2_fullstack_simple_delayed_request_test <nl> $ ( CC ) $ ( CFLAGS ) / Fo : $ ( OUT_DIR ) \ $ ( REPO_ROOT ) \ vsprojects \ dummy . c <nl> chttp2_socket_pair_request_with_payload_test . exe : build_libs $ ( OUT_DIR ) <nl> chttp2_socket_pair_request_with_payload_test : chttp2_socket_pair_request_with_payload_test . exe <nl> echo Running chttp2_socket_pair_request_with_payload_test <nl> $ ( OUT_DIR ) \ chttp2_socket_pair_request_with_payload_test . exe <nl> + chttp2_socket_pair_server_finishes_request_test . exe : build_libs $ ( OUT_DIR ) <nl> + echo Building chttp2_socket_pair_server_finishes_request_test <nl> + $ ( CC ) $ ( CFLAGS ) / Fo : $ ( OUT_DIR ) \ $ ( REPO_ROOT ) \ vsprojects \ dummy . c <nl> + $ ( LINK ) $ ( LFLAGS ) / OUT : " $ ( OUT_DIR ) \ chttp2_socket_pair_server_finishes_request_test . exe " Debug \ end2end_fixture_chttp2_socket_pair . lib Debug \ end2end_test_server_finishes_request . lib Debug \ end2end_certs . lib Debug \ grpc_test_util . lib Debug \ grpc . lib Debug \ gpr_test_util . lib Debug \ gpr . lib $ ( LIBS ) $ ( OUT_DIR ) \ dummy . obj <nl> + chttp2_socket_pair_server_finishes_request_test : chttp2_socket_pair_server_finishes_request_test . exe <nl> + echo Running chttp2_socket_pair_server_finishes_request_test <nl> + $ ( OUT_DIR ) \ chttp2_socket_pair_server_finishes_request_test . exe <nl> chttp2_socket_pair_simple_delayed_request_test . exe : build_libs $ ( OUT_DIR ) <nl> echo Building chttp2_socket_pair_simple_delayed_request_test <nl> $ ( CC ) $ ( CFLAGS ) / Fo : $ ( OUT_DIR ) \ $ ( REPO_ROOT ) \ vsprojects \ dummy . c <nl> chttp2_socket_pair_one_byte_at_a_time_request_with_payload_test . exe : build_libs <nl> chttp2_socket_pair_one_byte_at_a_time_request_with_payload_test : chttp2_socket_pair_one_byte_at_a_time_request_with_payload_test . exe <nl> echo Running chttp2_socket_pair_one_byte_at_a_time_request_with_payload_test <nl> $ ( OUT_DIR ) \ chttp2_socket_pair_one_byte_at_a_time_request_with_payload_test . exe <nl> + chttp2_socket_pair_one_byte_at_a_time_server_finishes_request_test . exe : build_libs $ ( OUT_DIR ) <nl> + echo Building chttp2_socket_pair_one_byte_at_a_time_server_finishes_request_test <nl> + $ ( CC ) $ ( CFLAGS ) / Fo : $ ( OUT_DIR ) \ $ ( REPO_ROOT ) \ vsprojects \ dummy . c <nl> + $ ( LINK ) $ ( LFLAGS ) / OUT : " $ ( OUT_DIR ) \ chttp2_socket_pair_one_byte_at_a_time_server_finishes_request_test . exe " Debug \ end2end_fixture_chttp2_socket_pair_one_byte_at_a_time . lib Debug \ end2end_test_server_finishes_request . lib Debug \ end2end_certs . lib Debug \ grpc_test_util . lib Debug \ grpc . lib Debug \ gpr_test_util . lib Debug \ gpr . lib $ ( LIBS ) $ ( OUT_DIR ) \ dummy . obj <nl> + chttp2_socket_pair_one_byte_at_a_time_server_finishes_request_test : chttp2_socket_pair_one_byte_at_a_time_server_finishes_request_test . exe <nl> + echo Running chttp2_socket_pair_one_byte_at_a_time_server_finishes_request_test <nl> + $ ( OUT_DIR ) \ chttp2_socket_pair_one_byte_at_a_time_server_finishes_request_test . exe <nl> chttp2_socket_pair_one_byte_at_a_time_simple_delayed_request_test . exe : build_libs $ ( OUT_DIR ) <nl> echo Building chttp2_socket_pair_one_byte_at_a_time_simple_delayed_request_test <nl> $ ( CC ) $ ( CFLAGS ) / Fo : $ ( OUT_DIR ) \ $ ( REPO_ROOT ) \ vsprojects \ dummy . c <nl> chttp2_socket_pair_with_grpc_trace_request_with_payload_test . exe : build_libs $ ( O <nl> chttp2_socket_pair_with_grpc_trace_request_with_payload_test : chttp2_socket_pair_with_grpc_trace_request_with_payload_test . exe <nl> echo Running chttp2_socket_pair_with_grpc_trace_request_with_payload_test <nl> $ ( OUT_DIR ) \ chttp2_socket_pair_with_grpc_trace_request_with_payload_test . exe <nl> + chttp2_socket_pair_with_grpc_trace_server_finishes_request_test . exe : build_libs $ ( OUT_DIR ) <nl> + echo Building chttp2_socket_pair_with_grpc_trace_server_finishes_request_test <nl> + $ ( CC ) $ ( CFLAGS ) / Fo : $ ( OUT_DIR ) \ $ ( REPO_ROOT ) \ vsprojects \ dummy . c <nl> + $ ( LINK ) $ ( LFLAGS ) / OUT : " $ ( OUT_DIR ) \ chttp2_socket_pair_with_grpc_trace_server_finishes_request_test . exe " Debug \ end2end_fixture_chttp2_socket_pair_with_grpc_trace . lib Debug \ end2end_test_server_finishes_request . lib Debug \ end2end_certs . lib Debug \ grpc_test_util . lib Debug \ grpc . lib Debug \ gpr_test_util . lib Debug \ gpr . lib $ ( LIBS ) $ ( OUT_DIR ) \ dummy . obj <nl> + chttp2_socket_pair_with_grpc_trace_server_finishes_request_test : chttp2_socket_pair_with_grpc_trace_server_finishes_request_test . exe <nl> + echo Running chttp2_socket_pair_with_grpc_trace_server_finishes_request_test <nl> + $ ( OUT_DIR ) \ chttp2_socket_pair_with_grpc_trace_server_finishes_request_test . exe <nl> chttp2_socket_pair_with_grpc_trace_simple_delayed_request_test . exe : build_libs $ ( OUT_DIR ) <nl> echo Building chttp2_socket_pair_with_grpc_trace_simple_delayed_request_test <nl> $ ( CC ) $ ( CFLAGS ) / Fo : $ ( OUT_DIR ) \ $ ( REPO_ROOT ) \ vsprojects \ dummy . c <nl> chttp2_fullstack_request_with_payload_unsecure_test . exe : build_libs $ ( OUT_DIR ) <nl> chttp2_fullstack_request_with_payload_unsecure_test : chttp2_fullstack_request_with_payload_unsecure_test . exe <nl> echo Running chttp2_fullstack_request_with_payload_unsecure_test <nl> $ ( OUT_DIR ) \ chttp2_fullstack_request_with_payload_unsecure_test . exe <nl> + chttp2_fullstack_server_finishes_request_unsecure_test . exe : build_libs $ ( OUT_DIR ) <nl> + echo Building chttp2_fullstack_server_finishes_request_unsecure_test <nl> + $ ( CC ) $ ( CFLAGS ) / Fo : $ ( OUT_DIR ) \ $ ( REPO_ROOT ) \ vsprojects \ dummy . c <nl> + $ ( LINK ) $ ( LFLAGS ) / OUT : " $ ( OUT_DIR ) \ chttp2_fullstack_server_finishes_request_unsecure_test . exe " Debug \ end2end_fixture_chttp2_fullstack . lib Debug \ end2end_test_server_finishes_request . lib Debug \ grpc_test_util_unsecure . lib Debug \ grpc_unsecure . lib Debug \ gpr_test_util . lib Debug \ gpr . lib $ ( LIBS ) $ ( OUT_DIR ) \ dummy . obj <nl> + chttp2_fullstack_server_finishes_request_unsecure_test : chttp2_fullstack_server_finishes_request_unsecure_test . exe <nl> + echo Running chttp2_fullstack_server_finishes_request_unsecure_test <nl> + $ ( OUT_DIR ) \ chttp2_fullstack_server_finishes_request_unsecure_test . exe <nl> chttp2_fullstack_simple_delayed_request_unsecure_test . exe : build_libs $ ( OUT_DIR ) <nl> echo Building chttp2_fullstack_simple_delayed_request_unsecure_test <nl> $ ( CC ) $ ( CFLAGS ) / Fo : $ ( OUT_DIR ) \ $ ( REPO_ROOT ) \ vsprojects \ dummy . c <nl> chttp2_socket_pair_request_with_payload_unsecure_test . exe : build_libs $ ( OUT_DIR ) <nl> chttp2_socket_pair_request_with_payload_unsecure_test : chttp2_socket_pair_request_with_payload_unsecure_test . exe <nl> echo Running chttp2_socket_pair_request_with_payload_unsecure_test <nl> $ ( OUT_DIR ) \ chttp2_socket_pair_request_with_payload_unsecure_test . exe <nl> + chttp2_socket_pair_server_finishes_request_unsecure_test . exe : build_libs $ ( OUT_DIR ) <nl> + echo Building chttp2_socket_pair_server_finishes_request_unsecure_test <nl> + $ ( CC ) $ ( CFLAGS ) / Fo : $ ( OUT_DIR ) \ $ ( REPO_ROOT ) \ vsprojects \ dummy . c <nl> + $ ( LINK ) $ ( LFLAGS ) / OUT : " $ ( OUT_DIR ) \ chttp2_socket_pair_server_finishes_request_unsecure_test . exe " Debug \ end2end_fixture_chttp2_socket_pair . lib Debug \ end2end_test_server_finishes_request . lib Debug \ grpc_test_util_unsecure . lib Debug \ grpc_unsecure . lib Debug \ gpr_test_util . lib Debug \ gpr . lib $ ( LIBS ) $ ( OUT_DIR ) \ dummy . obj <nl> + chttp2_socket_pair_server_finishes_request_unsecure_test : chttp2_socket_pair_server_finishes_request_unsecure_test . exe <nl> + echo Running chttp2_socket_pair_server_finishes_request_unsecure_test <nl> + $ ( OUT_DIR ) \ chttp2_socket_pair_server_finishes_request_unsecure_test . exe <nl> chttp2_socket_pair_simple_delayed_request_unsecure_test . exe : build_libs $ ( OUT_DIR ) <nl> echo Building chttp2_socket_pair_simple_delayed_request_unsecure_test <nl> $ ( CC ) $ ( CFLAGS ) / Fo : $ ( OUT_DIR ) \ $ ( REPO_ROOT ) \ vsprojects \ dummy . c <nl> chttp2_socket_pair_one_byte_at_a_time_request_with_payload_unsecure_test . exe : bu <nl> chttp2_socket_pair_one_byte_at_a_time_request_with_payload_unsecure_test : chttp2_socket_pair_one_byte_at_a_time_request_with_payload_unsecure_test . exe <nl> echo Running chttp2_socket_pair_one_byte_at_a_time_request_with_payload_unsecure_test <nl> $ ( OUT_DIR ) \ chttp2_socket_pair_one_byte_at_a_time_request_with_payload_unsecure_test . exe <nl> + chttp2_socket_pair_one_byte_at_a_time_server_finishes_request_unsecure_test . exe : build_libs $ ( OUT_DIR ) <nl> + echo Building chttp2_socket_pair_one_byte_at_a_time_server_finishes_request_unsecure_test <nl> + $ ( CC ) $ ( CFLAGS ) / Fo : $ ( OUT_DIR ) \ $ ( REPO_ROOT ) \ vsprojects \ dummy . c <nl> + $ ( LINK ) $ ( LFLAGS ) / OUT : " $ ( OUT_DIR ) \ chttp2_socket_pair_one_byte_at_a_time_server_finishes_request_unsecure_test . exe " Debug \ end2end_fixture_chttp2_socket_pair_one_byte_at_a_time . lib Debug \ end2end_test_server_finishes_request . lib Debug \ grpc_test_util_unsecure . lib Debug \ grpc_unsecure . lib Debug \ gpr_test_util . lib Debug \ gpr . lib $ ( LIBS ) $ ( OUT_DIR ) \ dummy . obj <nl> + chttp2_socket_pair_one_byte_at_a_time_server_finishes_request_unsecure_test : chttp2_socket_pair_one_byte_at_a_time_server_finishes_request_unsecure_test . exe <nl> + echo Running chttp2_socket_pair_one_byte_at_a_time_server_finishes_request_unsecure_test <nl> + $ ( OUT_DIR ) \ chttp2_socket_pair_one_byte_at_a_time_server_finishes_request_unsecure_test . exe <nl> chttp2_socket_pair_one_byte_at_a_time_simple_delayed_request_unsecure_test . exe : build_libs $ ( OUT_DIR ) <nl> echo Building chttp2_socket_pair_one_byte_at_a_time_simple_delayed_request_unsecure_test <nl> $ ( CC ) $ ( CFLAGS ) / Fo : $ ( OUT_DIR ) \ $ ( REPO_ROOT ) \ vsprojects \ dummy . c <nl> chttp2_socket_pair_with_grpc_trace_request_with_payload_unsecure_test . exe : build <nl> chttp2_socket_pair_with_grpc_trace_request_with_payload_unsecure_test : chttp2_socket_pair_with_grpc_trace_request_with_payload_unsecure_test . exe <nl> echo Running chttp2_socket_pair_with_grpc_trace_request_with_payload_unsecure_test <nl> $ ( OUT_DIR ) \ chttp2_socket_pair_with_grpc_trace_request_with_payload_unsecure_test . exe <nl> + chttp2_socket_pair_with_grpc_trace_server_finishes_request_unsecure_test . exe : build_libs $ ( OUT_DIR ) <nl> + echo Building chttp2_socket_pair_with_grpc_trace_server_finishes_request_unsecure_test <nl> + $ ( CC ) $ ( CFLAGS ) / Fo : $ ( OUT_DIR ) \ $ ( REPO_ROOT ) \ vsprojects \ dummy . c <nl> + $ ( LINK ) $ ( LFLAGS ) / OUT : " $ ( OUT_DIR ) \ chttp2_socket_pair_with_grpc_trace_server_finishes_request_unsecure_test . exe " Debug \ end2end_fixture_chttp2_socket_pair_with_grpc_trace . lib Debug \ end2end_test_server_finishes_request . lib Debug \ grpc_test_util_unsecure . lib Debug \ grpc_unsecure . lib Debug \ gpr_test_util . lib Debug \ gpr . lib $ ( LIBS ) $ ( OUT_DIR ) \ dummy . obj <nl> + chttp2_socket_pair_with_grpc_trace_server_finishes_request_unsecure_test : chttp2_socket_pair_with_grpc_trace_server_finishes_request_unsecure_test . exe <nl> + echo Running chttp2_socket_pair_with_grpc_trace_server_finishes_request_unsecure_test <nl> + $ ( OUT_DIR ) \ chttp2_socket_pair_with_grpc_trace_server_finishes_request_unsecure_test . exe <nl> chttp2_socket_pair_with_grpc_trace_simple_delayed_request_unsecure_test . exe : build_libs $ ( OUT_DIR ) <nl> echo Building chttp2_socket_pair_with_grpc_trace_simple_delayed_request_unsecure_test <nl> $ ( CC ) $ ( CFLAGS ) / Fo : $ ( OUT_DIR ) \ $ ( REPO_ROOT ) \ vsprojects \ dummy . c <nl> Debug \ end2end_test_request_with_payload . lib : $ ( OUT_DIR ) <nl> echo Building end2end_test_request_with_payload <nl> $ ( CC ) $ ( CFLAGS ) / Fo : $ ( OUT_DIR ) \ $ ( REPO_ROOT ) \ test \ core \ end2end \ tests \ request_with_payload . c <nl> $ ( LIBTOOL ) / OUT : " Debug \ end2end_test_request_with_payload . lib " $ ( OUT_DIR ) \ request_with_payload . obj <nl> + Debug \ end2end_test_server_finishes_request . lib : $ ( OUT_DIR ) <nl> + echo Building end2end_test_server_finishes_request <nl> + $ ( CC ) $ ( CFLAGS ) / Fo : $ ( OUT_DIR ) \ $ ( REPO_ROOT ) \ test \ core \ end2end \ tests \ server_finishes_request . c <nl> + $ ( LIBTOOL ) / OUT : " Debug \ end2end_test_server_finishes_request . lib " $ ( OUT_DIR ) \ server_finishes_request . obj <nl> Debug \ end2end_test_simple_delayed_request . lib : $ ( OUT_DIR ) <nl> echo Building end2end_test_simple_delayed_request <nl> $ ( CC ) $ ( CFLAGS ) / Fo : $ ( OUT_DIR ) \ $ ( REPO_ROOT ) \ test \ core \ end2end \ tests \ simple_delayed_request . c <nl>
Merge pull request from ctiller / really - really - finish - the - stream
grpc/grpc
a42c1fe8aeddff6e1fe13b7ee2d990999f2867c6
2015-05-20T16:31:25Z
mmm a / MachineLearning / CNTKSGDLib / DataReaderHelpers . h <nl> ppp b / MachineLearning / CNTKSGDLib / DataReaderHelpers . h <nl> namespace Microsoft { namespace MSR { namespace CNTK { <nl> <nl> / * static * / struct DataReaderHelpers <nl> { <nl> - # if 0 / / no longer needed since frame mode now uses N sequences with 1 frame each <nl> - / / decimate minibatch for parallelization - - in frame mode <nl> - / / We sub - sample the individual frames ( = matrix columns ) . <nl> - template < class ElemType > <nl> - static void DecimateMinibatch ( std : : map < std : : wstring , MSR : : CNTK : : Matrix < ElemType > * > & mb , int procs , int rank , MBLayoutPtr pMBLayout ) <nl> - { <nl> - if ( procs = = 1 ) <nl> - return ; <nl> - <nl> - const size_t nCols = mb . begin ( ) - > second - > GetNumCols ( ) ; <nl> - const size_t colBegin = ( nCols * rank ) / procs ; <nl> - const size_t colEnd = ( nCols * ( rank + 1 ) ) / procs ; <nl> - <nl> - for ( auto it = mb . begin ( ) ; it ! = mb . end ( ) ; + + it ) <nl> - { <nl> - MSR : : CNTK : : Matrix < ElemType > & mat = * ( it - > second ) ; <nl> - <nl> - if ( nCols ! = mat . GetNumCols ( ) ) / / all matrices must have the same number of columns <nl> - LogicError ( " DecimateMinibatch : Inconsistent number of columns among inputs ( found % d and % d ) . " , ( int ) nCols , ( int ) mat . GetNumCols ( ) ) ; <nl> - <nl> - # if 1 <nl> - MSR : : CNTK : : Matrix < ElemType > tmp = mat . ColumnSlice ( colBegin , colEnd - colBegin ) ; <nl> - if ( tmp . GetNumRows ( ) ! = mat . GetNumRows ( ) ) <nl> - LogicError ( " DecimateMinibatch : : found ColumnSlice ( ) to not preserve # rows when asking for 0 columns . That ' s a bug in ColumnSlice ( ) " ) ; / / TODO : remove this if confirmed the original code below indicates that it may not ( then that would be a bug in ColumnSlice ( ) ) <nl> - mat . SetValue ( tmp ) ; <nl> - # else <nl> - if ( colEnd = = colBegin ) <nl> - { <nl> - MSR : : CNTK : : Matrix < ElemType > tmp ( mat . GetNumRows ( ) , 0 , AUTOPLACEMATRIX , DENSE ) ; <nl> - mat . SetValue ( tmp ) ; <nl> - / / TODO : ^ ^ why is ColumnSlice not applicable here ? That would be a bug in ColumnSlice ( ) <nl> - } <nl> - else <nl> - { <nl> - MSR : : CNTK : : Matrix < ElemType > tmp = mat . ColumnSlice ( colBegin , colEnd - colBegin ) ; <nl> - mat . SetValue ( tmp ) ; <nl> - } <nl> - # endif <nl> - <nl> - } <nl> - <nl> - / / fix the layout <nl> - / / In frame mode , this is easy , since the layout has no flags . So we can just recreate one . <nl> - if ( ! pMBLayout - > IsAllNone ( ) ) <nl> - LogicError ( " DecimateMinibatch : unexpectedly called on minibatch that has sentence - boundary flags set " ) ; <nl> - else if ( pMBLayout - > GetNumParallelSequences ( ) ! = 1 ) <nl> - LogicError ( " DecimateMinibatch : unexpectedly called on minibatch that has > 1 parallel sequence " ) ; <nl> - else if ( nCols ! = pMBLayout - > GetNumTimeSteps ( ) ) / / matrices must match the layout prior to decimation <nl> - LogicError ( " DecimateMinibatch : Number of columns inconsistent with layout ( % d vs . % d ) . " , ( int ) nCols , ( int ) pMBLayout - > GetNumTimeSteps ( ) ) ; <nl> - pMBLayout - > Init ( 1 , colEnd - colBegin , false ) ; <nl> - } <nl> - # endif <nl> <nl> / / decimate minibatch for parallelization - - in utterance mode , also requires presence of parallel utterances <nl> / / We sub - sample the utterances . <nl> namespace Microsoft { namespace MSR { namespace CNTK { <nl> / / | x_t ^ { st } . . . x_t ^ { en - 1 } | . . . . | x_ { t + T - 1 } ^ { st } . . . x_ { t + T - 1 } ^ { en - 1 } | <nl> / / Each block now has nSlice / nProcs <nl> / / <nl> - / / Correspondingly , the SentenceBoundary and PackingFlags will be revised <nl> + / / Correspondingly , the MBLayout will be revised <nl> + <nl> size_t nOrigParallelUtts = pMBLayout - > GetNumParallelSequences ( ) ; <nl> size_t T = pMBLayout - > GetNumTimeSteps ( ) ; <nl> <nl> / / decide new parallel utterances <nl> - # if 1 <nl> size_t sent_start = nOrigParallelUtts * ( size_t ) rank / numprocs ; <nl> size_t sent_end = nOrigParallelUtts * ( size_t ) ( rank + 1 ) / numprocs ; <nl> static bool warned = false ; <nl> - if ( ! warned ) <nl> + if ( nOrigParallelUtts % numprocs ! = 0 & & ! warned ) <nl> { <nl> / * give a warning of potential bandwidth wasting * / <nl> fprintf ( stderr , " DecimateMinibatchSequences : WARNING : Number of parallel utterances % d not a multiple of number of GPUs % d , GPU usage will be suboptimal . \ n " , <nl> ( int ) nOrigParallelUtts , ( int ) numprocs ) ; <nl> warned = true ; <nl> } <nl> - # else <nl> - size_t nSlices = nOrigParallelUtts ; <nl> - static bool warned = false ; <nl> - size_t sent_start = 0 ; <nl> - size_t sent_end = 0 ; <nl> - if ( nOrigParallelUtts % numprocs ! = 0 ) <nl> - { <nl> - if ( ! warned ) <nl> - { <nl> - / * give a warning of potential bandwidth wasting * / <nl> - fprintf ( stderr , " WARNING : % d GPUs are used in model averaging , but the number of parallel utterances are % d , a potential training speed degradation . \ n " , <nl> - ( int ) g_mpi - > NumNodesInUse ( ) , ( int ) nOrigParallelUtts ) ; <nl> - warned = true ; <nl> - } <nl> - if ( rank = = numprocs - 1 ) <nl> - { <nl> - nSlices = nOrigParallelUtts - ( nOrigParallelUtts / numprocs + 1 ) * ( numprocs - 1 ) ; <nl> - sent_start = ( nOrigParallelUtts / numprocs + 1 ) * ( numprocs - 1 ) ; <nl> - sent_end = nOrigParallelUtts ; <nl> - } <nl> - else <nl> - { <nl> - nSlices = nOrigParallelUtts / numprocs + 1 ; <nl> - sent_start = nSlices * rank ; <nl> - sent_end = nSlices * ( rank + 1 ) ; <nl> - if ( sent_end > nOrigParallelUtts ) sent_end = nOrigParallelUtts ; <nl> - } <nl> - } <nl> - else <nl> - { <nl> - nSlices = nOrigParallelUtts / numprocs ; <nl> - sent_start = rank * nSlices ; <nl> - sent_end = ( rank + 1 ) * nSlices ; <nl> - if ( sent_end > nOrigParallelUtts ) sent_end = nOrigParallelUtts ; <nl> - } <nl> - # endif <nl> size_t newNumParallelSequences = sent_end - sent_start ; <nl> <nl> / / decimate data <nl> namespace Microsoft { namespace MSR { namespace CNTK { <nl> tmp . SetColumnSlice ( mat . ColumnSlice ( t * nOrigParallelUtts + sent_start , newNumParallelSequences ) , t * newNumParallelSequences , newNumParallelSequences ) ; <nl> mat . SetValue ( tmp ) ; / / update matrix in - place ( new matrix has less parallel streams ) <nl> / / TODO : ^ ^ If had Matrix : : RowSlice ( ) , this would be simpler . <nl> + / / TODO : But we do have a row - slice assignment function . This could be used . <nl> } <nl> / / decimate layout <nl> auto pNewMBLayout = make_shared < MBLayout > ( newNumParallelSequences , T , true ) ; <nl>
fixed a warning in DecimateMinibatchSequences ( ) which should only warn when it has something to warn about
microsoft/CNTK
b5f8f235b53ef61f7c510a009cafa1d7604fcd0b
2015-10-29T18:39:58Z
mmm a / cocos / ui / UIVideoPlayerIOS . mm <nl> ppp b / cocos / ui / UIVideoPlayerIOS . mm <nl> + ( NSString * ) fullPathFromRelativePath : ( NSString * ) relPath <nl> void VideoPlayer : : draw ( Renderer * renderer , const Mat4 & transform , uint32_t flags ) <nl> { <nl> cocos2d : : ui : : Widget : : draw ( renderer , transform , flags ) ; <nl> - <nl> + <nl> if ( flags & FLAGS_TRANSFORM_DIRTY ) <nl> { <nl> auto directorInstance = Director : : getInstance ( ) ; <nl> + ( NSString * ) fullPathFromRelativePath : ( NSString * ) relPath <nl> : ( rightTop . x - leftBottom . x ) * glView - > getScaleX ( ) / scaleFactor <nl> : ( ( rightTop . y - leftBottom . y ) * glView - > getScaleY ( ) / scaleFactor ) ] ; <nl> } <nl> - <nl> + <nl> # if CC_VIDEOPLAYER_DEBUG_DRAW <nl> _customDebugDrawCommand . init ( _globalZOrder ) ; <nl> _customDebugDrawCommand . func = CC_CALLBACK_0 ( VideoPlayer : : drawDebugData , this ) ; <nl>
Fix spacing
cocos2d/cocos2d-x
0a2afe983ca9dde1d632fa88270cdc65208120d0
2014-08-06T00:56:55Z
mmm a / src / arm / full - codegen - arm . cc <nl> ppp b / src / arm / full - codegen - arm . cc <nl> void FullCodeGenerator : : VisitForInStatement ( ForInStatement * stmt ) { <nl> __ push ( r0 ) ; <nl> __ InvokeBuiltin ( Builtins : : TO_OBJECT , CALL_FUNCTION ) ; <nl> __ bind ( & done_convert ) ; <nl> + PrepareForBailoutForId ( stmt - > ToObjectId ( ) , TOS_REG ) ; <nl> __ push ( r0 ) ; <nl> <nl> / / Check for proxies . <nl> void FullCodeGenerator : : VisitForInStatement ( ForInStatement * stmt ) { <nl> __ bind ( & call_runtime ) ; <nl> __ push ( r0 ) ; / / Duplicate the enumerable object on the stack . <nl> __ CallRuntime ( Runtime : : kGetPropertyNamesFast , 1 ) ; <nl> + PrepareForBailoutForId ( stmt - > EnumId ( ) , TOS_REG ) ; <nl> <nl> / / If we got a map from the runtime call , we can do a fast <nl> / / modification check . Otherwise , we got a fixed array , and we have <nl> void FullCodeGenerator : : VisitObjectLiteral ( ObjectLiteral * expr ) { <nl> FastCloneShallowObjectStub stub ( isolate ( ) , properties_count ) ; <nl> __ CallStub ( & stub ) ; <nl> } <nl> + PrepareForBailoutForId ( expr - > CreateLiteralId ( ) , TOS_REG ) ; <nl> <nl> / / If result_saved is true the result is on top of the stack . If <nl> / / result_saved is false the result is in r0 . <nl> mmm a / src / arm64 / full - codegen - arm64 . cc <nl> ppp b / src / arm64 / full - codegen - arm64 . cc <nl> void FullCodeGenerator : : VisitForInStatement ( ForInStatement * stmt ) { <nl> __ Push ( x0 ) ; <nl> __ InvokeBuiltin ( Builtins : : TO_OBJECT , CALL_FUNCTION ) ; <nl> __ Bind ( & done_convert ) ; <nl> + PrepareForBailoutForId ( stmt - > ToObjectId ( ) , TOS_REG ) ; <nl> __ Push ( x0 ) ; <nl> <nl> / / Check for proxies . <nl> void FullCodeGenerator : : VisitForInStatement ( ForInStatement * stmt ) { <nl> __ Bind ( & call_runtime ) ; <nl> __ Push ( x0 ) ; / / Duplicate the enumerable object on the stack . <nl> __ CallRuntime ( Runtime : : kGetPropertyNamesFast , 1 ) ; <nl> + PrepareForBailoutForId ( stmt - > EnumId ( ) , TOS_REG ) ; <nl> <nl> / / If we got a map from the runtime call , we can do a fast <nl> / / modification check . Otherwise , we got a fixed array , and we have <nl> void FullCodeGenerator : : VisitObjectLiteral ( ObjectLiteral * expr ) { <nl> FastCloneShallowObjectStub stub ( isolate ( ) , properties_count ) ; <nl> __ CallStub ( & stub ) ; <nl> } <nl> + PrepareForBailoutForId ( expr - > CreateLiteralId ( ) , TOS_REG ) ; <nl> <nl> / / If result_saved is true the result is on top of the stack . If <nl> / / result_saved is false the result is in x0 . <nl> mmm a / src / ast . h <nl> ppp b / src / ast . h <nl> class ForInStatement FINAL : public ForEachStatement { <nl> ForInType for_in_type ( ) const { return for_in_type_ ; } <nl> void set_for_in_type ( ForInType type ) { for_in_type_ = type ; } <nl> <nl> - static int num_ids ( ) { return parent_num_ids ( ) + 2 ; } <nl> + static int num_ids ( ) { return parent_num_ids ( ) + 4 ; } <nl> BailoutId BodyId ( ) const { return BailoutId ( local_id ( 0 ) ) ; } <nl> BailoutId PrepareId ( ) const { return BailoutId ( local_id ( 1 ) ) ; } <nl> + BailoutId EnumId ( ) const { return BailoutId ( local_id ( 2 ) ) ; } <nl> + BailoutId ToObjectId ( ) const { return BailoutId ( local_id ( 3 ) ) ; } <nl> virtual BailoutId ContinueId ( ) const OVERRIDE { return EntryId ( ) ; } <nl> virtual BailoutId StackCheckId ( ) const OVERRIDE { return BodyId ( ) ; } <nl> <nl> class ObjectLiteral FINAL : public MaterializedLiteral { <nl> } ; <nl> <nl> struct Accessors : public ZoneObject { <nl> - Accessors ( ) : getter ( NULL ) , setter ( NULL ) { } <nl> + Accessors ( ) : getter ( NULL ) , setter ( NULL ) { } <nl> Expression * getter ; <nl> Expression * setter ; <nl> } ; <nl> <nl> + BailoutId CreateLiteralId ( ) const { return BailoutId ( local_id ( 0 ) ) ; } <nl> + <nl> + static int num_ids ( ) { return parent_num_ids ( ) + 1 ; } <nl> + <nl> protected : <nl> ObjectLiteral ( Zone * zone , ZoneList < Property * > * properties , int literal_index , <nl> int boilerplate_properties , bool has_function , int pos ) <nl> class ObjectLiteral FINAL : public MaterializedLiteral { <nl> fast_elements_ ( false ) , <nl> may_store_doubles_ ( false ) , <nl> has_function_ ( has_function ) { } <nl> + static int parent_num_ids ( ) { return MaterializedLiteral : : num_ids ( ) ; } <nl> <nl> private : <nl> + int local_id ( int n ) const { return base_id ( ) + parent_num_ids ( ) + n ; } <nl> Handle < FixedArray > constant_properties_ ; <nl> ZoneList < Property * > * properties_ ; <nl> int boilerplate_properties_ ; <nl> mmm a / src / compiler . cc <nl> ppp b / src / compiler . cc <nl> OptimizedCompileJob : : Status OptimizedCompileJob : : CreateGraph ( ) { <nl> compiler : : Pipeline pipeline ( info ( ) ) ; <nl> pipeline . GenerateCode ( ) ; <nl> if ( ! info ( ) - > code ( ) . is_null ( ) ) { <nl> - if ( FLAG_turbo_deoptimization ) { <nl> - info ( ) - > context ( ) - > native_context ( ) - > AddOptimizedCode ( * info ( ) - > code ( ) ) ; <nl> - } <nl> return SetLastStatus ( SUCCEEDED ) ; <nl> } <nl> } <nl> OptimizedCompileJob : : Status OptimizedCompileJob : : GenerateCode ( ) { <nl> DCHECK ( last_status ( ) = = SUCCEEDED ) ; <nl> / / TODO ( turbofan ) : Currently everything is done in the first phase . <nl> if ( ! info ( ) - > code ( ) . is_null ( ) ) { <nl> + if ( FLAG_turbo_deoptimization ) { <nl> + info ( ) - > context ( ) - > native_context ( ) - > AddOptimizedCode ( * info ( ) - > code ( ) ) ; <nl> + } <nl> RecordOptimizationStats ( ) ; <nl> return last_status ( ) ; <nl> } <nl> mmm a / src / compiler / ast - graph - builder . cc <nl> ppp b / src / compiler / ast - graph - builder . cc <nl> void AstGraphBuilder : : VisitForInStatement ( ForInStatement * stmt ) { <nl> / / Convert object to jsobject . <nl> / / PrepareForBailoutForId ( stmt - > PrepareId ( ) , TOS_REG ) ; <nl> obj = NewNode ( javascript ( ) - > ToObject ( ) , obj ) ; <nl> + PrepareFrameState ( obj , stmt - > ToObjectId ( ) , OutputFrameStateCombine : : Push ( ) ) ; <nl> environment ( ) - > Push ( obj ) ; <nl> / / TODO ( dcarney ) : should do a fast enum cache check here to skip runtime . <nl> environment ( ) - > Push ( obj ) ; <nl> Node * cache_type = ProcessArguments ( <nl> javascript ( ) - > CallRuntime ( Runtime : : kGetPropertyNamesFast , 1 ) , 1 ) ; <nl> + PrepareFrameState ( cache_type , stmt - > EnumId ( ) , <nl> + OutputFrameStateCombine : : Push ( ) ) ; <nl> / / TODO ( dcarney ) : these next runtime calls should be removed in favour of <nl> / / a few simplified instructions . <nl> environment ( ) - > Push ( obj ) ; <nl> void AstGraphBuilder : : VisitObjectLiteral ( ObjectLiteral * expr ) { <nl> const Operator * op = <nl> javascript ( ) - > CallRuntime ( Runtime : : kCreateObjectLiteral , 4 ) ; <nl> Node * literal = NewNode ( op , literals_array , literal_index , constants , flags ) ; <nl> + PrepareFrameState ( literal , expr - > CreateLiteralId ( ) , <nl> + OutputFrameStateCombine : : Push ( ) ) ; <nl> <nl> / / The object is expected on the operand stack during computation of the <nl> / / property values and is the value of the entire expression . <nl> void AstGraphBuilder : : VisitObjectLiteral ( ObjectLiteral * expr ) { <nl> if ( property - > emit_store ( ) ) { <nl> const Operator * op = <nl> javascript ( ) - > CallRuntime ( Runtime : : kInternalSetPrototype , 2 ) ; <nl> - NewNode ( op , receiver , value ) ; <nl> + Node * set_prototype = NewNode ( op , receiver , value ) ; <nl> + / / SetPrototype should not lazy deopt on an object <nl> + / / literal . <nl> + PrepareFrameState ( set_prototype , BailoutId : : None ( ) ) ; <nl> } <nl> break ; <nl> } <nl> void AstGraphBuilder : : VisitObjectLiteral ( ObjectLiteral * expr ) { <nl> const Operator * op = <nl> javascript ( ) - > CallRuntime ( Runtime : : kDefineAccessorPropertyUnchecked , 5 ) ; <nl> Node * call = NewNode ( op , literal , name , getter , setter , attr ) ; <nl> - PrepareFrameState ( call , it - > first - > id ( ) ) ; <nl> + / / This should not lazy deopt on a new literal . <nl> + PrepareFrameState ( call , BailoutId : : None ( ) ) ; <nl> } <nl> <nl> / / Transform literals that contain functions to fast properties . <nl> void AstGraphBuilder : : VisitCall ( Call * expr ) { <nl> receiver_value = NewNode ( common ( ) - > Projection ( 1 ) , pair ) ; <nl> <nl> PrepareFrameState ( pair , expr - > EvalOrLookupId ( ) , <nl> - OutputFrameStateCombine : : Push ( ) ) ; <nl> + OutputFrameStateCombine : : Push ( 2 ) ) ; <nl> break ; <nl> } <nl> case Call : : PROPERTY_CALL : { <nl> mmm a / src / compiler / common - operator . h <nl> ppp b / src / compiler / common - operator . h <nl> class OutputFrameStateCombine { <nl> return kind_ = = kPushOutput & & parameter_ = = 0 ; <nl> } <nl> <nl> + size_t ConsumedOutputCount ( ) const { <nl> + return kind_ = = kPushOutput ? GetPushCount ( ) : 1 ; <nl> + } <nl> + <nl> bool operator = = ( OutputFrameStateCombine const & other ) const { <nl> return kind_ = = other . kind_ & & parameter_ = = other . parameter_ ; <nl> } <nl> mmm a / src / compiler / instruction - selector - impl . h <nl> ppp b / src / compiler / instruction - selector - impl . h <nl> class OperandGenerator { <nl> return ImmediateOperand : : Create ( index , zone ( ) ) ; <nl> } <nl> <nl> + InstructionOperand * TempLocation ( LinkageLocation location , MachineType type ) { <nl> + UnallocatedOperand * op = ToUnallocatedOperand ( location , type ) ; <nl> + op - > set_virtual_register ( sequence ( ) - > NextVirtualRegister ( ) ) ; <nl> + return op ; <nl> + } <nl> + <nl> InstructionOperand * Label ( BasicBlock * block ) { <nl> / / TODO ( bmeurer ) : We misuse ImmediateOperand here . <nl> return TempImmediate ( block - > rpo_number ( ) ) ; <nl> mmm a / src / compiler / instruction - selector . cc <nl> ppp b / src / compiler / instruction - selector . cc <nl> void InstructionSelector : : MarkAsReference ( Node * node ) { <nl> } <nl> <nl> <nl> + void InstructionSelector : : MarkAsRepresentation ( MachineType rep , <nl> + InstructionOperand * op ) { <nl> + UnallocatedOperand * unalloc = UnallocatedOperand : : cast ( op ) ; <nl> + switch ( RepresentationOf ( rep ) ) { <nl> + case kRepFloat32 : <nl> + case kRepFloat64 : <nl> + sequence ( ) - > MarkAsDouble ( unalloc - > virtual_register ( ) ) ; <nl> + break ; <nl> + case kRepTagged : <nl> + sequence ( ) - > MarkAsReference ( unalloc - > virtual_register ( ) ) ; <nl> + break ; <nl> + default : <nl> + break ; <nl> + } <nl> + } <nl> + <nl> + <nl> void InstructionSelector : : MarkAsRepresentation ( MachineType rep , Node * node ) { <nl> DCHECK_NOT_NULL ( node ) ; <nl> switch ( RepresentationOf ( rep ) ) { <nl> void InstructionSelector : : InitializeCallBuffer ( Node * call , CallBuffer * buffer , <nl> } <nl> <nl> / / Filter out the outputs that aren ' t live because no projection uses them . <nl> + size_t outputs_needed_by_framestate = <nl> + buffer - > frame_state_descriptor = = NULL <nl> + ? 0 <nl> + : buffer - > frame_state_descriptor - > state_combine ( ) <nl> + . ConsumedOutputCount ( ) ; <nl> for ( size_t i = 0 ; i < buffer - > output_nodes . size ( ) ; i + + ) { <nl> - if ( buffer - > output_nodes [ i ] ! = NULL ) { <nl> - Node * output = buffer - > output_nodes [ i ] ; <nl> + bool output_is_live = <nl> + buffer - > output_nodes [ i ] ! = NULL | | i < outputs_needed_by_framestate ; <nl> + if ( output_is_live ) { <nl> MachineType type = <nl> buffer - > descriptor - > GetReturnType ( static_cast < int > ( i ) ) ; <nl> LinkageLocation location = <nl> buffer - > descriptor - > GetReturnLocation ( static_cast < int > ( i ) ) ; <nl> - MarkAsRepresentation ( type , output ) ; <nl> - buffer - > outputs . push_back ( g . DefineAsLocation ( output , location , type ) ) ; <nl> + <nl> + Node * output = buffer - > output_nodes [ i ] ; <nl> + InstructionOperand * op = <nl> + output = = NULL ? g . TempLocation ( location , type ) <nl> + : g . DefineAsLocation ( output , location , type ) ; <nl> + MarkAsRepresentation ( type , op ) ; <nl> + <nl> + buffer - > outputs . push_back ( op ) ; <nl> } <nl> } <nl> } <nl> mmm a / src / compiler / instruction - selector . h <nl> ppp b / src / compiler / instruction - selector . h <nl> class InstructionSelector FINAL { <nl> / / by { node } . <nl> void MarkAsRepresentation ( MachineType rep , Node * node ) ; <nl> <nl> + / / Inform the register allocation of the representation of the unallocated <nl> + / / operand { op } . <nl> + void MarkAsRepresentation ( MachineType rep , InstructionOperand * op ) ; <nl> + <nl> / / Initialize the call buffer with the InstructionOperands , nodes , etc , <nl> / / corresponding <nl> / / to the inputs and outputs of the call . <nl> mmm a / src / compiler / linkage . cc <nl> ppp b / src / compiler / linkage . cc <nl> bool Linkage : : NeedsFrameState ( Runtime : : FunctionId function ) { <nl> case Runtime : : kCompileLazy : <nl> case Runtime : : kCompileOptimized : <nl> case Runtime : : kCompileString : <nl> + case Runtime : : kCreateObjectLiteral : <nl> case Runtime : : kDebugBreak : <nl> case Runtime : : kDataViewSetInt8 : <nl> case Runtime : : kDataViewSetUint8 : <nl> bool Linkage : : NeedsFrameState ( Runtime : : FunctionId function ) { <nl> case Runtime : : kDataViewGetFloat32 : <nl> case Runtime : : kDataViewGetFloat64 : <nl> case Runtime : : kDebugEvaluate : <nl> + case Runtime : : kDebugEvaluateGlobal : <nl> case Runtime : : kDebugGetLoadedScripts : <nl> case Runtime : : kDebugGetPropertyDetails : <nl> case Runtime : : kDebugPromiseEvent : <nl> + case Runtime : : kDefineAccessorPropertyUnchecked : <nl> + case Runtime : : kDefineDataPropertyUnchecked : <nl> case Runtime : : kDeleteProperty : <nl> case Runtime : : kDeoptimizeFunction : <nl> case Runtime : : kFunctionBindArguments : <nl> + case Runtime : : kGetDefaultReceiver : <nl> case Runtime : : kGetFrameCount : <nl> + case Runtime : : kGetImplFromInitializedIntlObject : <nl> case Runtime : : kGetOwnProperty : <nl> + case Runtime : : kGetOwnPropertyNames : <nl> + case Runtime : : kGetPropertyNamesFast : <nl> + case Runtime : : kGetPrototype : <nl> + case Runtime : : kInlineArguments : <nl> case Runtime : : kInlineCallFunction : <nl> case Runtime : : kInlineDateField : <nl> case Runtime : : kInlineRegExpExec : <nl> + case Runtime : : kInternalSetPrototype : <nl> + case Runtime : : kInterrupt : <nl> + case Runtime : : kIsPropertyEnumerable : <nl> + case Runtime : : kIsSloppyModeFunction : <nl> case Runtime : : kLiveEditGatherCompileInfo : <nl> case Runtime : : kLoadLookupSlot : <nl> case Runtime : : kLoadLookupSlotNoReferenceError : <nl> case Runtime : : kMaterializeRegExpLiteral : <nl> + case Runtime : : kNewObject : <nl> case Runtime : : kNewObjectFromBound : <nl> + case Runtime : : kNewObjectWithAllocationSite : <nl> case Runtime : : kObjectFreeze : <nl> + case Runtime : : kOwnKeys : <nl> case Runtime : : kParseJson : <nl> case Runtime : : kPrepareStep : <nl> case Runtime : : kPreventExtensions : <nl> bool Linkage : : NeedsFrameState ( Runtime : : FunctionId function ) { <nl> case Runtime : : kRegExpCompile : <nl> case Runtime : : kRegExpExecMultiple : <nl> case Runtime : : kResolvePossiblyDirectEval : <nl> - / / case Runtime : : kSetPrototype : <nl> + case Runtime : : kSetPrototype : <nl> case Runtime : : kSetScriptBreakPoint : <nl> + case Runtime : : kSparseJoinWithSeparator : <nl> case Runtime : : kStackGuard : <nl> + case Runtime : : kStoreKeyedToSuper_Sloppy : <nl> + case Runtime : : kStoreKeyedToSuper_Strict : <nl> + case Runtime : : kStoreToSuper_Sloppy : <nl> + case Runtime : : kStoreToSuper_Strict : <nl> case Runtime : : kStoreLookupSlot : <nl> case Runtime : : kStringBuilderConcat : <nl> + case Runtime : : kStringBuilderJoin : <nl> case Runtime : : kStringReplaceGlobalRegExpWithString : <nl> + case Runtime : : kThrowNonMethodError : <nl> + case Runtime : : kThrowNotDateError : <nl> case Runtime : : kThrowReferenceError : <nl> + case Runtime : : kThrowUnsupportedSuperError : <nl> case Runtime : : kThrow : <nl> case Runtime : : kTypedArraySetFastCases : <nl> case Runtime : : kTypedArrayInitializeFromArrayLike : <nl> - case Runtime : : kDebugEvaluateGlobal : <nl> - case Runtime : : kOwnKeys : <nl> - case Runtime : : kGetOwnPropertyNames : <nl> - case Runtime : : kIsPropertyEnumerable : <nl> - case Runtime : : kGetPrototype : <nl> - case Runtime : : kSparseJoinWithSeparator : <nl> return true ; <nl> default : <nl> return false ; <nl> mmm a / src / compiler / operator - properties - inl . h <nl> ppp b / src / compiler / operator - properties - inl . h <nl> inline bool OperatorProperties : : HasFrameStateInput ( const Operator * op ) { <nl> case IrOpcode : : kJSStoreProperty : <nl> case IrOpcode : : kJSSubtract : <nl> <nl> + / / Conversions <nl> + case IrOpcode : : kJSToObject : <nl> + <nl> / / Other <nl> case IrOpcode : : kJSDeleteProperty : <nl> return true ; <nl> mmm a / src / ia32 / full - codegen - ia32 . cc <nl> ppp b / src / ia32 / full - codegen - ia32 . cc <nl> void FullCodeGenerator : : VisitForInStatement ( ForInStatement * stmt ) { <nl> __ push ( eax ) ; <nl> __ InvokeBuiltin ( Builtins : : TO_OBJECT , CALL_FUNCTION ) ; <nl> __ bind ( & done_convert ) ; <nl> + PrepareForBailoutForId ( stmt - > ToObjectId ( ) , TOS_REG ) ; <nl> __ push ( eax ) ; <nl> <nl> / / Check for proxies . <nl> void FullCodeGenerator : : VisitForInStatement ( ForInStatement * stmt ) { <nl> __ bind ( & call_runtime ) ; <nl> __ push ( eax ) ; <nl> __ CallRuntime ( Runtime : : kGetPropertyNamesFast , 1 ) ; <nl> + PrepareForBailoutForId ( stmt - > EnumId ( ) , TOS_REG ) ; <nl> __ cmp ( FieldOperand ( eax , HeapObject : : kMapOffset ) , <nl> isolate ( ) - > factory ( ) - > meta_map ( ) ) ; <nl> __ j ( not_equal , & fixed_array ) ; <nl> void FullCodeGenerator : : VisitObjectLiteral ( ObjectLiteral * expr ) { <nl> FastCloneShallowObjectStub stub ( isolate ( ) , properties_count ) ; <nl> __ CallStub ( & stub ) ; <nl> } <nl> + PrepareForBailoutForId ( expr - > CreateLiteralId ( ) , TOS_REG ) ; <nl> <nl> / / If result_saved is true the result is on top of the stack . If <nl> / / result_saved is false the result is in eax . <nl> mmm a / src / mips / full - codegen - mips . cc <nl> ppp b / src / mips / full - codegen - mips . cc <nl> void FullCodeGenerator : : VisitForInStatement ( ForInStatement * stmt ) { <nl> __ InvokeBuiltin ( Builtins : : TO_OBJECT , CALL_FUNCTION ) ; <nl> __ mov ( a0 , v0 ) ; <nl> __ bind ( & done_convert ) ; <nl> + PrepareForBailoutForId ( stmt - > ToObjectId ( ) , TOS_REG ) ; <nl> __ push ( a0 ) ; <nl> <nl> / / Check for proxies . <nl> void FullCodeGenerator : : VisitForInStatement ( ForInStatement * stmt ) { <nl> __ bind ( & call_runtime ) ; <nl> __ push ( a0 ) ; / / Duplicate the enumerable object on the stack . <nl> __ CallRuntime ( Runtime : : kGetPropertyNamesFast , 1 ) ; <nl> + PrepareForBailoutForId ( stmt - > EnumId ( ) , TOS_REG ) ; <nl> <nl> / / If we got a map from the runtime call , we can do a fast <nl> / / modification check . Otherwise , we got a fixed array , and we have <nl> void FullCodeGenerator : : VisitObjectLiteral ( ObjectLiteral * expr ) { <nl> FastCloneShallowObjectStub stub ( isolate ( ) , properties_count ) ; <nl> __ CallStub ( & stub ) ; <nl> } <nl> + PrepareForBailoutForId ( expr - > CreateLiteralId ( ) , TOS_REG ) ; <nl> <nl> / / If result_saved is true the result is on top of the stack . If <nl> / / result_saved is false the result is in v0 . <nl> mmm a / src / mips64 / full - codegen - mips64 . cc <nl> ppp b / src / mips64 / full - codegen - mips64 . cc <nl> void FullCodeGenerator : : VisitForInStatement ( ForInStatement * stmt ) { <nl> __ InvokeBuiltin ( Builtins : : TO_OBJECT , CALL_FUNCTION ) ; <nl> __ mov ( a0 , v0 ) ; <nl> __ bind ( & done_convert ) ; <nl> + PrepareForBailoutForId ( stmt - > ToObjectId ( ) , TOS_REG ) ; <nl> __ push ( a0 ) ; <nl> <nl> / / Check for proxies . <nl> void FullCodeGenerator : : VisitForInStatement ( ForInStatement * stmt ) { <nl> __ bind ( & call_runtime ) ; <nl> __ push ( a0 ) ; / / Duplicate the enumerable object on the stack . <nl> __ CallRuntime ( Runtime : : kGetPropertyNamesFast , 1 ) ; <nl> + PrepareForBailoutForId ( stmt - > EnumId ( ) , TOS_REG ) ; <nl> <nl> / / If we got a map from the runtime call , we can do a fast <nl> / / modification check . Otherwise , we got a fixed array , and we have <nl> void FullCodeGenerator : : VisitObjectLiteral ( ObjectLiteral * expr ) { <nl> FastCloneShallowObjectStub stub ( isolate ( ) , properties_count ) ; <nl> __ CallStub ( & stub ) ; <nl> } <nl> + PrepareForBailoutForId ( expr - > CreateLiteralId ( ) , TOS_REG ) ; <nl> <nl> / / If result_saved is true the result is on top of the stack . If <nl> / / result_saved is false the result is in v0 . <nl> mmm a / src / x64 / full - codegen - x64 . cc <nl> ppp b / src / x64 / full - codegen - x64 . cc <nl> void FullCodeGenerator : : VisitForInStatement ( ForInStatement * stmt ) { <nl> __ Push ( rax ) ; <nl> __ InvokeBuiltin ( Builtins : : TO_OBJECT , CALL_FUNCTION ) ; <nl> __ bind ( & done_convert ) ; <nl> + PrepareForBailoutForId ( stmt - > ToObjectId ( ) , TOS_REG ) ; <nl> __ Push ( rax ) ; <nl> <nl> / / Check for proxies . <nl> void FullCodeGenerator : : VisitForInStatement ( ForInStatement * stmt ) { <nl> __ bind ( & call_runtime ) ; <nl> __ Push ( rax ) ; / / Duplicate the enumerable object on the stack . <nl> __ CallRuntime ( Runtime : : kGetPropertyNamesFast , 1 ) ; <nl> + PrepareForBailoutForId ( stmt - > EnumId ( ) , TOS_REG ) ; <nl> <nl> / / If we got a map from the runtime call , we can do a fast <nl> / / modification check . Otherwise , we got a fixed array , and we have <nl> void FullCodeGenerator : : VisitObjectLiteral ( ObjectLiteral * expr ) { <nl> FastCloneShallowObjectStub stub ( isolate ( ) , properties_count ) ; <nl> __ CallStub ( & stub ) ; <nl> } <nl> + PrepareForBailoutForId ( expr - > CreateLiteralId ( ) , TOS_REG ) ; <nl> <nl> / / If result_saved is true the result is on top of the stack . If <nl> / / result_saved is false the result is in rax . <nl> mmm a / src / x87 / full - codegen - x87 . cc <nl> ppp b / src / x87 / full - codegen - x87 . cc <nl> void FullCodeGenerator : : VisitForInStatement ( ForInStatement * stmt ) { <nl> __ push ( eax ) ; <nl> __ InvokeBuiltin ( Builtins : : TO_OBJECT , CALL_FUNCTION ) ; <nl> __ bind ( & done_convert ) ; <nl> + PrepareForBailoutForId ( stmt - > ToObjectId ( ) , TOS_REG ) ; <nl> __ push ( eax ) ; <nl> <nl> / / Check for proxies . <nl> void FullCodeGenerator : : VisitForInStatement ( ForInStatement * stmt ) { <nl> __ bind ( & call_runtime ) ; <nl> __ push ( eax ) ; <nl> __ CallRuntime ( Runtime : : kGetPropertyNamesFast , 1 ) ; <nl> + PrepareForBailoutForId ( stmt - > EnumId ( ) , TOS_REG ) ; <nl> __ cmp ( FieldOperand ( eax , HeapObject : : kMapOffset ) , <nl> isolate ( ) - > factory ( ) - > meta_map ( ) ) ; <nl> __ j ( not_equal , & fixed_array ) ; <nl> void FullCodeGenerator : : VisitObjectLiteral ( ObjectLiteral * expr ) { <nl> FastCloneShallowObjectStub stub ( isolate ( ) , properties_count ) ; <nl> __ CallStub ( & stub ) ; <nl> } <nl> + PrepareForBailoutForId ( expr - > CreateLiteralId ( ) , TOS_REG ) ; <nl> <nl> / / If result_saved is true the result is on top of the stack . If <nl> / / result_saved is false the result is in eax . <nl> mmm a / test / mjsunit / harmony / proxies . js <nl> ppp b / test / mjsunit / harmony / proxies . js <nl> <nl> / / test enters an infinite recursion which goes through the runtime and we <nl> / / overflow the system stack before the simulator stack . <nl> <nl> - / / Flags : - - harmony - proxies - - sim - stack - size = 500 <nl> + / / Flags : - - harmony - proxies - - sim - stack - size = 500 - - turbo - deoptimization <nl> <nl> <nl> / / Helper . <nl> mmm a / test / mjsunit / regress / regress - 417709a . js <nl> ppp b / test / mjsunit / regress / regress - 417709a . js <nl> <nl> / / Use of this source code is governed by a BSD - style license that can be <nl> / / found in the LICENSE file . <nl> <nl> - / / Flags : - - stack - size = 100 <nl> + / / Flags : - - stack - size = 100 - - turbo - deoptimization <nl> <nl> var a = [ ] ; <nl> <nl> mmm a / test / unittests / compiler / js - operator - unittest . cc <nl> ppp b / test / unittests / compiler / js - operator - unittest . cc <nl> const SharedOperator kSharedOperators [ ] = { <nl> SHARED ( ToNumber , Operator : : kNoProperties , 1 , 0 , 1 , 1 , 1 , 1 ) , <nl> SHARED ( ToString , Operator : : kNoProperties , 1 , 0 , 1 , 1 , 1 , 1 ) , <nl> SHARED ( ToName , Operator : : kNoProperties , 1 , 0 , 1 , 1 , 1 , 1 ) , <nl> - SHARED ( ToObject , Operator : : kNoProperties , 1 , 0 , 1 , 1 , 1 , 1 ) , <nl> + SHARED ( ToObject , Operator : : kNoProperties , 1 , 1 , 1 , 1 , 1 , 1 ) , <nl> SHARED ( Yield , Operator : : kNoProperties , 1 , 0 , 1 , 1 , 1 , 1 ) , <nl> SHARED ( Create , Operator : : kEliminatable , 0 , 0 , 1 , 0 , 1 , 1 ) , <nl> - SHARED ( HasProperty , Operator : : kNoProperties , 2 , 0 , 1 , 1 , 1 , 1 ) , <nl> + SHARED ( HasProperty , Operator : : kNoProperties , 2 , 1 , 1 , 1 , 1 , 1 ) , <nl> SHARED ( TypeOf , Operator : : kPure , 1 , 0 , 0 , 0 , 1 , 0 ) , <nl> - SHARED ( InstanceOf , Operator : : kNoProperties , 2 , 0 , 1 , 1 , 1 , 1 ) , <nl> + SHARED ( InstanceOf , Operator : : kNoProperties , 2 , 1 , 1 , 1 , 1 , 1 ) , <nl> SHARED ( Debugger , Operator : : kNoProperties , 0 , 0 , 1 , 1 , 0 , 1 ) , <nl> SHARED ( CreateFunctionContext , Operator : : kNoProperties , 1 , 0 , 1 , 1 , 1 , 1 ) , <nl> SHARED ( CreateWithContext , Operator : : kNoProperties , 2 , 0 , 1 , 1 , 1 , 1 ) , <nl>
Add more missing deopts
v8/v8
23df66ee24abb502fbb68ef43fef6161ba8af036
2014-10-26T10:25:48Z
mmm a / modules / core / include / opencv2 / core / cuda / common . hpp <nl> ppp b / modules / core / include / opencv2 / core / cuda / common . hpp <nl> namespace cv { namespace cuda <nl> cudaChannelFormatDesc desc = cudaCreateChannelDesc < T > ( ) ; <nl> cudaSafeCall ( cudaBindTexture2D ( 0 , tex , img . ptr ( ) , & desc , img . cols , img . rows , img . step ) ) ; <nl> } <nl> + <nl> + template < class T > inline void createTextureObjectPitch2D ( cudaTextureObject_t * tex , PtrStepSz < T > & img , const cudaTextureDesc & texDesc ) <nl> + { <nl> + cudaResourceDesc resDesc ; <nl> + memset ( & resDesc , 0 , sizeof ( resDesc ) ) ; <nl> + resDesc . resType = cudaResourceTypePitch2D ; <nl> + resDesc . res . pitch2D . devPtr = static_cast < void * > ( img . ptr ( ) ) ; <nl> + resDesc . res . pitch2D . height = img . rows ; <nl> + resDesc . res . pitch2D . width = img . cols ; <nl> + resDesc . res . pitch2D . pitchInBytes = img . step ; <nl> + resDesc . res . pitch2D . desc = cudaCreateChannelDesc < T > ( ) ; <nl> + <nl> + cudaSafeCall ( cudaCreateTextureObject ( tex , & resDesc , & texDesc , NULL ) ) ; <nl> + } <nl> } <nl> } } <nl> <nl> mmm a / modules / cudaimgproc / src / cuda / canny . cu <nl> ppp b / modules / cudaimgproc / src / cuda / canny . cu <nl> namespace cv { namespace cuda { namespace device <nl> <nl> namespace canny <nl> { <nl> - texture < uchar , cudaTextureType2D , cudaReadModeElementType > tex_src ( false , cudaFilterModePoint , cudaAddressModeClamp ) ; <nl> struct SrcTex <nl> { <nl> + virtual ~ SrcTex ( ) { } <nl> + <nl> + __host__ SrcTex ( int _xoff , int _yoff ) : xoff ( _xoff ) , yoff ( _yoff ) { } <nl> + <nl> + __device__ __forceinline__ virtual int operator ( ) ( int y , int x ) const = 0 ; <nl> + <nl> int xoff ; <nl> int yoff ; <nl> - __host__ SrcTex ( int _xoff , int _yoff ) : xoff ( _xoff ) , yoff ( _yoff ) { } <nl> + } ; <nl> + <nl> + texture < uchar , cudaTextureType2D , cudaReadModeElementType > tex_src ( false , cudaFilterModePoint , cudaAddressModeClamp ) ; <nl> + struct SrcTexRef : SrcTex <nl> + { <nl> + __host__ SrcTexRef ( int _xoff , int _yoff ) : SrcTex ( _xoff , _yoff ) { } <nl> <nl> - __device__ __forceinline__ int operator ( ) ( int y , int x ) const <nl> + __device__ __forceinline__ int operator ( ) ( int y , int x ) const override <nl> { <nl> return tex2D ( tex_src , x + xoff , y + yoff ) ; <nl> } <nl> } ; <nl> <nl> - struct SrcTexObject <nl> + struct SrcTexObj : SrcTex <nl> { <nl> - int xoff ; <nl> - int yoff ; <nl> - cudaTextureObject_t tex_src_object ; <nl> - __host__ SrcTexObject ( int _xoff , int _yoff , cudaTextureObject_t _tex_src_object ) : xoff ( _xoff ) , yoff ( _yoff ) , tex_src_object ( _tex_src_object ) { } <nl> + __host__ SrcTexObj ( int _xoff , int _yoff , cudaTextureObject_t _tex_src_object ) : SrcTex ( _xoff , _yoff ) , tex_src_object ( _tex_src_object ) { } <nl> <nl> - __device__ __forceinline__ int operator ( ) ( int y , int x ) const <nl> + __device__ __forceinline__ int operator ( ) ( int y , int x ) const override <nl> { <nl> return tex2D < uchar > ( tex_src_object , x + xoff , y + yoff ) ; <nl> } <nl> <nl> + cudaTextureObject_t tex_src_object ; <nl> } ; <nl> <nl> - template < class Norm > __global__ <nl> - void calcMagnitudeKernel ( const SrcTex src , PtrStepi dx , PtrStepi dy , PtrStepSzf mag , const Norm norm ) <nl> - { <nl> - const int x = blockIdx . x * blockDim . x + threadIdx . x ; <nl> - const int y = blockIdx . y * blockDim . y + threadIdx . y ; <nl> - <nl> - if ( y > = mag . rows | | x > = mag . cols ) <nl> - return ; <nl> - <nl> - int dxVal = ( src ( y - 1 , x + 1 ) + 2 * src ( y , x + 1 ) + src ( y + 1 , x + 1 ) ) - ( src ( y - 1 , x - 1 ) + 2 * src ( y , x - 1 ) + src ( y + 1 , x - 1 ) ) ; <nl> - int dyVal = ( src ( y + 1 , x - 1 ) + 2 * src ( y + 1 , x ) + src ( y + 1 , x + 1 ) ) - ( src ( y - 1 , x - 1 ) + 2 * src ( y - 1 , x ) + src ( y - 1 , x + 1 ) ) ; <nl> - <nl> - dx ( y , x ) = dxVal ; <nl> - dy ( y , x ) = dyVal ; <nl> - <nl> - mag ( y , x ) = norm ( dxVal , dyVal ) ; <nl> - } <nl> - <nl> - template < class Norm > __global__ <nl> - void calcMagnitudeKernel ( const SrcTexObject src , PtrStepi dx , PtrStepi dy , PtrStepSzf mag , const Norm norm ) <nl> + template < <nl> + class T , <nl> + class Norm , <nl> + typename = std : : enable_if_t < std : : is_base_of < SrcTex , T > : : value > <nl> + > <nl> + __global__ void calcMagnitudeKernel ( const T src , PtrStepi dx , PtrStepi dy , PtrStepSzf mag , const Norm norm ) <nl> { <nl> const int x = blockIdx . x * blockDim . x + threadIdx . x ; <nl> const int y = blockIdx . y * blockDim . y + threadIdx . y ; <nl> namespace canny <nl> <nl> if ( cc30 ) <nl> { <nl> - cudaResourceDesc resDesc ; <nl> - memset ( & resDesc , 0 , sizeof ( resDesc ) ) ; <nl> - resDesc . resType = cudaResourceTypePitch2D ; <nl> - resDesc . res . pitch2D . devPtr = srcWhole . ptr ( ) ; <nl> - resDesc . res . pitch2D . height = srcWhole . rows ; <nl> - resDesc . res . pitch2D . width = srcWhole . cols ; <nl> - resDesc . res . pitch2D . pitchInBytes = srcWhole . step ; <nl> - resDesc . res . pitch2D . desc = cudaCreateChannelDesc < uchar > ( ) ; <nl> - <nl> cudaTextureDesc texDesc ; <nl> memset ( & texDesc , 0 , sizeof ( texDesc ) ) ; <nl> texDesc . addressMode [ 0 ] = cudaAddressModeClamp ; <nl> namespace canny <nl> texDesc . addressMode [ 2 ] = cudaAddressModeClamp ; <nl> <nl> cudaTextureObject_t tex = 0 ; <nl> - cudaCreateTextureObject ( & tex , & resDesc , & texDesc , NULL ) ; <nl> + createTextureObjectPitch2D ( & tex , srcWhole , texDesc ) ; <nl> <nl> - SrcTexObject src ( xoff , yoff , tex ) ; <nl> + SrcTexObj src ( xoff , yoff , tex ) ; <nl> <nl> if ( L2Grad ) <nl> { <nl> namespace canny <nl> else <nl> { <nl> bindTexture ( & tex_src , srcWhole ) ; <nl> - SrcTex src ( xoff , yoff ) ; <nl> + SrcTexRef src ( xoff , yoff ) ; <nl> <nl> if ( L2Grad ) <nl> { <nl> mmm a / modules / cudaimgproc / test / test_canny . cpp <nl> ppp b / modules / cudaimgproc / test / test_canny . cpp <nl> class CannyAsyncParallelLoopBody : public cv : : ParallelLoopBody <nl> bool useL2gradient ; <nl> } ; <nl> <nl> - # define NUM_STREAMS 64 <nl> + # define NUM_STREAMS 128 <nl> <nl> CUDA_TEST_P ( Canny , Async ) <nl> { <nl> mmm a / modules / cudaoptflow / src / cuda / tvl1flow . cu <nl> ppp b / modules / cudaoptflow / src / cuda / tvl1flow . cu <nl> <nl> # include " opencv2 / core / cuda / common . hpp " <nl> # include " opencv2 / core / cuda / border_interpolate . hpp " <nl> # include " opencv2 / core / cuda / limits . hpp " <nl> + # include " opencv2 / core / cuda . hpp " <nl> <nl> using namespace cv : : cuda ; <nl> using namespace cv : : cuda : : device ; <nl> namespace tvl1flow <nl> } <nl> } <nl> <nl> + struct SrcTex <nl> + { <nl> + virtual ~ SrcTex ( ) { } <nl> + <nl> + __device__ __forceinline__ virtual float I1 ( float x , float y ) const = 0 ; <nl> + __device__ __forceinline__ virtual float I1x ( float x , float y ) const = 0 ; <nl> + __device__ __forceinline__ virtual float I1y ( float x , float y ) const = 0 ; <nl> + } ; <nl> + <nl> texture < float , cudaTextureType2D , cudaReadModeElementType > tex_I1 ( false , cudaFilterModePoint , cudaAddressModeClamp ) ; <nl> texture < float , cudaTextureType2D , cudaReadModeElementType > tex_I1x ( false , cudaFilterModePoint , cudaAddressModeClamp ) ; <nl> texture < float , cudaTextureType2D , cudaReadModeElementType > tex_I1y ( false , cudaFilterModePoint , cudaAddressModeClamp ) ; <nl> + struct SrcTexRef : SrcTex <nl> + { <nl> + __device__ __forceinline__ float I1 ( float x , float y ) const override <nl> + { <nl> + return tex2D ( tex_I1 , x , y ) ; <nl> + } <nl> + __device__ __forceinline__ float I1x ( float x , float y ) const override <nl> + { <nl> + return tex2D ( tex_I1x , x , y ) ; <nl> + } <nl> + __device__ __forceinline__ float I1y ( float x , float y ) const override <nl> + { <nl> + return tex2D ( tex_I1y , x , y ) ; <nl> + } <nl> + } ; <nl> + <nl> + struct SrcTexObj : SrcTex <nl> + { <nl> + __host__ SrcTexObj ( cudaTextureObject_t tex_obj_I1_ , cudaTextureObject_t tex_obj_I1x_ , cudaTextureObject_t tex_obj_I1y_ ) <nl> + : tex_obj_I1 ( tex_obj_I1_ ) , tex_obj_I1x ( tex_obj_I1x_ ) , tex_obj_I1y ( tex_obj_I1y_ ) { } <nl> + <nl> + __device__ __forceinline__ float I1 ( float x , float y ) const override <nl> + { <nl> + return tex2D < float > ( tex_obj_I1 , x , y ) ; <nl> + } <nl> + __device__ __forceinline__ float I1x ( float x , float y ) const override <nl> + { <nl> + return tex2D < float > ( tex_obj_I1x , x , y ) ; <nl> + } <nl> + __device__ __forceinline__ float I1y ( float x , float y ) const override <nl> + { <nl> + return tex2D < float > ( tex_obj_I1y , x , y ) ; <nl> + } <nl> <nl> - __global__ void warpBackwardKernel ( const PtrStepSzf I0 , const PtrStepf u1 , const PtrStepf u2 , PtrStepf I1w , PtrStepf I1wx , PtrStepf I1wy , PtrStepf grad , PtrStepf rho ) <nl> + cudaTextureObject_t tex_obj_I1 ; <nl> + cudaTextureObject_t tex_obj_I1x ; <nl> + cudaTextureObject_t tex_obj_I1y ; <nl> + } ; <nl> + <nl> + template < <nl> + typename T , <nl> + typename = std : : enable_if_t < std : : is_base_of < SrcTex , T > : : value > <nl> + > <nl> + __global__ void warpBackwardKernel ( <nl> + const PtrStepSzf I0 , const T src , const PtrStepf u1 , const PtrStepf u2 , <nl> + PtrStepf I1w , PtrStepf I1wx , PtrStepf I1wy , PtrStepf grad , PtrStepf rho ) <nl> { <nl> const int x = blockIdx . x * blockDim . x + threadIdx . x ; <nl> const int y = blockIdx . y * blockDim . y + threadIdx . y ; <nl> namespace tvl1flow <nl> { <nl> const float w = bicubicCoeff ( wx - cx ) * bicubicCoeff ( wy - cy ) ; <nl> <nl> - sum + = w * tex2D ( tex_I1 , cx , cy ) ; <nl> - sumx + = w * tex2D ( tex_I1x , cx , cy ) ; <nl> - sumy + = w * tex2D ( tex_I1y , cx , cy ) ; <nl> + sum + = w * src . I1 ( cx , cy ) ; <nl> + sumx + = w * src . I1x ( cx , cy ) ; <nl> + sumy + = w * src . I1y ( cx , cy ) ; <nl> <nl> wsum + = w ; <nl> } <nl> namespace tvl1flow <nl> const dim3 block ( 32 , 8 ) ; <nl> const dim3 grid ( divUp ( I0 . cols , block . x ) , divUp ( I0 . rows , block . y ) ) ; <nl> <nl> - bindTexture ( & tex_I1 , I1 ) ; <nl> - bindTexture ( & tex_I1x , I1x ) ; <nl> - bindTexture ( & tex_I1y , I1y ) ; <nl> + bool cc30 = deviceSupports ( FEATURE_SET_COMPUTE_30 ) ; <nl> <nl> - warpBackwardKernel < < < grid , block , 0 , stream > > > ( I0 , u1 , u2 , I1w , I1wx , I1wy , grad , rho ) ; <nl> - cudaSafeCall ( cudaGetLastError ( ) ) ; <nl> + if ( cc30 ) <nl> + { <nl> + cudaTextureDesc texDesc ; <nl> + memset ( & texDesc , 0 , sizeof ( texDesc ) ) ; <nl> + texDesc . addressMode [ 0 ] = cudaAddressModeClamp ; <nl> + texDesc . addressMode [ 1 ] = cudaAddressModeClamp ; <nl> + texDesc . addressMode [ 2 ] = cudaAddressModeClamp ; <nl> <nl> - if ( ! stream ) <nl> - cudaSafeCall ( cudaDeviceSynchronize ( ) ) ; <nl> + cudaTextureObject_t texObj_I1 = 0 , texObj_I1x = 0 , texObj_I1y = 0 ; <nl> + <nl> + createTextureObjectPitch2D ( & texObj_I1 , I1 , texDesc ) ; <nl> + createTextureObjectPitch2D ( & texObj_I1x , I1x , texDesc ) ; <nl> + createTextureObjectPitch2D ( & texObj_I1y , I1y , texDesc ) ; <nl> + <nl> + warpBackwardKernel < < < grid , block , 0 , stream > > > ( I0 , SrcTexObj ( texObj_I1 , texObj_I1x , texObj_I1y ) , u1 , u2 , I1w , I1wx , I1wy , grad , rho ) ; <nl> + cudaSafeCall ( cudaGetLastError ( ) ) ; <nl> + <nl> + if ( ! stream ) <nl> + cudaSafeCall ( cudaDeviceSynchronize ( ) ) ; <nl> + else <nl> + cudaSafeCall ( cudaStreamSynchronize ( stream ) ) ; <nl> + <nl> + cudaSafeCall ( cudaDestroyTextureObject ( texObj_I1 ) ) ; <nl> + cudaSafeCall ( cudaDestroyTextureObject ( texObj_I1x ) ) ; <nl> + cudaSafeCall ( cudaDestroyTextureObject ( texObj_I1y ) ) ; <nl> + } <nl> + else <nl> + { <nl> + bindTexture ( & tex_I1 , I1 ) ; <nl> + bindTexture ( & tex_I1x , I1x ) ; <nl> + bindTexture ( & tex_I1y , I1y ) ; <nl> + <nl> + warpBackwardKernel < < < grid , block , 0 , stream > > > ( I0 , SrcTexRef ( ) , u1 , u2 , I1w , I1wx , I1wy , grad , rho ) ; <nl> + cudaSafeCall ( cudaGetLastError ( ) ) ; <nl> + <nl> + if ( ! stream ) <nl> + cudaSafeCall ( cudaDeviceSynchronize ( ) ) ; <nl> + } <nl> } <nl> } <nl> <nl> mmm a / modules / cudaoptflow / test / test_optflow . cpp <nl> ppp b / modules / cudaoptflow / test / test_optflow . cpp <nl> CUDA_TEST_P ( OpticalFlowDual_TVL1 , Accuracy ) <nl> EXPECT_MAT_SIMILAR ( flow , d_flow , 4e - 3 ) ; <nl> } <nl> <nl> + class TVL1AsyncParallelLoopBody : public cv : : ParallelLoopBody <nl> + { <nl> + public : <nl> + TVL1AsyncParallelLoopBody ( const cv : : cuda : : GpuMat & d_img1_ , const cv : : cuda : : GpuMat & d_img2_ , cv : : cuda : : GpuMat * d_flow_ , int iterations_ , double gamma_ ) <nl> + : d_img1 ( d_img1_ ) , d_img2 ( d_img2_ ) , d_flow ( d_flow_ ) , iterations ( iterations_ ) , gamma ( gamma_ ) { } <nl> + ~ TVL1AsyncParallelLoopBody ( ) { } <nl> + void operator ( ) ( const cv : : Range & r ) const <nl> + { <nl> + for ( int i = r . start ; i < r . end ; i + + ) { <nl> + cv : : cuda : : Stream stream ; <nl> + cv : : Ptr < cv : : cuda : : OpticalFlowDual_TVL1 > d_alg = cv : : cuda : : OpticalFlowDual_TVL1 : : create ( ) ; <nl> + d_alg - > setNumIterations ( iterations ) ; <nl> + d_alg - > setGamma ( gamma ) ; <nl> + d_alg - > calc ( d_img1 , d_img2 , d_flow [ i ] , stream ) ; <nl> + stream . waitForCompletion ( ) ; <nl> + } <nl> + } <nl> + protected : <nl> + const cv : : cuda : : GpuMat & d_img1 ; <nl> + const cv : : cuda : : GpuMat & d_img2 ; <nl> + cv : : cuda : : GpuMat * d_flow ; <nl> + int iterations ; <nl> + double gamma ; <nl> + } ; <nl> + <nl> + # define NUM_STREAMS 16 <nl> + <nl> + CUDA_TEST_P ( OpticalFlowDual_TVL1 , Async ) <nl> + { <nl> + if ( ! supportFeature ( devInfo , cv : : cuda : : FEATURE_SET_COMPUTE_30 ) ) <nl> + { <nl> + throw SkipTestException ( " CUDA device doesn ' t support texture objects " ) ; <nl> + } <nl> + else <nl> + { <nl> + cv : : Mat frame0 = readImage ( " opticalflow / rubberwhale1 . png " , cv : : IMREAD_GRAYSCALE ) ; <nl> + ASSERT_FALSE ( frame0 . empty ( ) ) ; <nl> + <nl> + cv : : Mat frame1 = readImage ( " opticalflow / rubberwhale2 . png " , cv : : IMREAD_GRAYSCALE ) ; <nl> + ASSERT_FALSE ( frame1 . empty ( ) ) ; <nl> + <nl> + const int iterations = 10 ; <nl> + <nl> + / / Synchronous call <nl> + cv : : Ptr < cv : : cuda : : OpticalFlowDual_TVL1 > d_alg = <nl> + cv : : cuda : : OpticalFlowDual_TVL1 : : create ( ) ; <nl> + d_alg - > setNumIterations ( iterations ) ; <nl> + d_alg - > setGamma ( gamma ) ; <nl> + <nl> + cv : : cuda : : GpuMat d_flow_gold ; <nl> + d_alg - > calc ( loadMat ( frame0 ) , loadMat ( frame1 ) , d_flow_gold ) ; <nl> + <nl> + / / Asynchronous call <nl> + cv : : cuda : : GpuMat d_flow [ NUM_STREAMS ] ; <nl> + cv : : parallel_for_ ( cv : : Range ( 0 , NUM_STREAMS ) , TVL1AsyncParallelLoopBody ( loadMat ( frame0 ) , loadMat ( frame1 ) , d_flow , iterations , gamma ) ) ; <nl> + <nl> + / / Compare the results of synchronous call and asynchronous call <nl> + for ( int i = 0 ; i < NUM_STREAMS ; i + + ) <nl> + EXPECT_MAT_NEAR ( d_flow_gold , d_flow [ i ] , 0 . 0 ) ; <nl> + } <nl> + } <nl> + <nl> INSTANTIATE_TEST_CASE_P ( CUDA_OptFlow , OpticalFlowDual_TVL1 , testing : : Combine ( <nl> ALL_DEVICES , <nl> testing : : Values ( Gamma ( 0 . 0 ) , Gamma ( 1 . 0 ) ) ) ) ; <nl> <nl> - <nl> } } / / namespace <nl> # endif / / HAVE_CUDA <nl>
Merge pull request from nglee : dev_optFlowTVL1Async
opencv/opencv
9755ab160d94f4ad2a672653cf657ad421d46837
2020-06-16T20:06:56Z
mmm a / src / base / http / server . cpp <nl> ppp b / src / base / http / server . cpp <nl> Server : : ~ Server ( ) <nl> } <nl> <nl> # ifndef QT_NO_OPENSSL <nl> - void Server : : enableHttps ( const QSslCertificate & certificate , const QSslKey & key ) <nl> + void Server : : enableHttps ( const QList < QSslCertificate > & certificates , const QSslKey & key ) <nl> { <nl> - m_certificate = certificate ; <nl> + m_certificates = certificates ; <nl> m_key = key ; <nl> m_https = true ; <nl> } <nl> void Server : : enableHttps ( const QSslCertificate & certificate , const QSslKey & key ) <nl> void Server : : disableHttps ( ) <nl> { <nl> m_https = false ; <nl> - m_certificate . clear ( ) ; <nl> + m_certificates . clear ( ) ; <nl> m_key . clear ( ) ; <nl> } <nl> # endif <nl> void Server : : incomingConnection ( int socketDescriptor ) <nl> if ( serverSocket - > setSocketDescriptor ( socketDescriptor ) ) { <nl> # ifndef QT_NO_OPENSSL <nl> if ( m_https ) { <nl> - static_cast < QSslSocket * > ( serverSocket ) - > setProtocol ( QSsl : : AnyProtocol ) ; <nl> + static_cast < QSslSocket * > ( serverSocket ) - > setProtocol ( QSsl : : SecureProtocols ) ; <nl> static_cast < QSslSocket * > ( serverSocket ) - > setPrivateKey ( m_key ) ; <nl> - static_cast < QSslSocket * > ( serverSocket ) - > setLocalCertificate ( m_certificate ) ; <nl> + # ifdef QBT_USES_QT5 <nl> + static_cast < QSslSocket * > ( serverSocket ) - > setLocalCertificateChain ( m_certificates ) ; <nl> + # else <nl> + static_cast < QSslSocket * > ( serverSocket ) - > setLocalCertificate ( m_certificates . first ( ) ) ; <nl> + # endif <nl> static_cast < QSslSocket * > ( serverSocket ) - > startServerEncryption ( ) ; <nl> } <nl> # endif <nl> mmm a / src / base / http / server . h <nl> ppp b / src / base / http / server . h <nl> namespace Http <nl> ~ Server ( ) ; <nl> <nl> # ifndef QT_NO_OPENSSL <nl> - void enableHttps ( const QSslCertificate & certificate , const QSslKey & key ) ; <nl> + void enableHttps ( const QList < QSslCertificate > & certificates , const QSslKey & key ) ; <nl> void disableHttps ( ) ; <nl> # endif <nl> <nl> namespace Http <nl> IRequestHandler * m_requestHandler ; <nl> # ifndef QT_NO_OPENSSL <nl> bool m_https ; <nl> - QSslCertificate m_certificate ; <nl> + QList < QSslCertificate > m_certificates ; <nl> QSslKey m_key ; <nl> # endif <nl> } ; <nl> mmm a / src / webui / webui . cpp <nl> ppp b / src / webui / webui . cpp <nl> void WebUI : : init ( ) <nl> <nl> # ifndef QT_NO_OPENSSL <nl> if ( pref - > isWebUiHttpsEnabled ( ) ) { <nl> - QSslCertificate cert ( pref - > getWebUiHttpsCertificate ( ) ) ; <nl> + QList < QSslCertificate > certs = QSslCertificate : : fromData ( pref - > getWebUiHttpsCertificate ( ) ) ; <nl> QSslKey key ; <nl> key = QSslKey ( pref - > getWebUiHttpsKey ( ) , QSsl : : Rsa ) ; <nl> - if ( ! cert . isNull ( ) & & ! key . isNull ( ) ) <nl> - httpServer_ - > enableHttps ( cert , key ) ; <nl> + bool certsIsNull = std : : any_of ( certs . begin ( ) , certs . end ( ) , [ ] ( QSslCertificate c ) { return c . isNull ( ) ; } ) ; <nl> + if ( ! certsIsNull & & ! certs . empty ( ) & & ! key . isNull ( ) ) <nl> + httpServer_ - > enableHttps ( certs , key ) ; <nl> else <nl> httpServer_ - > disableHttps ( ) ; <nl> } <nl>
Support SSL certificate bundles . Issue .
qbittorrent/qBittorrent
f50a8d4f59d12f58cd64bc48b2f43b38418221bb
2016-03-05T19:10:28Z
mmm a / Documentation / Books / Users / SUMMARY . md <nl> ppp b / Documentation / Books / Users / SUMMARY . md <nl> <nl> * [ Example Data ] ( Graphs / Traversals / ExampleData . md ) <nl> * [ Working with Edges ] ( Graphs / Edges / README . md ) <nl> # <nl> - # Will be replaced by new FOTF docs <nl> + # Foxx <nl> + # <nl> * [ Foxx Microservices ] ( Foxx / README . md ) <nl> - * [ In a nutshell ] ( Foxx / Nutshell / README . md ) <nl> - * [ Install ] ( Foxx / Install / README . md ) <nl> - * [ Github ] ( Foxx / Install / Github . md ) <nl> - * [ Store ] ( Foxx / Install / Store . md ) <nl> - * [ Local ] ( Foxx / Install / Local . md ) <nl> - * [ Remote ] ( Foxx / Install / Remote . md ) <nl> - * [ Generate ] ( Foxx / Install / Generate . md ) <nl> - * [ Development ] ( Foxx / Develop / README . md ) <nl> - * [ Dev - Mode ] ( Foxx / Develop / Developmentmode . md ) <nl> - * [ Debugging ] ( Foxx / Develop / Debugging . md ) <nl> - * [ Source Files ] ( Foxx / Develop / Folder . md ) <nl> - * [ Controller ] ( Foxx / Develop / Controller . md ) <nl> - * [ Scripts ] ( Foxx / Develop / Scripts . md ) <nl> - * [ Model ] ( Foxx / Develop / Model . md ) <nl> - * [ Repository ] ( Foxx / Develop / Repository . md ) <nl> - * [ Queries ] ( Foxx / Develop / Queries . md ) <nl> - * [ Sessions ] ( Foxx / Develop / Sessions . md ) <nl> - * [ Background Tasks ] ( Foxx / Develop / Queues . md ) <nl> - * [ Console API ] ( Foxx / Develop / Console . md ) <nl> - * [ Meta information ] ( Foxx / Develop / Manifest . md ) <nl> - * [ Exports ] ( Foxx / Develop / Exports . md ) <nl> - * [ Documentation ] ( Foxx / Develop / ApiDocumentation . md ) <nl> - * [ Production ] ( Foxx / Production / README . md ) <nl> - * [ Prod - Mode ] ( Foxx / Production / Productionmode . md ) <nl> - * [ Debugging ] ( Foxx / Production / Debugging . md ) <nl> - * [ New Versions ] ( Foxx / Production / Upgrade . md ) <nl> - * [ Cluster ] ( Foxx / Cluster / README . md ) <nl> - * [ Install ] ( Foxx / Cluster / Install . md ) <nl> - * [ Setup & Teardown ] ( Foxx / Cluster / Scripts . md ) <nl> + * [ Getting started ] ( Foxx / GettingStarted . md ) <nl> + * [ Service manifest ] ( Foxx / Manifest . md ) <nl> + * [ Service context ] ( Foxx / Context . md ) <nl> + * [ Configuration ] ( Foxx / Configuration . md ) <nl> + * [ Dependencies ] ( Foxx / Dependencies . md ) <nl> + * [ Routing ] ( Foxx / Router / README . md ) <nl> + * [ Routers ] ( Foxx / Router / Routers . md ) <nl> + * [ Endpoints ] ( Foxx / Router / Endpoints . md ) <nl> + * [ Middleware ] ( Foxx / Router / Middleware . md ) <nl> + * [ Request ] ( Foxx / Router / Request . md ) <nl> + * [ Response ] ( Foxx / Router / Response . md ) <nl> + * [ Sessions middleware ] ( Foxx / Sessions / README . md ) <nl> + * [ Session storages ] ( Foxx / Sessions / Storages / README . md ) <nl> + * [ Collection storage ] ( Foxx / Sessions / Storages / Collection . md ) <nl> + * [ JWT storage ] ( Foxx / Sessions / Storages / JWT . md ) <nl> + * [ Session transports ] ( Foxx / Sessions / Transports / README . md ) <nl> + * [ Cookie transport ] ( Foxx / Sessions / Transports / Cookie . md ) <nl> + * [ Header transport ] ( Foxx / Sessions / Transports / Header . md ) <nl> + * [ Serving files ] ( Foxx / Assets . md ) <nl> + * [ Writing tests ] ( Foxx / Testing . md ) <nl> + * [ Scripts and queued jobs ] ( Foxx / Scripts . md ) <nl> + * [ Legacy mode for 2 . x ] ( Foxx / LegacyMode . md ) <nl> + * [ Related modules ] ( Foxx / Modules . md ) <nl> + * [ Authentication ] ( Foxx / Auth . md ) <nl> + * [ OAuth 2 . 0 ] ( Foxx / OAuth2 . md ) <nl> * [ Transactions ] ( Transactions / README . md ) <nl> * [ Transaction invocation ] ( Transactions / TransactionInvocation . md ) <nl> * [ Passing parameters ] ( Transactions / Passing . md ) <nl>
Add new Foxx index
arangodb/arangodb
36b1f92057cb27b37f3d0ede2a8aa55c5c1f0324
2016-05-18T13:36:01Z
mmm a / jstests / core / txns / prepare_conflict . js <nl> ppp b / jstests / core / txns / prepare_conflict . js <nl> <nl> / * * <nl> * Tests that prepare conflicts for prepared transactions are retried . <nl> - * We use a failpoint after the prepare command to pause and test document visibility . <nl> - * <nl> - * TODO : At this point , prepare is only able to abort after transactions . This tests assumes the <nl> - * completion of a prepare operation results in an unmodified state . <nl> * <nl> * @ tags : [ uses_transactions ] <nl> * / <nl> ( function ( ) { <nl> " use strict " ; <nl> - let replSet = new ReplSetTest ( { <nl> - name : " prepareReadConflicts " , <nl> - nodes : 3 , <nl> - } ) ; <nl> - <nl> - replSet . startSet ( ) ; <nl> - replSet . initiate ( ) ; <nl> - replSet . awaitSecondaryNodes ( ) ; <nl> <nl> - const collName = " prepare_read_conflict " ; <nl> - let testDB = replSet . getPrimary ( ) . getDB ( " test " ) ; <nl> - let adminDB = replSet . getPrimary ( ) . getDB ( " admin " ) ; <nl> - let testColl = testDB . getCollection ( collName ) ; <nl> + const dbName = " test " ; <nl> + const collName = " prepare_conflict " ; <nl> + const testDB = db . getSiblingDB ( dbName ) ; <nl> + const testColl = testDB . getCollection ( collName ) ; <nl> <nl> testColl . drop ( ) ; <nl> assert . commandWorked ( testDB . runCommand ( { create : collName , writeConcern : { w : " majority " } } ) ) ; <nl> <nl> - / / Starts a session , does an update to a document , prepares the transaction , pauses from the set <nl> - / / failpoint , then aborts when the failpoint is unset . <nl> - / / The update operation increments ' x ' by one on the document ' doc ' . <nl> - function doUpdateTransactionPrepare ( conn , query , update , txn ) { <nl> - TestData . collName = collName ; <nl> - TestData . query = query ; <nl> - TestData . update = update ; <nl> - TestData . txnNumber = txn ; <nl> - let shellFn = function ( ) { <nl> - / / Create the session . <nl> - var session = db . getMongo ( ) . startSession ( { causalConsistency : false } ) ; <nl> - var sessionDB = session . getDatabase ( ' test ' ) ; <nl> - / / Update , but don ' t autocommit <nl> - assert . commandWorked ( sessionDB . runCommand ( { <nl> - update : TestData . collName , <nl> - updates : [ { q : TestData . query , u : TestData . update } ] , <nl> - txnNumber : NumberLong ( TestData . txnNumber ) , <nl> - readConcern : { level : ' snapshot ' } , <nl> - autocommit : false , <nl> - startTransaction : true <nl> - } ) ) ; <nl> - / / Run prepare , which blocks until the failpoint is unset . <nl> - assert . commandWorked ( sessionDB . adminCommand ( { <nl> - prepareTransaction : 1 , <nl> - txnNumber : NumberLong ( TestData . txnNumber ) , <nl> - autocommit : false <nl> - } ) ) ; <nl> - } ; <nl> - <nl> - return startParallelShell ( shellFn , conn . port ) ; <nl> - } <nl> - <nl> - / / Read until a prepare conflict is encountered <nl> - function waitForPrepareConflict ( conn , filter ) { <nl> - assert . soon ( function ( ) { <nl> - let res = testDB . runCommand ( { find : collName , filter : filter , maxTimeMS : 1000 } ) ; <nl> - <nl> - / / Do a short sleep if there is no error . <nl> - if ( res . ok ) { <nl> - sleep ( 10 ) ; <nl> - return false ; <nl> + function assertPrepareConflict ( filter ) { <nl> + assert . commandFailedWithCode ( <nl> + testDB . runCommand ( { find : collName , filter : filter , maxTimeMS : 1000 } ) , <nl> + ErrorCodes . ExceededTimeLimit ) ; <nl> + <nl> + let prepareConflicted = false ; <nl> + const cur = <nl> + testDB . system . profile . find ( { " ns " : testColl . getFullName ( ) , " command . filter " : filter } ) ; <nl> + while ( cur . hasNext ( ) ) { <nl> + const n = cur . next ( ) ; <nl> + print ( " op : " + JSON . stringify ( n ) ) ; <nl> + if ( n . prepareReadConflicts > 0 ) { <nl> + prepareConflicted = true ; <nl> } <nl> - <nl> - / / The profiler should log a prepare read conflict when the query times out . <nl> - let cur = <nl> - testDB . system . profile . find ( { " ns " : " test . " + collName , " command . filter " : filter } ) ; <nl> - while ( cur . hasNext ( ) ) { <nl> - let n = cur . next ( ) ; <nl> - print ( " op : " + JSON . stringify ( n ) ) ; <nl> - if ( n . prepareReadConflicts > 0 ) { <nl> - return true ; <nl> - } <nl> - } <nl> - <nl> - / / In this case the command failed but did not generate any prepare conflicts . <nl> - return false ; <nl> - } ) ; <nl> + } <nl> + assert ( prepareConflicted ) ; <nl> } <nl> <nl> / / Insert the document . <nl> const doc1 = { _id : 1 , x : 1 } ; <nl> - assert . writeOK ( testColl . insert ( doc1 ) ) ; <nl> + assert . commandWorked ( testColl . insert ( doc1 ) ) ; <nl> <nl> / / Enable the profiler to log slow queries . We expect a ' find ' to hang until the prepare <nl> / / conflict is resolved . <nl> - testDB . runCommand ( { profile : 1 , level : 1 , slowms : 100 } ) ; <nl> + assert . commandWorked ( testDB . runCommand ( { profile : 1 , level : 1 , slowms : 100 } ) ) ; <nl> <nl> - / / Enable the failpoint to pause after running prepare . <nl> - assert . commandWorked ( testDB . adminCommand ( <nl> - { configureFailPoint : ' pauseAfterTransactionPrepare ' , mode : ' alwaysOn ' } ) ) ; <nl> + const session = db . getMongo ( ) . startSession ( { causalConsistency : false } ) ; <nl> + const sessionDB = session . getDatabase ( dbName ) ; <nl> + session . startTransaction ( { readConcern : { level : " snapshot " } } ) ; <nl> + assert . commandWorked ( sessionDB . runCommand ( { <nl> + update : collName , <nl> + updates : [ { q : doc1 , u : { $ inc : { x : 1 } } } ] , <nl> + } ) ) ; <nl> <nl> - / / Start a parallel shell to update , prepare , and pause ; <nl> - const txnNumber = 0 ; <nl> - let prepareAwait = <nl> - doUpdateTransactionPrepare ( replSet . getPrimary ( ) , doc1 , { $ inc : { x : 1 } } , txnNumber ) ; <nl> - <nl> - waitForPrepareConflict ( replSet . getPrimary ( ) . conn , { _id : 1 } ) ; <nl> + assert . commandWorked ( sessionDB . adminCommand ( { prepareTransaction : 1 } ) ) ; <nl> + assertPrepareConflict ( { _id : 1 } ) ; <nl> <nl> / / At this point , we can guarantee all subsequent reads will conflict . Do a read in a parallel <nl> - / / shell , disable the failpoint , then ensure the read succeeded with the old document . <nl> + / / shell , abort the transaction , then ensure the read succeeded with the old document . <nl> TestData . collName = collName ; <nl> - let findAwait = startParallelShell ( function ( ) { <nl> - var it = db . getSiblingDB ( ' test ' ) . runCommand ( { find : TestData . collName , filter : { _id : 1 } } ) ; <nl> - } , replSet . getPrimary ( ) . port ) ; <nl> + TestData . dbName = dbName ; <nl> + const findAwait = startParallelShell ( function ( ) { <nl> + const it = db . getSiblingDB ( TestData . dbName ) <nl> + . runCommand ( { find : TestData . collName , filter : { _id : 1 } } ) ; <nl> + } , db . getMongo ( ) . port ) ; <nl> <nl> - / / Disable the failpoint to let the transaction proceed . <nl> - assert . commandWorked ( <nl> - testDB . adminCommand ( { configureFailPoint : ' pauseAfterTransactionPrepare ' , mode : ' off ' } ) ) ; <nl> + session . abortTransaction ( ) ; <nl> <nl> / / The find command should be successful . <nl> findAwait ( { checkExitSuccess : true } ) ; <nl> <nl> - / / Wait for prepare to exit successfully . <nl> - prepareAwait ( { checkExitSuccess : true } ) ; <nl> - <nl> - / / The document should be unmodified , because prepare does not yet commit . <nl> + / / The document should be unmodified , because we aborted . <nl> assert . eq ( doc1 , testColl . findOne ( doc1 ) ) ; <nl> - <nl> - replSet . stopSet ( ) ; <nl> } ) ( ) ; <nl> mmm a / jstests / core / txns / prepare_transaction . js <nl> ppp b / jstests / core / txns / prepare_transaction . js <nl> <nl> / * * <nl> * Tests prepared transaction support . <nl> - * The current stub for prepareTransaction prepares and immediately aborts . <nl> * <nl> * @ tags : [ uses_transactions ] <nl> * / <nl> ( function ( ) { <nl> " use strict " ; <nl> <nl> - let replSet = new ReplSetTest ( { <nl> - name : " prepareTransaction " , <nl> - nodes : 1 , <nl> - } ) ; <nl> - <nl> - replSet . startSet ( ) ; <nl> - replSet . initiate ( ) ; <nl> - replSet . awaitSecondaryNodes ( ) ; <nl> - <nl> - let collName = " prepare_txn " ; <nl> - let testDB = replSet . getPrimary ( ) . getDB ( " test " ) ; <nl> - let adminDB = replSet . getPrimary ( ) . getDB ( " admin " ) ; <nl> - let testColl = testDB . getCollection ( collName ) ; <nl> + const dbName = " test " ; <nl> + const collName = " prepare_transaction " ; <nl> + const testDB = db . getSiblingDB ( dbName ) ; <nl> + const testColl = testDB . getCollection ( collName ) ; <nl> <nl> testColl . drop ( ) ; <nl> assert . commandWorked ( testDB . runCommand ( { create : collName , writeConcern : { w : " majority " } } ) ) ; <nl> <nl> - var session = testDB . getMongo ( ) . startSession ( { causalConsistency : false } ) ; <nl> - let sessionDB = session . getDatabase ( " test " ) ; <nl> - let sessionColl = sessionDB . getCollection ( collName ) ; <nl> - var txnNumber = 0 ; <nl> + const session = db . getMongo ( ) . startSession ( { causalConsistency : false } ) ; <nl> + const sessionDB = session . getDatabase ( dbName ) ; <nl> + const sessionColl = sessionDB . getCollection ( collName ) ; <nl> + <nl> + const doc1 = { _id : 1 , x : 1 } ; <nl> <nl> - var doc1 = { _id : 1 , x : 1 } ; <nl> + / / mmm - Test 1 . Insert a single document and run prepare . mmm - <nl> <nl> - / / Test 1 . Insert a single document and run prepare . <nl> + session . startTransaction ( ) ; <nl> assert . commandWorked ( sessionDB . runCommand ( { <nl> insert : collName , <nl> documents : [ doc1 ] , <nl> - readConcern : { level : " snapshot " } , <nl> - txnNumber : NumberLong ( txnNumber ) , <nl> - startTransaction : true , <nl> - autocommit : false <nl> } ) ) ; <nl> - / / Should not be visible . <nl> + <nl> + / / Insert should not be visible outside the session . <nl> assert . eq ( null , testColl . findOne ( doc1 ) ) ; <nl> <nl> - / / Should be visible in this session . <nl> - let res = sessionDB . runCommand ( <nl> - { find : collName , filter : doc1 , txnNumber : NumberLong ( txnNumber ) , autocommit : false } ) ; <nl> - assert . commandWorked ( res ) ; <nl> - assert . docEq ( [ doc1 ] , res . cursor . firstBatch ) ; <nl> + / / Insert should be visible in this session . <nl> + assert . eq ( doc1 , sessionColl . findOne ( doc1 ) ) ; <nl> <nl> - / / Run prepare on the admin db , which immediately runs abort afterwards . <nl> - assert . commandWorked ( sessionDB . adminCommand ( <nl> - { prepareTransaction : 1 , txnNumber : NumberLong ( txnNumber ) , autocommit : false } ) ) ; <nl> + assert . commandWorked ( sessionDB . adminCommand ( { prepareTransaction : 1 } ) ) ; <nl> + session . abortTransaction ( ) ; <nl> <nl> - / / The insert should be visible in this session , but because the prepare command immediately <nl> - / / aborts afterwards , the transaction is rolled back and the insert is not visible . <nl> + / / After abort the insert is rolled back . <nl> assert . eq ( null , testColl . findOne ( doc1 ) ) ; <nl> <nl> - res = sessionDB . runCommand ( { find : collName , filter : doc1 } ) ; <nl> - assert . commandWorked ( res ) ; <nl> - assert . eq ( [ ] , res . cursor . firstBatch ) ; <nl> - <nl> - / / Test 2 . Update a document and run prepare . <nl> + / / mmm - Test 2 . Update a document and run prepare . mmm - <nl> <nl> / / Insert a document to update . <nl> assert . commandWorked ( <nl> testDB . runCommand ( { insert : collName , documents : [ doc1 ] , writeConcern : { w : " majority " } } ) ) ; <nl> <nl> - let doc2 = { _id : 1 , x : 2 } ; <nl> - txnNumber + + ; <nl> + session . startTransaction ( ) ; <nl> assert . commandWorked ( sessionDB . runCommand ( { <nl> update : collName , <nl> updates : [ { q : doc1 , u : { $ inc : { x : 1 } } } ] , <nl> - txnNumber : NumberLong ( txnNumber ) , <nl> - readConcern : { level : " snapshot " } , <nl> - startTransaction : true , <nl> - autocommit : false <nl> } ) ) ; <nl> <nl> - / / Should not be visible with default read concern . <nl> + const doc2 = { _id : 1 , x : 2 } ; <nl> + <nl> + / / Update should not be visible outside the session . <nl> assert . eq ( null , testColl . findOne ( doc2 ) ) ; <nl> <nl> - / / Should be visible in this session . <nl> - res = sessionDB . runCommand ( <nl> - { find : collName , filter : doc2 , txnNumber : NumberLong ( txnNumber ) , autocommit : false } ) ; <nl> - assert . commandWorked ( res ) ; <nl> - assert . docEq ( [ doc2 ] , res . cursor . firstBatch ) ; <nl> + / / Update should be visible in this session . <nl> + assert . eq ( doc2 , sessionColl . findOne ( doc2 ) ) ; <nl> <nl> - / / Run prepare , which immediately runs abort afterwards . <nl> - assert . commandWorked ( sessionDB . adminCommand ( <nl> - { prepareTransaction : 1 , txnNumber : NumberLong ( txnNumber ) , autocommit : false } ) ) ; <nl> + assert . commandWorked ( sessionDB . adminCommand ( { prepareTransaction : 1 } ) ) ; <nl> + session . abortTransaction ( ) ; <nl> <nl> - / / The update should be visible in this session , but because the prepare command immediately <nl> - / / aborts afterwards , the transaction is rolled back and the update is not visible . <nl> - res = sessionDB . runCommand ( { find : collName , filter : doc2 } ) ; <nl> - assert . commandWorked ( res ) ; <nl> - assert . eq ( [ ] , res . cursor . firstBatch ) ; <nl> + / / After abort the update is rolled back . <nl> + assert . eq ( doc1 , testColl . findOne ( { _id : 1 } ) ) ; <nl> <nl> - / / Test 3 . Delete a document and run prepare . <nl> + / / mmm - Test 3 . Delete a document and run prepare . mmm - <nl> <nl> / / Update the document . <nl> assert . commandWorked ( testDB . runCommand ( { <nl> <nl> writeConcern : { w : " majority " } <nl> } ) ) ; <nl> <nl> - txnNumber + + ; <nl> + session . startTransaction ( ) ; <nl> assert . commandWorked ( sessionDB . runCommand ( { <nl> delete : collName , <nl> deletes : [ { q : doc2 , limit : 1 } ] , <nl> - txnNumber : NumberLong ( txnNumber ) , <nl> - readConcern : { level : " snapshot " } , <nl> - startTransaction : true , <nl> - autocommit : false <nl> } ) ) ; <nl> <nl> - / / Should be visible with default read concern . <nl> + / / Delete should not be visible outside the session , so the document should be . <nl> assert . eq ( doc2 , testColl . findOne ( doc2 ) ) ; <nl> <nl> - / / Should not be visible in this session . <nl> - res = sessionDB . runCommand ( <nl> - { find : collName , filter : doc2 , txnNumber : NumberLong ( txnNumber ) , autocommit : false } ) ; <nl> - assert . commandWorked ( res ) ; <nl> - assert . docEq ( [ ] , res . cursor . firstBatch ) ; <nl> - <nl> - / / Run prepare . <nl> - assert . commandWorked ( sessionDB . adminCommand ( <nl> - { prepareTransaction : 1 , txnNumber : NumberLong ( txnNumber ) , autocommit : false } ) ) ; <nl> - <nl> - / / The delete should be visible in this session , but because the prepare command immediately <nl> - / / aborts afterwards , the transaction is rolled back and the document is still visible . <nl> - res = sessionDB . runCommand ( { find : collName , filter : doc2 } ) ; <nl> - assert . commandWorked ( res ) ; <nl> - assert . eq ( [ doc2 ] , res . cursor . firstBatch ) ; <nl> - replSet . stopSet ( ) ; <nl> + / / Document should not be visible in this session , since the delete should be visible . <nl> + assert . eq ( null , sessionColl . findOne ( doc2 ) ) ; <nl> + <nl> + assert . commandWorked ( sessionDB . adminCommand ( { prepareTransaction : 1 } ) ) ; <nl> + session . abortTransaction ( ) ; <nl> + <nl> + / / After abort the delete is rolled back . <nl> + assert . eq ( doc2 , testColl . findOne ( doc2 ) ) ; <nl> } ( ) ) ; <nl> mmm a / src / mongo / db / session . cpp <nl> ppp b / src / mongo / db / session . cpp <nl> void Session : : unstashTransactionResources ( OperationContext * opCtx , const std : : st <nl> MONGO_FAIL_POINT_PAUSE_WHILE_SET ( hangAfterPreallocateSnapshot ) ; <nl> } <nl> <nl> - MONGO_FAIL_POINT_DEFINE ( pauseAfterTransactionPrepare ) ; <nl> - <nl> void Session : : prepareTransaction ( OperationContext * opCtx ) { <nl> auto opObserver = opCtx - > getServiceContext ( ) - > getOpObserver ( ) ; <nl> invariant ( opObserver ) ; <nl> opObserver - > onTransactionPrepare ( opCtx ) ; <nl> <nl> - / / For testing purposes , this command prepares and immediately aborts the transaction , <nl> - / / Running commit after prepare is not allowed yet . <nl> - / / Prepared units of work cannot be released by the session , so we immediately abort here . <nl> opCtx - > getWriteUnitOfWork ( ) - > prepare ( ) ; <nl> - / / This failpoint will cause readers of prepared documents to return prepare conflicts . <nl> - MONGO_FAIL_POINT_PAUSE_WHILE_SET ( pauseAfterTransactionPrepare ) ; <nl> - abortActiveTransaction ( opCtx ) ; <nl> } <nl> <nl> void Session : : abortArbitraryTransaction ( ) { <nl> mmm a / src / mongo / db / storage / write_unit_of_work . cpp <nl> ppp b / src / mongo / db / storage / write_unit_of_work . cpp <nl> WriteUnitOfWork : : RecoveryUnitState WriteUnitOfWork : : release ( ) { <nl> invariant ( ruState = = RecoveryUnitState : : kActiveUnitOfWork | | <nl> ruState = = RecoveryUnitState : : kFailedUnitOfWork ) ; <nl> invariant ( ! _committed ) ; <nl> - invariant ( ! _prepared ) ; <nl> invariant ( _toplevel ) ; <nl> <nl> _released = true ; <nl>
SERVER - 35376 remove implicit abort on prepare transaction
mongodb/mongo
f6b6b6c7a9b8f06c7f1d9bf628ec575c1a2c2812
2018-06-18T21:37:28Z
mmm a / hphp / runtime / ext / ext_file . cpp <nl> ppp b / hphp / runtime / ext / ext_file . cpp <nl> <nl> # include < grp . h > <nl> # include < pwd . h > <nl> # include < fnmatch . h > <nl> + # include < boost / algorithm / string / predicate . hpp > <nl> # include < vector > <nl> <nl> # define CHECK_HANDLE_BASE ( handle , f , ret ) \ <nl> static bool check_error ( const char * function , int line , bool ret ) { <nl> } <nl> <nl> static int accessSyscall ( <nl> - const String & path , <nl> + const String & uri_or_path , <nl> int mode , <nl> bool useFileCache = false ) { <nl> - Stream : : Wrapper * w = Stream : : getWrapperFromURI ( path ) ; <nl> + Stream : : Wrapper * w = Stream : : getWrapperFromURI ( uri_or_path ) ; <nl> if ( ! w ) return - 1 ; <nl> + <nl> if ( useFileCache & & dynamic_cast < FileStreamWrapper * > ( w ) ) { <nl> + String path ( uri_or_path ) ; <nl> + if ( UNLIKELY ( boost : : istarts_with ( uri_or_path . data ( ) , " file : / / " ) ) ) { <nl> + path = uri_or_path . substr ( sizeof ( " file : / / " ) - 1 ) ; <nl> + } <nl> return : : access ( File : : TranslatePathWithFileCache ( path ) . data ( ) , mode ) ; <nl> } <nl> - return w - > access ( path , mode ) ; <nl> + return w - > access ( uri_or_path , mode ) ; <nl> } <nl> <nl> static int statSyscall ( <nl> mmm a / hphp / test / frameworks / results / mustache . expect <nl> ppp b / hphp / test / frameworks / results / mustache . expect <nl> Mustache_Test_Loader_CascadingLoaderTest : : testMissingTemplatesThrowExceptions <nl> Mustache_Test_Loader_FilesystemLoaderTest : : testConstructor <nl> . <nl> Mustache_Test_Loader_FilesystemLoaderTest : : testConstructorWithProtocol <nl> - E <nl> + . <nl> Mustache_Test_Loader_FilesystemLoaderTest : : testEmptyExtensionString <nl> . <nl> Mustache_Test_Loader_FilesystemLoaderTest : : testLoadTemplates <nl> new file mode 100644 <nl> index 00000000000 . . 46b217e5a0f <nl> mmm / dev / null <nl> ppp b / hphp / test / slow / streams / file_exists . php <nl> <nl> + < ? php <nl> + <nl> + $ fnam = __FILE__ ; <nl> + var_dump ( file_exists ( $ fnam ) ) ; <nl> + var_dump ( file_exists ( ' file : / / ' . $ fnam ) ) ; <nl> + var_dump ( file_exists ( ' file : / / ' . realpath ( $ fnam ) ) ) ; <nl> new file mode 100644 <nl> index 00000000000 . . 14c72c2736f <nl> mmm / dev / null <nl> ppp b / hphp / test / slow / streams / file_exists . php . expect <nl> <nl> + bool ( true ) <nl> + bool ( true ) <nl> + bool ( true ) <nl>
Fix file_exists ( ) and related functions for file : / / URIs
facebook/hhvm
5838505ceb9e73767e38a08cd3f1b3429c4ba0d2
2014-05-10T13:37:52Z
mmm a / src / main . h <nl> ppp b / src / main . h <nl> class CValidationState { <nl> unsigned char chRejectCode ; <nl> bool corruptionPossible ; <nl> public : <nl> - CValidationState ( ) : mode ( MODE_VALID ) , nDoS ( 0 ) { } <nl> + CValidationState ( ) : mode ( MODE_VALID ) , nDoS ( 0 ) , corruptionPossible ( false ) { } <nl> bool DoS ( int level , bool ret = false , <nl> unsigned char chRejectCodeIn = 0 , std : : string strRejectReasonIn = " " , <nl> bool corruptionIn = false ) { <nl>
Fix uninitialized variable added in b33b9a6fe
bitcoin/bitcoin
106f133de6bdb577c4135847fd703d08f525ba46
2013-11-26T00:51:07Z
mmm a / modules / core / src / hal_internal . cpp <nl> ppp b / modules / core / src / hal_internal . cpp <nl> lapack_gemm_c ( const fptype * src1 , size_t src1_step , const fptype * src2 , size_t s <nl> set_value ( ( std : : complex < fptype > * ) dst , lddst , std : : complex < fptype > ( 0 . 0 , 0 . 0 ) , d_m , d_n ) ; <nl> <nl> if ( typeid ( fptype ) = = typeid ( float ) ) <nl> - cblas_cgemm ( CblasRowMajor , transA , transB , a_m , d_n , a_n , & cAlpha , ( void * ) src1 , ldsrc1 , ( void * ) src2 , ldsrc2 , & cBeta , ( void * ) dst , lddst ) ; <nl> + cblas_cgemm ( CblasRowMajor , transA , transB , a_m , d_n , a_n , ( float * ) reinterpret_cast < fptype ( & ) [ 2 ] > ( cAlpha ) , ( float * ) src1 , ldsrc1 , ( float * ) src2 , ldsrc2 , ( float * ) reinterpret_cast < fptype ( & ) [ 2 ] > ( cBeta ) , ( float * ) dst , lddst ) ; <nl> else if ( typeid ( fptype ) = = typeid ( double ) ) <nl> - cblas_zgemm ( CblasRowMajor , transA , transB , a_m , d_n , a_n , & cAlpha , ( void * ) src1 , ldsrc1 , ( void * ) src2 , ldsrc2 , & cBeta , ( void * ) dst , lddst ) ; <nl> + cblas_zgemm ( CblasRowMajor , transA , transB , a_m , d_n , a_n , ( double * ) reinterpret_cast < fptype ( & ) [ 2 ] > ( cAlpha ) , ( double * ) src1 , ldsrc1 , ( double * ) src2 , ldsrc2 , ( double * ) reinterpret_cast < fptype ( & ) [ 2 ] > ( cBeta ) , ( double * ) dst , lddst ) ; <nl> <nl> return CV_HAL_ERROR_OK ; <nl> } <nl>
core : fix arguments types for cblas calls
opencv/opencv
b23527bf02d193cef9c6bc753851c5ab62c21d89
2016-06-30T17:25:08Z
mmm a / src / Interpreters / ClusterProxy / SelectStreamFactory . cpp <nl> ppp b / src / Interpreters / ClusterProxy / SelectStreamFactory . cpp <nl> QueryPipeline createLocalStream ( <nl> pipeline . addSimpleTransform ( [ & ] ( const Block & source_header ) <nl> { <nl> return std : : make_shared < ConvertingTransform > ( <nl> - source_header , header , ConvertingTransform : : MatchColumnsMode : : Name ) ; <nl> + source_header , header , ConvertingTransform : : MatchColumnsMode : : Name , true ) ; <nl> } ) ; <nl> <nl> / * * Materialization is needed , since from remote servers the constants come materialized . <nl> mmm a / src / Interpreters / InterpreterSelectQuery . cpp <nl> ppp b / src / Interpreters / InterpreterSelectQuery . cpp <nl> void InterpreterSelectQuery : : buildQueryPlan ( QueryPlan & query_plan ) <nl> / / / We must guarantee that result structure is the same as in getSampleBlock ( ) <nl> if ( ! blocksHaveEqualStructure ( query_plan . getCurrentDataStream ( ) . header , result_header ) ) <nl> { <nl> - auto converting = std : : make_unique < ConvertingStep > ( query_plan . getCurrentDataStream ( ) , result_header ) ; <nl> + auto converting = std : : make_unique < ConvertingStep > ( query_plan . getCurrentDataStream ( ) , result_header , true ) ; <nl> query_plan . addStep ( std : : move ( converting ) ) ; <nl> } <nl> } <nl> mmm a / src / Processors / QueryPlan / ConvertingStep . cpp <nl> ppp b / src / Processors / QueryPlan / ConvertingStep . cpp <nl> static ITransformingStep : : DataStreamTraits getTraits ( ) <nl> } ; <nl> } <nl> <nl> - ConvertingStep : : ConvertingStep ( const DataStream & input_stream_ , Block result_header_ ) <nl> + ConvertingStep : : ConvertingStep ( const DataStream & input_stream_ , Block result_header_ , bool ignore_constant_values_ ) <nl> : ITransformingStep ( input_stream_ , result_header_ , getTraits ( ) ) <nl> , result_header ( std : : move ( result_header_ ) ) <nl> + , ignore_constant_values ( ignore_constant_values_ ) <nl> { <nl> updateDistinctColumns ( output_stream - > header , output_stream - > distinct_columns ) ; <nl> } <nl> void ConvertingStep : : transformPipeline ( QueryPipeline & pipeline ) <nl> { <nl> pipeline . addSimpleTransform ( [ & ] ( const Block & header ) <nl> { <nl> - return std : : make_shared < ConvertingTransform > ( header , result_header , ConvertingTransform : : MatchColumnsMode : : Name ) ; <nl> + return std : : make_shared < ConvertingTransform > ( header , result_header , ConvertingTransform : : MatchColumnsMode : : Name , ignore_constant_values ) ; <nl> } ) ; <nl> } <nl> <nl> void ConvertingStep : : describeActions ( FormatSettings & settings ) const <nl> { <nl> const auto & header = input_streams [ 0 ] . header ; <nl> - auto conversion = ConvertingTransform ( header , result_header , ConvertingTransform : : MatchColumnsMode : : Name ) <nl> + auto conversion = ConvertingTransform ( header , result_header , ConvertingTransform : : MatchColumnsMode : : Name , ignore_constant_values ) <nl> . getConversion ( ) ; <nl> <nl> auto dump_description = [ & ] ( const ColumnWithTypeAndName & elem , bool is_const ) <nl> mmm a / src / Processors / QueryPlan / ConvertingStep . h <nl> ppp b / src / Processors / QueryPlan / ConvertingStep . h <nl> namespace DB <nl> class ConvertingStep : public ITransformingStep <nl> { <nl> public : <nl> - ConvertingStep ( const DataStream & input_stream_ , Block result_header_ ) ; <nl> + ConvertingStep ( const DataStream & input_stream_ , Block result_header_ , bool ignore_constant_values_ = false ) ; <nl> <nl> String getName ( ) const override { return " Converting " ; } <nl> <nl> class ConvertingStep : public ITransformingStep <nl> <nl> private : <nl> Block result_header ; <nl> + / / / Do not check that constants are same . Use value from result_header . <nl> + bool ignore_constant_values ; <nl> } ; <nl> <nl> } <nl> mmm a / src / Processors / Transforms / ConvertingTransform . cpp <nl> ppp b / src / Processors / Transforms / ConvertingTransform . cpp <nl> static ColumnPtr castColumnWithDiagnostic ( <nl> ConvertingTransform : : ConvertingTransform ( <nl> Block source_header_ , <nl> Block result_header_ , <nl> - MatchColumnsMode mode_ ) <nl> + MatchColumnsMode mode_ , <nl> + bool ignore_constant_values_ ) <nl> : ISimpleTransform ( std : : move ( source_header_ ) , std : : move ( result_header_ ) , false ) <nl> , conversion ( getOutputPort ( ) . getHeader ( ) . columns ( ) ) <nl> + , ignore_constant_values ( ignore_constant_values_ ) <nl> { <nl> const auto & source = getInputPort ( ) . getHeader ( ) ; <nl> const auto & result = getOutputPort ( ) . getHeader ( ) ; <nl> ConvertingTransform : : ConvertingTransform ( <nl> { <nl> if ( const auto * src_const = typeid_cast < const ColumnConst * > ( src_elem . column . get ( ) ) ) <nl> { <nl> - if ( res_const - > getField ( ) ! = src_const - > getField ( ) ) <nl> + if ( ! ignore_constant_values & & res_const - > getField ( ) ! = src_const - > getField ( ) ) <nl> throw Exception ( " Cannot convert column " + backQuoteIfNeed ( res_elem . name ) + " because " <nl> " it is constant but values of constants are different in source and result " , <nl> ErrorCodes : : ILLEGAL_COLUMN ) ; <nl> void ConvertingTransform : : transform ( Chunk & chunk ) <nl> src_elem . column = src_columns [ conversion [ res_pos ] ] ; <nl> auto res_elem = result . getByPosition ( res_pos ) ; <nl> <nl> + if ( ignore_constant_values & & isColumnConst ( * res_elem . column ) ) <nl> + { <nl> + res_columns . emplace_back ( res_elem . column - > cloneResized ( num_rows ) ) ; <nl> + continue ; <nl> + } <nl> + <nl> ColumnPtr converted = castColumnWithDiagnostic ( src_elem , res_elem ) ; <nl> <nl> if ( ! isColumnConst ( * res_elem . column ) ) <nl> mmm a / src / Processors / Transforms / ConvertingTransform . h <nl> ppp b / src / Processors / Transforms / ConvertingTransform . h <nl> class ConvertingTransform : public ISimpleTransform <nl> ConvertingTransform ( <nl> Block source_header_ , <nl> Block result_header_ , <nl> - MatchColumnsMode mode_ ) ; <nl> + MatchColumnsMode mode_ , <nl> + bool ignore_constant_values_ = false ) ; / / / Do not check that constants are same . Use value from result_header . <nl> <nl> String getName ( ) const override { return " Converting " ; } <nl> <nl> class ConvertingTransform : public ISimpleTransform <nl> private : <nl> / / / How to construct result block . Position in source block , where to get each column . <nl> ColumnNumbers conversion ; <nl> + / / / Do not check that constants are same . Use value from result_header . <nl> + / / / This is needed in case run functions which are constatn in query scope , <nl> + / / / but may return different result being executed remotely , like ` now64 ( ) ` or ` randConstant ( ) ` . <nl> + / / / In this case we replace constants from remote source to constatns from initiator . <nl> + bool ignore_constant_values ; <nl> } ; <nl> <nl> } <nl> new file mode 100644 <nl> index 00000000000 . . 627e1097cda <nl> mmm / dev / null <nl> ppp b / tests / queries / 0_stateless / 01418_query_scope_constants_and_remote . reference <nl> <nl> + 1 <nl> + 1 <nl> + 1 <nl> + 1 <nl> + 1 <nl> new file mode 100644 <nl> index 00000000000 . . fcdf2f7896e <nl> mmm / dev / null <nl> ppp b / tests / queries / 0_stateless / 01418_query_scope_constants_and_remote . sql <nl> <nl> + select c > = 0 from ( SELECT randConstant ( ) as c FROM remote ( ' 127 . 0 . 0 . { 1 , 2 } ' , numbers_mt ( 1 ) ) ) ; <nl> + select c > = 0 from ( SELECT randConstant ( ) as c FROM remote ( ' 127 . 0 . 0 . { 3 , 2 } ' , numbers_mt ( 1 ) ) ) ; <nl> + select c > = 0 from ( SELECT randConstant ( ) as c FROM remote ( ' 127 . 0 . 0 . 1 ' , numbers_mt ( 1 ) ) ) ; <nl> \ No newline at end of file <nl>
Merge pull request from ClickHouse / fix - 11327
ClickHouse/ClickHouse
91156bef5464144d6821be3873a7ca36428cbd8e
2020-07-31T11:53:07Z
mmm a / arangod / Utils / WorkMonitorArangod . cpp <nl> ppp b / arangod / Utils / WorkMonitorArangod . cpp <nl> void WorkMonitor : : deleteHandler ( WorkDescription * desc ) { <nl> desc - > _data . _handler . _handler <nl> . std : : shared_ptr < rest : : RestHandler > : : ~ shared_ptr < rest : : RestHandler > ( ) ; <nl> <nl> - desc - > _data . _handler . _canceled . std : : atomic < bool > : : ~ atomic < bool > ( ) ; <nl> + desc - > _data . _handler . _canceled . std : : atomic < bool > : : ~ atomic ( ) ; <nl> } <nl> <nl> void WorkMonitor : : vpackHandler ( VPackBuilder * b , WorkDescription * desc ) { <nl>
try to fix compile warning
arangodb/arangodb
4e18eefa4e44c8a553b08633cb2265b757b4e4dc
2016-11-03T08:57:14Z
mmm a / tensorflow / core / profiler / convert / BUILD <nl> ppp b / tensorflow / core / profiler / convert / BUILD <nl> cc_library ( <nl> " : xplane_to_kernel_stats_db " , <nl> " : xplane_to_op_metrics_db " , <nl> " : xplane_to_step_events " , <nl> + " : xplane_to_tf_functions " , <nl> " / / tensorflow / core : lib " , <nl> " / / tensorflow / core / profiler / protobuf : hardware_types_proto_cc " , <nl> " / / tensorflow / core / profiler / protobuf : kernel_stats_proto_cc " , <nl> " / / tensorflow / core / profiler / protobuf : op_stats_proto_cc " , <nl> + " / / tensorflow / core / profiler / protobuf : tf_function_proto_cc " , <nl> " / / tensorflow / core / profiler / protobuf : xplane_proto_cc " , <nl> " / / tensorflow / core / profiler / utils : event_span " , <nl> " / / tensorflow / core / profiler / utils : hardware_type_utils " , <nl> tf_cc_test ( <nl> srcs = [ " xplane_to_op_stats_test . cc " ] , <nl> deps = [ <nl> " : xplane_to_op_stats " , <nl> + " : xplane_to_tf_functions " , <nl> " / / tensorflow / core : lib " , <nl> " / / tensorflow / core : lib_internal " , <nl> " / / tensorflow / core : protos_all_cc " , <nl> cc_library ( <nl> " / / tensorflow / core / profiler / utils : xplane_visitor " , <nl> ] , <nl> ) <nl> + <nl> + cc_library ( <nl> + name = " xplane_to_tf_functions " , <nl> + srcs = [ " xplane_to_tf_functions . cc " ] , <nl> + hdrs = [ " xplane_to_tf_functions . h " ] , <nl> + deps = [ <nl> + " / / tensorflow / core : lib " , <nl> + " / / tensorflow / core : lib_internal " , <nl> + " / / tensorflow / core / profiler / protobuf : tf_function_proto_cc " , <nl> + " / / tensorflow / core / profiler / protobuf : xplane_proto_cc " , <nl> + " / / tensorflow / core / profiler / utils : tf_xplane_visitor " , <nl> + " / / tensorflow / core / profiler / utils : timespan " , <nl> + " / / tensorflow / core / profiler / utils : xplane_schema " , <nl> + " / / tensorflow / core / profiler / utils : xplane_utils " , <nl> + " / / tensorflow / core / profiler / utils : xplane_visitor " , <nl> + " @ com_google_absl / / absl / algorithm : container " , <nl> + " @ com_google_absl / / absl / container : flat_hash_map " , <nl> + " @ com_google_absl / / absl / strings " , <nl> + ] , <nl> + ) <nl> + <nl> + tf_cc_test ( <nl> + name = " xplane_to_tf_functions_test " , <nl> + size = " small " , <nl> + srcs = [ " xplane_to_tf_functions_test . cc " ] , <nl> + deps = [ <nl> + " : xplane_to_tf_functions " , <nl> + " / / tensorflow / core : lib " , <nl> + " / / tensorflow / core : lib_internal " , <nl> + " / / tensorflow / core : protos_all_cc " , <nl> + " / / tensorflow / core : test " , <nl> + " / / tensorflow / core : test_main " , <nl> + " / / tensorflow / core : testlib " , <nl> + " / / tensorflow / core / profiler / protobuf : tf_function_proto_cc " , <nl> + " / / tensorflow / core / profiler / utils : tf_xplane_visitor " , <nl> + " / / tensorflow / core / profiler / utils : xplane_builder " , <nl> + " / / tensorflow / core / profiler / utils : xplane_schema " , <nl> + " / / tensorflow / core / profiler / utils : xplane_utils " , <nl> + ] , <nl> + ) <nl> mmm a / tensorflow / core / profiler / convert / xplane_to_op_stats . cc <nl> ppp b / tensorflow / core / profiler / convert / xplane_to_op_stats . cc <nl> limitations under the License . <nl> # include " tensorflow / core / profiler / convert / xplane_to_kernel_stats_db . h " <nl> # include " tensorflow / core / profiler / convert / xplane_to_op_metrics_db . h " <nl> # include " tensorflow / core / profiler / convert / xplane_to_step_events . h " <nl> + # include " tensorflow / core / profiler / convert / xplane_to_tf_functions . h " <nl> # include " tensorflow / core / profiler / protobuf / hardware_types . pb . h " <nl> # include " tensorflow / core / profiler / protobuf / kernel_stats . pb . h " <nl> + # include " tensorflow / core / profiler / protobuf / tf_function . pb . h " <nl> # include " tensorflow / core / profiler / utils / event_span . h " <nl> # include " tensorflow / core / profiler / utils / hardware_type_utils . h " <nl> # include " tensorflow / core / profiler / utils / kernel_stats_utils . h " <nl> - # include " tensorflow / core / profiler / utils / tf_xplane_visitor . h " <nl> # include " tensorflow / core / profiler / utils / xplane_schema . h " <nl> # include " tensorflow / core / profiler / utils / xplane_utils . h " <nl> <nl> void SetRunEnvironment ( int32 accelerator_count , RunEnvironment * env ) { <nl> env - > set_device_core_count ( accelerator_count ) ; <nl> } <nl> <nl> + void ProcessHostPlane ( const XPlane * host_plane , bool use_device_step_events , <nl> + OpMetricsDb * op_metrics_db , StepEvents * step_events , <nl> + TfFunctionDb * tf_function_db ) { <nl> + absl : : flat_hash_map < int64 , TfOp > tf_ops = <nl> + CollectTfOpsFromHostThreadsXPlane ( * host_plane ) ; <nl> + OpMetricsDbCombiner combiner ( op_metrics_db ) ; <nl> + XPlaneVisitor plane = CreateTfXPlaneVisitor ( host_plane ) ; <nl> + plane . ForEachLine ( [ & ] ( const XLineVisitor & line ) { <nl> + ConsumeTfMetricsDbData ( <nl> + ConvertHostThreadsXLineToTfMetricsDbData ( line , tf_ops ) , & combiner ) ; <nl> + CombineStepEvents ( ConvertHostThreadsXLineToStepEvents ( <nl> + line , use_device_step_events , * step_events ) , <nl> + step_events ) ; <nl> + CombineTfFunctionDb ( ConvertHostThreadsXLineToTfFunctionDb ( line ) , <nl> + tf_function_db ) ; <nl> + } ) ; <nl> + } <nl> + <nl> } / / namespace <nl> <nl> OpStats ConvertXSpaceToOpStats ( const XSpace & space ) { <nl> OpStats ConvertXSpaceToOpStats ( const XSpace & space ) { <nl> / / Convert a host plane . <nl> bool has_device = ! device_planes . empty ( ) ; <nl> if ( host_plane ) { <nl> - * op_stats . mutable_host_op_metrics_db ( ) = <nl> - ConvertHostThreadsXPlaneToOpMetricsDb ( * host_plane ) ; <nl> - CombineStepEvents ( <nl> - ConvertHostThreadsXPlaneToStepEvents ( <nl> - * host_plane , / * use_device_step_events = * / has_device , step_events ) , <nl> - & step_events ) ; <nl> + ProcessHostPlane ( host_plane , has_device , <nl> + op_stats . mutable_host_op_metrics_db ( ) , & step_events , <nl> + op_stats . mutable_tf_function_db ( ) ) ; <nl> } <nl> StepEvents nonoverlapped_step_events = ToNonOverlappedStepEvents ( step_events ) ; <nl> * op_stats . mutable_step_db ( ) = <nl> mmm a / tensorflow / core / profiler / convert / xplane_to_op_stats_test . cc <nl> ppp b / tensorflow / core / profiler / convert / xplane_to_op_stats_test . cc <nl> limitations under the License . <nl> # include " tensorflow / core / profiler / convert / xplane_to_op_stats . h " <nl> <nl> # include " tensorflow / core / platform / test . h " <nl> + # include " tensorflow / core / profiler / convert / xplane_to_tf_functions . h " <nl> # include " tensorflow / core / profiler / protobuf / op_metrics . pb . h " <nl> # include " tensorflow / core / profiler / protobuf / steps_db . pb . h " <nl> # include " tensorflow / core / profiler / utils / group_events . h " <nl> TEST ( ConvertXPlaneToOpStats , CpuOnlyStepDbTest ) { <nl> CreateXEvent ( & host_plane_builder , & tf_executor_thread , <nl> HostEventType : : kExecutorStateProcess , 20 , 80 , <nl> { { StatType : : kStepId , 0 } } ) ; <nl> - CreateXEvent ( & host_plane_builder , & tf_executor_thread , " matmul " , 30 , 70 , { } ) ; <nl> + CreateXEvent ( & host_plane_builder , & tf_executor_thread , " matmul " , 30 , 70 ) ; <nl> <nl> GroupTfEvents ( & space , / * event_group_name_map = * / nullptr ) ; <nl> OpStats op_stats = ConvertXSpaceToOpStats ( space ) ; <nl> TEST ( ConvertXPlaneToOpStats , GpuStepDbTest ) { <nl> EXPECT_EQ ( precision_stats . compute_32bit_ps ( ) , 40 ) ; <nl> } <nl> <nl> + TEST ( ConcertXPlaneToOpStats , TfFunctionTest ) { <nl> + XSpace space ; <nl> + XPlaneBuilder host_plane_builder ( space . add_planes ( ) ) ; <nl> + host_plane_builder . SetName ( kHostThreads ) ; <nl> + host_plane_builder . ReserveLines ( 1 ) ; <nl> + std : : string kFunctionName = " increment " ; <nl> + <nl> + auto main_thread = host_plane_builder . GetOrCreateLine ( 0 ) ; <nl> + CreateTfFunctionCallEvent ( & host_plane_builder , & main_thread , kFunctionName , <nl> + 10 , 100 , " traced - nonXla " , 1 ) ; <nl> + CreateTfFunctionCallEvent ( & host_plane_builder , & main_thread , kFunctionName , <nl> + 150 , 20 , " notTraced - nonXla " , 1 ) ; <nl> + CreateTfFunctionCallEvent ( & host_plane_builder , & main_thread , kFunctionName , <nl> + 200 , 80 , " traced - nonXla " , 2 ) ; <nl> + <nl> + OpStats op_stats = ConvertXSpaceToOpStats ( space ) ; <nl> + const TfFunctionDb & tf_function_db = op_stats . tf_function_db ( ) ; <nl> + <nl> + EXPECT_EQ ( tf_function_db . tf_functions ( ) . size ( ) , 1 ) ; <nl> + EXPECT_EQ ( tf_function_db . tf_functions ( ) . count ( kFunctionName ) , 1 ) ; <nl> + const TfFunction & tf_function = <nl> + tf_function_db . tf_functions ( ) . at ( kFunctionName ) ; <nl> + EXPECT_EQ ( tf_function . total_tracing_count ( ) , 2 ) ; <nl> + EXPECT_EQ ( tf_function . compiler ( ) , OTHER_COMPILER ) ; <nl> + const auto & metrics = tf_function . metrics ( ) ; <nl> + EXPECT_EQ ( metrics . size ( ) , 2 ) ; <nl> + EXPECT_EQ ( metrics . count ( TRACED_MODE ) , 1 ) ; <nl> + EXPECT_EQ ( metrics . count ( NOT_TRACED_MODE ) , 1 ) ; <nl> + const auto & traced_mode = metrics . at ( TRACED_MODE ) ; <nl> + EXPECT_EQ ( traced_mode . count ( ) , 2 ) ; <nl> + EXPECT_EQ ( traced_mode . self_time_ps ( ) , 180 ) ; <nl> + const auto & not_traced_mode = metrics . at ( NOT_TRACED_MODE ) ; <nl> + EXPECT_EQ ( not_traced_mode . count ( ) , 1 ) ; <nl> + EXPECT_EQ ( not_traced_mode . self_time_ps ( ) , 20 ) ; <nl> + } <nl> + <nl> } / / namespace <nl> } / / namespace profiler <nl> } / / namespace tensorflow <nl> new file mode 100644 <nl> index 0000000000000 . . ea57a53321c59 <nl> mmm / dev / null <nl> ppp b / tensorflow / core / profiler / convert / xplane_to_tf_functions . cc <nl> <nl> + / * Copyright 2020 The TensorFlow Authors . All Rights Reserved . <nl> + <nl> + Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + You may not use this file except in compliance with the License . <nl> + You may obtain a copy of the License at <nl> + <nl> + http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + <nl> + Unless required by applicable law or agreed to in writing , software <nl> + distributed under the License is distributed on an " AS IS " BASIS , <nl> + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + See the License for the specific language governing permissions and <nl> + limitations under the License . <nl> + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = * / <nl> + <nl> + # include " tensorflow / core / profiler / convert / xplane_to_tf_functions . h " <nl> + <nl> + # include < stack > <nl> + <nl> + # include " absl / algorithm / container . h " <nl> + # include " absl / container / flat_hash_map . h " <nl> + # include " absl / strings / string_view . h " <nl> + # include " tensorflow / core / lib / gtl / map_util . h " <nl> + # include " tensorflow / core / lib / strings / proto_serialization . h " <nl> + # include " tensorflow / core / platform / logging . h " <nl> + # include " tensorflow / core / platform / types . h " <nl> + # include " tensorflow / core / profiler / protobuf / xplane . pb . h " <nl> + # include " tensorflow / core / profiler / utils / tf_xplane_visitor . h " <nl> + # include " tensorflow / core / profiler / utils / timespan . h " <nl> + # include " tensorflow / core / profiler / utils / xplane_schema . h " <nl> + # include " tensorflow / core / profiler / utils / xplane_utils . h " <nl> + # include " tensorflow / core / profiler / utils / xplane_visitor . h " <nl> + <nl> + namespace tensorflow { <nl> + namespace profiler { <nl> + <nl> + namespace { <nl> + <nl> + std : : pair < TfFunctionExecutionMode , TfFunctionCompiler > Decode ( <nl> + absl : : string_view function_name , absl : : string_view mode ) { <nl> + / / mode is one of [ " eager " , " concrete " , " traced - xla " , " traced - nonXla " , <nl> + / / " notTraced - xla " , " notTraced - nonXla " ] <nl> + if ( mode = = " eager " ) return { EAGER_MODE , INVALID_COMPILER } ; <nl> + if ( mode = = " concrete " ) return { CONCRETE_MODE , INVALID_COMPILER } ; <nl> + if ( mode = = " traced - xla " ) return { TRACED_MODE , XLA_COMPILER } ; <nl> + if ( mode = = " traced - nonXla " ) return { TRACED_MODE , OTHER_COMPILER } ; <nl> + if ( mode = = " notTraced - xla " ) return { NOT_TRACED_MODE , XLA_COMPILER } ; <nl> + if ( mode = = " notTraced - nonXla " ) return { NOT_TRACED_MODE , OTHER_COMPILER } ; <nl> + / / Shouldn ' t reach here . <nl> + LOG ( ERROR ) < < absl : : StrCat ( " tf - function ' " , function_name , <nl> + " ' has an unexpected execution mode ' " , mode , " ' " ) <nl> + < < std : : endl ; <nl> + return { INVALID_MODE , INVALID_COMPILER } ; <nl> + DCHECK ( false ) ; <nl> + } <nl> + <nl> + / / Each invocation of a tf - function creates an ActivationRecord . <nl> + struct ActivationRecord { <nl> + std : : string function_name ; / / name of the tf - function . <nl> + Timespan timespan ; / / timespan of this invocation . <nl> + TfFunctionExecutionMode execution_mode ; / / execution mode . <nl> + TfFunctionCompiler compiler ; / / compiler used . <nl> + int64 tracing_count ; / / the total tracing count of this function when this <nl> + / / invocation happened . <nl> + uint64 children_duration_ps ; / / Sum of the duration of all ( immediate ) <nl> + / / children tf - functions of this function . <nl> + ActivationRecord ( ) <nl> + : function_name ( " " ) , <nl> + execution_mode ( INVALID_MODE ) , <nl> + compiler ( INVALID_COMPILER ) , <nl> + tracing_count ( 0 ) , <nl> + children_duration_ps ( 0 ) { } <nl> + ActivationRecord ( absl : : string_view name , const Timespan & timespan , <nl> + TfFunctionExecutionMode exe_mode , <nl> + TfFunctionCompiler compiler , int64 tracing_cnt ) <nl> + : function_name ( std : : string ( name ) ) , <nl> + timespan ( timespan ) , <nl> + execution_mode ( exe_mode ) , <nl> + compiler ( compiler ) , <nl> + tracing_count ( tracing_cnt ) , <nl> + children_duration_ps ( 0 ) { } <nl> + std : : string DebugString ( ) const { <nl> + return absl : : StrCat ( " { " , function_name , " , " , <nl> + TfFunctionExecutionMode_Name ( execution_mode ) , " , " , <nl> + TfFunctionCompiler_Name ( compiler ) , <nl> + " , tracing_count : " , tracing_count , <nl> + " , children_duration : " , children_duration_ps , <nl> + " ps , timespan : " , timespan . DebugString ( ) , " } " ) ; <nl> + } <nl> + } ; <nl> + <nl> + / / Entry or exit point of a tf - function . <nl> + struct EntryOrExit { <nl> + bool is_entry ; / / true for entry , false for exit . <nl> + int64 index ; / / index to the ActivationRecord . <nl> + uint64 timestamp_ps ; / / the time when this entry / exit happens . <nl> + EntryOrExit ( ) : is_entry ( false ) , index ( - 1 ) , timestamp_ps ( 0 ) { } <nl> + EntryOrExit ( bool is_entry , int64 index , uint64 timestamp_ps ) <nl> + : is_entry ( is_entry ) , index ( index ) , timestamp_ps ( timestamp_ps ) { } <nl> + std : : string DebugString ( ) const { <nl> + std : : string entry_or_exit = is_entry ? " entry , " : " exit , " ; <nl> + return absl : : StrCat ( " { " , entry_or_exit , " idx : " , index , <nl> + " , timestamp : " , timestamp_ps , " } " ) ; <nl> + } <nl> + } ; <nl> + <nl> + TfFunctionCompiler CombineCompilers ( TfFunctionCompiler a , <nl> + TfFunctionCompiler b ) { <nl> + if ( a = = INVALID_COMPILER ) return b ; <nl> + if ( b = = INVALID_COMPILER ) return a ; <nl> + if ( a = = b ) return a ; <nl> + return MIXED_COMPILER ; <nl> + } <nl> + <nl> + void CombineTfFunctionMetrics ( const TfFunctionMetrics & src , <nl> + TfFunctionMetrics * dst ) { <nl> + dst - > set_count ( src . count ( ) + dst - > count ( ) ) ; <nl> + dst - > set_self_time_ps ( src . self_time_ps ( ) + dst - > self_time_ps ( ) ) ; <nl> + } <nl> + <nl> + void CombineTfFunction ( const TfFunction & src , TfFunction * dst ) { <nl> + dst - > set_total_tracing_count ( <nl> + std : : max ( src . total_tracing_count ( ) , dst - > total_tracing_count ( ) ) ) ; <nl> + dst - > set_compiler ( CombineCompilers ( src . compiler ( ) , dst - > compiler ( ) ) ) ; <nl> + for ( const auto & mode_metrics : src . metrics ( ) ) { <nl> + int32 execution_mode = mode_metrics . first ; <nl> + const TfFunctionMetrics & src_metrics = mode_metrics . second ; <nl> + TfFunctionMetrics * dst_metrics = <nl> + gtl : : FindOrNull ( * dst - > mutable_metrics ( ) , execution_mode ) ; <nl> + if ( dst_metrics = = nullptr ) { <nl> + ( * dst - > mutable_metrics ( ) ) [ execution_mode ] = src_metrics ; <nl> + } else { <nl> + CombineTfFunctionMetrics ( src_metrics , dst_metrics ) ; <nl> + } <nl> + } <nl> + } <nl> + <nl> + / / Execution history of all tf - functions invoked . <nl> + class TfFunctionExecutions { <nl> + public : <nl> + explicit TfFunctionExecutions ( const XLineVisitor & line ) { <nl> + / / Creates points_ and activations_ from line . <nl> + line . ForEachEvent ( [ & ] ( const XEventVisitor & event ) { <nl> + std : : string mode = " " ; <nl> + int64 tracing_count = 0 ; <nl> + event . ForEachStat ( [ & mode , & tracing_count ] ( const XStatVisitor & stat ) { <nl> + if ( stat . Type ( ) = = StatType : : kTfFunctionCall ) <nl> + mode = std : : string ( stat . StrValue ( ) ) ; <nl> + if ( stat . Type ( ) = = StatType : : kTfFunctionTracingCount ) <nl> + tracing_count = stat . IntValue ( ) ; <nl> + } ) ; <nl> + if ( mode . empty ( ) ) return ; <nl> + <nl> + / / event is a tf - function . <nl> + int64 index = activations_ . size ( ) ; <nl> + auto timespan = event . GetTimespan ( ) ; <nl> + auto mode_compiler = Decode ( event . Name ( ) , mode ) ; <nl> + ActivationRecord activation_record = <nl> + ActivationRecord ( event . Name ( ) , timespan , mode_compiler . first , <nl> + mode_compiler . second , tracing_count ) ; <nl> + activations_ . push_back ( activation_record ) ; <nl> + EntryOrExit entry_point = <nl> + EntryOrExit ( / * is_entry = * / true , index , timespan . begin_ps ( ) ) ; <nl> + EntryOrExit exit_point = <nl> + EntryOrExit ( / * is_entry = * / false , index , timespan . end_ps ( ) ) ; <nl> + points_ . push_back ( entry_point ) ; <nl> + points_ . push_back ( exit_point ) ; <nl> + } ) ; <nl> + <nl> + / / Sorts points_ in ascending order of timestamps . <nl> + auto ascending_in_timestamp = [ ] ( const EntryOrExit & a , <nl> + const EntryOrExit & b ) { <nl> + return a . timestamp_ps < b . timestamp_ps ; <nl> + } ; <nl> + absl : : c_sort ( points_ , ascending_in_timestamp ) ; <nl> + <nl> + / / Calculates the children duration for each activation record . <nl> + CalculateChildrenDurations ( ) ; <nl> + } <nl> + <nl> + std : : string DebugString ( ) const { <nl> + std : : string result = " \ nActivations : \ n " ; <nl> + for ( auto i = 0 ; i < activations_ . size ( ) ; i + + ) { <nl> + absl : : StrAppend ( & result , " [ " , i , " ] " , activations_ [ i ] . DebugString ( ) , <nl> + " \ n " ) ; <nl> + } <nl> + absl : : StrAppend ( & result , " tf - function Entry / Exit Points : \ n " ) ; <nl> + for ( const auto & pt : points_ ) { <nl> + absl : : StrAppend ( & result , pt . DebugString ( ) , " \ n " ) ; <nl> + } <nl> + return result ; <nl> + } <nl> + <nl> + / / Converts this execution history to a TfFunctionDb . <nl> + TfFunctionDb ConvertToTfFunctionDb ( ) { <nl> + TfFunctionDb result ; <nl> + for ( const auto & record : activations_ ) { <nl> + TfFunction * fun = & ( * result . mutable_tf_functions ( ) ) [ record . function_name ] ; <nl> + fun - > set_total_tracing_count ( <nl> + std : : max ( static_cast < int64 > ( fun - > total_tracing_count ( ) ) , <nl> + record . tracing_count ) ) ; <nl> + fun - > set_compiler ( CombineCompilers ( fun - > compiler ( ) , record . compiler ) ) ; <nl> + / / The self - time of this function is the difference between the duration <nl> + / / of this function and the duration of its children . <nl> + uint64 self_time_ps = <nl> + record . timespan . duration_ps ( ) - record . children_duration_ps ; <nl> + / / Updates the metrics for this execution mode with this invocation . <nl> + TfFunctionMetrics * metrics = <nl> + & ( * fun - > mutable_metrics ( ) ) [ record . execution_mode ] ; <nl> + metrics - > set_count ( metrics - > count ( ) + 1 ) ; <nl> + metrics - > set_self_time_ps ( metrics - > self_time_ps ( ) + self_time_ps ) ; <nl> + } <nl> + return result ; <nl> + } <nl> + <nl> + / / Calculates the children duration of every tf - function . <nl> + void CalculateChildrenDurations ( ) { <nl> + std : : stack < int64 > call_stack ; <nl> + for ( const auto & pt : points_ ) { <nl> + if ( pt . is_entry ) { <nl> + / / Function entry . <nl> + call_stack . push ( pt . index ) ; <nl> + } else { <nl> + / / Function exit . <nl> + DCHECK ( call_stack . top ( ) = = pt . index ) ; / / must be well nested . <nl> + uint64 call_duration = activations_ [ pt . index ] . timespan . duration_ps ( ) ; <nl> + call_stack . pop ( ) ; <nl> + if ( ! call_stack . empty ( ) ) { <nl> + / / call_stack . top ( ) is the parent tf - function ; adds call_duration to <nl> + / / its children_duration . <nl> + activations_ [ call_stack . top ( ) ] . children_duration_ps + = call_duration ; <nl> + } <nl> + } <nl> + } <nl> + } <nl> + <nl> + private : <nl> + / / ActivationRecords for all tf - function invocations . <nl> + std : : vector < ActivationRecord > activations_ ; <nl> + / / Entry and exit points of all invocations . <nl> + std : : vector < EntryOrExit > points_ ; <nl> + } ; <nl> + <nl> + } / / namespace <nl> + <nl> + std : : string DebugString ( const TfFunctionDb tf_function_db ) { <nl> + std : : string str ; <nl> + : : tensorflow : : protobuf : : TextFormat : : PrintToString ( tf_function_db , & str ) ; <nl> + return str ; <nl> + } <nl> + <nl> + void CombineTfFunctionDb ( const TfFunctionDb & src , TfFunctionDb * dst ) { <nl> + for ( const auto & name_function : src . tf_functions ( ) ) { <nl> + const auto & name = name_function . first ; <nl> + const auto & src_fun = name_function . second ; <nl> + TfFunction * dst_fun = gtl : : FindOrNull ( * dst - > mutable_tf_functions ( ) , name ) ; <nl> + if ( dst_fun = = nullptr ) { <nl> + ( * dst - > mutable_tf_functions ( ) ) [ name ] = src_fun ; <nl> + } else { <nl> + CombineTfFunction ( src_fun , dst_fun ) ; <nl> + } <nl> + } <nl> + } <nl> + <nl> + TfFunctionDb ConvertHostThreadsXLineToTfFunctionDb ( const XLineVisitor & line ) { <nl> + TfFunctionExecutions tf_function_executions = TfFunctionExecutions ( line ) ; <nl> + return tf_function_executions . ConvertToTfFunctionDb ( ) ; <nl> + } <nl> + <nl> + } / / namespace profiler <nl> + } / / namespace tensorflow <nl> new file mode 100644 <nl> index 0000000000000 . . 470b22d34b872 <nl> mmm / dev / null <nl> ppp b / tensorflow / core / profiler / convert / xplane_to_tf_functions . h <nl> <nl> + / * Copyright 2020 The TensorFlow Authors . All Rights Reserved . <nl> + <nl> + Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + you may not use this file except in compliance with the License . <nl> + You may obtain a copy of the License at <nl> + <nl> + http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + <nl> + Unless required by applicable law or agreed to in writing , software <nl> + distributed under the License is distributed on an " AS IS " BASIS , <nl> + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + See the License for the specific language governing permissions and <nl> + limitations under the License . <nl> + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = * / <nl> + <nl> + # ifndef TENSORFLOW_CORE_PROFILER_CONVERT_XPLANE_TO_TF_FUNCTIONS_H_ <nl> + # define TENSORFLOW_CORE_PROFILER_CONVERT_XPLANE_TO_TF_FUNCTIONS_H_ <nl> + <nl> + # include " tensorflow / core / profiler / protobuf / tf_function . pb . h " <nl> + # include " tensorflow / core / profiler / protobuf / xplane . pb . h " <nl> + # include " tensorflow / core / profiler / utils / xplane_visitor . h " <nl> + <nl> + namespace tensorflow { <nl> + namespace profiler { <nl> + <nl> + / / Converts from the given XLine to a TfFunctionDb . <nl> + TfFunctionDb ConvertHostThreadsXLineToTfFunctionDb ( const XLineVisitor & line ) ; <nl> + <nl> + / / Returns a debugging string for the given TfFunctionDb . <nl> + std : : string DebugString ( const TfFunctionDb tf_function_db ) ; <nl> + <nl> + / / Combines the tf - function statistics from src and dst into dst . <nl> + void CombineTfFunctionDb ( const TfFunctionDb & src , TfFunctionDb * dst ) ; <nl> + <nl> + } / / namespace profiler <nl> + } / / namespace tensorflow <nl> + <nl> + # endif / / TENSORFLOW_CORE_PROFILER_CONVERT_XPLANE_TO_TF_FUNCTIONS_H_ <nl> new file mode 100644 <nl> index 0000000000000 . . 253ef1a74f998 <nl> mmm / dev / null <nl> ppp b / tensorflow / core / profiler / convert / xplane_to_tf_functions_test . cc <nl> <nl> + / * Copyright 2020 The TensorFlow Authors . All Rights Reserved . <nl> + <nl> + Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + you may not use this file except in compliance with the License . <nl> + You may obtain a copy of the License at <nl> + <nl> + http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + <nl> + Unless required by applicable law or agreed to in writing , software <nl> + distributed under the License is distributed on an " AS IS " BASIS , <nl> + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + See the License for the specific language governing permissions and <nl> + limitations under the License . <nl> + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = * / <nl> + <nl> + # include " tensorflow / core / profiler / convert / xplane_to_tf_functions . h " <nl> + <nl> + # include " tensorflow / core / platform / test . h " <nl> + # include " tensorflow / core / profiler / protobuf / tf_function . pb . h " <nl> + # include " tensorflow / core / profiler / utils / tf_xplane_visitor . h " <nl> + # include " tensorflow / core / profiler / utils / xplane_builder . h " <nl> + # include " tensorflow / core / profiler / utils / xplane_schema . h " <nl> + # include " tensorflow / core / profiler / utils / xplane_utils . h " <nl> + <nl> + namespace tensorflow { <nl> + namespace profiler { <nl> + namespace { <nl> + <nl> + const absl : : string_view kEager = " eager " ; <nl> + const absl : : string_view kConcrete = " concrete " ; <nl> + const absl : : string_view kTracedNonXla = " traced - nonXla " ; <nl> + const absl : : string_view kTracedXla = " traced - xla " ; <nl> + const absl : : string_view kNotTracedNonXla = " notTraced - nonXla " ; <nl> + const absl : : string_view kNotTracedXla = " notTraced - xla " ; <nl> + <nl> + TfFunctionDb ConvertXSpaceToTfFunctionDb ( const XSpace & space ) { <nl> + TfFunctionDb result ; <nl> + const XPlane * host_plane = FindPlaneWithName ( space , kHostThreads ) ; <nl> + if ( host_plane ) { <nl> + XPlaneVisitor plane = CreateTfXPlaneVisitor ( host_plane ) ; <nl> + plane . ForEachLine ( [ & result ] ( const XLineVisitor & line ) { <nl> + CombineTfFunctionDb ( ConvertHostThreadsXLineToTfFunctionDb ( line ) , & result ) ; <nl> + } ) ; <nl> + } <nl> + return result ; <nl> + } <nl> + <nl> + TEST ( ConvertXPlaneToTfFunctions , CombineTwoThreads ) { <nl> + XSpace space ; <nl> + XPlaneBuilder host_plane_builder ( space . add_planes ( ) ) ; <nl> + host_plane_builder . SetName ( kHostThreads ) ; <nl> + host_plane_builder . ReserveLines ( 2 ) ; <nl> + std : : string kFunctionName = " decrement " ; <nl> + <nl> + auto main_thread = host_plane_builder . GetOrCreateLine ( 0 ) ; <nl> + CreateTfFunctionCallEvent ( & host_plane_builder , & main_thread , kFunctionName , <nl> + 10 , 100 , kTracedNonXla , 1 ) ; <nl> + CreateTfFunctionCallEvent ( & host_plane_builder , & main_thread , kFunctionName , <nl> + 150 , 20 , kNotTracedNonXla , 2 ) ; <nl> + CreateTfFunctionCallEvent ( & host_plane_builder , & main_thread , kFunctionName , <nl> + 200 , 80 , kTracedNonXla , 3 ) ; <nl> + <nl> + auto other_thread = host_plane_builder . GetOrCreateLine ( 1 ) ; <nl> + CreateTfFunctionCallEvent ( & host_plane_builder , & other_thread , kFunctionName , <nl> + 20 , 100 , kTracedNonXla , 2 ) ; <nl> + CreateTfFunctionCallEvent ( & host_plane_builder , & other_thread , kFunctionName , <nl> + 160 , 20 , kNotTracedNonXla , 2 ) ; <nl> + CreateTfFunctionCallEvent ( & host_plane_builder , & other_thread , kFunctionName , <nl> + 210 , 80 , kTracedXla , 4 ) ; <nl> + <nl> + TfFunctionDb tf_function_db = ConvertXSpaceToTfFunctionDb ( space ) ; <nl> + EXPECT_EQ ( tf_function_db . tf_functions ( ) . size ( ) , 1 ) ; <nl> + EXPECT_EQ ( tf_function_db . tf_functions ( ) . count ( kFunctionName ) , 1 ) ; <nl> + const TfFunction & tf_function = <nl> + tf_function_db . tf_functions ( ) . at ( kFunctionName ) ; <nl> + EXPECT_EQ ( tf_function . total_tracing_count ( ) , 4 ) ; <nl> + EXPECT_EQ ( tf_function . compiler ( ) , MIXED_COMPILER ) ; <nl> + const auto & metrics = tf_function . metrics ( ) ; <nl> + EXPECT_EQ ( metrics . size ( ) , 2 ) ; <nl> + EXPECT_EQ ( metrics . count ( TRACED_MODE ) , 1 ) ; <nl> + EXPECT_EQ ( metrics . count ( NOT_TRACED_MODE ) , 1 ) ; <nl> + const auto & traced_mode = metrics . at ( TRACED_MODE ) ; <nl> + EXPECT_EQ ( traced_mode . count ( ) , 4 ) ; <nl> + EXPECT_EQ ( traced_mode . self_time_ps ( ) , 360 ) ; <nl> + const auto & not_traced_mode = metrics . at ( NOT_TRACED_MODE ) ; <nl> + EXPECT_EQ ( not_traced_mode . count ( ) , 2 ) ; <nl> + EXPECT_EQ ( not_traced_mode . self_time_ps ( ) , 40 ) ; <nl> + } <nl> + <nl> + TEST ( ConvertXPlaneToTfFunctions , NestedFunctions ) { <nl> + XSpace space ; <nl> + XPlaneBuilder host_plane_builder ( space . add_planes ( ) ) ; <nl> + host_plane_builder . SetName ( kHostThreads ) ; <nl> + host_plane_builder . ReserveLines ( 1 ) ; <nl> + std : : string kOuterFunctionName = " outer " ; <nl> + std : : string kInnerFunctionName = " inner " ; <nl> + <nl> + auto main_thread = host_plane_builder . GetOrCreateLine ( 0 ) ; <nl> + CreateTfFunctionCallEvent ( & host_plane_builder , & main_thread , <nl> + kOuterFunctionName , 10 , 100 , kTracedNonXla , 1 ) ; <nl> + CreateTfFunctionCallEvent ( & host_plane_builder , & main_thread , <nl> + kInnerFunctionName , 30 , 40 , kNotTracedXla , 0 ) ; <nl> + TfFunctionDb tf_function_db = ConvertXSpaceToTfFunctionDb ( space ) ; <nl> + EXPECT_EQ ( tf_function_db . tf_functions ( ) . size ( ) , 2 ) ; <nl> + EXPECT_EQ ( tf_function_db . tf_functions ( ) . count ( kOuterFunctionName ) , 1 ) ; <nl> + EXPECT_EQ ( tf_function_db . tf_functions ( ) . count ( kInnerFunctionName ) , 1 ) ; <nl> + const TfFunction & outer = <nl> + tf_function_db . tf_functions ( ) . at ( kOuterFunctionName ) ; <nl> + EXPECT_EQ ( outer . total_tracing_count ( ) , 1 ) ; <nl> + EXPECT_EQ ( outer . compiler ( ) , OTHER_COMPILER ) ; <nl> + const auto & outer_metrics = outer . metrics ( ) ; <nl> + EXPECT_EQ ( outer_metrics . size ( ) , 1 ) ; <nl> + EXPECT_EQ ( outer_metrics . count ( TRACED_MODE ) , 1 ) ; <nl> + const auto & traced_mode = outer_metrics . at ( TRACED_MODE ) ; <nl> + EXPECT_EQ ( traced_mode . count ( ) , 1 ) ; <nl> + EXPECT_EQ ( traced_mode . self_time_ps ( ) , 60 ) ; <nl> + const TfFunction & inner = <nl> + tf_function_db . tf_functions ( ) . at ( kInnerFunctionName ) ; <nl> + EXPECT_EQ ( inner . total_tracing_count ( ) , 0 ) ; <nl> + EXPECT_EQ ( inner . compiler ( ) , XLA_COMPILER ) ; <nl> + const auto & inner_metrics = inner . metrics ( ) ; <nl> + EXPECT_EQ ( inner_metrics . size ( ) , 1 ) ; <nl> + EXPECT_EQ ( inner_metrics . count ( NOT_TRACED_MODE ) , 1 ) ; <nl> + const auto & not_traced_mode = inner_metrics . at ( NOT_TRACED_MODE ) ; <nl> + EXPECT_EQ ( not_traced_mode . count ( ) , 1 ) ; <nl> + EXPECT_EQ ( not_traced_mode . self_time_ps ( ) , 40 ) ; <nl> + } <nl> + <nl> + TEST ( ConvertXPlaneToTfFunctions , EagerPlusConcrete ) { <nl> + XSpace space ; <nl> + XPlaneBuilder host_plane_builder ( space . add_planes ( ) ) ; <nl> + host_plane_builder . SetName ( kHostThreads ) ; <nl> + host_plane_builder . ReserveLines ( 2 ) ; <nl> + std : : string kEagerFunctionName = " i_am_eager " ; <nl> + std : : string kConcreteFunctionName = " i_am_concrete " ; <nl> + <nl> + auto main_thread = host_plane_builder . GetOrCreateLine ( 0 ) ; <nl> + CreateTfFunctionCallEvent ( & host_plane_builder , & main_thread , <nl> + kEagerFunctionName , 10 , 200 , kEager ) ; <nl> + auto other_thread = host_plane_builder . GetOrCreateLine ( 1 ) ; <nl> + CreateTfFunctionCallEvent ( & host_plane_builder , & other_thread , <nl> + kConcreteFunctionName , 20 , 40 , kConcrete ) ; <nl> + TfFunctionDb tf_function_db = ConvertXSpaceToTfFunctionDb ( space ) ; <nl> + EXPECT_EQ ( tf_function_db . tf_functions ( ) . size ( ) , 2 ) ; <nl> + EXPECT_EQ ( tf_function_db . tf_functions ( ) . count ( kEagerFunctionName ) , 1 ) ; <nl> + EXPECT_EQ ( tf_function_db . tf_functions ( ) . count ( kConcreteFunctionName ) , 1 ) ; <nl> + const TfFunction & eager = <nl> + tf_function_db . tf_functions ( ) . at ( kEagerFunctionName ) ; <nl> + EXPECT_EQ ( eager . total_tracing_count ( ) , 0 ) ; <nl> + EXPECT_EQ ( eager . compiler ( ) , INVALID_COMPILER ) ; <nl> + const auto & eager_metrics = eager . metrics ( ) ; <nl> + EXPECT_EQ ( eager_metrics . size ( ) , 1 ) ; <nl> + EXPECT_EQ ( eager_metrics . count ( EAGER_MODE ) , 1 ) ; <nl> + const auto & eager_mode = eager_metrics . at ( EAGER_MODE ) ; <nl> + EXPECT_EQ ( eager_mode . count ( ) , 1 ) ; <nl> + EXPECT_EQ ( eager_mode . self_time_ps ( ) , 200 ) ; <nl> + const TfFunction & concrete = <nl> + tf_function_db . tf_functions ( ) . at ( kConcreteFunctionName ) ; <nl> + EXPECT_EQ ( concrete . total_tracing_count ( ) , 0 ) ; <nl> + EXPECT_EQ ( concrete . compiler ( ) , INVALID_COMPILER ) ; <nl> + const auto & concrete_metrics = concrete . metrics ( ) ; <nl> + EXPECT_EQ ( concrete_metrics . size ( ) , 1 ) ; <nl> + EXPECT_EQ ( concrete_metrics . count ( CONCRETE_MODE ) , 1 ) ; <nl> + const auto & concrete_mode = concrete_metrics . at ( CONCRETE_MODE ) ; <nl> + EXPECT_EQ ( concrete_mode . count ( ) , 1 ) ; <nl> + EXPECT_EQ ( concrete_mode . self_time_ps ( ) , 40 ) ; <nl> + } <nl> + <nl> + } / / namespace <nl> + } / / namespace profiler <nl> + } / / namespace tensorflow <nl> mmm a / tensorflow / core / profiler / protobuf / BUILD <nl> ppp b / tensorflow / core / profiler / protobuf / BUILD <nl> tf_proto_library ( <nl> " : kernel_stats_proto " , <nl> " : op_metrics_proto " , <nl> " : steps_db_proto " , <nl> + " : tf_function_proto " , <nl> ] , <nl> visibility = [ <nl> " : friends " , <nl> tf_proto_library ( <nl> visibility = [ " : friends " ] , <nl> ) <nl> <nl> + tf_proto_library ( <nl> + name = " tf_function_proto " , <nl> + srcs = [ " tf_function . proto " ] , <nl> + cc_api_version = 2 , <nl> + visibility = [ " : friends " ] , <nl> + ) <nl> + <nl> # This proto is deprecating and not guaranteed to be compatible across versions . <nl> # Please don ' t refer in new project unless you are double confirmed . <nl> tf_proto_library ( <nl> mmm a / tensorflow / core / profiler / protobuf / op_stats . proto <nl> ppp b / tensorflow / core / profiler / protobuf / op_stats . proto <nl> package tensorflow . profiler ; <nl> import " tensorflow / core / profiler / protobuf / kernel_stats . proto " ; <nl> import " tensorflow / core / profiler / protobuf / op_metrics . proto " ; <nl> import " tensorflow / core / profiler / protobuf / steps_db . proto " ; <nl> + import " tensorflow / core / profiler / protobuf / tf_function . proto " ; <nl> <nl> / / Performance environment , e . g the peak performance capabilities of the device . <nl> message PerfEnv { <nl> message OpStats { <nl> RunEnvironment run_environment = 5 ; <nl> / / Kernel stats results from all GPUs . <nl> KernelStatsDb kernel_stats_db = 6 ; <nl> + / / Statistics for all tf - functions . <nl> + TfFunctionDb tf_function_db = 8 ; <nl> / / Errors seen . <nl> repeated string errors = 7 ; <nl> } <nl> new file mode 100644 <nl> index 0000000000000 . . fe07c00c8d37a <nl> mmm / dev / null <nl> ppp b / tensorflow / core / profiler / protobuf / tf_function . proto <nl> <nl> + syntax = " proto3 " ; <nl> + <nl> + package tensorflow . profiler ; <nl> + <nl> + / / All possible execution modes of a tf - function . <nl> + enum TfFunctionExecutionMode { <nl> + / / Yet to be set . <nl> + INVALID_MODE = 0 ; <nl> + / / Eager execution . <nl> + EAGER_MODE = 1 ; <nl> + / / Graph execution with tracing . <nl> + TRACED_MODE = 2 ; <nl> + / / Graph execution without tracing . <nl> + NOT_TRACED_MODE = 3 ; <nl> + / / Concrete function . <nl> + CONCRETE_MODE = 4 ; <nl> + } <nl> + <nl> + / / All possible compilers that can be used to compile a tf - function in the graph <nl> + / / mode . <nl> + enum TfFunctionCompiler { <nl> + / / Yet to be set . <nl> + INVALID_COMPILER = 0 ; <nl> + / / Any other compiler . <nl> + OTHER_COMPILER = 1 ; <nl> + / / If some instance of the function is compiled with XLA and some is compiled <nl> + / / with Non - XLA , use " MIXED_COMPILER " . <nl> + MIXED_COMPILER = 2 ; <nl> + / / XLA compiler . <nl> + XLA_COMPILER = 3 ; <nl> + / / MLIR compiler . <nl> + MLIR_COMPILER = 4 ; <nl> + } <nl> + <nl> + / / Metrics associated with a particular execution mode of a tf - function . <nl> + message TfFunctionMetrics { <nl> + / / Number of invocations to the function in that execution mode . <nl> + uint64 count = 1 ; <nl> + / / The sum of " self - execution " time of this function over those invocations . <nl> + uint64 self_time_ps = 2 ; <nl> + } <nl> + <nl> + / / Statistics for a tf - function . <nl> + message TfFunction { <nl> + / / A map from each execution mode to its corresponding metrics . <nl> + map < int32 , TfFunctionMetrics > metrics = 1 ; <nl> + / / Total tracing count from the program ' s beginning ( i . e . beyond the profiling <nl> + / / period ) of this tf - function . <nl> + int64 total_tracing_count = 2 ; <nl> + / / Compiler used to compile this function . <nl> + TfFunctionCompiler compiler = 3 ; <nl> + } <nl> + <nl> + / / Statistics for all tf - functions . <nl> + message TfFunctionDb { <nl> + / / A map from function name to the statistics of that function . <nl> + map < string , TfFunction > tf_functions = 1 ; <nl> + } <nl> mmm a / tensorflow / core / profiler / utils / derived_timeline_test . cc <nl> ppp b / tensorflow / core / profiler / utils / derived_timeline_test . cc <nl> TEST ( DerivedTimelineTest , HloModuleNameTest ) { <nl> XPlane * plane = space . add_planes ( ) ; <nl> XPlaneBuilder plane_builder ( plane ) ; <nl> auto line_builder = plane_builder . GetOrCreateLine ( 0 ) ; <nl> - auto first_event = <nl> - CreateXEvent ( & plane_builder , & line_builder , " op1 " , 0 , 100 , { } ) ; <nl> + auto first_event = CreateXEvent ( & plane_builder , & line_builder , " op1 " , 0 , 100 ) ; <nl> first_event . AddStatValue ( * plane_builder . GetOrCreateStatMetadata ( <nl> GetStatTypeStr ( StatType : : kHloModule ) ) , <nl> kHloModuleName ) ; <nl> TEST ( DerivedTimelineTest , HloModuleNameTest ) { <nl> GetStatTypeStr ( StatType : : kKernelDetails ) ) , <nl> kKernelDetails ) ; <nl> auto second_event = <nl> - CreateXEvent ( & plane_builder , & line_builder , " op2 " , 200 , 300 , { } ) ; <nl> + CreateXEvent ( & plane_builder , & line_builder , " op2 " , 200 , 300 ) ; <nl> second_event . AddStatValue ( * plane_builder . GetOrCreateStatMetadata ( <nl> GetStatTypeStr ( StatType : : kHloModule ) ) , <nl> kHloModuleName ) ; <nl> TEST ( DerivedTimelineTest , TfOpLineTest ) { <nl> XPlane * plane = space . add_planes ( ) ; <nl> XPlaneBuilder plane_builder ( plane ) ; <nl> auto line_builder = plane_builder . GetOrCreateLine ( 0 ) ; <nl> - auto first_event = <nl> - CreateXEvent ( & plane_builder , & line_builder , " op1 " , 0 , 100 , { } ) ; <nl> + auto first_event = CreateXEvent ( & plane_builder , & line_builder , " op1 " , 0 , 100 ) ; <nl> first_event . AddStatValue ( <nl> * plane_builder . GetOrCreateStatMetadata ( GetStatTypeStr ( StatType : : kLevel0 ) ) , <nl> kTfOpName ) ; <nl> TEST ( DerivedTimelineTest , TfOpLineTest ) { <nl> GetStatTypeStr ( StatType : : kKernelDetails ) ) , <nl> kKernelDetails ) ; <nl> auto second_event = <nl> - CreateXEvent ( & plane_builder , & line_builder , " op2 " , 200 , 300 , { } ) ; <nl> + CreateXEvent ( & plane_builder , & line_builder , " op2 " , 200 , 300 ) ; <nl> second_event . AddStatValue ( <nl> * plane_builder . GetOrCreateStatMetadata ( GetStatTypeStr ( StatType : : kLevel0 ) ) , <nl> kTfOpName ) ; <nl> TEST ( DerivedTimelineTest , TfOpNameScopeTest ) { <nl> XPlane * plane = space . add_planes ( ) ; <nl> XPlaneBuilder plane_builder ( plane ) ; <nl> auto line_builder = plane_builder . GetOrCreateLine ( 0 ) ; <nl> - auto first_event = <nl> - CreateXEvent ( & plane_builder , & line_builder , " op1 " , 0 , 100 , { } ) ; <nl> + auto first_event = CreateXEvent ( & plane_builder , & line_builder , " op1 " , 0 , 100 ) ; <nl> first_event . AddStatValue ( <nl> * plane_builder . GetOrCreateStatMetadata ( GetStatTypeStr ( StatType : : kLevel0 ) ) , <nl> kTfOpName ) ; <nl> TEST ( DerivedTimelineTest , TfOpNameScopeTest ) { <nl> GetStatTypeStr ( StatType : : kKernelDetails ) ) , <nl> kKernelDetails ) ; <nl> auto second_event = <nl> - CreateXEvent ( & plane_builder , & line_builder , " op2 " , 200 , 300 , { } ) ; <nl> + CreateXEvent ( & plane_builder , & line_builder , " op2 " , 200 , 300 ) ; <nl> second_event . AddStatValue ( <nl> * plane_builder . GetOrCreateStatMetadata ( GetStatTypeStr ( StatType : : kLevel0 ) ) , <nl> kTfOpName ) ; <nl> mmm a / tensorflow / core / profiler / utils / group_events_test . cc <nl> ppp b / tensorflow / core / profiler / utils / group_events_test . cc <nl> TEST ( GroupEventsTest , EagerOpTest ) { <nl> / / Eagerly executed CPU TF op . <nl> CreateXEvent ( & host_plane_builder , & main_thread , <nl> HostEventType : : kEagerKernelExecute , 120 , 80 , { } ) ; <nl> - CreateXEvent ( & host_plane_builder , & main_thread , " add : Add " , 120 , 80 , { } ) ; <nl> + CreateXEvent ( & host_plane_builder , & main_thread , " add : Add " , 120 , 80 ) ; <nl> <nl> XPlane * device_plane = space . add_planes ( ) ; <nl> XPlaneBuilder device_plane_builder ( device_plane ) ; <nl> TEST ( GroupEventsTest , FunctionOpTest ) { <nl> CreateXEvent ( & host_plane_builder , & tf_executor_thread , " matmul " , 30 , 30 , <nl> { { StatType : : kCorrelationId , 100 } } ) ; <nl> / / CPU TF op executed inside tf . function . <nl> - CreateXEvent ( & host_plane_builder , & tf_executor_thread , " add : Add " , 70 , 20 , { } ) ; <nl> + CreateXEvent ( & host_plane_builder , & tf_executor_thread , " add : Add " , 70 , 20 ) ; <nl> <nl> XPlane * device_plane = space . add_planes ( ) ; <nl> XPlaneBuilder device_plane_builder ( device_plane ) ; <nl> mmm a / tensorflow / core / profiler / utils / xplane_schema . cc <nl> ppp b / tensorflow / core / profiler / utils / xplane_schema . cc <nl> const StatTypeMap & GetStatTypeMap ( ) { <nl> { " hlo_module " , kHloModule } , <nl> { " equation " , kEquation } , <nl> { " is_eager " , kIsEager } , <nl> + { " tf_function_call " , kTfFunctionCall } , <nl> + { " tracing_count " , kTfFunctionTracingCount } , <nl> / / Performance counter related . <nl> { " Raw Value " , kRawValue } , <nl> { " Scaled Value " , kScaledValue } , <nl> mmm a / tensorflow / core / profiler / utils / xplane_schema . h <nl> ppp b / tensorflow / core / profiler / utils / xplane_schema . h <nl> enum StatType { <nl> kHloModule , <nl> kEquation , <nl> kIsEager , <nl> + kTfFunctionCall , <nl> + kTfFunctionTracingCount , <nl> / / Performance counter related . <nl> kRawValue , <nl> kScaledValue , <nl> mmm a / tensorflow / core / profiler / utils / xplane_utils . cc <nl> ppp b / tensorflow / core / profiler / utils / xplane_utils . cc <nl> XEventBuilder CreateXEvent ( <nl> stats ) ; <nl> } <nl> <nl> + XEventBuilder CreateXEventWithStringViewMetadataValue ( <nl> + XPlaneBuilder * plane_builder , XLineBuilder * line_builder , <nl> + absl : : string_view event_name , int64 offset_ps , int64 duration_ps , <nl> + const absl : : flat_hash_map < StatType , absl : : string_view / * stat_value * / > & <nl> + stats ) { <nl> + auto event_builder = line_builder - > AddEvent ( <nl> + * plane_builder - > GetOrCreateEventMetadata ( event_name ) ) ; <nl> + event_builder . SetOffsetPs ( offset_ps ) ; <nl> + event_builder . SetDurationPs ( duration_ps ) ; <nl> + for ( const auto & stat_type_and_value : stats ) { <nl> + event_builder . AddStatValue ( * plane_builder - > GetOrCreateStatMetadata ( <nl> + GetStatTypeStr ( stat_type_and_value . first ) ) , <nl> + stat_type_and_value . second ) ; <nl> + } <nl> + return event_builder ; <nl> + } <nl> + <nl> void RemovePlaneWithName ( XSpace * space , absl : : string_view name ) { <nl> auto * planes = space - > mutable_planes ( ) ; <nl> planes - > erase ( <nl> uint64 GetStartTimestampNs ( const XPlane & plane ) { <nl> return plane_timestamp ; <nl> } <nl> <nl> + void CreateTfFunctionCallEvent ( XPlaneBuilder * plane_builder , <nl> + XLineBuilder * line_builder , <nl> + absl : : string_view function_name , int64 offset_ps , <nl> + int64 duration_ps , <nl> + absl : : string_view execution_mode , <nl> + int64 tracing_count ) { <nl> + XEventBuilder event_builder = CreateXEventWithStringViewMetadataValue ( <nl> + plane_builder , line_builder , function_name , offset_ps , duration_ps , <nl> + { { StatType : : kTfFunctionCall , execution_mode } } ) ; <nl> + if ( tracing_count > = 0 ) { <nl> + / / Adds the tracing_count stats only if tracing_count is valid . <nl> + event_builder . AddStatValue ( <nl> + * plane_builder - > GetOrCreateStatMetadata ( <nl> + GetStatTypeStr ( StatType : : kTfFunctionTracingCount ) ) , <nl> + tracing_count ) ; <nl> + } <nl> + } <nl> + <nl> } / / namespace profiler <nl> } / / namespace tensorflow <nl> mmm a / tensorflow / core / profiler / utils / xplane_utils . h <nl> ppp b / tensorflow / core / profiler / utils / xplane_utils . h <nl> void AddOrUpdateIntStat ( int64 metadata_id , int64 value , <nl> void AddOrUpdateStrStat ( int64 metadata_id , absl : : string_view value , <nl> tensorflow : : profiler : : XEvent * event ) ; <nl> <nl> + / / Creates an XEvent with int64 stats . <nl> XEventBuilder CreateXEvent ( <nl> XPlaneBuilder * plane_builder , XLineBuilder * line_builder , <nl> absl : : string_view event_name , int64 offset_ps , int64 duration_ps , <nl> - const absl : : flat_hash_map < StatType , int64 / * stat_value * / > & stats ) ; <nl> - <nl> + const absl : : flat_hash_map < StatType , int64 / * stat_value * / > & stats = { } ) ; <nl> XEventBuilder CreateXEvent ( <nl> XPlaneBuilder * plane_builder , XLineBuilder * line_builder , <nl> HostEventType event_type , int64 offset_ps , int64 duration_ps , <nl> const absl : : flat_hash_map < StatType , int64 / * stat_value * / > & stats ) ; <nl> <nl> + / / Creates an XEvent with string stats . <nl> + XEventBuilder CreateXEventWithStringViewMetadataValue ( <nl> + XPlaneBuilder * plane_builder , XLineBuilder * line_builder , <nl> + absl : : string_view event_name , int64 offset_ps , int64 duration_ps , <nl> + const absl : : flat_hash_map < StatType , absl : : string_view / * stat_value * / > & <nl> + stats ) ; <nl> + <nl> void RemovePlaneWithName ( XSpace * space , absl : : string_view name ) ; <nl> void RemoveEmptyPlanes ( XSpace * space ) ; <nl> void RemoveEmptyLines ( XPlane * plane ) ; <nl> void MergePlanes ( const XPlane & src_plane , XPlane * dst_plane ) ; <nl> / / timestamps . If zero line exists , return 0 ; <nl> uint64 GetStartTimestampNs ( const XPlane & plane ) ; <nl> <nl> + / / Creates a Xevent in the given plane & line for a tf - function . <nl> + void CreateTfFunctionCallEvent ( XPlaneBuilder * plane_builder , <nl> + XLineBuilder * line_builder , <nl> + absl : : string_view function_name , int64 offset_ps , <nl> + int64 duration_ps , <nl> + absl : : string_view execution_mode , <nl> + int64 tracing_count = - 1 ) ; <nl> } / / namespace profiler <nl> } / / namespace tensorflow <nl> <nl>
[ Profiler ] Add tf - function stats to be part of op_stats .
tensorflow/tensorflow
b091e4212038ac774bc2d9a4fe907e3d51ccdd68
2020-04-28T18:25:28Z
mmm a / README <nl> ppp b / README <nl> @ @ - 1 + 1 , 5 @ @ <nl> - See the wiki at : https : / / github . com / philsquared / Catch / wiki <nl> + CATCH is an automated test framework for C , C + + and Objective - C . <nl> + <nl> + The latest stable version can be found as a single header in the Downloads section . <nl> + <nl> + For documentation see the wiki at : https : / / github . com / philsquared / Catch / wiki <nl>
Added to the readme
catchorg/Catch2
105726f8e4363b0a3bd1bae1979be7a7244e7a89
2012-10-28T12:11:35Z
mmm a / cocos2dx / platform / uphone / CCXUIImage_uphone . cpp <nl> ppp b / cocos2dx / platform / uphone / CCXUIImage_uphone . cpp <nl> THE SOFTWARE . <nl> using namespace std ; <nl> namespace cocos2d { <nl> <nl> + # ifdef _TRANZDA_VM_ <nl> + # define CCX_RGB ( vr , vg , vb ) \ <nl> + ( ColorRefType ) ( ( ( UInt32 ) ( UInt8 ) ( vb ) < < 16 ) | ( ( UInt32 ) ( UInt8 ) ( vg ) < < 8 ) | ( UInt32 ) ( UInt8 ) ( vr ) | ( ( UInt32 ) 0xffL < < 24 ) ) <nl> + <nl> + # define CCX_RGB_APLHA ( vr , vg , vb , va ) \ <nl> + ( ColorRefType ) ( ( ( UInt32 ) ( ( UInt8 ) ( vr ) * ( ( UInt8 ) ( va ) + 1 ) ) > > 8 ) | \ <nl> + ( ( UInt32 ) ( ( UInt8 ) ( vg ) * ( ( UInt8 ) ( va ) + 1 ) > > 8 ) < < 8 ) | \ <nl> + ( ( UInt32 ) ( ( UInt8 ) ( vb ) * ( ( UInt8 ) ( va ) + 1 ) > > 8 ) < < 16 ) | \ <nl> + ( ( UInt32 ) ( UInt8 ) ( va ) < < 24 ) ) <nl> + <nl> + # define CCX_RGBA ( vr , vg , vb , va ) \ <nl> + ( ( ( va ) = = 0xff ) ? CCX_RGB ( ( vr ) , ( vg ) , ( vb ) ) : CCX_RGB_APLHA ( ( vr ) , ( vg ) , ( vb ) , ( va ) ) ) <nl> + <nl> + # else <nl> + # define CCX_RGB RGB <nl> + # define CCX_RGBA RGBA <nl> + # endif / / _TRANZDA_VM_ <nl> + <nl> typedef struct <nl> { <nl> unsigned char * data ; <nl> static void pngReadCallback ( png_structp png_ptr , png_bytep data , png_size_t leng <nl> } <nl> } <nl> <nl> + static void copyImageData ( tImageInfo & imageInfo , png_bytep * rowPointers ) <nl> + { <nl> + / / allocate memory <nl> + imageInfo . data = new unsigned char [ imageInfo . height * imageInfo . width * 4 ] ; <nl> + if ( ! imageInfo . data ) <nl> + { <nl> + return ; <nl> + } <nl> + <nl> + / / copy data <nl> + if ( imageInfo . hasAlpha ) { <nl> + unsigned int bytesPerRow = imageInfo . width * 4 ; <nl> + unsigned int * tmp = ( unsigned int * ) imageInfo . data ; <nl> + for ( unsigned int i = 0 ; i < imageInfo . height ; i + + ) <nl> + { <nl> + for ( unsigned int j = 0 ; j < bytesPerRow ; j + = 4 ) <nl> + { <nl> + * tmp + + = CCX_RGBA ( rowPointers [ i ] [ j ] , rowPointers [ i ] [ j + 1 ] , <nl> + rowPointers [ i ] [ j + 2 ] , rowPointers [ i ] [ j + 3 ] ) ; <nl> + } <nl> + } <nl> + } <nl> + else <nl> + { <nl> + unsigned int bytesPerRow = imageInfo . width * 3 ; <nl> + unsigned int * tmp = ( unsigned int * ) imageInfo . data ; <nl> + for ( unsigned int i = 0 ; i < imageInfo . height ; i + + ) <nl> + { <nl> + for ( unsigned int j = 0 ; j < bytesPerRow ; j + = 3 ) <nl> + { <nl> + * tmp + + = CCX_RGB ( rowPointers [ i ] [ j ] , rowPointers [ i ] [ j + 1 ] , <nl> + rowPointers [ i ] [ j + 2 ] ) ; <nl> + } <nl> + } <nl> + } <nl> + } <nl> + <nl> UIImage : : UIImage ( void ) <nl> { <nl> m_pBitmap = NULL ; <nl> + <nl> + m_imageInfo . hasAlpha = false ; <nl> + m_imageInfo . isPremultipliedAlpha = false ; <nl> + m_imageInfo . height = 0 ; <nl> + m_imageInfo . width = 0 ; <nl> + m_imageInfo . data = NULL ; <nl> + m_imageInfo . bitsPerComponent = 0 ; <nl> } <nl> + <nl> UIImage : : UIImage ( TBitmap * bitmap ) <nl> { <nl> - m_pBitmap = bitmap - > Clone ( ) ; <nl> + if ( bitmap ) <nl> + { <nl> + m_pBitmap = bitmap - > DupBitmapTo32 ( ) ; <nl> + <nl> + / / init imageinfo <nl> + m_imageInfo . data = m_pBitmap - > GetDataPtr ( ) ; <nl> + m_imageInfo . height = m_pBitmap - > GetHeight ( ) ; <nl> + m_imageInfo . width = m_pBitmap - > GetWidth ( ) ; <nl> + m_imageInfo . hasAlpha = m_pBitmap - > HasAlphaData ( ) ; <nl> + / / uphone only support predefined <nl> + m_imageInfo . isPremultipliedAlpha = true ; <nl> + m_imageInfo . bitsPerComponent = m_pBitmap - > GetDepth ( ) ; <nl> + } <nl> } <nl> <nl> UIImage : : UIImage ( int nX , int nY , void * buffer ) <nl> UIImage : : ~ UIImage ( void ) <nl> { <nl> if ( m_pBitmap ) <nl> { <nl> + / / the m_imageInfo ' s data points to m_pBitmap , <nl> + / / so we don ' t release m_imageInfo ' s data <nl> m_pBitmap - > Destroy ( ) ; <nl> } <nl> - } <nl> - <nl> - bool UIImage : : initWithContentsOfFile ( const string & strPath ) <nl> - { <nl> - if ( m_pBitmap ) <nl> - { <nl> - return false ; <nl> - } <nl> - <nl> - bool bRet = false ; <nl> - do <nl> + else <nl> { <nl> - / / load the image <nl> - / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> - / * Use ImageToolKit load image * / <nl> - / / ImageLoader obImgLoader ; <nl> - / / Image obImg ; <nl> - / / TUChar * pszPath = new TUChar [ strPath . size ( ) + 1 ] ; <nl> - / / TUString : : StrGBToUnicode ( pszPath , ( const Char * ) strPath . c_str ( ) ) ; <nl> - / / if ( ! obImgLoader . loadImage ( obImg , pszPath , IT_LOAD_FMT_UNKNOWN ) ) <nl> - / / { <nl> - / / bRet = false ; <nl> - / / break ; <nl> - / / } <nl> - / / <nl> - / / / / init bitmap <nl> - / / m_pBitmap = ( TBitmap * ) obImg . GetTBitmap ( ) ; <nl> - / / m_pBitmap = m_pBitmap - > DupBitmapTo32 ( ) ; <nl> - / / delete [ ] pszPath ; <nl> - / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> - <nl> - / / use libpng load image <nl> - bRet = loadPng ( strPath . c_str ( ) ) ; <nl> - <nl> - / / check if the loading action is successful <nl> - if ( ! bRet ) <nl> - { <nl> - break ; <nl> - } <nl> - <nl> - / / the hight is 0 ? ? <nl> - if ( m_pBitmap - > GetHeight ( ) = = 0 ) <nl> + if ( m_imageInfo . data ) <nl> { <nl> - m_pBitmap - > Destroy ( ) ; <nl> - m_pBitmap = NULL ; <nl> - <nl> - bRet = false ; <nl> - break ; <nl> + delete [ ] m_imageInfo . data ; <nl> } <nl> - } while ( 0 ) ; <nl> + } <nl> + } <nl> <nl> - return bRet ; <nl> + bool UIImage : : initWithContentsOfFile ( const string & strPath ) <nl> + { <nl> + / / use libpng load image <nl> + return loadPng ( strPath . c_str ( ) ) ; <nl> } <nl> <nl> unsigned int UIImage : : width ( void ) <nl> { <nl> - if ( ! m_pBitmap ) <nl> - { <nl> - return 0 ; <nl> - } <nl> - <nl> - return m_pBitmap - > GetWidth ( ) ; <nl> + return m_imageInfo . width ; <nl> } <nl> <nl> unsigned int UIImage : : height ( void ) <nl> { <nl> - if ( ! m_pBitmap ) <nl> - { <nl> - return 0 ; <nl> - } <nl> - <nl> - return m_pBitmap - > GetHeight ( ) ; <nl> + return m_imageInfo . height ; <nl> } <nl> <nl> bool UIImage : : isAlphaPixelFormat ( void ) <nl> { <nl> - if ( ! m_pBitmap ) <nl> - { <nl> - return false ; <nl> - } <nl> - <nl> - bool bRet ; <nl> - if ( m_pBitmap - > HasAlphaData ( ) ) <nl> - { <nl> - bRet = true ; <nl> - } <nl> - else <nl> - { <nl> - bRet = false ; <nl> - } <nl> - <nl> - return bRet ; <nl> + return m_imageInfo . hasAlpha ; <nl> } <nl> <nl> / / now , uphone only support premultiplied data <nl> bool UIImage : : isPremultipliedAlpha ( void ) <nl> / / compute how many bits every color component <nl> int UIImage : : CGImageGetBitsPerComponent ( void ) <nl> { <nl> - if ( ! m_pBitmap ) <nl> - { <nl> - return 0 ; <nl> - } <nl> - <nl> - int nRet = 0 ; <nl> - int nRowBytes = m_pBitmap - > GetRowBytes ( ) ; <nl> - if ( m_pBitmap - > HasAlphaData ( ) ) <nl> - { <nl> - / / it has alpha data , so <nl> - / / nRawBytes / 4 - > the bytes of per component <nl> - nRet = nRowBytes / 4 * 8 ; <nl> - } <nl> - else <nl> - { <nl> - / / have not alpha data <nl> - / / nRawBytes / 3 - > the bytes of per component <nl> - nRet = nRowBytes / 3 * 8 ; <nl> - } <nl> - <nl> - return nRet ; <nl> + return m_imageInfo . bitsPerComponent ; <nl> } <nl> <nl> / / 0 - > it is a mask <nl> int UIImage : : CGImageGetColorSpace ( void ) <nl> { <nl> int nRet = 1 ; <nl> <nl> - if ( m_pBitmap - > GetRowBytes ( ) = = 1 ) <nl> + if ( m_imageInfo . bitsPerComponent = = 8 ) <nl> { <nl> nRet = 0 ; <nl> } <nl> int UIImage : : CGImageGetColorSpace ( void ) <nl> <nl> unsigned char * UIImage : : getRGBA8888Data ( void ) <nl> { <nl> - unsigned char * pBufferRet = NULL ; <nl> - <nl> - do { <nl> - / * TBitmap * pBitmap ; * / <nl> - int nW ; <nl> - int nH ; <nl> - unsigned char uR ; <nl> - unsigned char uB ; <nl> - <nl> - if ( m_pBitmap = = NULL ) <nl> - { <nl> - break ; <nl> - } <nl> - <nl> - / / convert to RGBA8888 format <nl> - / / pBitmap = m_pBitmap - > DupBitmapTo32 ( ) ; <nl> - / / if ( pBitmap = = NULL ) <nl> - / / { <nl> - / / break ; <nl> - / / } <nl> - <nl> - / / compute width and height <nl> - nW = m_pBitmap - > GetWidth ( ) ; <nl> - nH = m_pBitmap - > GetHeight ( ) ; <nl> - <nl> - / / alloc memory and store the bitmap data <nl> - pBufferRet = new unsigned char [ nW * nH * 4 ] ; <nl> - memcpy ( pBufferRet , m_pBitmap - > GetDataPtr ( ) , nW * nH * 4 ) ; <nl> - <nl> - # ifdef _TRANZDA_VM_ <nl> - / / translate BGRA to RGBA <nl> - for ( int i = 0 ; i < nW ; + + i ) <nl> - { <nl> - for ( int j = 0 ; j < nH ; + + j ) <nl> - { <nl> - int baseAddr = ( j * nW + i ) * 4 ; <nl> - <nl> - uB = pBufferRet [ baseAddr ] ; <nl> - uR = pBufferRet [ baseAddr + 2 ] ; <nl> - <nl> - pBufferRet [ baseAddr ] = uR ; <nl> - pBufferRet [ baseAddr + 2 ] = uB ; <nl> - } <nl> - } <nl> - # endif / / _TRANZDA_VM_ <nl> - <nl> - / * pBitmap - > Destroy ( ) ; * / <nl> - } while ( 0 ) ; <nl> - <nl> - return pBufferRet ; <nl> + return m_imageInfo . data ; <nl> } <nl> <nl> bool UIImage : : loadPng ( const char * strFileName ) <nl> { <nl> - char header [ 8 ] ; <nl> - FILE * fp ; <nl> - png_structp png_ptr ; <nl> - png_infop info_ptr ; <nl> - UInt32 * pBmpData ; <nl> - Int32 bitDepth ; <nl> - png_uint_32 width ; <nl> - png_uint_32 height ; <nl> - Int32 interlaceType ; <nl> - png_bytep * rowPointers ; <nl> - Int32 colorType ; <nl> - <nl> + FILE * fp ; <nl> + unsigned char * buffer = NULL ; <nl> + bool bRet = true ; <nl> + <nl> fp = NULL ; <nl> - pBmpData = NULL ; <nl> - <nl> - / / open file <nl> - fp = fopen ( strFileName , " rb " ) ; <nl> - if ( ! fp ) <nl> - return false ; <nl> - <nl> - / / read 8 bytes from the beginning of the file <nl> - fread ( header , 1 , 8 , fp ) ; <nl> - <nl> - / / close the file if it ' s not a png <nl> - if ( png_sig_cmp ( ( png_bytep ) header , 0 , 8 ) ) <nl> - { <nl> - fclose ( fp ) ; <nl> - return false ; <nl> - } <nl> - <nl> - / / init png_struct <nl> - png_ptr = png_create_read_struct ( PNG_LIBPNG_VER_STRING , NULL , NULL , NULL ) ; <nl> - if ( ! png_ptr ) <nl> - { <nl> - fclose ( fp ) ; <nl> - return false ; <nl> - } <nl> - <nl> - / / init png_info <nl> - info_ptr = png_create_info_struct ( png_ptr ) ; <nl> - if ( ! info_ptr ) <nl> - { <nl> - png_destroy_read_struct ( & png_ptr , NULL , NULL ) ; <nl> - fclose ( fp ) ; <nl> - return false ; <nl> - } <nl> - <nl> - / / if something wrong , close file and return <nl> - if ( setjmp ( png_jmpbuf ( png_ptr ) ) ) <nl> - { <nl> - png_destroy_read_struct ( & png_ptr , NULL , NULL ) ; <nl> - png_destroy_info_struct ( png_ptr , & info_ptr ) ; <nl> - fclose ( fp ) ; <nl> - return false ; <nl> - } <nl> - <nl> - / / conect the file pointer to libpng <nl> - png_init_io ( png_ptr , fp ) ; <nl> - png_set_sig_bytes ( png_ptr , 8 ) ; <nl> - <nl> - / / read the data of the file <nl> - png_read_png ( png_ptr , info_ptr , PNG_TRANSFORM_EXPAND | PNG_TRANSFORM_GRAY_TO_RGB , 0 ) ; <nl> - <nl> - png_get_IHDR ( png_ptr , info_ptr , & width , & height , & bitDepth , & colorType , <nl> - & interlaceType , NULL , NULL ) ; <nl> - <nl> - if ( setjmp ( png_jmpbuf ( png_ptr ) ) ) <nl> - { <nl> - png_destroy_read_struct ( & png_ptr , NULL , NULL ) ; <nl> - png_destroy_info_struct ( png_ptr , & info_ptr ) ; <nl> - fclose ( fp ) ; <nl> - return false ; <nl> - } <nl> - <nl> - / / get the image file data <nl> - rowPointers = png_get_rows ( png_ptr , info_ptr ) ; <nl> - <nl> - / / Create a bitmap of 32bits depth <nl> - if ( ! m_pBitmap ) <nl> - { <nl> - m_pBitmap = TBitmap : : Create ( width , height , 32 ) ; <nl> - } <nl> - if ( ! m_pBitmap ) <nl> - { <nl> - png_destroy_read_struct ( & png_ptr , NULL , NULL ) ; <nl> - png_destroy_info_struct ( png_ptr , & info_ptr ) ; <nl> - fclose ( fp ) ; <nl> - return false ; <nl> - } <nl> - <nl> - / / Alpha data <nl> - pBmpData = ( UInt32 * ) ( m_pBitmap - > GetDataPtr ( ) ) ; <nl> - <nl> - if ( info_ptr - > color_type & PNG_COLOR_MASK_ALPHA ) { <nl> - for ( unsigned int i = 0 ; i < height ; i + + ) <nl> - { <nl> - for ( unsigned int j = 0 ; j < ( 4 * width ) ; j + = 4 ) <nl> - { <nl> - * pBmpData + + = RGBA ( rowPointers [ i ] [ j ] , rowPointers [ i ] [ j + 1 ] , <nl> - rowPointers [ i ] [ j + 2 ] , rowPointers [ i ] [ j + 3 ] ) ; <nl> - } <nl> - } <nl> - } <nl> - else <nl> - { <nl> - for ( unsigned int i = 0 ; i < height ; i + + ) <nl> - { <nl> - for ( unsigned int j = 0 ; j < ( 3 * width ) ; j + = 3 ) <nl> - { <nl> - * pBmpData + + = RGB ( rowPointers [ i ] [ j ] , rowPointers [ i ] [ j + 1 ] , <nl> - rowPointers [ i ] [ j + 2 ] ) ; <nl> - } <nl> - } <nl> - } <nl> - <nl> - / / release <nl> - png_destroy_read_struct ( & png_ptr , NULL , NULL ) ; <nl> - png_destroy_info_struct ( png_ptr , & info_ptr ) ; <nl> - fclose ( fp ) ; <nl> - <nl> - return true ; <nl> + <nl> + do <nl> + { <nl> + / / open file <nl> + fp = fopen ( strFileName , " rb " ) ; <nl> + if ( ! fp ) <nl> + { <nl> + bRet = false ; <nl> + break ; <nl> + } <nl> + <nl> + / / compute the length of file <nl> + fseek ( fp , 0 , SEEK_END ) ; <nl> + int size = ftell ( fp ) ; <nl> + fseek ( fp , 0 , SEEK_SET ) ; <nl> + <nl> + / / allocate enough memory to save the data of file <nl> + buffer = new unsigned char [ size ] ; <nl> + if ( ! buffer ) <nl> + { <nl> + bRet = false ; <nl> + break ; <nl> + } <nl> + <nl> + / / read data <nl> + fread ( buffer , sizeof ( unsigned char ) , size , fp ) ; <nl> + <nl> + bRet = loadPngFromStream ( buffer , size ) ; <nl> + delete [ ] buffer ; <nl> + } while ( 0 ) ; <nl> + <nl> + if ( fp ) <nl> + { <nl> + fclose ( fp ) ; <nl> + } <nl> + <nl> + return bRet ; <nl> } <nl> <nl> bool UIImage : : loadPngFromStream ( unsigned char * data , int nLength ) <nl> bool UIImage : : loadPngFromStream ( unsigned char * data , int nLength ) <nl> char header [ 8 ] ; <nl> png_structp png_ptr ; <nl> png_infop info_ptr ; <nl> - UInt32 * pBmpData ; <nl> Int32 pos ; <nl> Int32 bitDepth ; <nl> png_uint_32 width ; <nl> bool UIImage : : loadPngFromStream ( unsigned char * data , int nLength ) <nl> tImageSource imageSource ; <nl> <nl> pos = 0 ; <nl> - pBmpData = NULL ; <nl> <nl> / / read 8 bytes from the beginning of stream <nl> unsigned char * tmp = data ; <nl> bool UIImage : : loadPngFromStream ( unsigned char * data , int nLength ) <nl> imageSource . offset = 0 ; <nl> png_set_read_fn ( png_ptr , & imageSource , pngReadCallback ) ; <nl> <nl> + <nl> / / read the data of the file <nl> png_read_png ( png_ptr , info_ptr , PNG_TRANSFORM_EXPAND | PNG_TRANSFORM_GRAY_TO_RGB , 0 ) ; <nl> <nl> bool UIImage : : loadPngFromStream ( unsigned char * data , int nLength ) <nl> / / get the image file data <nl> rowPointers = png_get_rows ( png_ptr , info_ptr ) ; <nl> <nl> - / / Create a bitmap of 32bits depth <nl> - if ( ! m_pBitmap ) <nl> - { <nl> - m_pBitmap = TBitmap : : Create ( width , height , 32 ) ; <nl> - } <nl> - if ( ! m_pBitmap ) <nl> - { <nl> - png_destroy_read_struct ( & png_ptr , NULL , NULL ) ; <nl> - png_destroy_info_struct ( png_ptr , & info_ptr ) ; <nl> - return false ; <nl> - } <nl> - <nl> - / / Alpha data <nl> - pBmpData = reinterpret_cast < UInt32 * > ( m_pBitmap - > GetDataPtr ( ) ) ; <nl> - <nl> - if ( info_ptr - > color_type & PNG_COLOR_MASK_ALPHA ) { <nl> - for ( unsigned int i = 0 ; i < height ; i + + ) <nl> - { <nl> - for ( unsigned int j = 0 ; j < ( 4 * width ) ; j + = 4 ) <nl> - { <nl> - * pBmpData + + = RGBA ( rowPointers [ i ] [ j ] , rowPointers [ i ] [ j + 1 ] , <nl> - rowPointers [ i ] [ j + 2 ] , rowPointers [ i ] [ j + 3 ] ) ; <nl> - } <nl> - } <nl> - } <nl> - else <nl> - { <nl> - for ( unsigned int i = 0 ; i < height ; i + + ) <nl> - { <nl> - for ( unsigned int j = 0 ; j < ( 3 * width ) ; j + = 3 ) <nl> - { <nl> - * pBmpData + + = RGB ( rowPointers [ i ] [ j ] , rowPointers [ i ] [ j + 1 ] , <nl> - rowPointers [ i ] [ j + 2 ] ) ; <nl> - } <nl> - } <nl> - } <nl> + / / init image info <nl> + m_imageInfo . height = height ; <nl> + m_imageInfo . width = width ; <nl> + m_imageInfo . hasAlpha = info_ptr - > color_type & PNG_COLOR_MASK_ALPHA ; <nl> + m_imageInfo . isPremultipliedAlpha = true ; <nl> + copyImageData ( m_imageInfo , rowPointers ) ; <nl> + / / we use CCX_RGA or CCX_RGB to save data <nl> + / / so the bitsPerComponet is 32 , and it also <nl> + / / has the alpha data <nl> + m_imageInfo . bitsPerComponent = 32 ; <nl> + m_imageInfo . hasAlpha = true ; <nl> <nl> / / release <nl> png_destroy_read_struct ( & png_ptr , NULL , NULL ) ; <nl> bool UIImage : : save ( const std : : string & strFileName , int nFormat ) <nl> } <nl> bool UIImage : : initWithData ( unsigned char * pBuffer , int nLength ) <nl> { <nl> - bool bRet = true ; <nl> - <nl> - do <nl> - { <nl> - bRet = loadPngFromStream ( pBuffer , nLength ) ; <nl> - / / if load failed , break <nl> - if ( ! bRet ) <nl> - { <nl> - break ; <nl> - } <nl> - <nl> - / / the hight is 0 ? ? <nl> - if ( m_pBitmap - > GetHeight ( ) = = 0 ) <nl> - { <nl> - m_pBitmap - > Destroy ( ) ; <nl> - m_pBitmap = NULL ; <nl> - bRet = false ; <nl> - <nl> - break ; <nl> - } <nl> - } while ( 0 ) ; <nl> - <nl> - return bRet ; <nl> + return loadPngFromStream ( pBuffer , nLength ) ; <nl> } <nl> <nl> bool UIImage : : initWithBuffer ( int tx , int ty , unsigned char * pBuffer ) <nl> mmm a / cocos2dx / platform / uphone / CCXUIImage_uphone . h <nl> ppp b / cocos2dx / platform / uphone / CCXUIImage_uphone . h <nl> THE SOFTWARE . <nl> class TBitmap ; <nl> namespace cocos2d { <nl> <nl> + typedef struct <nl> + { <nl> + unsigned int height ; <nl> + unsigned int width ; <nl> + int bitsPerComponent ; <nl> + bool hasAlpha ; <nl> + bool isPremultipliedAlpha ; <nl> + unsigned char * data ; <nl> + } tImageInfo ; <nl> + <nl> class CCX_DLL UIImage <nl> { <nl> public : <nl> class CCX_DLL UIImage <nl> <nl> private : <nl> TBitmap * m_pBitmap ; <nl> + tImageInfo m_imageInfo ; <nl> } ; <nl> } / / namespace cocos2d <nl> <nl> mmm a / cocos2dx / textures / CCTexture2D . cpp <nl> ppp b / cocos2dx / textures / CCTexture2D . cpp <nl> bool CCTexture2D : : initPremultipliedATextureWithImage ( UIImage * image , unsigned in <nl> NSAssert ( tempData ! = NULL , " NULL image data . " ) ; <nl> if ( image - > width ( ) = = POTWide & & image - > height ( ) = = POTHigh ) <nl> { <nl> - data = tempData ; <nl> + data = new UINT8 [ POTHigh * POTWide * 4 ] ; <nl> + memcpy ( data , tempData , POTHigh * POTWide * 4 ) ; <nl> } <nl> else <nl> { <nl> bool CCTexture2D : : initPremultipliedATextureWithImage ( UIImage * image , unsigned in <nl> { <nl> memcpy ( pTargetData + POTWide * 4 * y , pPixelData + ( image - > width ( ) ) * 4 * y , ( image - > width ( ) ) * 4 ) ; <nl> } <nl> - delete [ ] tempData ; <nl> } <nl> break ; <nl> default : <nl> bool CCTexture2D : : initPremultipliedATextureWithImage ( UIImage * image , unsigned in <nl> tempData = new UINT8 [ POTHigh * POTWide * 2 ] ; <nl> inPixel32 = ( unsigned int * ) data ; <nl> outPixel16 = ( unsigned short * ) tempData ; <nl> + <nl> for ( i = 0 ; i < POTWide * POTHigh ; + + i , + + inPixel32 ) <nl> * outPixel16 + + = ( ( ( ( * inPixel32 > > 0 ) & 0xFF ) > > 3 ) < < 11 ) | ( ( ( ( * inPixel32 > > 8 ) & 0xFF ) > > 2 ) < < 5 ) | ( ( ( ( * inPixel32 > > 16 ) & 0xFF ) > > 3 ) < < 0 ) ; <nl> + <nl> delete [ ] data ; <nl> data = tempData ; <nl> } <nl> bool CCTexture2D : : initPremultipliedATextureWithImage ( UIImage * image , unsigned in <nl> tempData = new UINT8 [ POTHigh * POTWide * 2 ] ; <nl> inPixel32 = ( unsigned int * ) data ; <nl> outPixel16 = ( unsigned short * ) tempData ; <nl> + <nl> for ( i = 0 ; i < POTWide * POTHigh ; + + i , + + inPixel32 ) <nl> * outPixel16 + + = <nl> ( ( ( ( * inPixel32 > > 0 ) & 0xFF ) > > 4 ) < < 12 ) | / / R <nl> bool CCTexture2D : : initPremultipliedATextureWithImage ( UIImage * image , unsigned in <nl> tempData = new UINT8 [ POTHigh * POTWide * 2 ] ; <nl> inPixel32 = ( unsigned int * ) data ; <nl> outPixel16 = ( unsigned short * ) tempData ; <nl> + <nl> for ( i = 0 ; i < POTWide * POTHigh ; + + i , + + inPixel32 ) <nl> * outPixel16 + + = <nl> ( ( ( ( * inPixel32 > > 0 ) & 0xFF ) > > 3 ) < < 11 ) | / / R <nl>
issue
cocos2d/cocos2d-x
b87fb419fbf07964b27c1b723e7ea214d7bba79f
2010-09-18T06:14:51Z
mmm a / Source / CNTK / BrainScript / ExperimentalNetworkBuilder . cpp <nl> ppp b / Source / CNTK / BrainScript / ExperimentalNetworkBuilder . cpp <nl> using namespace std ; <nl> wstring computationNodes = / / TODO : use actual TypeName ( ) here ? would first need to make it a wide string ; we should also extract those two methods into the base macro <nl> L " LearnableParameter ( rows , cols , needGradient = true , init = ' uniform ' / * | fixedValue | gaussian | fromFile * / , initValueScale = 1 , value = 0 , initFromFilePath = ' ' , initOnCPUOnly = true , randomSeed = - 1 , tag = ' ' ) = new ComputationNode [ operation = ' LearnableParameter ' ; shape = new TensorShape [ dims = ( rows : cols ) ] / * plus the function args * / ] \ n " <nl> L " Parameter = LearnableParameter / / deprecated \ n " <nl> + L " ParameterTensor ( dims , needGradient = true , init = ' uniform ' / * | fixedValue | gaussian | fromFile * / , initValueScale = 1 , value = 0 , initFromFilePath = ' ' , initOnCPUOnly = true , randomSeed = - 1 , tag = ' ' ) = new ComputationNode [ operation = ' LearnableParameter ' ; shape = new TensorShape [ / * dims * / ] / * plus the function args * / ] \ n " <nl> / / ^ ^ already works ; vv untested <nl> L " Input ( rows , tag = ' feature ' ) = new ComputationNode [ operation = ' InputValue ' ; shape = new TensorShape [ dims = ( rows ) ] ; isImage = false / * plus the function args * / ] \ n " / / note : naming a little inconsistent / / TODO : re - test after flag change <nl> L " SparseInput ( rows , tag = ' feature ' ) = new ComputationNode [ operation = ' SparseInputValue ' ; shape = new TensorShape [ dims = ( rows ) ] ; isImage = false / * plus the function args * / ] \ n " <nl> mmm a / Source / Common / Include / DataTensor . h <nl> ppp b / Source / Common / Include / DataTensor . h <nl> namespace Microsoft { namespace MSR { namespace CNTK { <nl> } ; <nl> static inline ImageLayoutKind ImageLayoutKindFrom ( const wstring & s ) <nl> { <nl> - if ( s = = L " CHW " ) return ImageLayoutKind : : CHW ; <nl> - else if ( s = = L " HWC " ) return ImageLayoutKind : : HWC ; <nl> + if ( s = = L " CHW " | | s = = L " cudnn " ) return ImageLayoutKind : : CHW ; <nl> + else if ( s = = L " HWC " | | s = = L " legacy " ) return ImageLayoutKind : : HWC ; <nl> else InvalidArgument ( " ImageLayoutKindFrom : Unknown ImageLayoutKind ' % ls ' , must be ' CHW ' ( cudnn ) or ' HWC ' ( CNTK legacy ) " , s . c_str ( ) ) ; <nl> } <nl> static inline TensorShape ImageLayout ( size_t width , size_t height , size_t channels , ImageLayoutKind imageLayoutKind ) <nl> mmm a / Source / ComputationNetworkLib / ComputationNode . cpp <nl> ppp b / Source / ComputationNetworkLib / ComputationNode . cpp <nl> namespace Microsoft { <nl> size_t rows0 = Input ( 0 ) - > GetNumRows ( ) , cols0 = Input ( 0 ) - > GetNumCols ( ) ; <nl> size_t rows1 = Input ( 1 ) - > GetNumRows ( ) , cols1 = Input ( 1 ) - > GetNumCols ( ) ; <nl> <nl> + # if 1 / / ndef ENABLE_TENSORVIEW <nl> / / TODO : This test will go away once we switch to full tensor lib . <nl> if ( isFinalValidationPass & & ! ( <nl> ( rows0 = = rows1 & & ( Input ( 0 ) - > GetMBLayout ( ) = = Input ( 1 ) - > GetMBLayout ( ) | | cols0 = = cols1 ) ) | | / / matching size ( obvious case ) <nl> namespace Microsoft { <nl> { <nl> LogicError ( " The Matrix dimensions in the % ls % ls operation do not match . " , NodeName ( ) . c_str ( ) , OperationName ( ) . c_str ( ) ) ; <nl> } <nl> + # else <nl> + rows0 ; rows1 ; <nl> + # endif <nl> <nl> / / result has tensor shape with dimensions being the max over both <nl> let shape0 = GetInputSampleLayout ( 0 ) ; <nl> namespace Microsoft { <nl> for ( size_t i = 0 ; i < GetNumInputs ( ) ; i + + ) <nl> { <nl> size_t rank = Input ( i ) - > GetAndValidateSampleLayout ( ) . GetRank ( ) ; <nl> + if ( ! HasMBLayout ( ) ) / / no MBLayout : last dim is column dimension <nl> + rank + + ; <nl> if ( maxRank < rank ) <nl> maxRank = rank ; <nl> } <nl> namespace Microsoft { <nl> TensorShape ComputationNodeBase : : GetTensorShape ( size_t rank , const FrameRange & fr ) const <nl> { <nl> / / GetAndValidateSampleLayout ( ) ; / / no need to validate because rank comes from DetermineElementwiseTensorRank ( ) which validates all <nl> - if ( ! HasMBLayout ( ) ) / / no MBLayout : just return sample layout ( if other participants have layout , tensor lib will broadcast ) <nl> - return GetSampleLayout ( ) ; / / . Pad ( rank ) ; / / no need for padding <nl> + if ( ! HasMBLayout ( ) ) <nl> + return GetSampleLayout ( ) . Append ( GetSampleLayout ( ) . GetRank ( ) , GetNumCols ( ) ) ; / / last dim is column dimension <nl> + / / TODO : This is not nice ! Instead , of no MBLayout then have sample layout explain whole matrix . <nl> else if ( fr . IsAllFrames ( ) ) <nl> { <nl> / / we have an MBLayout , and for refers to the entire MB <nl> mmm a / Source / ComputationNetworkLib / ComputationNode . h <nl> ppp b / Source / ComputationNetworkLib / ComputationNode . h <nl> <nl> # include < sstream > <nl> # include < iostream > <nl> <nl> - # define ENABLE_TENSORVIEW / / flip this switch once the tensor lib is confirmed to be working <nl> - # define ENABLE_BROADCASTING_ELEMENTTIMES / / if set then ScaleNode and Row / ColumnElementTimes are redirected to ElementTimes <nl> + # define ENABLE_TENSORVIEW / / flip this switch once the tensor lib is confirmed to be working <nl> + # define ENABLE_BROADCASTING_ELEMENTTIMES / / if set then ScaleNode and Row / ColumnElementTimes are redirected to ElementTimes <nl> <nl> # define DEFAULT_HIDDEN_ACTIVATION 0 . 1 <nl> <nl> mmm a / Source / ComputationNetworkLib / LinearAlgebraNodes . h <nl> ppp b / Source / ComputationNetworkLib / LinearAlgebraNodes . h <nl> namespace Microsoft { namespace MSR { namespace CNTK { <nl> <nl> virtual void / * ComputationNode : : * / BackpropTo ( const size_t inputIndex , const FrameRange & fr ) override <nl> { <nl> - # ifdef ENABLE_TENSORVIEW <nl> + # if 0 / / def ENABLE_TENSORVIEW <nl> size_t rank = DetermineElementwiseTensorRank ( ) ; <nl> auto gradient = GradientTensorFor ( rank , fr ) ; <nl> auto inputGradient = Input ( inputIndex ) - > GradientTensorFor ( rank , fr . AllowBroadcast ( ) ) ; <nl> mmm a / Tests / EndToEndTests / Image / QuickE2E / cntk . config <nl> ppp b / Tests / EndToEndTests / Image / QuickE2E / cntk . config <nl> train = [ <nl> convW = Parameter ( outMap , inWCount , init = " uniform " , initValueScale = wScale , initOnCPUOnly = false ) <nl> conv = Convolution ( convW , inp , kW , kH , outMap , hStride , vStride , zeroPadding = false ) <nl> convB = Parameter ( outMap , 1 , init = " fixedValue " , value = bValue ) <nl> + # convB = ParameterTensor ( ( 1 : 1 : outMap : 1 / * col dim * / ) , init = " fixedValue " , value = bValue ) <nl> convPlusB = Plus ( conv , convB ) ; <nl> out = RectifiedLinear ( convPlusB ) ; <nl> ] <nl> - <nl> + <nl> DNNSigmoidLayer ( inDim , outDim , x , parmScale ) = [ / / Sigmoid non - linearity <nl> W = Parameter ( outDim , inDim , init = " uniform " , initValueScale = parmScale , initOnCPUOnly = false ) <nl> b = Parameter ( outDim , 1 , init = " uniform " , initValueScale = parmScale , initOnCPUOnly = false ) <nl> train = [ <nl> z = Plus ( t , b ) <nl> out = Sigmoid ( z ) <nl> ] <nl> - <nl> + <nl> DNNLayer ( inDim , outDim , x , parmScale ) = [ / / no non - linearity , as input for SoftMax <nl> W = Parameter ( outDim , inDim , init = " uniform " , initValueScale = parmScale , initOnCPUOnly = false ) <nl> b = Parameter ( outDim , 1 , init = " uniform " , initValueScale = parmScale , initOnCPUOnly = false ) <nl> train = [ <nl> imageW = 28 <nl> imageH = 28 <nl> labelDim = 10 <nl> - <nl> - features = ImageInput ( imageW , imageH , 1 , imageLayout = " HWC " , tag = " feature " ) <nl> + <nl> + features = ImageInput ( imageW , imageH , 1 , imageLayout = " legacy " , tag = " feature " ) <nl> featScale = Constant ( 0 . 00390625 ) <nl> featScaled = Scale ( featScale , features ) <nl> labels = Input ( labelDim , tag = " label " ) <nl> train = [ <nl> # DNNSigmoidLayer and DNNLayer are defined in Macros . ndl <nl> h1 = DNNSigmoidLayer ( 512 , h1Dim , pool2 , 1 ) . out <nl> ol = DNNLayer ( h1Dim , labelDim , h1 , 1 ) . out <nl> - <nl> + <nl> ce = CrossEntropyWithSoftmax ( labels , ol , tag = " criterion " ) <nl> err = ErrorPrediction ( labels , ol , tag = " eval " ) <nl> outputNodes = ol <nl>
disabled TensorView for PlusNode : : BackpropTo ( ) , as that causes a difference for Image / QuickE2E ;
microsoft/CNTK
c87e2f75501a76a328618f7b0a68f23b0dc7f209
2015-12-31T00:40:49Z
mmm a / script / lib / config . py <nl> ppp b / script / lib / config . py <nl> <nl> <nl> <nl> BASE_URL = ' http : / / gh - contractor - zcbenz . s3 . amazonaws . com / libchromiumcontent ' <nl> - LIBCHROMIUMCONTENT_COMMIT = ' fa886209473d40eafda4e8263a79b5cf83eef95e ' <nl> + LIBCHROMIUMCONTENT_COMMIT = ' 5ccddd5f3968a7f63eaa888e6a8ba319ea8cd3b7 ' <nl> <nl> PLATFORM = { <nl> ' cygwin ' : ' win32 ' , <nl>
Update libchromiumcontent for race condition fix
electron/electron
8a6ba7c49ff5a897d736dd20923d12d7ac327973
2015-05-28T06:43:15Z
mmm a / shell / utils . js <nl> ppp b / shell / utils . js <nl> shellHelper . show = function ( what ) { <nl> <nl> <nl> Map = function ( ) { <nl> - print ( " warning : Map isn ' t a good thing to use " ) ; <nl> } <nl> <nl> Map . prototype . values = function ( ) { <nl>
get rid of extraneous Map warning MINOR
mongodb/mongo
cc15ffda91b81eeb55d178a0e73066831b12cd73
2009-05-27T19:40:50Z
mmm a / lib / Sema / CSApply . cpp <nl> ppp b / lib / Sema / CSApply . cpp <nl> bool ConstraintSystem : : isTypeReference ( Expr * E ) { <nl> } ) ; <nl> } <nl> <nl> + bool Solution : : isTypeReference ( Expr * E ) const { <nl> + return E - > isTypeReference ( <nl> + [ & ] ( Expr * expr ) - > Type { return simplifyType ( getType ( expr ) ) ; } , <nl> + [ & ] ( Expr * expr ) - > Decl * { <nl> + ConstraintLocator * locator = nullptr ; <nl> + if ( auto * UDE = dyn_cast < UnresolvedDotExpr > ( E ) ) { <nl> + locator = getConstraintLocator ( UDE , { ConstraintLocator : : Member } ) ; <nl> + } <nl> + <nl> + if ( auto * UME = dyn_cast < UnresolvedMemberExpr > ( E ) ) { <nl> + locator = <nl> + getConstraintLocator ( UME , { ConstraintLocator : : UnresolvedMember } ) ; <nl> + } <nl> + <nl> + if ( isa < OverloadSetRefExpr > ( E ) ) <nl> + locator = getConstraintLocator ( const_cast < Expr * > ( E ) ) ; <nl> + <nl> + if ( locator ) { <nl> + if ( auto selectedOverload = getOverloadChoiceIfAvailable ( locator ) ) { <nl> + const auto & choice = selectedOverload - > choice ; <nl> + return choice . getDeclOrNull ( ) ; <nl> + } <nl> + } <nl> + <nl> + return nullptr ; <nl> + } ) ; <nl> + } <nl> + <nl> bool ConstraintSystem : : isStaticallyDerivedMetatype ( Expr * E ) { <nl> return E - > isStaticallyDerivedMetatype ( <nl> [ & ] ( Expr * E ) - > Type { return simplifyType ( getType ( E ) ) ; } , <nl> [ & ] ( Expr * E ) - > bool { return isTypeReference ( E ) ; } ) ; <nl> } <nl> <nl> + bool Solution : : isStaticallyDerivedMetatype ( Expr * E ) const { <nl> + return E - > isStaticallyDerivedMetatype ( <nl> + [ & ] ( Expr * E ) - > Type { return simplifyType ( getType ( E ) ) ; } , <nl> + [ & ] ( Expr * E ) - > bool { return isTypeReference ( E ) ; } ) ; <nl> + } <nl> + <nl> Type ConstraintSystem : : getInstanceType ( TypeExpr * E ) { <nl> if ( ! hasType ( E ) ) <nl> return Type ( ) ; <nl> Type Solution : : getType ( ASTNode node ) const { <nl> return cs . getType ( node ) ; <nl> } <nl> <nl> + Type Solution : : getResolvedType ( ASTNode node ) const { <nl> + return simplifyType ( getType ( node ) ) ; <nl> + } <nl> + <nl> void Solution : : setExprTypes ( Expr * expr ) const { <nl> if ( ! expr ) <nl> return ; <nl> mmm a / lib / Sema / CSSolver . cpp <nl> ppp b / lib / Sema / CSSolver . cpp <nl> void ConstraintSystem : : solveForCodeCompletion ( <nl> <nl> cs . shrink ( expr ) ; <nl> <nl> - if ( cs . generateConstraints ( expr , DC ) ) <nl> + if ( ! cs . generateConstraints ( expr , DC ) ) <nl> return ; <nl> <nl> llvm : : SmallVector < Solution , 4 > solutions ; <nl> mmm a / lib / Sema / ConstraintSystem . h <nl> ppp b / lib / Sema / ConstraintSystem . h <nl> class Solution { <nl> / / / Retrieve the type of the given node , as recorded in this solution . <nl> Type getType ( ASTNode node ) const ; <nl> <nl> + / / / Retrieve the type of the given node as recorded in this solution <nl> + / / / and resolve all of the type variables in contains to form a fully <nl> + / / / " resolved " concrete type . <nl> + Type getResolvedType ( ASTNode node ) const ; <nl> + <nl> / / / Resolve type variables present in the raw type , using generic parameter <nl> / / / types where possible . <nl> Type resolveInterfaceType ( Type type ) const ; <nl> class Solution { <nl> : nullptr ; <nl> } <nl> <nl> + / / / This method implements functionality of ` Expr : : isTypeReference ` <nl> + / / / with data provided by a given solution . <nl> + bool isTypeReference ( Expr * E ) const ; <nl> + <nl> + / / / Call Expr : : isIsStaticallyDerivedMetatype on the given <nl> + / / / expression , using a custom accessor for the type on the <nl> + / / / expression that reads the type from the Solution <nl> + / / / expression type map . <nl> + bool isStaticallyDerivedMetatype ( Expr * E ) const ; <nl> + <nl> SWIFT_DEBUG_DUMP ; <nl> <nl> / / / Dump this solution . <nl> mmm a / utils / build - script <nl> ppp b / utils / build - script <nl> class BuildScriptInvocation ( object ) : <nl> impl_args + = [ " - - skip - build " ] <nl> if not args . build_benchmarks : <nl> impl_args + = [ " - - skip - build - benchmarks " ] <nl> - # Currently we do not build external benchmarks by default . <nl> - if args . build_external_benchmarks : <nl> - impl_args + = [ " - - skip - build - external - benchmarks = 0 " ] <nl> <nl> # Then add subproject install flags that either skip building them / or / <nl> # if we are going to build them and install_all is set , we also install <nl> class BuildScriptInvocation ( object ) : <nl> if args . build_swift_static_sdk_overlay : <nl> impl_args + = [ " - - build - swift - static - sdk - overlay " ] <nl> <nl> - if not args . build_linux : <nl> - impl_args + = [ " - - skip - build - linux " ] <nl> - if not args . build_freebsd : <nl> - impl_args + = [ " - - skip - build - freebsd " ] <nl> - if not args . build_cygwin : <nl> - impl_args + = [ " - - skip - build - cygwin " ] <nl> - if not args . build_osx : <nl> - impl_args + = [ " - - skip - build - osx " ] <nl> - if not args . build_ios_device : <nl> - impl_args + = [ " - - skip - build - ios - device " ] <nl> - if not args . build_ios_simulator : <nl> - impl_args + = [ " - - skip - build - ios - simulator " ] <nl> - if not args . build_tvos_device : <nl> - impl_args + = [ " - - skip - build - tvos - device " ] <nl> - if not args . build_tvos_simulator : <nl> - impl_args + = [ " - - skip - build - tvos - simulator " ] <nl> - if not args . build_watchos_device : <nl> - impl_args + = [ " - - skip - build - watchos - device " ] <nl> - if not args . build_watchos_simulator : <nl> - impl_args + = [ " - - skip - build - watchos - simulator " ] <nl> if not args . build_android : <nl> impl_args + = [ " - - skip - build - android " ] <nl> if not args . build_clang_tools_extra : <nl> class BuildScriptInvocation ( object ) : <nl> " - - skip - test - libdispatch " , <nl> " - - skip - test - libicu " , <nl> ] <nl> - if not args . test_linux : <nl> - impl_args + = [ " - - skip - test - linux " ] <nl> - if not args . test_freebsd : <nl> - impl_args + = [ " - - skip - test - freebsd " ] <nl> - if not args . test_cygwin : <nl> - impl_args + = [ " - - skip - test - cygwin " ] <nl> - if not args . test_osx : <nl> - impl_args + = [ " - - skip - test - osx " ] <nl> - if not args . test_ios_host : <nl> - impl_args + = [ " - - skip - test - ios - host " ] <nl> - if not args . test_ios_simulator : <nl> - impl_args + = [ " - - skip - test - ios - simulator " ] <nl> - if not args . test_ios_32bit_simulator : <nl> - impl_args + = [ " - - skip - test - ios - 32bit - simulator " ] <nl> - if not args . test_tvos_host : <nl> - impl_args + = [ " - - skip - test - tvos - host " ] <nl> - if not args . test_tvos_simulator : <nl> - impl_args + = [ " - - skip - test - tvos - simulator " ] <nl> - if not args . test_watchos_host : <nl> - impl_args + = [ " - - skip - test - watchos - host " ] <nl> - if not args . test_watchos_simulator : <nl> - impl_args + = [ " - - skip - test - watchos - simulator " ] <nl> - if not args . test_android : <nl> - impl_args + = [ " - - skip - test - android " ] <nl> - if not args . test_android_host : <nl> - impl_args + = [ " - - skip - test - android - host " ] <nl> if args . build_runtime_with_host_compiler : <nl> impl_args + = [ " - - build - runtime - with - host - compiler " ] <nl> if args . validation_test : <nl> class BuildScriptInvocation ( object ) : <nl> impl_args + = [ " - - only - executable - test " ] <nl> if not args . benchmark : <nl> impl_args + = [ " - - skip - test - benchmarks " ] <nl> - if not args . test_optimized : <nl> - impl_args + = [ " - - skip - test - optimized " ] <nl> - if not args . test_optimize_for_size : <nl> - impl_args + = [ " - - skip - test - optimize - for - size " ] <nl> - if not args . test_optimize_none_with_implicit_dynamic : <nl> - impl_args + = [ " - - skip - test - optimize - none - with - implicit - dynamic " ] <nl> if args . build_libparser_only : <nl> impl_args + = [ " - - build - libparser - only " ] <nl> if args . android : <nl> mmm a / utils / build - script - impl <nl> ppp b / utils / build - script - impl <nl> KNOWN_SETTINGS = ( <nl> skip - build - clang - tools - extra " " " set to skip building clang - tools - extra as part of llvm " <nl> skip - build - compiler - rt " " " set to skip building Compiler - RT " <nl> skip - build - lld " " " set to skip building lld as part of llvm ( linux only ) " <nl> - skip - build - cygwin " " " set to skip building Swift stdlibs for Cygwin " <nl> - skip - build - external - benchmarks " 1 " " set to skip building the external Swift Benchmark Suite . ( skipped by default ) " <nl> - skip - build - freebsd " " " set to skip building Swift stdlibs for FreeBSD " <nl> - skip - build - haiku " " " set to skip building Swift stdlibs for Haiku " <nl> - skip - build - ios - device " " " set to skip building Swift stdlibs for iOS devices ( i . e . build simulators only ) " <nl> - skip - build - ios - simulator " " " set to skip building Swift stdlibs for iOS simulators ( i . e . build devices only ) " <nl> - skip - build - linux " " " set to skip building Swift stdlibs for Linux " <nl> - skip - build - maccatalyst " " " set to skip building Swift stdlibs for macCatalyst " <nl> - skip - build - osx " " " set to skip building Swift stdlibs for OS X " <nl> - skip - build - tvos - device " " " set to skip building Swift stdlibs for tvOS devices ( i . e . build simulators only ) " <nl> - skip - build - tvos - simulator " " " set to skip building Swift stdlibs for tvOS simulators ( i . e . build devices only ) " <nl> - skip - build - watchos - device " " " set to skip building Swift stdlibs for Apple watchOS devices ( i . e . build simulators only ) " <nl> - skip - build - watchos - simulator " " " set to skip building Swift stdlibs for Apple watchOS simulators ( i . e . build devices only ) " <nl> <nl> # # Skip Test . . . <nl> - skip - test - android " " " set to skip testing Swift stdlibs for Android " <nl> - skip - test - android - host " " " set to skip testing the host parts of the Android toolchain " <nl> - skip - test - cygwin " " " set to skip testing Swift stdlibs for Cygwin " <nl> - skip - test - freebsd " " " set to skip testing Swift stdlibs for FreeBSD " <nl> - skip - test - haiku " " " set to skip testing Swift stdlibs for Haiku " <nl> - skip - test - ios - 32bit - simulator " " " set to skip testing Swift stdlibs for iOS 32bit simulators " <nl> - skip - test - ios - host " " " set to skip testing the host parts of the iOS toolchain " <nl> - skip - test - ios - simulator " " " set to skip testing Swift stdlibs for iOS simulators ( i . e . test devices only ) " <nl> - skip - test - linux " " " set to skip testing Swift stdlibs for Linux " <nl> - skip - test - maccatalyst " " " set to skip testing Swift stdlibs for macCatalyst " <nl> - skip - test - osx " " " set to skip testing Swift stdlibs for OS X " <nl> - skip - test - tvos - host " " " set to skip testing the host parts of the tvOS toolchain " <nl> - skip - test - tvos - simulator " " " set to skip testing Swift stdlibs for tvOS simulators ( i . e . test devices only ) " <nl> - skip - test - watchos - host " " " set to skip testing the host parts of the watchOS toolchain " <nl> - skip - test - watchos - simulator " " " set to skip testing Swift stdlibs for Apple watchOS simulators ( i . e . test devices only ) " <nl> skip - test - benchmarks " " " set to skip running Swift Benchmark Suite " <nl> - skip - test - optimized " " " set to skip testing the test suite in optimized mode " <nl> - skip - test - optimize - for - size " " " set to skip testing the test suite in optimize for size mode " <nl> - skip - test - optimize - none - with - implicit - dynamic " " " set to skip testing the test suite in optimize none with implicit dynamic mode " <nl> skip - test - sourcekit " " " set to skip testing SourceKit " <nl> <nl> # # Extra . . . CMake Options <nl>
Merge remote - tracking branch ' origin / master ' into master - rebranch
apple/swift
4c18ddcd0a9719bef18b147d1ec8d118b9de7e1b
2020-08-11T22:23:27Z
mmm a / src / core / ext / transport / cronet / transport / cronet_transport . c <nl> ppp b / src / core / ext / transport / cronet / transport / cronet_transport . c <nl> static int parse_grpc_header ( const uint8_t * data ) { <nl> return length ; <nl> } <nl> <nl> + static bool header_has_authority ( grpc_linked_mdelem * head ) { <nl> + while ( head ! = NULL ) { <nl> + if ( head - > md - > key = = GRPC_MDSTR_AUTHORITY ) { <nl> + return true ; <nl> + } <nl> + head = head - > next ; <nl> + } <nl> + return false ; <nl> + } <nl> + <nl> / * <nl> Op Execution : Decide if one of the actions contained in the stream op can be <nl> executed . This is the heart of the state machine . <nl> static void perform_stream_op ( grpc_exec_ctx * exec_ctx , grpc_transport * gt , <nl> s - > curr_gs = gs ; <nl> memcpy ( & s - > curr_ct , gt , sizeof ( grpc_cronet_transport ) ) ; <nl> add_to_storage ( s , op ) ; <nl> + if ( op - > send_initial_metadata & & <nl> + header_has_authority ( op - > send_initial_metadata - > list . head ) ) { <nl> + CRONET_LOG ( GPR_DEBUG , " : authority header is provided but not supported ; cancel operations " ) ; <nl> + s - > state . state_op_done [ OP_CANCEL_ERROR ] = true ; <nl> + } <nl> execute_from_storage ( s ) ; <nl> } <nl> <nl>
Cancel the stream operation if it contains send_initial_metadata and : authority header
grpc/grpc
ff1ee6f7a39b3400c3256f34b8e8b919c4ef1648
2016-10-11T19:20:01Z
mmm a / test / CMakeLists . txt <nl> ppp b / test / CMakeLists . txt <nl> function ( get_test_dependencies SDK result_var_name ) <nl> swift - api - digester swift - refactor ) <nl> if ( NOT SWIFT_BUILT_STANDALONE ) <nl> list ( APPEND deps_binaries FileCheck arcmt - test c - arcmt - test c - index - test <nl> - clang llc llvm - cov llvm - dwarfdump llvm - link llvm - as llvm - dis llvm - profdata not ) <nl> + clang llc llvm - cov llvm - dwarfdump llvm - link llvm - as llvm - dis <nl> + llvm - bcanalyzer llvm - nm llvm - readobj llvm - profdata count not ) <nl> endif ( ) <nl> if ( SWIFT_BUILD_SOURCEKIT ) <nl> list ( APPEND deps_binaries sourcekitd - test complete - test ) <nl>
[ CMake ] Add missing unified build test dependencies
apple/swift
478321265a500c34dfd843bef95069c0725723f5
2018-02-16T13:36:41Z
mmm a / src / compiler / effect - control - linearizer . cc <nl> ppp b / src / compiler / effect - control - linearizer . cc <nl> void TryCloneBranch ( Node * node , BasicBlock * block , Graph * graph , <nl> edge . UpdateTo ( ( control = = matcher . IfTrue ( ) ) ? phi_true : phi_false ) ; <nl> } <nl> } <nl> - true_block_data - > current_effect = phi_true ; <nl> - false_block_data - > current_effect = phi_false ; <nl> + if ( phi - > opcode ( ) = = IrOpcode : : kEffectPhi ) { <nl> + true_block_data - > current_effect = phi_true ; <nl> + false_block_data - > current_effect = phi_false ; <nl> + } <nl> phi - > Kill ( ) ; <nl> } <nl> / / Fix up IfTrue and IfFalse and kill all dead nodes . <nl>
[ turbofan ] Don ' t connect regular Phis into the effect chain .
v8/v8
dae6320d1bc5bc3d618215ffe85ad12f917969a9
2016-07-13T05:21:41Z
mmm a / python / mxnet / recordio . py <nl> ppp b / python / mxnet / recordio . py <nl> def pack_img ( header , img , quality = 80 , img_fmt = ' . jpg ' ) : <nl> The packed string <nl> " " " <nl> assert opencv_available <nl> - if img_fmt is ' . jpg ' : <nl> + if img_fmt = = ' . jpg ' : <nl> encode_params = [ cv2 . IMWRITE_JPEG_QUALITY , quality ] <nl> - elif img_fmt is ' . png ' : <nl> + elif img_fmt = = ' . png ' : <nl> encode_params = [ cv2 . IMWRITE_PNG_COMPRESSION , quality ] <nl> ret , buf = cv2 . imencode ( img_fmt , img , encode_params ) <nl> assert ret , ' failed encoding image ' <nl>
Merge pull request from winstywang / master
apache/incubator-mxnet
97c7068c873c9fad40e0003b7f9f2e0d4d23df3a
2015-12-23T12:53:03Z
new file mode 100644 <nl> index 000000000000 . . 4ae566516dd8 <nl> mmm / dev / null <nl> ppp b / project / BuildDependencies / scripts / librtmp_d . bat <nl> <nl> + @ ECHO OFF <nl> + <nl> + SET LOC_PATH = % CD % <nl> + SET FILES = % LOC_PATH % \ librtmp_d . txt <nl> + <nl> + CALL dlextract . bat libvpx % FILES % <nl> + <nl> + cd % TMP_PATH % <nl> + % ZIP % x rtmpdump - 2 . 2e . tar <nl> + <nl> + xcopy rtmpdump - 2 . 2e \ librtmp \ * . h " % CUR_PATH % \ include \ librtmp \ " / E / Q / I / Y <nl> + <nl> + cd % LOC_PATH % <nl> new file mode 100644 <nl> index 000000000000 . . e54a44aa5588 <nl> mmm / dev / null <nl> ppp b / project / BuildDependencies / scripts / librtmp_d . txt <nl> <nl> + ; filename source of the file <nl> + rtmpdump - 2 . 2e . tar . gz http : / / rtmpdump . mplayerhq . hu / download / <nl>
[ WIN32 ] added download scripts for librtmp
xbmc/xbmc
cb67d3df39c3f490b64c5b690e07169353c0eb5f
2010-06-21T22:13:56Z
mmm a / libraries / chain / CMakeLists . txt <nl> ppp b / libraries / chain / CMakeLists . txt <nl> add_library ( eosio_chain <nl> <nl> <nl> $ { HEADERS } <nl> - ) <nl> + transaction_metadata . cpp ) <nl> <nl> target_link_libraries ( eosio_chain eos_utilities fc chainbase Logging IR WAST WASM Runtime ) <nl> target_include_directories ( eosio_chain <nl> mmm a / libraries / chain / chain_controller . cpp <nl> ppp b / libraries / chain / chain_controller . cpp <nl> optional < signed_block > chain_controller : : fetch_block_by_number ( uint32_t num ) cons <nl> return optional < signed_block > ( ) ; <nl> } <nl> <nl> - / * <nl> - const signed_transaction & chain_controller : : get_recent_transaction ( const transaction_id_type & trx_id ) const <nl> - { <nl> - auto & index = _db . get_index < transaction_multi_index , by_trx_id > ( ) ; <nl> - auto itr = index . find ( trx_id ) ; <nl> - FC_ASSERT ( itr ! = index . end ( ) ) ; <nl> - return itr - > trx ; <nl> - } <nl> - * / <nl> - <nl> std : : vector < block_id_type > chain_controller : : get_block_ids_on_fork ( block_id_type head_of_fork ) const <nl> { <nl> pair < fork_database : : branch_type , fork_database : : branch_type > branches = _fork_db . fetch_branch_from ( head_block_id ( ) , head_of_fork ) ; <nl> bool chain_controller : : _push_block ( const signed_block & new_block ) <nl> * queues full as well , it will be kept in the queue to be propagated later when a new block flushes out the pending <nl> * queues . <nl> * / <nl> - transaction_trace chain_controller : : push_transaction ( const signed_transaction & trx , uint32_t skip ) <nl> + transaction_trace chain_controller : : push_transaction ( const packed_transaction & trx , uint32_t skip ) <nl> { try { <nl> return with_skip_flags ( skip , [ & ] ( ) { <nl> return _db . with_write_lock ( [ & ] ( ) { <nl> transaction_trace chain_controller : : push_transaction ( const signed_transaction & t <nl> } ) ; <nl> } FC_CAPTURE_AND_RETHROW ( ( trx ) ) } <nl> <nl> - transaction_trace chain_controller : : _push_transaction ( const signed_transaction & trx ) { <nl> - check_transaction_authorization ( trx ) ; <nl> + transaction_trace chain_controller : : _push_transaction ( const packed_transaction & trx ) { <nl> transaction_metadata mtrx ( trx , get_chain_id ( ) , head_block_time ( ) ) ; <nl> + check_transaction_authorization ( mtrx . trx , trx . signatures ) ; <nl> <nl> - auto result = _push_transaction ( mtrx ) ; <nl> - <nl> - _pending_block - > input_transactions . push_back ( trx ) ; <nl> + auto result = _push_transaction ( std : : move ( mtrx ) ) ; <nl> <nl> / / notify anyone listening to pending transactions <nl> on_pending_transaction ( trx ) ; <nl> <nl> + _pending_block - > input_transactions . emplace_back ( trx ) ; <nl> + <nl> return result ; <nl> <nl> } <nl> static void record_locks_for_data_access ( const vector < action_trace > & action_trac <nl> } <nl> } <nl> <nl> - transaction_trace chain_controller : : _push_transaction ( transaction_metadata & data ) <nl> + transaction_trace chain_controller : : _push_transaction ( transaction_metadata & & data ) <nl> { <nl> const transaction & trx = data . trx ; <nl> / / If this is the first transaction pushed after applying a block , start a new undo session . <nl> transaction_trace chain_controller : : _push_transaction ( transaction_metadata & dat <nl> / / The transaction applied successfully . Merge its changes into the pending block session . <nl> temp_session . squash ( ) ; <nl> <nl> + _pending_transaction_metas . emplace_back ( std : : forward < transaction_metadata > ( data ) ) ; <nl> + <nl> return result ; <nl> } <nl> <nl> signed_block chain_controller : : _generate_block ( block_timestamp_type when , <nl> _pending_block - > producer = producer_obj . owner ; <nl> _pending_block - > previous = head_block_id ( ) ; <nl> _pending_block - > block_mroot = get_dynamic_global_properties ( ) . block_merkle_root . get_root ( ) ; <nl> - _pending_block - > transaction_mroot = _pending_block - > calculate_transaction_merkle_root ( ) ; <nl> + _pending_block - > transaction_mroot = transaction_metadata : : calculate_transaction_merkle_root ( _pending_transaction_metas ) ; <nl> _pending_block - > action_mroot = _pending_block_trace - > calculate_action_merkle_root ( ) ; <nl> <nl> <nl> void chain_controller : : __apply_block ( const signed_block & next_block ) <nl> <nl> / / / cache the input tranasction ids so that they can be looked up when executing the <nl> / / / summary <nl> - map < transaction_id_type , const signed_transaction * > trx_index ; <nl> + vector < transaction_metadata > input_metas ; <nl> + map < transaction_id_type , transaction_metadata * > trx_index ; <nl> for ( const auto & t : next_block . input_transactions ) { <nl> - trx_index [ t . get_transaction ( ) . id ( ) ] = & t ; <nl> + input_metas . emplace_back ( t , chain_id_type ( ) , next_block . timestamp ) ; <nl> + trx_index [ input_metas . back ( ) . id ] = & input_metas . back ( ) ; <nl> } <nl> <nl> block_trace next_block_trace ( next_block ) ; <nl> void chain_controller : : __apply_block ( const signed_block & next_block ) <nl> <nl> shard_trace s_trace ; <nl> for ( const auto & receipt : shard . transactions ) { <nl> - auto make_metadata = [ & ] ( ) { <nl> + optional < transaction_metadata > _temp ; <nl> + auto make_metadata = [ & ] ( ) - > transaction_metadata * { <nl> auto itr = trx_index . find ( receipt . id ) ; <nl> if ( itr ! = trx_index . end ( ) ) { <nl> - return transaction_metadata ( * itr - > second , get_chain_id ( ) , next_block . timestamp ) ; <nl> + return itr - > second ; <nl> } else { <nl> const auto & gtrx = _db . get < generated_transaction_object , by_trx_id > ( receipt . id ) ; <nl> auto trx = fc : : raw : : unpack < deferred_transaction > ( gtrx . packed_trx . data ( ) , gtrx . packed_trx . size ( ) ) ; <nl> - return transaction_metadata ( trx , gtrx . published , trx . sender , trx . sender_id , gtrx . packed_trx . data ( ) , gtrx . packed_trx . size ( ) ) ; <nl> + _temp . emplace ( trx , gtrx . published , trx . sender , trx . sender_id , gtrx . packed_trx . data ( ) , gtrx . packed_trx . size ( ) ) ; <nl> + return & * _temp ; <nl> } <nl> } ; <nl> <nl> - auto mtrx = make_metadata ( ) ; <nl> - mtrx . region_id = r . region ; <nl> - mtrx . cycle_index = cycle_index ; <nl> - mtrx . shard_index = shard_index ; <nl> - mtrx . allowed_read_locks . emplace ( & shard . read_locks ) ; <nl> - mtrx . allowed_write_locks . emplace ( & shard . write_locks ) ; <nl> + auto * mtrx = make_metadata ( ) ; <nl> + mtrx - > region_id = r . region ; <nl> + mtrx - > cycle_index = cycle_index ; <nl> + mtrx - > shard_index = shard_index ; <nl> + mtrx - > allowed_read_locks . emplace ( & shard . read_locks ) ; <nl> + mtrx - > allowed_write_locks . emplace ( & shard . write_locks ) ; <nl> <nl> - s_trace . transaction_traces . emplace_back ( _apply_transaction ( mtrx ) ) ; <nl> + s_trace . transaction_traces . emplace_back ( _apply_transaction ( * mtrx ) ) ; <nl> record_locks_for_data_access ( s_trace . transaction_traces . back ( ) . action_traces , used_read_locks , used_write_locks ) ; <nl> <nl> FC_ASSERT ( receipt . status = = s_trace . transaction_traces . back ( ) . status ) ; <nl> void chain_controller : : __apply_block ( const signed_block & next_block ) <nl> } / / / for each region <nl> <nl> FC_ASSERT ( next_block . action_mroot = = next_block_trace . calculate_action_merkle_root ( ) ) ; <nl> + FC_ASSERT ( transaction_metadata : : calculate_transaction_merkle_root ( input_metas ) = = next_block . transaction_mroot , " merkle root does not match " ) ; <nl> <nl> - _finalize_block ( next_block_trace ) ; <nl> + _finalize_block ( next_block_trace ) ; <nl> } FC_CAPTURE_AND_RETHROW ( ( next_block . block_num ( ) ) ) } <nl> <nl> - flat_set < public_key_type > chain_controller : : get_required_keys ( const signed_transaction & trx , <nl> - const flat_set < public_key_type > & candidate_keys ) const <nl> + flat_set < public_key_type > chain_controller : : get_required_keys ( const transaction & trx , <nl> + const flat_set < public_key_type > & candidate_keys ) const <nl> { <nl> auto checker = make_auth_checker ( [ & ] ( const permission_level & p ) { return get_permission ( p ) . auth ; } , <nl> get_global_properties ( ) . configuration . max_authority_depth , <nl> candidate_keys ) ; <nl> <nl> - const auto decompressed = trx . get_transaction ( ) ; <nl> - for ( const auto & act : decompressed . actions ) { <nl> + for ( const auto & act : trx . actions ) { <nl> for ( const auto & declared_auth : act . authorization ) { <nl> if ( ! checker . satisfied ( declared_auth ) ) { <nl> EOS_ASSERT ( checker . satisfied ( declared_auth ) , tx_missing_sigs , <nl> void chain_controller : : check_authorization ( const vector < action > & actions , <nl> ( " keys " , checker . unused_keys ( ) ) ) ; <nl> } <nl> <nl> - void chain_controller : : check_transaction_authorization ( const signed_transaction & trx , <nl> + void chain_controller : : check_transaction_authorization ( const transaction & trx , <nl> + const vector < signature_type > & signatures , <nl> bool allow_unused_signatures ) const <nl> { <nl> - auto decompressed = trx . get_transaction ( ) ; <nl> - check_authorization ( decompressed . actions , trx . get_signature_keys ( chain_id_type { } ) , allow_unused_signatures ) ; <nl> + check_authorization ( trx . actions , trx . get_signature_keys ( signatures , chain_id_type { } ) , allow_unused_signatures ) ; <nl> } <nl> <nl> optional < permission_name > chain_controller : : lookup_minimum_permission ( account_name authorizer_account , <nl> optional < permission_name > chain_controller : : lookup_minimum_permission ( account_na <nl> } FC_CAPTURE_AND_RETHROW ( ( authorizer_account ) ( scope ) ( act_name ) ) <nl> } <nl> <nl> - void chain_controller : : validate_uniqueness ( const signed_transaction & trx ) const { <nl> + void chain_controller : : validate_uniqueness ( const transaction & trx ) const { <nl> if ( ! should_check_for_duplicate_transactions ( ) ) return ; <nl> <nl> - auto transaction = _db . find < transaction_object , by_trx_id > ( trx . get_transaction ( ) . id ( ) ) ; <nl> + auto transaction = _db . find < transaction_object , by_trx_id > ( trx . id ( ) ) ; <nl> EOS_ASSERT ( transaction = = nullptr , tx_duplicate , " transaction is not unique " ) ; <nl> } <nl> <nl> const producer_object & chain_controller : : validate_block_header ( uint32_t skip , co <nl> } <nl> <nl> <nl> - FC_ASSERT ( next_block . calculate_transaction_merkle_root ( ) = = next_block . transaction_mroot , " merkle root does not match " ) ; <nl> - <nl> return producer ; <nl> } <nl> <nl> void chain_controller : : _initialize_chain ( contracts : : chain_initializer & starter ) <nl> ctrace . shard_traces . emplace_back ( ) ; <nl> auto & strace = ctrace . shard_traces . back ( ) ; <nl> <nl> - transaction genesis_setup_transaction ; / / not actually signed , signature checking is skipped <nl> + signed_transaction genesis_setup_transaction ; / / not actually signed , signature checking is skipped <nl> genesis_setup_transaction . actions = move ( acts ) ; <nl> - block . input_transactions . emplace_back ( genesis_setup_transaction , signed_transaction : : zlib ) ; <nl> + block . input_transactions . emplace_back ( genesis_setup_transaction ) ; <nl> <nl> ilog ( " applying genesis transaction " ) ; <nl> with_skip_flags ( skip_scope_check | skip_transaction_signatures | skip_authority_check | received_block | genesis_setup , <nl> [ & ] ( ) { <nl> - transaction_metadata tmeta ( genesis_setup_transaction ) ; <nl> + transaction_metadata tmeta ( packed_transaction ( genesis_setup_transaction ) , chain_id_type ( ) , initial_timestamp ) ; <nl> transaction_trace ttrace = __apply_transaction ( tmeta ) ; <nl> strace . append ( ttrace ) ; <nl> } ) ; <nl> transaction_trace chain_controller : : _apply_error ( transaction_metadata & meta ) { <nl> <nl> transaction etrx ; <nl> etrx . actions . emplace_back ( vector < permission_level > { { meta . sender_id , config : : active_name } } , <nl> - contracts : : onerror ( meta . generated_data , meta . generated_data + meta . generated_size ) ) ; <nl> + contracts : : onerror ( meta . raw_data , meta . raw_data + meta . raw_size ) ) ; <nl> <nl> try { <nl> auto temp_session = _db . start_undo_session ( true ) ; <nl> void chain_controller : : push_deferred_transactions ( bool flush ) <nl> try { <nl> auto trx = fc : : raw : : unpack < deferred_transaction > ( trx_p - > packed_trx . data ( ) , trx_p - > packed_trx . size ( ) ) ; <nl> transaction_metadata mtrx ( trx , trx_p - > published , trx . sender , trx . sender_id , trx_p - > packed_trx . data ( ) , trx_p - > packed_trx . size ( ) ) ; <nl> - _push_transaction ( mtrx ) ; <nl> + _push_transaction ( std : : move ( mtrx ) ) ; <nl> generated_transaction_idx . remove ( * trx_p ) ; <nl> } FC_CAPTURE_AND_LOG ( ( trx_p - > trx_id ) ( trx_p - > sender ) ) ; <nl> } else { <nl> mmm a / libraries / chain / include / eosio / chain / block . hpp <nl> ppp b / libraries / chain / include / eosio / chain / block . hpp <nl> namespace eosio { namespace chain { <nl> * / <nl> struct signed_block : public signed_block_summary { <nl> digest_type calculate_transaction_merkle_root ( ) const ; <nl> - vector < signed_transaction > input_transactions ; / / / this is loaded and indexed into map < id , trx > that is referenced by summary <nl> + vector < packed_transaction > input_transactions ; / / / this is loaded and indexed into map < id , trx > that is referenced by summary <nl> } ; <nl> <nl> struct shard_trace { <nl> mmm a / libraries / chain / include / eosio / chain / chain_controller . hpp <nl> ppp b / libraries / chain / include / eosio / chain / chain_controller . hpp <nl> namespace eosio { namespace chain { <nl> <nl> <nl> void push_block ( const signed_block & b , uint32_t skip = skip_nothing ) ; <nl> - transaction_trace push_transaction ( const signed_transaction & trx , uint32_t skip = skip_nothing ) ; <nl> + transaction_trace push_transaction ( const packed_transaction & trx , uint32_t skip = skip_nothing ) ; <nl> void push_deferred_transactions ( bool flush = false ) ; <nl> <nl> <nl> namespace eosio { namespace chain { <nl> * This signal is emitted any time a new transaction is added to the pending <nl> * block state . <nl> * / <nl> - signal < void ( const signed_transaction & ) > on_pending_transaction ; <nl> + signal < void ( const packed_transaction & ) > on_pending_transaction ; <nl> <nl> <nl> <nl> namespace eosio { namespace chain { <nl> * @ return Subset of candidate_keys whose private keys should be used to sign transaction <nl> * @ throws fc : : exception if candidate_keys does not contain all required keys <nl> * / <nl> - flat_set < public_key_type > get_required_keys ( const signed_transaction & trx , const flat_set < public_key_type > & candidate_keys ) const ; <nl> + flat_set < public_key_type > get_required_keys ( const transaction & trx , const flat_set < public_key_type > & candidate_keys ) const ; <nl> <nl> <nl> bool _push_block ( const signed_block & b ) ; <nl> namespace eosio { namespace chain { <nl> template < typename Function > <nl> auto without_pending_transactions ( Function & & f ) <nl> { <nl> - vector < signed_transaction > old_input ; <nl> + vector < transaction_metadata > old_input ; <nl> <nl> if ( _pending_block ) <nl> - old_input = move ( _pending_block - > input_transactions ) ; <nl> + old_input = move ( _pending_transaction_metas ) ; <nl> <nl> clear_pending ( ) ; <nl> <nl> / * * after applying f ( ) push previously input transactions on top * / <nl> auto on_exit = fc : : make_scoped_exit ( [ & ] ( ) { <nl> - for ( const auto & t : old_input ) { <nl> + for ( auto & t : old_input ) { <nl> try { <nl> - if ( ! is_known_transaction ( t . get_transaction ( ) . id ( ) ) ) <nl> - push_transaction ( t ) ; <nl> + if ( ! is_known_transaction ( t . id ) ) <nl> + _push_transaction ( std : : move ( t ) ) ; <nl> } catch ( . . . ) { } <nl> } <nl> } ) ; <nl> namespace eosio { namespace chain { <nl> / / @ } <nl> <nl> <nl> - transaction_trace _push_transaction ( const signed_transaction & trx ) ; <nl> - transaction_trace _push_transaction ( transaction_metadata & data ) ; <nl> + transaction_trace _push_transaction ( const packed_transaction & trx ) ; <nl> + transaction_trace _push_transaction ( transaction_metadata & & data ) ; <nl> transaction_trace _apply_transaction ( transaction_metadata & data ) ; <nl> transaction_trace __apply_transaction ( transaction_metadata & data ) ; <nl> transaction_trace _apply_error ( transaction_metadata & data ) ; <nl> namespace eosio { namespace chain { <nl> return f ( ) ; <nl> } <nl> <nl> - void check_transaction_authorization ( const signed_transaction & trx , <nl> + void check_transaction_authorization ( const transaction & trx , <nl> + const vector < signature_type > & signatures , <nl> bool allow_unused_signatures = false ) const ; <nl> <nl> <nl> namespace eosio { namespace chain { <nl> } FC_CAPTURE_AND_RETHROW ( ( trx ) ) } <nl> <nl> / / / Validate transaction helpers @ { <nl> - void validate_uniqueness ( const signed_transaction & trx ) const ; <nl> + void validate_uniqueness ( const transaction & trx ) const ; <nl> void validate_tapos ( const transaction & trx ) const ; <nl> void validate_referenced_accounts ( const transaction & trx ) const ; <nl> void validate_expiration ( const transaction & trx ) const ; <nl> namespace eosio { namespace chain { <nl> optional < database : : session > _pending_block_session ; <nl> optional < signed_block > _pending_block ; <nl> optional < block_trace > _pending_block_trace ; <nl> - uint32_t _pending_transaction_count = 0 ; <nl> + vector < transaction_metadata > _pending_transaction_metas ; <nl> optional < cycle_trace > _pending_cycle_trace ; <nl> <nl> bool _currently_applying_block = false ; <nl> mmm a / libraries / chain / include / eosio / chain / contracts / abi_serializer . hpp <nl> ppp b / libraries / chain / include / eosio / chain / contracts / abi_serializer . hpp <nl> namespace impl { <nl> template < typename T > <nl> constexpr bool single_type_requires_abi_v ( ) { <nl> return std : : is_base_of < transaction , T > : : value | | <nl> + std : : is_same < T , packed_transaction > : : value | | <nl> std : : is_same < T , action > : : value | | <nl> std : : is_same < T , transaction_trace > : : value | | <nl> std : : is_same < T , action_trace > : : value ; <nl> namespace impl { <nl> template < typename T > <nl> using require_abi_t = std : : enable_if_t < type_requires_abi_v < T > ( ) , int > ; <nl> <nl> + struct abi_to_variant { <nl> + / * * <nl> + * template which overloads add for types which are not relvant to ABI information <nl> + * and can be degraded to the normal : : to_variant ( . . . ) processing <nl> + * / <nl> + template < typename M , typename Resolver , not_require_abi_t < M > = 1 > <nl> + static void add ( mutable_variant_object & mvo , const char * name , const M & v , Resolver ) <nl> + { <nl> + mvo ( name , v ) ; <nl> + } <nl> + <nl> + / * * <nl> + * template which overloads add for types which contain ABI information in their trees <nl> + * for these types we create new ABI aware visitors <nl> + * / <nl> + template < typename M , typename Resolver , require_abi_t < M > = 1 > <nl> + static void add ( mutable_variant_object & mvo , const char * name , const M & v , Resolver resolver ) ; <nl> + <nl> + / * * <nl> + * template which overloads add for vectors of types which contain ABI information in their trees <nl> + * for these members we call : : add in order to trigger further processing <nl> + * / <nl> + template < typename M , typename Resolver , require_abi_t < M > = 1 > <nl> + static void add ( mutable_variant_object & mvo , const char * name , const vector < M > & v , Resolver resolver ) <nl> + { <nl> + vector < variant > array ( v . size ( ) ) ; <nl> + for ( const auto & iter : v ) { <nl> + mutable_variant_object elem_mvo ; <nl> + add ( elem_mvo , " _ " , iter , resolver ) ; <nl> + array . emplace_back ( std : : move ( elem_mvo [ " _ " ] ) ) ; <nl> + } <nl> + mvo ( name , std : : move ( array ) ) ; <nl> + } <nl> + <nl> + / * * <nl> + * overload of to_variant_object for actions <nl> + * @ tparam Resolver <nl> + * @ param act <nl> + * @ param resolver <nl> + * @ return <nl> + * / <nl> + template < typename Resolver > <nl> + static void add ( mutable_variant_object & out , const char * name , const action & act , Resolver resolver ) { <nl> + mutable_variant_object mvo ; <nl> + mvo ( " account " , act . account ) ; <nl> + mvo ( " name " , act . name ) ; <nl> + mvo ( " authorization " , act . authorization ) ; <nl> + <nl> + auto abi = resolver ( act . account ) ; <nl> + if ( abi . valid ( ) ) { <nl> + auto type = abi - > get_action_type ( act . name ) ; <nl> + mvo ( " data " , abi - > binary_to_variant ( type , act . data ) ) ; <nl> + mvo ( " hex_data " , act . data ) ; <nl> + } else { <nl> + mvo ( " data " , act . data ) ; <nl> + } <nl> + out ( name , std : : move ( mvo ) ) ; <nl> + } <nl> + <nl> + / * * <nl> + * overload of to_variant_object for packed_transaction <nl> + * @ tparam Resolver <nl> + * @ param act <nl> + * @ param resolver <nl> + * @ return <nl> + * / <nl> + template < typename Resolver > <nl> + static void add ( mutable_variant_object & out , const char * name , const packed_transaction & ptrx , Resolver resolver ) { <nl> + mutable_variant_object mvo ; <nl> + mvo ( " signatures " , ptrx . signatures ) ; <nl> + mvo ( " compression " , ptrx . compression ) ; <nl> + mvo ( " data " , ptrx . data ) ; <nl> + <nl> + transaction trx = ptrx . get_transaction ( ) ; <nl> + add ( mvo , " transaction " , trx , resolver ) ; <nl> + out ( name , std : : move ( mvo ) ) ; <nl> + } <nl> + } ; <nl> + <nl> / * * <nl> * Reflection visitor that uses a resolver to resolve ABIs for nested types <nl> * this will degrade to the common fc : : to_variant as soon as the type no longer contains <nl> namespace impl { <nl> template < typename Member , class Class , Member ( Class : : * member ) > <nl> void operator ( ) ( const char * name ) const <nl> { <nl> - this - > add ( _vo , name , ( _val . * member ) ) ; <nl> + abi_to_variant : : add ( _vo , name , ( _val . * member ) , _resolver ) ; <nl> } <nl> <nl> private : <nl> + mutable_variant_object & _vo ; <nl> + const T & _val ; <nl> + Resolver _resolver ; <nl> + } ; <nl> <nl> - / * * <nl> - * template which overloads add for types which are not relvant to ABI information <nl> - * and can be degraded to the normal : : to_variant ( . . . ) processing <nl> - * / <nl> - template < typename M , not_require_abi_t < M > = 1 > <nl> - void add ( mutable_variant_object & vo , const char * name , const M & v ) const <nl> - { <nl> - vo ( name , v ) ; <nl> + struct abi_from_variant { <nl> + / * * <nl> + * template which overloads extract for types which are not relvant to ABI information <nl> + * and can be degraded to the normal : : from_variant ( . . . ) processing <nl> + * / <nl> + template < typename M , typename Resolver , not_require_abi_t < M > = 1 > <nl> + static void extract ( const variant & v , M & o , Resolver ) <nl> + { <nl> + from_variant ( v , o ) ; <nl> + } <nl> + <nl> + / * * <nl> + * template which overloads extract for types which contain ABI information in their trees <nl> + * for these types we create new ABI aware visitors <nl> + * / <nl> + template < typename M , typename Resolver , require_abi_t < M > = 1 > <nl> + static void extract ( const variant & v , M & o , Resolver resolver ) ; <nl> + <nl> + / * * <nl> + * template which overloads extract for vectors of types which contain ABI information in their trees <nl> + * for these members we call : : extract in order to trigger further processing <nl> + * / <nl> + template < typename M , typename Resolver , require_abi_t < M > = 1 > <nl> + static void extract ( const variant & v , vector < M > & o , Resolver resolver ) <nl> + { <nl> + const variants & array = v . get_array ( ) ; <nl> + o . clear ( ) ; <nl> + o . reserve ( array . size ( ) ) ; <nl> + for ( auto itr = array . begin ( ) ; itr ! = array . end ( ) ; + + itr ) { <nl> + M o_iter ; <nl> + extract ( * itr , o_iter , resolver ) ; <nl> + o . emplace_back ( std : : move ( o_iter ) ) ; <nl> } <nl> + } <nl> <nl> - / * * <nl> - * template which overloads add for types which contain ABI information in their trees <nl> - * for these types we create new ABI aware visitors <nl> - * / <nl> - template < typename M , require_abi_t < M > = 1 > <nl> - void add ( mutable_variant_object & vo , const char * name , const M & v ) const <nl> - { <nl> - mutable_variant_object mvo ; <nl> - fc : : reflector < M > : : visit ( impl : : abi_to_variant_visitor < M , decltype ( _resolver ) > ( mvo , v , _resolver ) ) ; <nl> - vo ( name , std : : move ( mvo ) ) ; <nl> + / * * <nl> + * Non templated overload that has priority for the action structure <nl> + * this type has members which must be directly translated by the ABI so it is <nl> + * exploded and processed explicitly <nl> + * / <nl> + template < typename Resolver > <nl> + static void extract ( const variant & v , action & act , Resolver resolver ) <nl> + { <nl> + const variant_object & vo = v . get_object ( ) ; <nl> + FC_ASSERT ( vo . contains ( " account " ) ) ; <nl> + FC_ASSERT ( vo . contains ( " name " ) ) ; <nl> + from_variant ( vo [ " account " ] , act . account ) ; <nl> + from_variant ( vo [ " name " ] , act . name ) ; <nl> + <nl> + if ( vo . contains ( " authorization " ) ) { <nl> + from_variant ( vo [ " authorization " ] , act . authorization ) ; <nl> } <nl> <nl> - / * * <nl> - * template which overloads add for vectors of types which contain ABI information in their trees <nl> - * for these members we call : : add in order to trigger further processing <nl> - * / <nl> - template < typename M , require_abi_t < M > = 1 > <nl> - void add ( mutable_variant_object & vo , const char * name , const vector < M > & v ) const <nl> - { <nl> - vector < variant > array ( v . size ( ) ) ; <nl> - for ( const auto & iter : v ) { <nl> - mutable_variant_object mvo ; <nl> - add ( mvo , " _ " , iter ) ; <nl> - array . emplace_back ( std : : move ( mvo [ " _ " ] ) ) ; <nl> + if ( vo . contains ( " data " ) ) { <nl> + const auto & data = vo [ " data " ] ; <nl> + if ( data . is_string ( ) ) { <nl> + from_variant ( data , act . data ) ; <nl> + } else if ( data . is_object ( ) ) { <nl> + auto abi = resolver ( act . account ) ; <nl> + if ( abi . valid ( ) ) { <nl> + auto type = abi - > get_action_type ( act . name ) ; <nl> + act . data = std : : move ( abi - > variant_to_binary ( type , data ) ) ; <nl> + } <nl> } <nl> - vo ( name , std : : move ( array ) ) ; <nl> } <nl> <nl> - / * * <nl> - * Non templated overload that has priority for the action structure <nl> - * this type has members which must be directly translated by the ABI so it is <nl> - * exploded and processed explicitly <nl> - * / <nl> - void add ( mutable_variant_object & vo , const char * name , const action & v ) const <nl> - { <nl> - mutable_variant_object mvo ; <nl> - mvo ( " account " , v . account ) ; <nl> - mvo ( " name " , v . name ) ; <nl> - mvo ( " authorization " , v . authorization ) ; <nl> - <nl> - auto abi = _resolver ( v . account ) ; <nl> - if ( abi . valid ( ) ) { <nl> - auto type = abi - > get_action_type ( v . name ) ; <nl> - mvo ( " data " , abi - > binary_to_variant ( type , v . data ) ) ; <nl> - mvo ( " hex_data " , v . data ) ; <nl> - } else { <nl> - mvo ( " data " , v . data ) ; <nl> + if ( act . data . empty ( ) ) { <nl> + if ( vo . contains ( " hex_data " ) ) { <nl> + const auto & data = vo [ " hex_data " ] ; <nl> + if ( data . is_string ( ) ) { <nl> + from_variant ( data , act . data ) ; <nl> + } <nl> } <nl> - <nl> - vo ( name , std : : move ( mvo ) ) ; <nl> } <nl> <nl> + FC_ASSERT ( ! act . data . empty ( ) , " Failed to deserialize data for $ { account } : $ { name } " , ( " account " , act . account ) ( " name " , act . name ) ) ; <nl> + } <nl> <nl> - mutable_variant_object & _vo ; <nl> - const T & _val ; <nl> - Resolver _resolver ; <nl> + template < typename Resolver > <nl> + static void extract ( const variant & v , packed_transaction & ptrx , Resolver resolver ) { <nl> + const variant_object & vo = v . get_object ( ) ; <nl> + FC_ASSERT ( vo . contains ( " signatures " ) ) ; <nl> + FC_ASSERT ( vo . contains ( " compression " ) ) ; <nl> + from_variant ( vo [ " signatures " ] , ptrx . signatures ) ; <nl> + from_variant ( vo [ " compression " ] , ptrx . compression ) ; <nl> + <nl> + if ( vo . contains ( " data " ) & & vo [ " data " ] . is_string ( ) & & ! vo [ " data " ] . as_string ( ) . empty ( ) ) { <nl> + from_variant ( vo [ " data " ] , ptrx . data ) ; <nl> + } else { <nl> + FC_ASSERT ( vo . contains ( " transaction " ) ) ; <nl> + transaction trx ; <nl> + extract ( vo [ " transaction " ] , trx , resolver ) ; <nl> + ptrx . set_transaction ( trx , ptrx . compression ) ; <nl> + } <nl> + } <nl> } ; <nl> <nl> / * * <nl> namespace impl { <nl> { <nl> auto itr = _vo . find ( name ) ; <nl> if ( itr ! = _vo . end ( ) ) <nl> - extract ( itr - > value ( ) , _val . * member ) ; <nl> + abi_from_variant : : extract ( itr - > value ( ) , _val . * member , _resolver ) ; <nl> } <nl> <nl> private : <nl> - <nl> - / * * <nl> - * template which overloads extract for types which are not relvant to ABI information <nl> - * and can be degraded to the normal : : from_variant ( . . . ) processing <nl> - * / <nl> - template < typename M , not_require_abi_t < M > = 1 > <nl> - void extract ( const variant & v , M & o ) const <nl> - { <nl> - from_variant ( v , o ) ; <nl> - } <nl> - <nl> - / * * <nl> - * template which overloads extract for types which contain ABI information in their trees <nl> - * for these types we create new ABI aware visitors <nl> - * / <nl> - template < typename M , require_abi_t < M > = 1 > <nl> - void extract ( const variant & v , M & o ) const <nl> - { <nl> - const variant_object & vo = v . get_object ( ) ; <nl> - fc : : reflector < M > : : visit ( abi_from_variant_visitor < M , decltype ( _resolver ) > ( vo , o , _resolver ) ) ; <nl> - } <nl> - <nl> - / * * <nl> - * template which overloads extract for vectors of types which contain ABI information in their trees <nl> - * for these members we call : : extract in order to trigger further processing <nl> - * / <nl> - template < typename M , require_abi_t < M > = 1 > <nl> - void extract ( const variant & v , vector < M > & o ) const <nl> - { <nl> - const variants & array = v . get_array ( ) ; <nl> - o . clear ( ) ; <nl> - o . reserve ( array . size ( ) ) ; <nl> - for ( auto itr = array . begin ( ) ; itr ! = array . end ( ) ; + + itr ) { <nl> - M o_iter ; <nl> - extract ( * itr , o_iter ) ; <nl> - o . emplace_back ( std : : move ( o_iter ) ) ; <nl> - } <nl> - } <nl> - <nl> - / * * <nl> - * Non templated overload that has priority for the action structure <nl> - * this type has members which must be directly translated by the ABI so it is <nl> - * exploded and processed explicitly <nl> - * / <nl> - void extract ( const variant & v , action & act ) const <nl> - { <nl> - const variant_object & vo = v . get_object ( ) ; <nl> - FC_ASSERT ( vo . contains ( " account " ) ) ; <nl> - FC_ASSERT ( vo . contains ( " name " ) ) ; <nl> - from_variant ( vo [ " account " ] , act . account ) ; <nl> - from_variant ( vo [ " name " ] , act . name ) ; <nl> - <nl> - if ( vo . contains ( " authorization " ) ) { <nl> - from_variant ( vo [ " authorization " ] , act . authorization ) ; <nl> - } <nl> - <nl> - if ( vo . contains ( " data " ) ) { <nl> - const auto & data = vo [ " data " ] ; <nl> - if ( data . is_string ( ) ) { <nl> - from_variant ( data , act . data ) ; <nl> - } else if ( data . is_object ( ) ) { <nl> - auto abi = _resolver ( act . account ) ; <nl> - if ( abi . valid ( ) ) { <nl> - auto type = abi - > get_action_type ( act . name ) ; <nl> - act . data = std : : move ( abi - > variant_to_binary ( type , data ) ) ; <nl> - } <nl> - } <nl> - } <nl> - <nl> - if ( act . data . empty ( ) ) { <nl> - if ( vo . contains ( " hex_data " ) ) { <nl> - const auto & data = vo [ " hex_data " ] ; <nl> - if ( data . is_string ( ) ) { <nl> - from_variant ( data , act . data ) ; <nl> - } <nl> - } <nl> - } <nl> - <nl> - FC_ASSERT ( ! act . data . empty ( ) , " Failed to deserialize data for $ { account } : $ { name } " , ( " account " , act . account ) ( " name " , act . name ) ) ; <nl> - } <nl> - <nl> - <nl> const variant_object & _vo ; <nl> T & _val ; <nl> Resolver _resolver ; <nl> } ; <nl> + <nl> + <nl> + template < typename M , typename Resolver , require_abi_t < M > > <nl> + void abi_to_variant : : add ( mutable_variant_object & mvo , const char * name , const M & v , Resolver resolver ) { <nl> + mutable_variant_object member_mvo ; <nl> + fc : : reflector < M > : : visit ( impl : : abi_to_variant_visitor < M , Resolver > ( member_mvo , v , resolver ) ) ; <nl> + mvo ( name , std : : move ( member_mvo ) ) ; <nl> + } <nl> + <nl> + template < typename M , typename Resolver , require_abi_t < M > > <nl> + void abi_from_variant : : extract ( const variant & v , M & o , Resolver resolver ) { <nl> + const variant_object & vo = v . get_object ( ) ; <nl> + fc : : reflector < M > : : visit ( abi_from_variant_visitor < M , decltype ( resolver ) > ( vo , o , resolver ) ) ; <nl> + } <nl> } <nl> <nl> template < typename T , typename Resolver > <nl> void abi_serializer : : to_variant ( const T & o , variant & vo , Resolver resolver ) try { <nl> mutable_variant_object mvo ; <nl> - fc : : reflector < T > : : visit ( impl : : abi_to_variant_visitor < T , Resolver > ( mvo , o , resolver ) ) ; <nl> - vo = std : : move ( mvo ) ; <nl> + impl : : abi_to_variant : : add ( mvo , " _ " , o , resolver ) ; <nl> + vo = std : : move ( mvo [ " _ " ] ) ; <nl> } FC_RETHROW_EXCEPTIONS ( error , " Failed to serialize type " , ( " object " , o ) ) <nl> <nl> template < typename T , typename Resolver > <nl> void abi_serializer : : from_variant ( const variant & v , T & o , Resolver resolver ) try { <nl> - const variant_object & vo = v . get_object ( ) ; <nl> - fc : : reflector < T > : : visit ( impl : : abi_from_variant_visitor < T , Resolver > ( vo , o , resolver ) ) ; <nl> + impl : : abi_from_variant : : extract ( v , o , resolver ) ; <nl> } FC_RETHROW_EXCEPTIONS ( error , " Failed to deserialize variant " , ( " variant " , v ) ) <nl> <nl> <nl> mmm a / libraries / chain / include / eosio / chain / transaction . hpp <nl> ppp b / libraries / chain / include / eosio / chain / transaction . hpp <nl> namespace eosio { namespace chain { <nl> struct transaction : public transaction_header { <nl> vector < action > actions ; <nl> <nl> - transaction_id_type id ( ) const ; <nl> - digest_type sig_digest ( const chain_id_type & chain_id ) const ; <nl> + transaction_id_type id ( ) const ; <nl> + digest_type sig_digest ( const chain_id_type & chain_id ) const ; <nl> + flat_set < public_key_type > get_signature_keys ( const vector < signature_type > & signatures , const chain_id_type & chain_id ) const ; <nl> + <nl> + } ; <nl> + <nl> + struct signed_transaction : public transaction <nl> + { <nl> + signed_transaction ( ) = default ; <nl> + / / signed_transaction ( const signed_transaction & ) = default ; <nl> + / / signed_transaction ( signed_transaction & & ) = default ; <nl> + signed_transaction ( transaction & & trx , const vector < signature_type > & signatures ) <nl> + : transaction ( std : : forward < transaction > ( trx ) ) <nl> + , signatures ( signatures ) <nl> + { <nl> + } <nl> + <nl> + vector < signature_type > signatures ; <nl> + <nl> + const signature_type & sign ( const private_key_type & key , const chain_id_type & chain_id ) ; <nl> + signature_type sign ( const private_key_type & key , const chain_id_type & chain_id ) const ; <nl> + flat_set < public_key_type > get_signature_keys ( const chain_id_type & chain_id ) const ; <nl> } ; <nl> <nl> - struct signed_transaction { <nl> + struct packed_transaction { <nl> enum compression_type { <nl> none , <nl> zlib , <nl> - <nl> } ; <nl> <nl> - signed_transaction ( ) = default ; <nl> + packed_transaction ( ) = default ; <nl> + <nl> + explicit packed_transaction ( const transaction & t , compression_type _compression = none ) <nl> + { <nl> + set_transaction ( t , _compression ) ; <nl> + } <nl> + <nl> + explicit packed_transaction ( const signed_transaction & t , compression_type _compression = none ) <nl> + : signatures ( t . signatures ) <nl> + { <nl> + set_transaction ( t , _compression ) ; <nl> + } <nl> <nl> - signed_transaction ( const transaction & t , signed_transaction : : compression_type _compression ) { <nl> + explicit packed_transaction ( signed_transaction & & t , compression_type _compression = none ) <nl> + : signatures ( std : : move ( t . signatures ) ) <nl> + { <nl> set_transaction ( t , _compression ) ; <nl> } <nl> <nl> namespace eosio { namespace chain { <nl> compression_type compression ; <nl> bytes data ; <nl> <nl> - const signature_type & sign ( const private_key_type & key , const chain_id_type & chain_id ) ; <nl> - signature_type sign ( const private_key_type & key , const chain_id_type & chain_id ) const ; <nl> - flat_set < public_key_type > get_signature_keys ( const chain_id_type & chain_id ) const ; <nl> + bytes get_raw_transaction ( ) const ; <nl> transaction get_transaction ( ) const ; <nl> - void set_transaction ( const transaction & t , signed_transaction : : compression_type _compression ) ; <nl> + signed_transaction get_signed_transaction ( ) const ; <nl> + void set_transaction ( const transaction & t , compression_type _compression = none ) ; <nl> + <nl> } ; <nl> <nl> <nl> FC_REFLECT ( eosio : : chain : : permission_level , ( actor ) ( permission ) ) <nl> FC_REFLECT ( eosio : : chain : : action , ( account ) ( name ) ( authorization ) ( data ) ) <nl> FC_REFLECT ( eosio : : chain : : transaction_header , ( expiration ) ( region ) ( ref_block_num ) ( ref_block_prefix ) ) <nl> FC_REFLECT_DERIVED ( eosio : : chain : : transaction , ( eosio : : chain : : transaction_header ) , ( actions ) ) <nl> - FC_REFLECT_ENUM ( eosio : : chain : : signed_transaction : : compression_type , ( none ) ( zlib ) ) <nl> - FC_REFLECT ( eosio : : chain : : signed_transaction , ( signatures ) ( compression ) ( data ) ) <nl> + FC_REFLECT_DERIVED ( eosio : : chain : : signed_transaction , ( eosio : : chain : : transaction ) , ( signatures ) ) <nl> + FC_REFLECT_ENUM ( eosio : : chain : : packed_transaction : : compression_type , ( none ) ( zlib ) ) <nl> + FC_REFLECT ( eosio : : chain : : packed_transaction , ( signatures ) ( compression ) ( data ) ) <nl> FC_REFLECT_DERIVED ( eosio : : chain : : deferred_transaction , ( eosio : : chain : : transaction ) , ( sender_id ) ( sender ) ( execute_after ) ) <nl> FC_REFLECT_ENUM ( eosio : : chain : : data_access_info : : access_type , ( read ) ( write ) ) <nl> FC_REFLECT ( eosio : : chain : : data_access_info , ( type ) ( code ) ( scope ) ( sequence ) ) <nl> mmm a / libraries / chain / include / eosio / chain / transaction_metadata . hpp <nl> ppp b / libraries / chain / include / eosio / chain / transaction_metadata . hpp <nl> <nl> namespace eosio { namespace chain { <nl> <nl> struct transaction_metadata { <nl> - transaction_metadata ( const transaction & t ) <nl> - : trx ( t ) <nl> - , id ( trx . id ( ) ) { } <nl> + / / transaction_metadata ( const transaction & t ) <nl> + / / : trx ( t ) <nl> + / / , id ( trx . id ( ) ) { } <nl> <nl> - transaction_metadata ( const transaction & t , const time_point & published , const account_name & sender , uint32_t sender_id , const char * generated_data , size_t generated_size ) <nl> + transaction_metadata ( const transaction & t , const time_point & published , const account_name & sender , uint32_t sender_id , const char * raw_data , size_t raw_size ) <nl> : trx ( t ) <nl> , id ( trx . id ( ) ) <nl> , published ( published ) <nl> - , sender ( sender ) , sender_id ( sender_id ) , generated_data ( generated_data ) , generated_size ( generated_size ) <nl> + , sender ( sender ) , sender_id ( sender_id ) , raw_data ( raw_data ) , raw_size ( raw_size ) <nl> { } <nl> <nl> - transaction_metadata ( const signed_transaction & t , chain_id_type chainid , const time_point & published ) <nl> - : decompressed_trx ( t . get_transaction ( ) ) <nl> - , trx ( * decompressed_trx ) <nl> - , id ( trx . id ( ) ) <nl> - , bandwidth_usage ( ( uint32_t ) fc : : raw : : pack_size ( t ) ) <nl> - , published ( published ) <nl> - { } <nl> + transaction_metadata ( const packed_transaction & t , chain_id_type chainid , const time_point & published ) ; <nl> <nl> + transaction_metadata ( transaction_metadata & & ) = default ; <nl> + transaction_metadata & operator = ( transaction_metadata & & ) = default ; <nl> <nl> - / / things for signed_transactions <nl> + / / things for packed_transaction <nl> + optional < bytes > raw_trx ; <nl> optional < transaction > decompressed_trx ; <nl> + <nl> + / / things for signed / packed transactions <nl> optional < flat_set < public_key_type > > signing_keys ; <nl> <nl> const transaction & trx ; <nl> struct transaction_metadata { <nl> / / things for processing deferred transactions <nl> optional < account_name > sender ; <nl> uint32_t sender_id = 0 ; <nl> - const char * generated_data = nullptr ; <nl> - size_t generated_size = 0 ; <nl> + <nl> + / / packed form to pass to contracts if needed <nl> + const char * raw_data = nullptr ; <nl> + size_t raw_size = 0 ; <nl> <nl> / / scopes available to this transaction if we are applying a block <nl> optional < const vector < shard_lock > * > allowed_read_locks ; <nl> optional < const vector < shard_lock > * > allowed_write_locks ; <nl> + <nl> + static digest_type calculate_transaction_merkle_root ( const vector < transaction_metadata > & metas ) ; <nl> } ; <nl> <nl> } } / / eosio : : chain <nl> mmm a / libraries / chain / test / transaction_test . cpp <nl> ppp b / libraries / chain / test / transaction_test . cpp <nl> BOOST_AUTO_TEST_SUITE ( transaction_test ) <nl> trx . actions . emplace_back ( vector < permission_level > { { N ( decomp ) , config : : active_name } } , <nl> test_action { " random data here " } ) ; <nl> <nl> - signed_transaction t ; <nl> - t . set_transaction ( trx , signed_transaction : : zlib ) ; <nl> + packed_transaction t ; <nl> + t . set_transaction ( trx , packed_transaction : : zlib ) ; <nl> <nl> auto actual = fc : : to_hex ( t . data ) ; <nl> BOOST_CHECK_EQUAL ( expected , actual ) ; <nl> BOOST_AUTO_TEST_SUITE ( transaction_test ) <nl> <nl> char compressed_tx_raw [ ] = " 78da63606060d8bf7ff5eab2198ace8c13962fe3909cb0f114835aa9248866044a3284784ef402d12bde1a19090a1425e6a5e4e72aa42496242a64a416a50200a9d114bb " ; <nl> <nl> - signed_transaction t ; <nl> + packed_transaction t ; <nl> t . data . resize ( ( sizeof ( compressed_tx_raw ) - 1 ) / 2 ) ; <nl> fc : : from_hex ( compressed_tx_raw , t . data . data ( ) , t . data . size ( ) ) ; <nl> - t . compression = signed_transaction : : zlib ; <nl> + t . compression = packed_transaction : : zlib ; <nl> <nl> auto actual = t . get_transaction ( ) ; <nl> BOOST_CHECK_EQUAL ( expected . region , actual . region ) ; <nl> mmm a / libraries / chain / transaction . cpp <nl> ppp b / libraries / chain / transaction . cpp <nl> digest_type transaction : : sig_digest ( const chain_id_type & chain_id ) const { <nl> return enc . result ( ) ; <nl> } <nl> <nl> - const signature_type & signed_transaction : : sign ( const private_key_type & key , const chain_id_type & chain_id ) { <nl> - signatures . push_back ( key . sign ( get_transaction ( ) . sig_digest ( chain_id ) ) ) ; <nl> - return signatures . back ( ) ; <nl> - } <nl> - <nl> - signature_type signed_transaction : : sign ( const private_key_type & key , const chain_id_type & chain_id ) const { <nl> - return key . sign ( get_transaction ( ) . sig_digest ( chain_id ) ) ; <nl> - } <nl> - <nl> - flat_set < public_key_type > signed_transaction : : get_signature_keys ( const chain_id_type & chain_id ) const <nl> + flat_set < public_key_type > transaction : : get_signature_keys ( const vector < signature_type > & signatures , const chain_id_type & chain_id ) const <nl> { try { <nl> using boost : : adaptors : : transformed ; <nl> <nl> constexpr size_t recovery_cache_size = 100000 ; <nl> static recovery_cache_type recovery_cache ; <nl> - const auto trx = get_transaction ( ) ; <nl> - const digest_type digest = trx . sig_digest ( chain_id ) ; <nl> + const digest_type digest = sig_digest ( chain_id ) ; <nl> <nl> flat_set < public_key_type > recovered_pub_keys ; <nl> for ( const signature_type & sig : signatures ) { <nl> recovery_cache_type : : index < by_sig > : : type : : iterator it = recovery_cache . get < by_sig > ( ) . find ( sig ) ; <nl> <nl> - if ( it = = recovery_cache . get < by_sig > ( ) . end ( ) | | it - > trx_id ! = trx . id ( ) ) { <nl> + if ( it = = recovery_cache . get < by_sig > ( ) . end ( ) | | it - > trx_id ! = id ( ) ) { <nl> public_key_type recov = public_key_type ( sig , digest ) ; <nl> - recovery_cache . emplace_back ( cached_pub_key { trx . id ( ) , recov , sig } ) ; / / could fail on dup signatures ; not a problem <nl> + recovery_cache . emplace_back ( cached_pub_key { id ( ) , recov , sig } ) ; / / could fail on dup signatures ; not a problem <nl> recovered_pub_keys . insert ( recov ) ; <nl> continue ; <nl> } <nl> flat_set < public_key_type > signed_transaction : : get_signature_keys ( const chain_id <nl> return recovered_pub_keys ; <nl> } FC_CAPTURE_AND_RETHROW ( ) } <nl> <nl> + <nl> + const signature_type & signed_transaction : : sign ( const private_key_type & key , const chain_id_type & chain_id ) { <nl> + signatures . push_back ( key . sign ( sig_digest ( chain_id ) ) ) ; <nl> + return signatures . back ( ) ; <nl> + } <nl> + <nl> + signature_type signed_transaction : : sign ( const private_key_type & key , const chain_id_type & chain_id ) const { <nl> + return key . sign ( sig_digest ( chain_id ) ) ; <nl> + } <nl> + <nl> + flat_set < public_key_type > signed_transaction : : get_signature_keys ( const chain_id_type & chain_id ) const <nl> + { <nl> + return transaction : : get_signature_keys ( signatures , chain_id ) ; <nl> + } <nl> + <nl> namespace bio = boost : : iostreams ; <nl> <nl> template < size_t Limit > <nl> static transaction zlib_decompress_transaction ( const bytes & data ) { <nl> } <nl> } <nl> <nl> + static bytes zlib_decompress ( const bytes & data ) { <nl> + try { <nl> + bytes out ; <nl> + bio : : filtering_ostream decomp ; <nl> + decomp . push ( bio : : zlib_decompressor ( ) ) ; <nl> + decomp . push ( read_limiter < 10 * 1024 * 1024 > ( ) ) ; / / limit to 10 megs decompressed for zip bomb protections <nl> + decomp . push ( bio : : back_inserter ( out ) ) ; <nl> + bio : : write ( decomp , data . data ( ) , data . size ( ) ) ; <nl> + bio : : close ( decomp ) ; <nl> + return out ; <nl> + } catch ( fc : : exception & er ) { <nl> + throw ; <nl> + } catch ( . . . ) { <nl> + fc : : unhandled_exception er ( FC_LOG_MESSAGE ( warn , " internal decompression error " ) , std : : current_exception ( ) ) ; <nl> + throw er ; <nl> + } <nl> + } <nl> + <nl> static bytes pack_transaction ( const transaction & t ) { <nl> return fc : : raw : : pack ( t ) ; <nl> } <nl> static bytes zlib_compress_transaction ( const transaction & t ) { <nl> return out ; <nl> } <nl> <nl> - transaction signed_transaction : : get_transaction ( ) const <nl> + bytes packed_transaction : : get_raw_transaction ( ) const <nl> + { <nl> + try { <nl> + switch ( compression ) { <nl> + case none : <nl> + return data ; <nl> + case zlib : <nl> + return zlib_decompress ( data ) ; <nl> + default : <nl> + FC_THROW ( " Unknown transaction compression algorithm " ) ; <nl> + } <nl> + } FC_CAPTURE_AND_RETHROW ( ( compression ) ( data ) ) <nl> + } <nl> + <nl> + transaction packed_transaction : : get_transaction ( ) const <nl> { <nl> try { <nl> switch ( compression ) { <nl> transaction signed_transaction : : get_transaction ( ) const <nl> } FC_CAPTURE_AND_RETHROW ( ( compression ) ( data ) ) <nl> } <nl> <nl> - void signed_transaction : : set_transaction ( const transaction & t , signed_transaction : : compression_type _compression ) <nl> + signed_transaction packed_transaction : : get_signed_transaction ( ) const <nl> + { <nl> + return signed_transaction ( get_transaction ( ) , signatures ) ; <nl> + } <nl> + <nl> + void packed_transaction : : set_transaction ( const transaction & t , packed_transaction : : compression_type _compression ) <nl> { <nl> try { <nl> switch ( _compression ) { <nl> new file mode 100644 <nl> index 0000000000 . . 9e913ff16c <nl> mmm / dev / null <nl> ppp b / libraries / chain / transaction_metadata . cpp <nl> <nl> + # include < eosio / chain / transaction_metadata . hpp > <nl> + # include < eosio / chain / merkle . hpp > <nl> + # include < fc / io / raw . hpp > <nl> + <nl> + namespace eosio { namespace chain { <nl> + <nl> + transaction_metadata : : transaction_metadata ( const packed_transaction & t , chain_id_type chainid , const time_point & published ) <nl> + : raw_trx ( t . get_raw_transaction ( ) ) <nl> + , decompressed_trx ( fc : : raw : : unpack < transaction > ( * raw_trx ) ) <nl> + , trx ( * decompressed_trx ) <nl> + , id ( decompressed_trx - > id ( ) ) <nl> + , bandwidth_usage ( ( uint32_t ) fc : : raw : : pack_size ( t ) ) <nl> + , published ( published ) <nl> + , raw_data ( raw_trx - > data ( ) ) <nl> + , raw_size ( raw_trx - > size ( ) ) <nl> + { } <nl> + <nl> + digest_type transaction_metadata : : calculate_transaction_merkle_root ( const vector < transaction_metadata > & metas ) { <nl> + vector < digest_type > ids ; <nl> + ids . reserve ( metas . size ( ) ) ; <nl> + <nl> + for ( const auto & t : metas ) <nl> + ids . emplace_back ( t . id ) ; <nl> + <nl> + return merkle ( std : : move ( ids ) ) ; <nl> + } <nl> + <nl> + } } / / eosio : : chain <nl> \ No newline at end of file <nl> mmm a / libraries / testing / include / eosio / testing / tester . hpp <nl> ppp b / libraries / testing / include / eosio / testing / tester . hpp <nl> namespace eosio { namespace testing { <nl> signed_block produce_block ( fc : : microseconds skip_time = fc : : milliseconds ( config : : block_interval_ms ) ) ; <nl> void produce_blocks ( uint32_t n = 1 ) ; <nl> <nl> + transaction_trace push_transaction ( packed_transaction & trx ) ; <nl> transaction_trace push_transaction ( signed_transaction & trx ) ; <nl> void set_tapos ( signed_transaction & trx ) const ; <nl> <nl> mmm a / libraries / testing / tester . cpp <nl> ppp b / libraries / testing / tester . cpp <nl> namespace eosio { namespace testing { <nl> . deposit = initial_balance <nl> } ) ; <nl> <nl> - trx . sign ( get_private_key ( creator , " active " ) , chain_id_type ( ) ) ; <nl> + set_tapos ( trx ) ; <nl> + trx . sign ( get_private_key ( creator , " active " ) , chain_id_type ( ) ) ; <nl> + push_transaction ( trx ) ; <nl> + } <nl> <nl> - control - > push_transaction ( trx ) ; <nl> + transaction_trace tester : : push_transaction ( packed_transaction & trx ) { <nl> + return control - > push_transaction ( trx ) ; <nl> } <nl> <nl> transaction_trace tester : : push_transaction ( signed_transaction & trx ) { <nl> - set_tapos ( trx ) ; <nl> - return control - > push_transaction ( trx ) ; <nl> + auto ptrx = packed_transaction ( trx ) ; <nl> + return push_transaction ( ptrx ) ; <nl> } <nl> <nl> void tester : : create_account ( account_name a , string initial_balance , account_name creator , bool multisig ) { <nl> namespace eosio { namespace testing { <nl> . memo = memo <nl> } ) ; <nl> <nl> - trx . sign ( get_private_key ( from , " active " ) , chain_id_type ( ) ) ; <nl> - return control - > push_transaction ( trx ) ; <nl> + set_tapos ( trx ) ; <nl> + trx . sign ( get_private_key ( from , " active " ) , chain_id_type ( ) ) ; <nl> + return push_transaction ( trx ) ; <nl> } <nl> <nl> void tester : : set_authority ( account_name account , <nl> namespace eosio { namespace testing { <nl> <nl> set_tapos ( trx ) ; <nl> trx . sign ( get_private_key ( account , " active " ) , chain_id_type ( ) ) ; <nl> - control - > push_transaction ( trx ) ; <nl> + push_transaction ( trx ) ; <nl> } FC_CAPTURE_AND_RETHROW ( ( account ) ( perm ) ( auth ) ( parent ) ) } <nl> <nl> void tester : : set_code ( account_name account , const char * wast ) try { <nl> namespace eosio { namespace testing { <nl> <nl> set_tapos ( trx ) ; <nl> trx . sign ( get_private_key ( account , " active " ) , chain_id_type ( ) ) ; <nl> - control - > push_transaction ( trx ) ; <nl> + push_transaction ( trx ) ; <nl> } FC_CAPTURE_AND_RETHROW ( ( account ) ( wast ) ) <nl> <nl> void tester : : set_abi ( account_name account , const char * abi_json ) { <nl> namespace eosio { namespace testing { <nl> <nl> set_tapos ( trx ) ; <nl> trx . sign ( get_private_key ( account , " active " ) , chain_id_type ( ) ) ; <nl> - control - > push_transaction ( trx ) ; <nl> + push_transaction ( trx ) ; <nl> } <nl> <nl> bool tester : : chain_has_transaction ( const transaction_id_type & txid ) const { <nl> mmm a / plugins / account_history_plugin / account_history_plugin . cpp <nl> ppp b / plugins / account_history_plugin / account_history_plugin . cpp <nl> using chain : : block_id_type ; <nl> using chain : : key_weight ; <nl> using chain : : permission_level_weight ; <nl> using chain : : permission_name ; <nl> - using chain : : signed_transaction ; <nl> + using chain : : packed_transaction ; <nl> using chain : : signed_block ; <nl> using boost : : multi_index_container ; <nl> using chain : : transaction_id_type ; <nl> using get_transactions_results = account_history_apis : : read_only : : get_transactio <nl> <nl> class account_history_plugin_impl { <nl> public : <nl> - signed_transaction get_transaction ( const chain : : transaction_id_type & transaction_id ) const ; <nl> + packed_transaction get_transaction ( const chain : : transaction_id_type & transaction_id ) const ; <nl> get_transactions_results get_transactions ( const account_name & account_name , const optional < uint32_t > & skip_seq , const optional < uint32_t > & num_seq ) const ; <nl> vector < account_name > get_key_accounts ( const public_key_type & public_key ) const ; <nl> vector < account_name > get_controlled_accounts ( const account_name & controlling_account ) const ; <nl> void applied_block ( const chain : : block_trace & ) ; <nl> - fc : : variant transaction_to_variant ( const signed_transaction & pretty_input ) const ; <nl> + fc : : variant transaction_to_variant ( const packed_transaction & pretty_input ) const ; <nl> <nl> chain_plugin * chain_plug ; <nl> static const int64_t DEFAULT_TRANSACTION_TIME_LIMIT ; <nl> class account_history_plugin_impl { <nl> typedef std : : multimap < block_id_type , transaction_id_type , block_comp > block_transaction_id_map ; <nl> <nl> optional < block_id_type > find_block_id ( const chainbase : : database & db , const transaction_id_type & transaction_id ) const ; <nl> - signed_transaction find_transaction ( const chain : : transaction_id_type & transaction_id , const signed_block & block ) const ; <nl> + packed_transaction find_transaction ( const chain : : transaction_id_type & transaction_id , const signed_block & block ) const ; <nl> bool is_scope_relevant ( const vector < account_name > & scope ) ; <nl> get_transactions_results ordered_transactions ( const block_transaction_id_map & block_transaction_ids , const fc : : time_point & start_time , const uint32_t begin , const uint32_t end ) const ; <nl> static void add ( chainbase : : database & db , const vector < key_weight > & keys , const account_name & account_name , const permission_name & permission ) ; <nl> optional < block_id_type > account_history_plugin_impl : : find_block_id ( const chainba <nl> return block_id ; <nl> } <nl> <nl> - signed_transaction account_history_plugin_impl : : find_transaction ( const chain : : transaction_id_type & transaction_id , const chain : : signed_block & block ) const <nl> + packed_transaction account_history_plugin_impl : : find_transaction ( const chain : : transaction_id_type & transaction_id , const chain : : signed_block & block ) const <nl> { <nl> - for ( const signed_transaction & trx : block . input_transactions ) <nl> - if ( trx . id ( ) = = transaction_id ) <nl> + for ( const packed_transaction & trx : block . input_transactions ) <nl> + if ( trx . get_transaction ( ) . id ( ) = = transaction_id ) <nl> return trx ; <nl> <nl> / / ERROR in indexing logic <nl> FC_THROW ( " Transaction with ID $ { tid } was indexed as being in block ID $ { bid } , but was not found in that block " , ( " tid " , transaction_id ) ( " bid " , block . id ( ) ) ) ; <nl> } <nl> <nl> - signed_transaction account_history_plugin_impl : : get_transaction ( const chain : : transaction_id_type & transaction_id ) const <nl> + packed_transaction account_history_plugin_impl : : get_transaction ( const chain : : transaction_id_type & transaction_id ) const <nl> { <nl> const auto & db = chain_plug - > chain ( ) . get_database ( ) ; <nl> optional < block_id_type > block_id ; <nl> get_transactions_results account_history_plugin_impl : : ordered_transactions ( const <nl> } <nl> for ( auto trx = block - > input_transactions . crbegin ( ) ; trx ! = block - > input_transactions . crend ( ) & & current < trx_after_block ; + + trx ) <nl> { <nl> - if ( trans_ids_for_block . count ( trx - > id ( ) ) ) <nl> + transaction_id_type trx_id = trx - > get_transaction ( ) . id ( ) ; <nl> + if ( trans_ids_for_block . count ( trx_id ) ) <nl> { <nl> if ( + + current > begin ) <nl> { <nl> const auto pretty_trx = transaction_to_variant ( * trx ) ; <nl> - results . transactions . emplace_back ( ordered_transaction_results { ( current - 1 ) , trx - > id ( ) , pretty_trx } ) ; <nl> + results . transactions . emplace_back ( ordered_transaction_results { ( current - 1 ) , trx_id , pretty_trx } ) ; <nl> <nl> if ( current > = end ) <nl> { <nl> bool account_history_plugin_impl : : is_scope_relevant ( const vector < account_name > & <nl> return false ; <nl> } <nl> <nl> - fc : : variant account_history_plugin_impl : : transaction_to_variant ( const signed_transaction & txn ) const <nl> + fc : : variant account_history_plugin_impl : : transaction_to_variant ( const packed_transaction & ptrx ) const <nl> { <nl> const chainbase : : database & database = chain_plug - > chain ( ) . get_database ( ) ; <nl> auto resolver = [ & database ] ( const account_name & name ) - > optional < abi_serializer > { <nl> fc : : variant account_history_plugin_impl : : transaction_to_variant ( const signed_tra <nl> } ; <nl> <nl> fc : : variant pretty_output ; <nl> - abi_serializer : : to_variant ( txn , pretty_output , resolver ) ; <nl> + abi_serializer : : to_variant ( ptrx , pretty_output , resolver ) ; <nl> return pretty_output ; <nl> } <nl> <nl> mmm a / plugins / chain_plugin / chain_plugin . cpp <nl> ppp b / plugins / chain_plugin / chain_plugin . cpp <nl> bool chain_plugin : : accept_block ( const signed_block & block , bool currently_syncin <nl> return true ; <nl> } <nl> <nl> - void chain_plugin : : accept_transaction ( const signed_transaction & trx ) { <nl> + void chain_plugin : : accept_transaction ( const packed_transaction & trx ) { <nl> chain ( ) . push_transaction ( trx , my - > skip_flags ) ; <nl> } <nl> <nl> read_write : : push_block_results read_write : : push_block ( const read_write : : push_blo <nl> } <nl> <nl> read_write : : push_transaction_results read_write : : push_transaction ( const read_write : : push_transaction_params & params ) { <nl> - signed_transaction pretty_input ; <nl> + packed_transaction pretty_input ; <nl> auto resolver = [ & , this ] ( const account_name & name ) - > optional < abi_serializer > { <nl> const auto * accnt = db . get_database ( ) . find < account_object , by_name > ( name ) ; <nl> if ( accnt ! = nullptr ) { <nl> read_write : : push_transaction_results read_write : : push_transaction ( const read_wri <nl> # warning TODO : get transaction results asynchronously <nl> fc : : variant pretty_output ; <nl> abi_serializer : : to_variant ( result , pretty_output , resolver ) ; <nl> - return read_write : : push_transaction_results { pretty_input . id ( ) , pretty_output } ; <nl> + return read_write : : push_transaction_results { result . id , pretty_output } ; <nl> } <nl> <nl> read_write : : push_transactions_results read_write : : push_transactions ( const read_write : : push_transactions_params & params ) { <nl> read_only : : abi_bin_to_json_result read_only : : abi_bin_to_json ( const read_only : : a <nl> } <nl> <nl> read_only : : get_required_keys_result read_only : : get_required_keys ( const get_required_keys_params & params ) const { <nl> - signed_transaction pretty_input ; <nl> + packed_transaction pretty_input ; <nl> from_variant ( params . transaction , pretty_input ) ; <nl> - auto required_keys_set = db . get_required_keys ( pretty_input , params . available_keys ) ; <nl> + auto required_keys_set = db . get_required_keys ( pretty_input . get_transaction ( ) , params . available_keys ) ; <nl> get_required_keys_result result ; <nl> result . required_keys = required_keys_set ; <nl> return result ; <nl> mmm a / plugins / chain_plugin / include / eosio / chain_plugin / chain_plugin . hpp <nl> ppp b / plugins / chain_plugin / include / eosio / chain_plugin / chain_plugin . hpp <nl> class chain_plugin : public plugin < chain_plugin > { <nl> chain_apis : : read_write get_read_write_api ( ) ; <nl> <nl> bool accept_block ( const chain : : signed_block & block , bool currently_syncing ) ; <nl> - void accept_transaction ( const chain : : signed_transaction & trx ) ; <nl> + void accept_transaction ( const chain : : packed_transaction & trx ) ; <nl> <nl> bool block_is_on_preferred_chain ( const chain : : block_id_type & block_id ) ; <nl> <nl> mmm a / plugins / faucet_testnet_plugin / faucet_testnet_plugin . cpp <nl> ppp b / plugins / faucet_testnet_plugin / faucet_testnet_plugin . cpp <nl> struct faucet_testnet_plugin_impl { <nl> trx . sign ( _create_account_private_key , chainid ) ; <nl> <nl> try { <nl> - cc . push_transaction ( trx ) ; <nl> + cc . push_transaction ( packed_transaction ( trx ) ) ; <nl> } catch ( const account_name_exists_exception & ) { <nl> / / another transaction ended up adding the account , so look for alternates <nl> return find_alternates ( new_account_name ) ; <nl> mmm a / plugins / net_plugin / net_plugin . cpp <nl> ppp b / plugins / net_plugin / net_plugin . cpp <nl> namespace eosio { <nl> / / template < typename VerifierFunc > <nl> / / void send_all ( net_message_ptr msg , VerifierFunc verify ) ; <nl> void send_all_txn ( const signed_transaction & txn ) ; <nl> - static void transaction_ready ( const signed_transaction & txn ) ; <nl> + static void transaction_ready ( const packed_transaction & txn ) ; <nl> void broadcast_block_impl ( const signed_block & sb ) ; <nl> <nl> size_t cache_txn ( const transaction_id_type , const signed_transaction & txn ) ; <nl> namespace eosio { <nl> } <nl> <nl> try { <nl> - chain_plug - > accept_transaction ( msg ) ; <nl> + / / TODO : avoid this reserialization by adjusting messages to deal with packed transactions . <nl> + chain_plug - > accept_transaction ( packed_transaction ( msg ) ) ; <nl> fc_dlog ( logger , " chain accepted transaction " ) ; <nl> } catch ( const fc : : exception & ex ) { <nl> / / received a block due to out of sequence <nl> namespace eosio { <nl> / * * <nl> * This one is necessary to hook into the boost notifier api <nl> * * / <nl> - void net_plugin_impl : : transaction_ready ( const signed_transaction & txn ) { <nl> - my_impl - > send_all_txn ( txn ) ; <nl> + void net_plugin_impl : : transaction_ready ( const packed_transaction & txn ) { <nl> + / / TODO : avoid this reserialization by updating protocol to use packed_transactions directly <nl> + auto strx = signed_transaction ( txn . get_transaction ( ) , txn . signatures ) ; <nl> + my_impl - > send_all_txn ( strx ) ; <nl> } <nl> <nl> void net_plugin_impl : : broadcast_block_impl ( const chain : : signed_block & sb ) { <nl> mmm a / plugins / txn_test_gen_plugin / txn_test_gen_plugin . cpp <nl> ppp b / plugins / txn_test_gen_plugin / txn_test_gen_plugin . cpp <nl> struct txn_test_gen_plugin_impl { <nl> trx . actions . emplace_back ( vector < chain : : permission_level > { { creator , " active " } } , contracts : : newaccount { creator , newaccountB , owner_auth , active_auth , recovery_auth , stake } ) ; <nl> } <nl> trx . sign ( creator_priv_key , chainid ) ; <nl> - cc . push_transaction ( trx ) ; <nl> + cc . push_transaction ( packed_transaction ( trx ) ) ; <nl> <nl> / / now , transfer some balance to new accounts <nl> { <nl> struct txn_test_gen_plugin_impl { <nl> trx . expiration = cc . head_block_time ( ) + fc : : seconds ( 30 ) ; <nl> trx . set_reference_block ( cc . head_block_id ( ) ) ; <nl> trx . sign ( creator_priv_key , chainid ) ; <nl> - cc . push_transaction ( trx ) ; <nl> + cc . push_transaction ( packed_transaction ( trx ) ) ; <nl> } <nl> } <nl> <nl> struct txn_test_gen_plugin_impl { <nl> <nl> fc : : crypto : : private_key creator_priv_key = fc : : crypto : : private_key : : regenerate ( fc : : sha256 ( std : : string ( 64 , ' a ' ) ) ) ; <nl> trx . sign ( creator_priv_key , chainid ) ; <nl> - cc . push_transaction ( trx ) ; <nl> + cc . push_transaction ( packed_transaction ( trx ) ) ; <nl> } <nl> <nl> / / make transaction b - > a <nl> struct txn_test_gen_plugin_impl { <nl> <nl> fc : : crypto : : private_key b_priv_key = fc : : crypto : : private_key : : regenerate ( fc : : sha256 ( std : : string ( 64 , ' b ' ) ) ) ; <nl> trx . sign ( b_priv_key , chainid ) ; <nl> - cc . push_transaction ( trx ) ; <nl> + cc . push_transaction ( packed_transaction ( trx ) ) ; <nl> } <nl> } <nl> <nl> mmm a / tests / chain_tests / transfer_tests . cpp <nl> ppp b / tests / chain_tests / transfer_tests . cpp <nl> BOOST_AUTO_TEST_CASE ( transfer_test ) { try { <nl> } ) ; <nl> <nl> test . set_tapos ( trx ) ; <nl> - BOOST_REQUIRE_THROW ( test . control - > push_transaction ( trx ) , tx_missing_sigs ) ; <nl> + BOOST_REQUIRE_THROW ( test . push_transaction ( trx ) , tx_missing_sigs ) ; <nl> trx . sign ( test . get_private_key ( from , " active " ) , chain_id_type ( ) ) ; <nl> - test . control - > push_transaction ( trx ) ; <nl> + test . push_transaction ( trx ) ; <nl> } <nl> <nl> { <nl> BOOST_AUTO_TEST_CASE ( transfer_test ) { try { <nl> test . set_tapos ( trx ) ; <nl> trx . sign ( test . get_private_key ( to , " active " ) , chain_id_type ( ) ) ; <nl> / / / action not provided from authority <nl> - BOOST_REQUIRE_THROW ( test . control - > push_transaction ( trx ) , tx_missing_auth ) ; <nl> + BOOST_REQUIRE_THROW ( test . push_transaction ( trx ) , tx_missing_auth ) ; <nl> } <nl> <nl> } FC_LOG_AND_RETHROW ( ) } / / / transfer_test <nl> BOOST_AUTO_TEST_CASE ( transfer_delegation ) { try { <nl> wdump ( ( fc : : raw : : pack_size ( trx ) ) ) ; <nl> <nl> / / / action not provided from authority <nl> - test . control - > push_transaction ( trx ) ; <nl> + test . push_transaction ( trx ) ; <nl> } <nl> <nl> } FC_LOG_AND_RETHROW ( ) } <nl> mmm a / tests / wasm_tests / currency_tests . cpp <nl> ppp b / tests / wasm_tests / currency_tests . cpp <nl> BOOST_FIXTURE_TEST_CASE ( test_currency , tester ) try { <nl> <nl> set_tapos ( trx ) ; <nl> trx . sign ( get_private_key ( N ( currency ) , " active " ) , chain_id_type ( ) ) ; <nl> - control - > push_transaction ( trx ) ; <nl> + push_transaction ( trx ) ; <nl> produce_block ( ) ; <nl> <nl> BOOST_REQUIRE_EQUAL ( true , chain_has_transaction ( trx . id ( ) ) ) ; <nl> BOOST_FIXTURE_TEST_CASE ( test_currency , tester ) try { <nl> <nl> set_tapos ( trx ) ; <nl> trx . sign ( get_private_key ( N ( currency ) , " active " ) , chain_id_type ( ) ) ; <nl> - control - > push_transaction ( trx ) ; <nl> + push_transaction ( trx ) ; <nl> produce_block ( ) ; <nl> <nl> BOOST_REQUIRE_EQUAL ( true , chain_has_transaction ( trx . id ( ) ) ) ; <nl> BOOST_FIXTURE_TEST_CASE ( test_currency , tester ) try { <nl> <nl> set_tapos ( trx ) ; <nl> trx . sign ( get_private_key ( N ( alice ) , " active " ) , chain_id_type ( ) ) ; <nl> - BOOST_CHECK_EXCEPTION ( control - > push_transaction ( trx ) , fc : : assert_exception , assert_message_is ( " integer underflow subtracting token balance " ) ) ; <nl> + BOOST_CHECK_EXCEPTION ( push_transaction ( trx ) , fc : : assert_exception , assert_message_is ( " integer underflow subtracting token balance " ) ) ; <nl> produce_block ( ) ; <nl> <nl> BOOST_REQUIRE_EQUAL ( false , chain_has_transaction ( trx . id ( ) ) ) ; <nl> BOOST_FIXTURE_TEST_CASE ( test_currency , tester ) try { <nl> <nl> set_tapos ( trx ) ; <nl> trx . sign ( get_private_key ( N ( alice ) , " active " ) , chain_id_type ( ) ) ; <nl> - control - > push_transaction ( trx ) ; <nl> + push_transaction ( trx ) ; <nl> produce_block ( ) ; <nl> <nl> BOOST_REQUIRE_EQUAL ( true , chain_has_transaction ( trx . id ( ) ) ) ; <nl> mmm a / tests / wasm_tests / wasm_tests . cpp <nl> ppp b / tests / wasm_tests / wasm_tests . cpp <nl> BOOST_FIXTURE_TEST_CASE ( basic_test , tester ) try { <nl> <nl> set_tapos ( trx ) ; <nl> trx . sign ( get_private_key ( N ( asserter ) , " active " ) , chain_id_type ( ) ) ; <nl> - auto result = control - > push_transaction ( trx ) ; <nl> + auto result = push_transaction ( trx ) ; <nl> BOOST_CHECK_EQUAL ( result . status , transaction_receipt : : executed ) ; <nl> BOOST_CHECK_EQUAL ( result . action_traces . size ( ) , 1 ) ; <nl> BOOST_CHECK_EQUAL ( result . action_traces . at ( 0 ) . receiver . to_string ( ) , name ( N ( asserter ) ) . to_string ( ) ) ; <nl> BOOST_FIXTURE_TEST_CASE ( basic_test , tester ) try { <nl> trx . sign ( get_private_key ( N ( asserter ) , " active " ) , chain_id_type ( ) ) ; <nl> yes_assert_id = trx . id ( ) ; <nl> <nl> - BOOST_CHECK_THROW ( control - > push_transaction ( trx ) , fc : : assert_exception ) ; <nl> + BOOST_CHECK_THROW ( push_transaction ( trx ) , fc : : assert_exception ) ; <nl> } <nl> <nl> produce_blocks ( 1 ) ; <nl> BOOST_FIXTURE_TEST_CASE ( prove_mem_reset , tester ) try { <nl> <nl> set_tapos ( trx ) ; <nl> trx . sign ( get_private_key ( N ( asserter ) , " active " ) , chain_id_type ( ) ) ; <nl> - control - > push_transaction ( trx ) ; <nl> + push_transaction ( trx ) ; <nl> produce_blocks ( 1 ) ; <nl> BOOST_REQUIRE_EQUAL ( true , chain_has_transaction ( trx . id ( ) ) ) ; <nl> const auto & receipt = get_transaction_receipt ( trx . id ( ) ) ; <nl> BOOST_FIXTURE_TEST_CASE ( abi_from_variant , tester ) try { <nl> abi_serializer : : from_variant ( pretty_trx , trx , resolver ) ; <nl> set_tapos ( trx ) ; <nl> trx . sign ( get_private_key ( N ( asserter ) , " active " ) , chain_id_type ( ) ) ; <nl> - control - > push_transaction ( trx ) ; <nl> + push_transaction ( trx ) ; <nl> produce_blocks ( 1 ) ; <nl> BOOST_REQUIRE_EQUAL ( true , chain_has_transaction ( trx . id ( ) ) ) ; <nl> const auto & receipt = get_transaction_receipt ( trx . id ( ) ) ; <nl> BOOST_FIXTURE_TEST_CASE ( test_api_bootstrap , tester ) try { <nl> <nl> set_tapos ( trx ) ; <nl> trx . sign ( get_private_key ( N ( tester ) , " active " ) , chain_id_type ( ) ) ; <nl> - BOOST_CHECK_EXCEPTION ( control - > push_transaction ( trx ) , fc : : assert_exception , assert_message_is ( " test_action : : assert_false " ) ) ; <nl> + BOOST_CHECK_EXCEPTION ( push_transaction ( trx ) , fc : : assert_exception , assert_message_is ( " test_action : : assert_false " ) ) ; <nl> produce_block ( ) ; <nl> <nl> BOOST_REQUIRE_EQUAL ( false , chain_has_transaction ( trx . id ( ) ) ) ; <nl> BOOST_FIXTURE_TEST_CASE ( test_api_bootstrap , tester ) try { <nl> <nl> set_tapos ( trx ) ; <nl> trx . sign ( get_private_key ( N ( tester ) , " active " ) , chain_id_type ( ) ) ; <nl> - control - > push_transaction ( trx ) ; <nl> + push_transaction ( trx ) ; <nl> produce_block ( ) ; <nl> <nl> BOOST_REQUIRE_EQUAL ( true , chain_has_transaction ( trx . id ( ) ) ) ; <nl> BOOST_FIXTURE_TEST_CASE ( test_proxy , tester ) try { <nl> <nl> set_tapos ( trx ) ; <nl> trx . sign ( get_private_key ( N ( proxy ) , " active " ) , chain_id_type ( ) ) ; <nl> - control - > push_transaction ( trx ) ; <nl> + push_transaction ( trx ) ; <nl> produce_block ( ) ; <nl> BOOST_REQUIRE_EQUAL ( true , chain_has_transaction ( trx . id ( ) ) ) ; <nl> } <nl> BOOST_FIXTURE_TEST_CASE ( test_deferred_failure , tester ) try { <nl> <nl> set_tapos ( trx ) ; <nl> trx . sign ( get_private_key ( N ( proxy ) , " active " ) , chain_id_type ( ) ) ; <nl> - control - > push_transaction ( trx ) ; <nl> + push_transaction ( trx ) ; <nl> produce_block ( ) ; <nl> BOOST_REQUIRE_EQUAL ( true , chain_has_transaction ( trx . id ( ) ) ) ; <nl> } <nl> BOOST_FIXTURE_TEST_CASE ( test_deferred_failure , tester ) try { <nl> <nl> set_tapos ( trx ) ; <nl> trx . sign ( get_private_key ( N ( bob ) , " active " ) , chain_id_type ( ) ) ; <nl> - control - > push_transaction ( trx ) ; <nl> + push_transaction ( trx ) ; <nl> produce_block ( ) ; <nl> BOOST_REQUIRE_EQUAL ( true , chain_has_transaction ( trx . id ( ) ) ) ; <nl> } <nl> BOOST_FIXTURE_TEST_CASE ( check_entry_behavior , tester ) try { <nl> <nl> set_tapos ( trx ) ; <nl> trx . sign ( get_private_key ( N ( entrycheck ) , " active " ) , chain_id_type ( ) ) ; <nl> - control - > push_transaction ( trx ) ; <nl> + push_transaction ( trx ) ; <nl> produce_blocks ( 1 ) ; <nl> BOOST_REQUIRE_EQUAL ( true , chain_has_transaction ( trx . id ( ) ) ) ; <nl> const auto & receipt = get_transaction_receipt ( trx . id ( ) ) ; <nl> BOOST_FIXTURE_TEST_CASE ( simple_no_memory_check , tester ) try { <nl> trx . actions . push_back ( act ) ; <nl> <nl> trx . sign ( get_private_key ( N ( nomem ) , " active " ) , chain_id_type ( ) ) ; <nl> - BOOST_CHECK_THROW ( control - > push_transaction ( trx ) , wasm_execution_error ) ; <nl> + BOOST_CHECK_THROW ( push_transaction ( trx ) , wasm_execution_error ) ; <nl> } FC_LOG_AND_RETHROW ( ) <nl> <nl> / / Make sure globals are all reset to their inital values <nl> BOOST_FIXTURE_TEST_CASE ( check_global_reset , tester ) try { <nl> <nl> set_tapos ( trx ) ; <nl> trx . sign ( get_private_key ( N ( globalreset ) , " active " ) , chain_id_type ( ) ) ; <nl> - control - > push_transaction ( trx ) ; <nl> + push_transaction ( trx ) ; <nl> produce_blocks ( 1 ) ; <nl> BOOST_REQUIRE_EQUAL ( true , chain_has_transaction ( trx . id ( ) ) ) ; <nl> const auto & receipt = get_transaction_receipt ( trx . id ( ) ) ; <nl>
refactor into an explicit ` packed_transaction ` and wire that through controller plugins etc
EOSIO/eos
6e41c1bd5ae4625e5df47eee93052e97260e40c3
2018-01-31T20:56:53Z
mmm a / src / allocators . h <nl> ppp b / src / allocators . h <nl> <nl> <nl> # include < string . h > <nl> # include < string > <nl> + # include < boost / thread / mutex . hpp > <nl> + # include < map > <nl> <nl> # ifdef WIN32 <nl> # ifdef _WIN32_WINNT <nl> <nl> / / Note that VirtualLock does not provide this as a guarantee on Windows , <nl> / / but , in practice , memory that has been VirtualLock ' d almost never gets written to <nl> / / the pagefile except in rare circumstances where memory is extremely low . <nl> - # define mlock ( p , n ) VirtualLock ( ( p ) , ( n ) ) ; <nl> - # define munlock ( p , n ) VirtualUnlock ( ( p ) , ( n ) ) ; <nl> # else <nl> # include < sys / mman . h > <nl> - # include < limits . h > <nl> - / * This comes from limits . h if it ' s not defined there set a sane default * / <nl> - # ifndef PAGESIZE <nl> - # include < unistd . h > <nl> - # define PAGESIZE sysconf ( _SC_PAGESIZE ) <nl> + # include < limits . h > / / for PAGESIZE <nl> + # include < unistd . h > / / for sysconf <nl> # endif <nl> - # define mlock ( a , b ) \ <nl> - mlock ( ( ( void * ) ( ( ( size_t ) ( a ) ) & ( ~ ( ( PAGESIZE ) - 1 ) ) ) ) , \ <nl> - ( ( ( ( ( size_t ) ( a ) ) + ( b ) - 1 ) | ( ( PAGESIZE ) - 1 ) ) + 1 ) - ( ( ( size_t ) ( a ) ) & ( ~ ( ( PAGESIZE ) - 1 ) ) ) ) <nl> - # define munlock ( a , b ) \ <nl> - munlock ( ( ( void * ) ( ( ( size_t ) ( a ) ) & ( ~ ( ( PAGESIZE ) - 1 ) ) ) ) , \ <nl> - ( ( ( ( ( size_t ) ( a ) ) + ( b ) - 1 ) | ( ( PAGESIZE ) - 1 ) ) + 1 ) - ( ( ( size_t ) ( a ) ) & ( ~ ( ( PAGESIZE ) - 1 ) ) ) ) <nl> + <nl> + / * * <nl> + * Thread - safe class to keep track of locked ( ie , non - swappable ) memory pages . <nl> + * <nl> + * Memory locks do not stack , that is , pages which have been locked several times by calls to mlock ( ) <nl> + * will be unlocked by a single call to munlock ( ) . This can result in keying material ending up in swap when <nl> + * those functions are used naively . This class simulates stacking memory locks by keeping a counter per page . <nl> + * <nl> + * @ note By using a map from each page base address to lock count , this class is optimized for <nl> + * small objects that span up to a few pages , mostly smaller than a page . To support large allocations , <nl> + * something like an interval tree would be the preferred data structure . <nl> + * / <nl> + template < class Locker > class LockedPageManagerBase <nl> + { <nl> + public : <nl> + LockedPageManagerBase ( size_t page_size ) : <nl> + page_size ( page_size ) <nl> + { <nl> + / / Determine bitmask for extracting page from address <nl> + assert ( ! ( page_size & ( page_size - 1 ) ) ) ; / / size must be power of two <nl> + page_mask = ~ ( page_size - 1 ) ; <nl> + } <nl> + <nl> + / / For all pages in affected range , increase lock count <nl> + void LockRange ( void * p , size_t size ) <nl> + { <nl> + boost : : mutex : : scoped_lock lock ( mutex ) ; <nl> + if ( ! size ) return ; <nl> + const size_t base_addr = reinterpret_cast < size_t > ( p ) ; <nl> + const size_t start_page = base_addr & page_mask ; <nl> + const size_t end_page = ( base_addr + size - 1 ) & page_mask ; <nl> + for ( size_t page = start_page ; page < = end_page ; page + = page_size ) <nl> + { <nl> + Histogram : : iterator it = histogram . find ( page ) ; <nl> + if ( it = = histogram . end ( ) ) / / Newly locked page <nl> + { <nl> + locker . Lock ( reinterpret_cast < void * > ( page ) , page_size ) ; <nl> + histogram . insert ( std : : make_pair ( page , 1 ) ) ; <nl> + } <nl> + else / / Page was already locked ; increase counter <nl> + { <nl> + it - > second + = 1 ; <nl> + } <nl> + } <nl> + } <nl> + <nl> + / / For all pages in affected range , decrease lock count <nl> + void UnlockRange ( void * p , size_t size ) <nl> + { <nl> + boost : : mutex : : scoped_lock lock ( mutex ) ; <nl> + if ( ! size ) return ; <nl> + const size_t base_addr = reinterpret_cast < size_t > ( p ) ; <nl> + const size_t start_page = base_addr & page_mask ; <nl> + const size_t end_page = ( base_addr + size - 1 ) & page_mask ; <nl> + for ( size_t page = start_page ; page < = end_page ; page + = page_size ) <nl> + { <nl> + Histogram : : iterator it = histogram . find ( page ) ; <nl> + assert ( it ! = histogram . end ( ) ) ; / / Cannot unlock an area that was not locked <nl> + / / Decrease counter for page , when it is zero , the page will be unlocked <nl> + it - > second - = 1 ; <nl> + if ( it - > second = = 0 ) / / Nothing on the page anymore that keeps it locked <nl> + { <nl> + / / Unlock page and remove the count from histogram <nl> + locker . Unlock ( reinterpret_cast < void * > ( page ) , page_size ) ; <nl> + histogram . erase ( it ) ; <nl> + } <nl> + } <nl> + } <nl> + <nl> + / / Get number of locked pages for diagnostics <nl> + int GetLockedPageCount ( ) <nl> + { <nl> + boost : : mutex : : scoped_lock lock ( mutex ) ; <nl> + return histogram . size ( ) ; <nl> + } <nl> + <nl> + private : <nl> + Locker locker ; <nl> + boost : : mutex mutex ; <nl> + size_t page_size , page_mask ; <nl> + / / map of page base address to lock count <nl> + typedef std : : map < size_t , int > Histogram ; <nl> + Histogram histogram ; <nl> + } ; <nl> + <nl> + / * * Determine system page size in bytes * / <nl> + static inline size_t GetSystemPageSize ( ) <nl> + { <nl> + size_t page_size ; <nl> + # if defined ( WIN32 ) <nl> + SYSTEM_INFO sSysInfo ; <nl> + GetSystemInfo ( & sSysInfo ) ; <nl> + page_size = sSysInfo . dwPageSize ; <nl> + # elif defined ( PAGESIZE ) / / defined in limits . h <nl> + page_size = PAGESIZE ; <nl> + # else / / assume some POSIX OS <nl> + page_size = sysconf ( _SC_PAGESIZE ) ; <nl> + # endif <nl> + return page_size ; <nl> + } <nl> + <nl> + / * * <nl> + * OS - dependent memory page locking / unlocking . <nl> + * Defined as policy class to make stubbing for test possible . <nl> + * / <nl> + class MemoryPageLocker <nl> + { <nl> + public : <nl> + / * * Lock memory pages . <nl> + * addr and len must be a multiple of the system page size <nl> + * / <nl> + bool Lock ( const void * addr , size_t len ) <nl> + { <nl> + # ifdef WIN32 <nl> + return VirtualLock ( const_cast < void * > ( addr ) , len ) ; <nl> + # else <nl> + return mlock ( addr , len ) = = 0 ; <nl> + # endif <nl> + } <nl> + / * * Unlock memory pages . <nl> + * addr and len must be a multiple of the system page size <nl> + * / <nl> + bool Unlock ( const void * addr , size_t len ) <nl> + { <nl> + # ifdef WIN32 <nl> + return VirtualUnlock ( const_cast < void * > ( addr ) , len ) ; <nl> + # else <nl> + return munlock ( addr , len ) = = 0 ; <nl> # endif <nl> + } <nl> + } ; <nl> + <nl> + / * * <nl> + * Singleton class to keep track of locked ( ie , non - swappable ) memory pages , for use in <nl> + * std : : allocator templates . <nl> + * / <nl> + class LockedPageManager : public LockedPageManagerBase < MemoryPageLocker > <nl> + { <nl> + public : <nl> + static LockedPageManager instance ; / / instantiated in util . cpp <nl> + private : <nl> + LockedPageManager ( ) : <nl> + LockedPageManagerBase < MemoryPageLocker > ( GetSystemPageSize ( ) ) <nl> + { } <nl> + } ; <nl> <nl> / / <nl> / / Allocator that locks its contents from being paged <nl> struct secure_allocator : public std : : allocator < T > <nl> T * p ; <nl> p = std : : allocator < T > : : allocate ( n , hint ) ; <nl> if ( p ! = NULL ) <nl> - mlock ( p , sizeof ( T ) * n ) ; <nl> + LockedPageManager : : instance . LockRange ( p , sizeof ( T ) * n ) ; <nl> return p ; <nl> } <nl> <nl> struct secure_allocator : public std : : allocator < T > <nl> if ( p ! = NULL ) <nl> { <nl> memset ( p , 0 , sizeof ( T ) * n ) ; <nl> - munlock ( p , sizeof ( T ) * n ) ; <nl> + LockedPageManager : : instance . UnlockRange ( p , sizeof ( T ) * n ) ; <nl> } <nl> std : : allocator < T > : : deallocate ( p , n ) ; <nl> } <nl> new file mode 100644 <nl> index 000000000000 . . d5cb8e81019e <nl> mmm / dev / null <nl> ppp b / src / test / allocator_tests . cpp <nl> <nl> + # include < boost / test / unit_test . hpp > <nl> + <nl> + # include " init . h " <nl> + # include " main . h " <nl> + # include " util . h " <nl> + <nl> + BOOST_AUTO_TEST_SUITE ( allocator_tests ) <nl> + <nl> + / / Dummy memory page locker for platform independent tests <nl> + static const void * last_lock_addr , * last_unlock_addr ; <nl> + static size_t last_lock_len , last_unlock_len ; <nl> + class TestLocker <nl> + { <nl> + public : <nl> + bool Lock ( const void * addr , size_t len ) <nl> + { <nl> + last_lock_addr = addr ; <nl> + last_lock_len = len ; <nl> + return true ; <nl> + } <nl> + bool Unlock ( const void * addr , size_t len ) <nl> + { <nl> + last_unlock_addr = addr ; <nl> + last_unlock_len = len ; <nl> + return true ; <nl> + } <nl> + } ; <nl> + <nl> + BOOST_AUTO_TEST_CASE ( test_LockedPageManagerBase ) <nl> + { <nl> + const size_t test_page_size = 4096 ; <nl> + LockedPageManagerBase < TestLocker > lpm ( test_page_size ) ; <nl> + size_t addr ; <nl> + last_lock_addr = last_unlock_addr = 0 ; <nl> + last_lock_len = last_unlock_len = 0 ; <nl> + <nl> + / * Try large number of small objects * / <nl> + addr = 0 ; <nl> + for ( int i = 0 ; i < 1000 ; + + i ) <nl> + { <nl> + lpm . LockRange ( reinterpret_cast < void * > ( addr ) , 33 ) ; <nl> + addr + = 33 ; <nl> + } <nl> + / * Try small number of page - sized objects , straddling two pages * / <nl> + addr = test_page_size * 100 + 53 ; <nl> + for ( int i = 0 ; i < 100 ; + + i ) <nl> + { <nl> + lpm . LockRange ( reinterpret_cast < void * > ( addr ) , test_page_size ) ; <nl> + addr + = test_page_size ; <nl> + } <nl> + / * Try small number of page - sized objects aligned to exactly one page * / <nl> + addr = test_page_size * 300 ; <nl> + for ( int i = 0 ; i < 100 ; + + i ) <nl> + { <nl> + lpm . LockRange ( reinterpret_cast < void * > ( addr ) , test_page_size ) ; <nl> + addr + = test_page_size ; <nl> + } <nl> + / * one very large object , straddling pages * / <nl> + lpm . LockRange ( reinterpret_cast < void * > ( test_page_size * 600 + 1 ) , test_page_size * 500 ) ; <nl> + BOOST_CHECK ( last_lock_addr = = reinterpret_cast < void * > ( test_page_size * ( 600 + 500 ) ) ) ; <nl> + / * one very large object , page aligned * / <nl> + lpm . LockRange ( reinterpret_cast < void * > ( test_page_size * 1200 ) , test_page_size * 500 - 1 ) ; <nl> + BOOST_CHECK ( last_lock_addr = = reinterpret_cast < void * > ( test_page_size * ( 1200 + 500 - 1 ) ) ) ; <nl> + <nl> + BOOST_CHECK ( lpm . GetLockedPageCount ( ) = = ( <nl> + ( 1000 * 33 + test_page_size - 1 ) / test_page_size + / / small objects <nl> + 101 + 100 + / / page - sized objects <nl> + 501 + 500 ) ) ; / / large objects <nl> + BOOST_CHECK ( ( last_lock_len & ( test_page_size - 1 ) ) = = 0 ) ; / / always lock entire pages <nl> + BOOST_CHECK ( last_unlock_len = = 0 ) ; / / nothing unlocked yet <nl> + <nl> + / * And unlock again * / <nl> + addr = 0 ; <nl> + for ( int i = 0 ; i < 1000 ; + + i ) <nl> + { <nl> + lpm . UnlockRange ( reinterpret_cast < void * > ( addr ) , 33 ) ; <nl> + addr + = 33 ; <nl> + } <nl> + addr = test_page_size * 100 + 53 ; <nl> + for ( int i = 0 ; i < 100 ; + + i ) <nl> + { <nl> + lpm . UnlockRange ( reinterpret_cast < void * > ( addr ) , test_page_size ) ; <nl> + addr + = test_page_size ; <nl> + } <nl> + addr = test_page_size * 300 ; <nl> + for ( int i = 0 ; i < 100 ; + + i ) <nl> + { <nl> + lpm . UnlockRange ( reinterpret_cast < void * > ( addr ) , test_page_size ) ; <nl> + addr + = test_page_size ; <nl> + } <nl> + lpm . UnlockRange ( reinterpret_cast < void * > ( test_page_size * 600 + 1 ) , test_page_size * 500 ) ; <nl> + lpm . UnlockRange ( reinterpret_cast < void * > ( test_page_size * 1200 ) , test_page_size * 500 - 1 ) ; <nl> + <nl> + / * Check that everything is released * / <nl> + BOOST_CHECK ( lpm . GetLockedPageCount ( ) = = 0 ) ; <nl> + <nl> + / * A few and unlocks of size zero ( should have no effect ) * / <nl> + addr = 0 ; <nl> + for ( int i = 0 ; i < 1000 ; + + i ) <nl> + { <nl> + lpm . LockRange ( reinterpret_cast < void * > ( addr ) , 0 ) ; <nl> + addr + = 1 ; <nl> + } <nl> + BOOST_CHECK ( lpm . GetLockedPageCount ( ) = = 0 ) ; <nl> + addr = 0 ; <nl> + for ( int i = 0 ; i < 1000 ; + + i ) <nl> + { <nl> + lpm . UnlockRange ( reinterpret_cast < void * > ( addr ) , 0 ) ; <nl> + addr + = 1 ; <nl> + } <nl> + BOOST_CHECK ( lpm . GetLockedPageCount ( ) = = 0 ) ; <nl> + BOOST_CHECK ( ( last_unlock_len & ( test_page_size - 1 ) ) = = 0 ) ; / / always unlock entire pages <nl> + } <nl> + <nl> + BOOST_AUTO_TEST_SUITE_END ( ) <nl> mmm a / src / util . cpp <nl> ppp b / src / util . cpp <nl> void locking_callback ( int mode , int i , const char * file , int line ) <nl> } <nl> } <nl> <nl> + LockedPageManager LockedPageManager : : instance ; <nl> + <nl> / / Init <nl> class CInit <nl> { <nl>
Handle locked pages more robustly ( Fixes issue )
bitcoin/bitcoin
e95568b78ddead0173339ca98df6cd92131ceb62
2012-08-23T04:55:35Z
mmm a / java / CMakeLists . txt <nl> ppp b / java / CMakeLists . txt <nl> set ( JNI_NATIVE_SOURCES <nl> rocksjni / compression_options . cc <nl> rocksjni / env . cc <nl> rocksjni / env_options . cc <nl> - rocksjni / external_sst_file_info . cc <nl> rocksjni / filter . cc <nl> + rocksjni / ingest_external_file_options . cc <nl> rocksjni / iterator . cc <nl> rocksjni / loggerjnicallback . cc <nl> rocksjni / lru_cache . cc <nl>
Fix the CMakeLists for RocksJava
facebook/rocksdb
5a253046278041c5515342400821042849e6112d
2017-05-24T18:29:08Z
mmm a / hphp / hack / src / server / inferAtPosService . ml <nl> ppp b / hphp / hack / src / server / inferAtPosService . ml <nl> let infer_result_to_ide_response typename = <nl> Infer_type_response { type_string = None ; type_json = None } <nl> | Some ( str , _json ) - > <nl> Infer_type_response { type_string = Some str ; type_json = None } <nl> - <nl> - ( * Remember ( when we care ) the type found at a position * ) <nl> - let save_infer result_ty target_line target_column ty pos env = <nl> - if Pos . inside pos target_line target_column & & ! result_ty = None <nl> - then begin <nl> - let ty_string = Typing_print . full_strip_ns env ty in <nl> - let ty_with_constraints_string = <nl> - match Typing_print . constraints_for_type env ty with <nl> - | None - > ty_string <nl> - | Some s - > ty_string ^ " \ n " ^ s in <nl> - result_ty : = Some ( ty_with_constraints_string , <nl> - Hh_json . json_to_string ( Typing_print . to_json env ty ) ) <nl> - end <nl> - <nl> - let attach_hooks line column = <nl> - let result_ty = ref None in <nl> - let get_result ( ) = ! result_ty in <nl> - Typing_hooks . attach_infer_ty_hook <nl> - ( save_infer result_ty line column ) ; <nl> - get_result <nl> - <nl> - let detach_hooks ( ) = <nl> - Typing_hooks . remove_all_hooks ( ) <nl>
Remove dead code in InferAtPosService
facebook/hhvm
225e055e732720c72acba88113c4262e258f9494
2017-12-06T22:56:36Z
mmm a / doc / py_tutorials / py_gui / py_video_display / py_video_display . markdown <nl> ppp b / doc / py_tutorials / py_gui / py_video_display / py_video_display . markdown <nl> Otherwise open it using * * cap . open ( ) * * . <nl> <nl> You can also access some of the features of this video using * * cap . get ( propId ) * * method where propId <nl> is a number from 0 to 18 . Each number denotes a property of the video ( if it is applicable to that <nl> - video ) and full details can be seen here : cv : : VideoCapture : : get ( ) . <nl> + video ) and full details can be seen here : cv : : VideoCapture : : get ( ) . <nl> Some of these values can be modified using * * cap . set ( propId , value ) * * . Value is the new value you <nl> want . <nl> <nl> Playing Video from file <nl> mmmmmmmmmmmmmmmmmmmmm - - <nl> <nl> It is same as capturing from Camera , just change camera index with video file name . Also while <nl> - displaying the frame , use appropriate time for cv2 . waitKey ( ) . If it is too less , video will be very <nl> + displaying the frame , use appropriate time for ` cv2 . waitKey ( ) ` . If it is too less , video will be very <nl> fast and if it is too high , video will be slow ( Well , that is how you can display videos in slow <nl> motion ) . 25 milliseconds will be OK in normal cases . <nl> @ code { . py } <nl> Saving a Video <nl> mmmmmmmmmmmm - - <nl> <nl> So we capture a video , process it frame - by - frame and we want to save that video . For images , it is <nl> - very simple , just use cv2 . imwrite ( ) . Here a little more work is required . <nl> + very simple , just use ` cv2 . imwrite ( ) ` . Here a little more work is required . <nl> <nl> This time we create a * * VideoWriter * * object . We should specify the output file name ( eg : <nl> output . avi ) . Then we should specify the * * FourCC * * code ( details in next paragraph ) . Then number of <nl> platform dependent . Following codecs works fine for me . <nl> - In Fedora : DIVX , XVID , MJPG , X264 , WMV1 , WMV2 . ( XVID is more preferable . MJPG results in high <nl> size video . X264 gives very small size video ) <nl> - In Windows : DIVX ( More to be tested and added ) <nl> - - In OSX : * ( I don ' t have access to OSX . Can some one fill this ? ) * <nl> + - In OSX : MJPG ( . mp4 ) , DIVX ( . avi ) , X264 ( . mkv ) . <nl> <nl> - FourCC code is passed as cv2 . VideoWriter_fourcc ( ' M ' , ' J ' , ' P ' , ' G ' ) or <nl> - cv2 . VideoWriter_fourcc ( \ * ' MJPG ' ) for MJPG . <nl> + FourCC code is passed as ` cv2 . VideoWriter_fourcc ( ' M ' , ' J ' , ' P ' , ' G ' ) ` or <nl> + ` cv2 . VideoWriter_fourcc ( * ' MJPG ' ) ` for MJPG . <nl> <nl> Below code capture from a Camera , flip every frame in vertical direction and saves it . <nl> @ code { . py } <nl>
Merge pull request from puqeko : patch - 2
opencv/opencv
1170d74868c2441c6a9bf63750f8994e3d44e430
2017-07-30T10:07:09Z
mmm a / Tests / UnitTests / ReaderTests / ImageReaderTests . cpp <nl> ppp b / Tests / UnitTests / ReaderTests / ImageReaderTests . cpp <nl> BOOST_AUTO_TEST_CASE ( ImageReaderSimple ) <nl> 0 , <nl> 0 , <nl> 1 ) ; <nl> - } ; <nl> + } <nl> <nl> BOOST_AUTO_TEST_CASE ( ImageReaderZip ) <nl> { <nl> BOOST_AUTO_TEST_CASE ( ImageReaderZip ) <nl> 0 , <nl> 0 , <nl> 1 ) ; <nl> - } ; <nl> + } <nl> <nl> BOOST_AUTO_TEST_SUITE_END ( ) <nl> } } } } <nl>
Improved memory utilization and error handling in zip reader .
microsoft/CNTK
92eeaa621d184ef83234f10541af54f988b978b8
2016-02-25T17:47:11Z
mmm a / xbmc / GUIInfoManager . cpp <nl> ppp b / xbmc / GUIInfoManager . cpp <nl> TIME_FORMAT CGUIInfoManager : : TranslateTimeFormat ( const CStdString & format ) <nl> <nl> CStdString CGUIInfoManager : : GetLabel ( int info , int contextWindow ) <nl> { <nl> + if ( info > = CONDITIONAL_LABEL_START & & info < = CONDITIONAL_LABEL_END ) <nl> + return GetSkinVariableString ( info , contextWindow , false ) ; <nl> + <nl> CStdString strLabel ; <nl> if ( info > = MULTI_INFO_START & & info < = MULTI_INFO_END ) <nl> return GetMultiInfoLabel ( m_multiInfo [ info - MULTI_INFO_START ] , contextWindow ) ; <nl> bool CGUIInfoManager : : GetMultiInfoInt ( int & value , const GUIInfo & info , int conte <nl> } <nl> <nl> / / / \ brief Examines the multi information sent and returns the string as appropriate <nl> - CStdString CGUIInfoManager : : GetMultiInfoLabel ( const GUIInfo & info , int contextWindow ) const <nl> + CStdString CGUIInfoManager : : GetMultiInfoLabel ( const GUIInfo & info , int contextWindow ) <nl> { <nl> if ( info . m_info = = SKIN_STRING ) <nl> { <nl> CStdString CGUIInfoManager : : GetMultiInfoLabel ( const GUIInfo & info , int contextWi <nl> / / / \ brief Obtains the filename of the image to show from whichever subsystem is needed <nl> CStdString CGUIInfoManager : : GetImage ( int info , int contextWindow ) <nl> { <nl> + if ( info > = CONDITIONAL_LABEL_START & & info < = CONDITIONAL_LABEL_END ) <nl> + return GetSkinVariableString ( info , contextWindow , false ) ; <nl> + <nl> if ( info > = MULTI_INFO_START & & info < = MULTI_INFO_END ) <nl> { <nl> return GetMultiInfoLabel ( m_multiInfo [ info - MULTI_INFO_START ] , contextWindow ) ; <nl> CStdString CGUIInfoManager : : GetMusicPartyModeLabel ( int item ) <nl> return " " ; <nl> } <nl> <nl> - const CStdString CGUIInfoManager : : GetMusicPlaylistInfo ( const GUIInfo & info ) const <nl> + const CStdString CGUIInfoManager : : GetMusicPlaylistInfo ( const GUIInfo & info ) <nl> { <nl> PLAYLIST : : CPlayList & playlist = g_playlistPlayer . GetPlaylist ( PLAYLIST_MUSIC ) ; <nl> if ( playlist . size ( ) < 1 ) <nl> CStdString CGUIInfoManager : : GetMusicLabel ( int item ) <nl> return GetMusicTagLabel ( item , m_currentFile ) ; <nl> } <nl> <nl> - CStdString CGUIInfoManager : : GetMusicTagLabel ( int info , const CFileItem * item ) const <nl> + CStdString CGUIInfoManager : : GetMusicTagLabel ( int info , const CFileItem * item ) <nl> { <nl> if ( ! item - > HasMusicInfoTag ( ) ) return " " ; <nl> const CMusicInfoTag & tag = * item - > GetMusicInfoTag ( ) ; <nl> bool CGUIInfoManager : : GetItemInt ( int & value , const CGUIListItem * item , int info ) <nl> return false ; <nl> } <nl> <nl> - CStdString CGUIInfoManager : : GetItemLabel ( const CFileItem * item , int info ) const <nl> + CStdString CGUIInfoManager : : GetItemLabel ( const CFileItem * item , int info ) <nl> { <nl> if ( ! item ) return " " ; <nl> <nl> + if ( info > = CONDITIONAL_LABEL_START & & info < = CONDITIONAL_LABEL_END ) <nl> + return GetSkinVariableString ( info , 0 , false , item ) ; <nl> + <nl> if ( info > = LISTITEM_PROPERTY_START & & info - LISTITEM_PROPERTY_START < ( int ) m_listitemProperties . size ( ) ) <nl> { / / grab the property <nl> CStdString property = m_listitemProperties [ info - LISTITEM_PROPERTY_START ] ; <nl> CStdString CGUIInfoManager : : GetItemLabel ( const CFileItem * item , int info ) const <nl> return " " ; <nl> } <nl> <nl> - CStdString CGUIInfoManager : : GetItemImage ( const CFileItem * item , int info ) const <nl> + CStdString CGUIInfoManager : : GetItemImage ( const CFileItem * item , int info ) <nl> { <nl> + if ( info > = CONDITIONAL_LABEL_START & & info < = CONDITIONAL_LABEL_END ) <nl> + return GetSkinVariableString ( info , 0 , false , item ) ; <nl> + <nl> switch ( info ) <nl> { <nl> case LISTITEM_RATING : / / old song rating format <nl> void CGUIInfoManager : : UpdateFromTuxBox ( ) <nl> } <nl> } <nl> <nl> - CStdString CGUIInfoManager : : GetPictureLabel ( int info ) const <nl> + CStdString CGUIInfoManager : : GetPictureLabel ( int info ) <nl> { <nl> if ( info = = SLIDE_FILE_NAME ) <nl> return GetItemLabel ( m_currentSlide , LISTITEM_FILENAME ) ; <nl> mmm a / xbmc / GUIInfoManager . h <nl> ppp b / xbmc / GUIInfoManager . h <nl> class CGUIInfoManager : public IMsgTargetCallback <nl> const CVideoInfoTag * GetCurrentMovieTag ( ) const ; <nl> <nl> CStdString GetMusicLabel ( int item ) ; <nl> - CStdString GetMusicTagLabel ( int info , const CFileItem * item ) const ; <nl> + CStdString GetMusicTagLabel ( int info , const CFileItem * item ) ; <nl> CStdString GetVideoLabel ( int item ) ; <nl> CStdString GetPlaylistLabel ( int item ) const ; <nl> CStdString GetMusicPartyModeLabel ( int item ) ; <nl> - const CStdString GetMusicPlaylistInfo ( const GUIInfo & info ) const ; <nl> - CStdString GetPictureLabel ( int item ) const ; <nl> + const CStdString GetMusicPlaylistInfo ( const GUIInfo & info ) ; <nl> + CStdString GetPictureLabel ( int item ) ; <nl> <nl> __int64 GetPlayTime ( ) const ; / / in ms <nl> CStdString GetCurrentPlayTime ( TIME_FORMAT format = TIME_FORMAT_GUESS ) const ; <nl> class CGUIInfoManager : public IMsgTargetCallback <nl> <nl> void ResetCache ( ) ; <nl> bool GetItemInt ( int & value , const CGUIListItem * item , int info ) const ; <nl> - CStdString GetItemLabel ( const CFileItem * item , int info ) const ; <nl> - CStdString GetItemImage ( const CFileItem * item , int info ) const ; <nl> + CStdString GetItemLabel ( const CFileItem * item , int info ) ; <nl> + CStdString GetItemImage ( const CFileItem * item , int info ) ; <nl> <nl> / / Called from tuxbox service thread to update current status <nl> void UpdateFromTuxBox ( ) ; <nl> class CGUIInfoManager : public IMsgTargetCallback <nl> <nl> bool GetMultiInfoBool ( const GUIInfo & info , int contextWindow = 0 , const CGUIListItem * item = NULL ) ; <nl> bool GetMultiInfoInt ( int & value , const GUIInfo & info , int contextWindow = 0 ) const ; <nl> - CStdString GetMultiInfoLabel ( const GUIInfo & info , int contextWindow = 0 ) const ; <nl> + CStdString GetMultiInfoLabel ( const GUIInfo & info , int contextWindow = 0 ) ; <nl> int TranslateListItem ( const Property & info ) ; <nl> int TranslateMusicPlayerString ( const CStdString & info ) const ; <nl> TIME_FORMAT TranslateTimeFormat ( const CStdString & format ) ; <nl>
hook skin variables in Get * Label / Get * Image GUIInfoManager methods
xbmc/xbmc
4400f87f6d2af0d1e9bf318f2df6c7118e997ea5
2011-09-29T17:44:02Z
mmm a / platform / x11 / joystick_linux . cpp <nl> ppp b / platform / x11 / joystick_linux . cpp <nl> joystick_linux : : Joystick : : Joystick ( ) { <nl> void joystick_linux : : Joystick : : reset ( ) { <nl> dpad = 0 ; <nl> fd = - 1 ; <nl> + <nl> + InputDefault : : JoyAxis jx ; <nl> + jx . min = - 1 ; <nl> + jx . value = 0 . 0f ; <nl> for ( int i = 0 ; i < MAX_ABS ; i + + ) { <nl> abs_map [ i ] = - 1 ; <nl> + curr_axis [ i ] = jx ; <nl> } <nl> } <nl> <nl> uint32_t joystick_linux : : process_joysticks ( uint32_t p_event_id ) { <nl> default : <nl> if ( joy - > abs_map [ ev . code ] ! = - 1 ) { <nl> InputDefault : : JoyAxis value = axis_correct ( libevdev_get_abs_info ( dev , ev . code ) , ev . value ) ; <nl> - p_event_id = input - > joy_axis ( p_event_id , i , joy - > abs_map [ ev . code ] , value ) ; <nl> + joy - > curr_axis [ joy - > abs_map [ ev . code ] ] = value ; <nl> } <nl> break ; <nl> } <nl> uint32_t joystick_linux : : process_joysticks ( uint32_t p_event_id ) { <nl> } <nl> rc = libevdev_next_event ( dev , LIBEVDEV_READ_FLAG_NORMAL , & ev ) ; <nl> } <nl> + for ( int j = 0 ; j < MAX_ABS ; j + + ) { <nl> + int index = joy - > abs_map [ j ] ; <nl> + if ( index ! = - 1 ) { <nl> + p_event_id = input - > joy_axis ( p_event_id , i , index , joy - > curr_axis [ index ] ) ; <nl> + } <nl> + } <nl> } <nl> joy_mutex - > unlock ( ) ; <nl> return p_event_id ; <nl> mmm a / platform / x11 / joystick_linux . h <nl> ppp b / platform / x11 / joystick_linux . h <nl> class joystick_linux <nl> } ; <nl> <nl> struct Joystick { <nl> + InputDefault : : JoyAxis curr_axis [ MAX_ABS ] ; <nl> int key_map [ MAX_KEY - BT_MISC ] ; <nl> int abs_map [ MAX_ABS ] ; <nl> int dpad ; <nl>
Merge pull request from Hinsbart / x11_axis_fix
godotengine/godot
b9d5763b023d7ad378aa2a7b3f5afc0aa78ba30f
2016-01-03T02:06:54Z
mmm a / src / objective - c / GRPCClient / private / GRPCCompletionQueue . m <nl> ppp b / src / objective - c / GRPCClient / private / GRPCCompletionQueue . m <nl> + ( instancetype ) completionQueue { <nl> <nl> - ( instancetype ) init { <nl> if ( ( self = [ super init ] ) ) { <nl> - _unmanagedQueue = grpc_completion_queue_create ( ) ; <nl> + _unmanagedQueue = grpc_completion_queue_create ( NULL ) ; <nl> <nl> / / This is for the following block to capture the pointer by value ( instead <nl> / / of retaining self and doing self - > _unmanagedQueue ) . This is essential <nl> - ( instancetype ) init { <nl> while ( YES ) { <nl> / / The following call blocks until an event is available . <nl> grpc_event event = grpc_completion_queue_next ( unmanagedQueue , <nl> - gpr_inf_future ( GPR_CLOCK_REALTIME ) ) ; <nl> + gpr_inf_future ( GPR_CLOCK_REALTIME ) , <nl> + NULL ) ; <nl> GRPCQueueCompletionHandler handler ; <nl> switch ( event . type ) { <nl> case GRPC_OP_COMPLETE : <nl> mmm a / src / objective - c / GRPCClient / private / GRPCHost . m <nl> ppp b / src / objective - c / GRPCClient / private / GRPCHost . m <nl> - ( grpc_call * ) unmanagedCallWithPath : ( NSString * ) path completionQueue : ( GRPCCompl <nl> queue . unmanagedQueue , <nl> path . UTF8String , <nl> self . hostName . UTF8String , <nl> - gpr_inf_future ( GPR_CLOCK_REALTIME ) ) ; <nl> + gpr_inf_future ( GPR_CLOCK_REALTIME ) , NULL ) ; <nl> } <nl> <nl> - ( GRPCChannel * ) channel { <nl> mmm a / src / objective - c / GRPCClient / private / GRPCUnsecuredChannel . m <nl> ppp b / src / objective - c / GRPCClient / private / GRPCUnsecuredChannel . m <nl> <nl> @ implementation GRPCUnsecuredChannel <nl> <nl> - ( instancetype ) initWithHost : ( NSString * ) host { <nl> - return ( self = [ super initWithChannel : grpc_insecure_channel_create ( host . UTF8String , NULL ) ] ) ; <nl> + return ( self = [ super initWithChannel : grpc_insecure_channel_create ( host . UTF8String , NULL , NULL ) ] ) ; <nl> } <nl> <nl> / / TODO ( jcanizales ) : GRPCSecureChannel and GRPCUnsecuredChannel are just convenience initializers <nl> mmm a / src / objective - c / GRPCClient / private / GRPCWrappedCall . m <nl> ppp b / src / objective - c / GRPCClient / private / GRPCWrappedCall . m <nl> - ( void ) startBatchWithOperations : ( NSArray * ) operations errorHandler : ( void ( ^ ) ( ) ) <nl> for ( GRPCOperation * operation in operations ) { <nl> [ operation finish ] ; <nl> } <nl> - } ) ) ; <nl> + } ) , NULL ) ; <nl> gpr_free ( ops_array ) ; <nl> <nl> if ( error ! = GRPC_CALL_OK ) { <nl> - ( void ) startBatchWithOperations : ( NSArray * ) operations errorHandler : ( void ( ^ ) ( ) ) <nl> } <nl> <nl> - ( void ) cancel { <nl> - grpc_call_cancel ( _call ) ; <nl> + grpc_call_cancel ( _call , NULL ) ; <nl> } <nl> <nl> - ( void ) dealloc { <nl>
Merge pull request from jcanizales / the - ultimate - showdown
grpc/grpc
534e47e26c0170e9a4e8fd571715219fb7466042
2015-08-10T17:26:55Z
mmm a / tensorflow / compiler / xla / g3doc / tutorials / compile . ipynb <nl> ppp b / tensorflow / compiler / xla / g3doc / tutorials / compile . ipynb <nl> <nl> " id " : " e1oSi4lHFt3z " <nl> } , <nl> " source " : [ <nl> - " # Use XLA ` experimental_compile ` with ` tf . function ` " <nl> + " # Use XLA with tf . function " <nl> ] <nl> } , <nl> { <nl>
Fix title to render
tensorflow/tensorflow
f9ddd0dacb913e60c79ae2e69beb281dd34b54a3
2020-01-14T23:49:14Z
new file mode 100644 <nl> index 00000000000 . . 08f0eac5346 <nl> mmm / dev / null <nl> ppp b / samples / cpp / tutorial_code / ShapeDescriptors / pointPolygonTest_demo . cpp <nl> <nl> + / * * <nl> + * @ function pointPolygonTest_demo . cpp <nl> + * @ brief Demo code to use the pointPolygonTest function . . . fairly easy <nl> + * @ author OpenCV team <nl> + * / <nl> + <nl> + # include " opencv2 / highgui / highgui . hpp " <nl> + # include " opencv2 / imgproc / imgproc . hpp " <nl> + # include < iostream > <nl> + # include < stdio . h > <nl> + # include < stdlib . h > <nl> + <nl> + using namespace cv ; <nl> + using namespace std ; <nl> + <nl> + / * * <nl> + * @ function main <nl> + * / <nl> + int main ( int argc , char * * argv ) <nl> + { <nl> + / / / Create an image <nl> + const int r = 100 ; <nl> + Mat src = Mat : : zeros ( Size ( 4 * r , 4 * r ) , CV_8UC1 ) ; <nl> + <nl> + / / / Create a sequence of points to make a contour : <nl> + vector < Point2f > vert ( 6 ) ; <nl> + <nl> + vert [ 0 ] = Point ( 1 . 5 * r , 1 . 34 * r ) ; <nl> + vert [ 1 ] = Point ( 1 * r , 2 * r ) ; <nl> + vert [ 2 ] = Point ( 1 . 5 * r , 2 . 866 * r ) ; <nl> + vert [ 3 ] = Point ( 2 . 5 * r , 2 . 866 * r ) ; <nl> + vert [ 4 ] = Point ( 3 * r , 2 * r ) ; <nl> + vert [ 5 ] = Point ( 2 . 5 * r , 1 . 34 * r ) ; <nl> + <nl> + / / / Draw it in src <nl> + for ( int j = 0 ; j < 6 ; j + + ) <nl> + { line ( src , vert [ j ] , vert [ ( j + 1 ) % 6 ] , Scalar ( 255 ) , 3 , 8 ) ; } <nl> + <nl> + / / / Get the contours <nl> + vector < vector < Point > > contours ; vector < Vec4i > hierarchy ; <nl> + Mat src_copy = src . clone ( ) ; <nl> + <nl> + findContours ( src_copy , contours , hierarchy , RETR_TREE , CHAIN_APPROX_SIMPLE ) ; <nl> + <nl> + / / / Calculate the distances to the contour <nl> + Mat raw_dist ( src . size ( ) , CV_32FC1 ) ; <nl> + <nl> + for ( int j = 0 ; j < src . rows ; j + + ) <nl> + { for ( int i = 0 ; i < src . cols ; i + + ) <nl> + { raw_dist . at < float > ( j , i ) = pointPolygonTest ( contours [ 0 ] , Point2f ( i , j ) , true ) ; } <nl> + } <nl> + <nl> + double minVal ; double maxVal ; <nl> + minMaxLoc ( raw_dist , & minVal , & maxVal , 0 , 0 , Mat ( ) ) ; <nl> + minVal = abs ( minVal ) ; maxVal = abs ( maxVal ) ; <nl> + <nl> + / / / Depicting the distances graphically <nl> + Mat drawing = Mat : : zeros ( src . size ( ) , CV_8UC3 ) ; <nl> + <nl> + for ( int j = 0 ; j < src . rows ; j + + ) <nl> + { for ( int i = 0 ; i < src . cols ; i + + ) <nl> + { <nl> + if ( raw_dist . at < float > ( j , i ) < 0 ) <nl> + { drawing . at < Vec3b > ( j , i ) [ 0 ] = 255 - ( int ) abs ( raw_dist . at < float > ( j , i ) ) * 255 / minVal ; } <nl> + else if ( raw_dist . at < float > ( j , i ) > 0 ) <nl> + { drawing . at < Vec3b > ( j , i ) [ 2 ] = 255 - ( int ) raw_dist . at < float > ( j , i ) * 255 / maxVal ; } <nl> + else <nl> + { drawing . at < Vec3b > ( j , i ) [ 0 ] = 255 ; drawing . at < Vec3b > ( j , i ) [ 1 ] = 255 ; drawing . at < Vec3b > ( j , i ) [ 2 ] = 255 ; } <nl> + } <nl> + } <nl> + <nl> + / / / Create Window and show your results <nl> + char * source_window = " Source " ; <nl> + namedWindow ( source_window , CV_WINDOW_AUTOSIZE ) ; <nl> + imshow ( source_window , src ) ; <nl> + namedWindow ( " Distance " , CV_WINDOW_AUTOSIZE ) ; <nl> + imshow ( " Distance " , drawing ) ; <nl> + <nl> + waitKey ( 0 ) ; <nl> + return ( 0 ) ; <nl> + } <nl> + <nl> + <nl>
Added pointPolygonTest_demo code for tutorials
opencv/opencv
bbba2a0608fe34a7243c3d85f7bc22ce6470bfa7
2011-07-13T02:43:02Z
mmm a / stdlib / public / runtime / Errors . cpp <nl> ppp b / stdlib / public / runtime / Errors . cpp <nl> swift : : fatalError ( uint32_t flags , const char * format , . . . ) <nl> va_start ( args , format ) ; <nl> <nl> char * log ; <nl> + # pragma GCC diagnostic push <nl> + # pragma GCC diagnostic ignored " - Wuninitialized " <nl> swift_vasprintf ( & log , format , args ) ; <nl> + # pragma GCC diagnostic pop <nl> <nl> swift_reportError ( flags , log ) ; <nl> abort ( ) ; <nl> swift : : warning ( uint32_t flags , const char * format , . . . ) <nl> va_start ( args , format ) ; <nl> <nl> char * log ; <nl> + # pragma GCC diagnostic push <nl> + # pragma GCC diagnostic ignored " - Wuninitialized " <nl> swift_vasprintf ( & log , format , args ) ; <nl> + # pragma GCC diagnostic pop <nl> <nl> reportNow ( flags , log ) ; <nl> <nl> mmm a / stdlib / public / stubs / Assert . cpp <nl> ppp b / stdlib / public / stubs / Assert . cpp <nl> static int swift_asprintf ( char * * strp , const char * fmt , . . . ) { <nl> va_list args ; <nl> va_start ( args , fmt ) ; <nl> # if defined ( _WIN32 ) <nl> + # pragma GCC diagnostic push <nl> + # pragma GCC diagnostic ignored " - Wuninitialized " <nl> int len = _vscprintf ( fmt , args ) ; <nl> + # pragma GCC diagnostic pop <nl> if ( len < 0 ) { <nl> va_end ( args ) ; <nl> return - 1 ; <nl>
Merge pull request from compnerd / va_list
apple/swift
b10726b62f7f58976988d47ca12caf63b52fe18b
2017-10-07T01:03:40Z
mmm a / tensorflow / compiler / xla / service / hlo_graph_dumper . cc <nl> ppp b / tensorflow / compiler / xla / service / hlo_graph_dumper . cc <nl> string HloDotDumper : : GetInstructionNodeLabel ( const HloInstruction * instr ) { <nl> } <nl> string extended_opcode = <nl> StrCat ( HloOpcodeString ( instr - > opcode ( ) ) , <nl> - instr - > opcode ( ) = = HloOpcode : : kFusion <nl> + instr - > opcode ( ) ! = HloOpcode : : kFusion <nl> ? " " <nl> : StrCat ( " : " , xla : : ToString ( instr - > fusion_kind ( ) ) ) ) ; <nl> / / If the name does not contain the opcode , render both . <nl>
Fix a bug when printing fusion_kind in hlo_graph_dumper .
tensorflow/tensorflow
2efb07ffe5d1f12a4eaef3d673f11615a8ddd6e5
2017-11-16T03:08:17Z
mmm a / src / io / file_io . cpp <nl> ppp b / src / io / file_io . cpp <nl> struct LocalFile : VirtualFileReader , VirtualFileWriter { <nl> } ; <nl> <nl> const char * kHdfsProto = " hdfs : / / " ; <nl> + const size_t kHdfsProtoLength = strlen ( kHdfsProto ) ; <nl> <nl> # ifdef USE_HDFS <nl> struct HDFSFile : VirtualFileReader , VirtualFileWriter { <nl> struct HDFSFile : VirtualFileReader , VirtualFileWriter { <nl> } <nl> <nl> static hdfsFS GetHDFSFileSystem ( const std : : string & uri ) { <nl> - size_t end = uri . find ( " / " , kHdfsProto . length ( ) ) ; <nl> + size_t end = uri . find ( " / " , kHdfsProtoLength ) ; <nl> if ( uri . find ( kHdfsProto ) ! = 0 | | end = = std : : string : : npos ) { <nl> Log : : Warning ( " Bad HDFS uri , no namenode found [ % s ] " , uri . c_str ( ) ) ; <nl> return NULL ; <nl> } <nl> - std : : string hostport = uri . substr ( kHdfsProto . length ( ) , end - kHdfsProto . length ( ) ) ; <nl> + std : : string hostport = uri . substr ( kHdfsProtoLength , end - kHdfsProtoLength ) ; <nl> if ( fs_cache_ . count ( hostport ) = = 0 ) { <nl> fs_cache_ [ hostport ] = MakeHDFSFileSystem ( hostport ) ; <nl> } <nl>
Fix build error when HDFS is enabled . ( )
microsoft/LightGBM
11f9682bb72dea34313758f054ccf37886dc7e6e
2019-11-16T00:07:55Z
mmm a / src / Makefile . am <nl> ppp b / src / Makefile . am <nl> BITCOIN_CORE_H = \ <nl> ecwrapper . h \ <nl> hash . h \ <nl> init . h \ <nl> + json_spirit_wrapper . h \ <nl> key . h \ <nl> keystore . h \ <nl> leveldbwrapper . h \ <nl> mmm a / src / bitcoin - cli . cpp <nl> ppp b / src / bitcoin - cli . cpp <nl> Object CallRPC ( const string & strMethod , const Array & params ) <nl> throw runtime_error ( " no response from server " ) ; <nl> <nl> / / Parse reply <nl> - Value valReply ; <nl> + Value valReply ( UniValue : : VSTR ) ; <nl> if ( ! valReply . read ( strReply ) ) <nl> throw runtime_error ( " couldn ' t parse reply from server " ) ; <nl> const Object & reply = valReply . get_obj ( ) ; <nl> mmm a / src / rest . cpp <nl> ppp b / src / rest . cpp <nl> static bool rest_block ( AcceptedConnection * conn , <nl> <nl> case RF_JSON : { <nl> Object objBlock = blockToJSON ( block , pblockindex , showTxDetails ) ; <nl> - string strJSON = write_string ( Value ( objBlock ) , false ) + " \ n " ; <nl> + string strJSON = objBlock . write ( ) + " \ n " ; <nl> conn - > stream ( ) < < HTTPReply ( HTTP_OK , strJSON , fRun ) < < std : : flush ; <nl> return true ; <nl> } <nl> static bool rest_chaininfo ( AcceptedConnection * conn , <nl> case RF_JSON : { <nl> Array rpcParams ; <nl> Value chainInfoObject = getblockchaininfo ( rpcParams , false ) ; <nl> - <nl> - string strJSON = write_string ( chainInfoObject , false ) + " \ n " ; <nl> + string strJSON = chainInfoObject . write ( ) + " \ n " ; <nl> conn - > stream ( ) < < HTTPReply ( HTTP_OK , strJSON , fRun ) < < std : : flush ; <nl> return true ; <nl> } <nl> static bool rest_tx ( AcceptedConnection * conn , <nl> case RF_JSON : { <nl> Object objTx ; <nl> TxToJSON ( tx , hashBlock , objTx ) ; <nl> - string strJSON = write_string ( Value ( objTx ) , false ) + " \ n " ; <nl> + string strJSON = objTx . write ( ) + " \ n " ; <nl> conn - > stream ( ) < < HTTPReply ( HTTP_OK , strJSON , fRun ) < < std : : flush ; <nl> return true ; <nl> } <nl> static bool rest_getutxos ( AcceptedConnection * conn , <nl> objGetUTXOResponse . push_back ( Pair ( " utxos " , utxos ) ) ; <nl> <nl> / / return json string <nl> - string strJSON = write_string ( Value ( objGetUTXOResponse ) , false ) + " \ n " ; <nl> + string strJSON = objGetUTXOResponse . write ( ) + " \ n " ; <nl> conn - > stream ( ) < < HTTPReply ( HTTP_OK , strJSON , fRun ) < < std : : flush ; <nl> return true ; <nl> } <nl> mmm a / src / rpcblockchain . cpp <nl> ppp b / src / rpcblockchain . cpp <nl> Value invalidateblock ( const Array & params , bool fHelp ) <nl> throw JSONRPCError ( RPC_DATABASE_ERROR , state . GetRejectReason ( ) ) ; <nl> } <nl> <nl> - return Value : : null ; <nl> + return NullUniValue ; <nl> } <nl> <nl> Value reconsiderblock ( const Array & params , bool fHelp ) <nl> Value reconsiderblock ( const Array & params , bool fHelp ) <nl> throw JSONRPCError ( RPC_DATABASE_ERROR , state . GetRejectReason ( ) ) ; <nl> } <nl> <nl> - return Value : : null ; <nl> + return NullUniValue ; <nl> } <nl> mmm a / src / rpcclient . cpp <nl> ppp b / src / rpcclient . cpp <nl> static CRPCConvertTable rpcCvtTable ; <nl> / * * Convert strings to command - specific RPC representation * / <nl> Array RPCConvertValues ( const std : : string & strMethod , const std : : vector < std : : string > & strParams ) <nl> { <nl> - Array params ; <nl> + UniValue params ( UniValue : : VARR ) ; <nl> <nl> for ( unsigned int idx = 0 ; idx < strParams . size ( ) ; idx + + ) { <nl> const std : : string & strVal = strParams [ idx ] ; <nl> mmm a / src / rpcmining . cpp <nl> ppp b / src / rpcmining . cpp <nl> Value getblocktemplate ( const Array & params , bool fHelp ) <nl> if ( strMode = = " proposal " ) <nl> { <nl> const Value & dataval = find_value ( oparam , " data " ) ; <nl> - if ( dataval . type ( ) ! = str_type ) <nl> + if ( dataval . isStr ( ) ) <nl> throw JSONRPCError ( RPC_TYPE_ERROR , " Missing data String key for proposal " ) ; <nl> <nl> CBlock block ; <nl> Value getblocktemplate ( const Array & params , bool fHelp ) <nl> UpdateTime ( pblock , Params ( ) . GetConsensus ( ) , pindexPrev ) ; <nl> pblock - > nNonce = 0 ; <nl> <nl> - static const Array aCaps = boost : : assign : : list_of ( " proposal " ) ; <nl> + Array aCaps ; aCaps . push_back ( " proposal " ) ; <nl> <nl> Array transactions ; <nl> map < uint256 , int64_t > setTxIndex ; <nl> mmm a / src / rpcmisc . cpp <nl> ppp b / src / rpcmisc . cpp <nl> Value setmocktime ( const Array & params , bool fHelp ) <nl> <nl> LOCK ( cs_main ) ; <nl> <nl> - RPCTypeCheck ( params , boost : : assign : : list_of ( int_type ) ) ; <nl> + RPCTypeCheck ( params , boost : : assign : : list_of ( UniValue : : VNUM ) ) ; <nl> SetMockTime ( params [ 0 ] . get_int64 ( ) ) ; <nl> <nl> - return Value : : null ; <nl> + return NullUniValue ; <nl> } <nl> mmm a / src / rpcprotocol . cpp <nl> ppp b / src / rpcprotocol . cpp <nl> int ReadHTTPMessage ( std : : basic_istream < char > & stream , map < string , <nl> <nl> string JSONRPCRequest ( const string & strMethod , const Array & params , const Value & id ) <nl> { <nl> - Object request ; <nl> + Object request ( UniValue : : VOBJ ) ; <nl> request . push_back ( Pair ( " method " , strMethod ) ) ; <nl> request . push_back ( Pair ( " params " , params ) ) ; <nl> request . push_back ( Pair ( " id " , id ) ) ; <nl> string JSONRPCRequest ( const string & strMethod , const Array & params , const Value & <nl> <nl> Object JSONRPCReplyObj ( const Value & result , const Value & error , const Value & id ) <nl> { <nl> - Object reply ; <nl> + Object reply ( UniValue : : VOBJ ) ; <nl> if ( ! error . isNull ( ) ) <nl> reply . push_back ( Pair ( " result " , NullUniValue ) ) ; <nl> else <nl> string JSONRPCReply ( const Value & result , const Value & error , const Value & id ) <nl> <nl> Object JSONRPCError ( int code , const string & message ) <nl> { <nl> - Object error ; <nl> + UniValue error ( UniValue : : VOBJ ) ; <nl> error . push_back ( Pair ( " code " , code ) ) ; <nl> error . push_back ( Pair ( " message " , message ) ) ; <nl> return error ; <nl> mmm a / src / rpcrawtransaction . cpp <nl> ppp b / src / rpcrawtransaction . cpp <nl> Value gettxoutproof ( const Array & params , bool fHelp ) <nl> set < uint256 > setTxids ; <nl> uint256 oneTxid ; <nl> Array txids = params [ 0 ] . get_array ( ) ; <nl> - BOOST_FOREACH ( Value & txid , txids ) { <nl> + for ( unsigned int idx = 0 ; idx < txids . size ( ) ; idx + + ) { <nl> + const Value & txid = txids [ idx ] ; <nl> if ( txid . get_str ( ) . length ( ) ! = 64 | | ! IsHex ( txid . get_str ( ) ) ) <nl> throw JSONRPCError ( RPC_INVALID_PARAMETER , string ( " Invalid txid " ) + txid . get_str ( ) ) ; <nl> uint256 hash ( uint256S ( txid . get_str ( ) ) ) ; <nl> Value decoderawtransaction ( const Array & params , bool fHelp ) <nl> if ( ! DecodeHexTx ( tx , params [ 0 ] . get_str ( ) ) ) <nl> throw JSONRPCError ( RPC_DESERIALIZATION_ERROR , " TX decode failed " ) ; <nl> <nl> - Object result ; <nl> + UniValue result ( UniValue : : VOBJ ) ; <nl> TxToJSON ( tx , uint256 ( ) , result ) ; <nl> <nl> return result ; <nl> Value decodescript ( const Array & params , bool fHelp ) <nl> ) ; <nl> <nl> LOCK ( cs_main ) ; <nl> - RPCTypeCheck ( params , boost : : assign : : list_of ( str_type ) ) ; <nl> + RPCTypeCheck ( params , boost : : assign : : list_of ( UniValue : : VSTR ) ) ; <nl> <nl> Object r ; <nl> CScript script ; <nl> mmm a / src / test / script_tests . cpp <nl> ppp b / src / test / script_tests . cpp <nl> BOOST_AUTO_TEST_CASE ( script_build ) <nl> Array json_good = read_json ( std : : string ( json_tests : : script_valid , json_tests : : script_valid + sizeof ( json_tests : : script_valid ) ) ) ; <nl> Array json_bad = read_json ( std : : string ( json_tests : : script_invalid , json_tests : : script_invalid + sizeof ( json_tests : : script_invalid ) ) ) ; <nl> <nl> - BOOST_FOREACH ( Value & tv , json_good ) { <nl> - tests_good . insert ( write_string ( Value ( tv . get_array ( ) ) , true ) ) ; <nl> + for ( unsigned int idx = 0 ; idx < json_good . size ( ) ; idx + + ) { <nl> + const Value & tv = json_good [ idx ] ; <nl> + tests_good . insert ( tv . get_array ( ) . write ( ) ) ; <nl> } <nl> - BOOST_FOREACH ( Value & tv , json_bad ) { <nl> - tests_bad . insert ( write_string ( Value ( tv . get_array ( ) ) , true ) ) ; <nl> + for ( unsigned int idx = 0 ; idx < json_bad . size ( ) ; idx + + ) { <nl> + const Value & tv = json_bad [ idx ] ; <nl> + tests_bad . insert ( tv . get_array ( ) . write ( ) ) ; <nl> } <nl> } <nl> <nl> BOOST_AUTO_TEST_CASE ( script_build ) <nl> <nl> BOOST_FOREACH ( TestBuilder & test , good ) { <nl> test . Test ( true ) ; <nl> - std : : string str = write_string ( Value ( test . GetJSON ( ) ) , true ) ; <nl> + std : : string str = test . GetJSON ( ) . write ( ) ; <nl> # ifndef UPDATE_JSON_TESTS <nl> if ( tests_good . count ( str ) = = 0 ) { <nl> BOOST_CHECK_MESSAGE ( false , " Missing auto script_valid test : " + test . GetComment ( ) ) ; <nl> BOOST_AUTO_TEST_CASE ( script_build ) <nl> } <nl> BOOST_FOREACH ( TestBuilder & test , bad ) { <nl> test . Test ( false ) ; <nl> - std : : string str = write_string ( Value ( test . GetJSON ( ) ) , true ) ; <nl> + std : : string str = test . GetJSON ( ) . write ( ) ; <nl> # ifndef UPDATE_JSON_TESTS <nl> if ( tests_bad . count ( str ) = = 0 ) { <nl> BOOST_CHECK_MESSAGE ( false , " Missing auto script_invalid test : " + test . GetComment ( ) ) ; <nl> mmm a / src / test / transaction_tests . cpp <nl> ppp b / src / test / transaction_tests . cpp <nl> <nl> <nl> # include < boost / algorithm / string / classification . hpp > <nl> # include < boost / algorithm / string / split . hpp > <nl> + # include < boost / assign / list_of . hpp > <nl> # include < boost / test / unit_test . hpp > <nl> # include < boost / assign / list_of . hpp > <nl> <nl> mmm a / src / wallet / rpcdump . cpp <nl> ppp b / src / wallet / rpcdump . cpp <nl> std : : string DecodeDumpString ( const std : : string & str ) { <nl> Value importprivkey ( const Array & params , bool fHelp ) <nl> { <nl> if ( ! EnsureWalletIsAvailable ( fHelp ) ) <nl> - return Value : : null ; <nl> + return NullUniValue ; <nl> <nl> if ( fHelp | | params . size ( ) < 1 | | params . size ( ) > 3 ) <nl> throw runtime_error ( <nl> Value importprivkey ( const Array & params , bool fHelp ) <nl> Value importaddress ( const Array & params , bool fHelp ) <nl> { <nl> if ( ! EnsureWalletIsAvailable ( fHelp ) ) <nl> - return Value : : null ; <nl> + return NullUniValue ; <nl> <nl> if ( fHelp | | params . size ( ) < 1 | | params . size ( ) > 3 ) <nl> throw runtime_error ( <nl> Value importaddress ( const Array & params , bool fHelp ) <nl> Value importwallet ( const Array & params , bool fHelp ) <nl> { <nl> if ( ! EnsureWalletIsAvailable ( fHelp ) ) <nl> - return Value : : null ; <nl> + return NullUniValue ; <nl> <nl> if ( fHelp | | params . size ( ) ! = 1 ) <nl> throw runtime_error ( <nl> Value importwallet ( const Array & params , bool fHelp ) <nl> Value dumpprivkey ( const Array & params , bool fHelp ) <nl> { <nl> if ( ! EnsureWalletIsAvailable ( fHelp ) ) <nl> - return Value : : null ; <nl> + return NullUniValue ; <nl> <nl> if ( fHelp | | params . size ( ) ! = 1 ) <nl> throw runtime_error ( <nl> Value dumpprivkey ( const Array & params , bool fHelp ) <nl> Value dumpwallet ( const Array & params , bool fHelp ) <nl> { <nl> if ( ! EnsureWalletIsAvailable ( fHelp ) ) <nl> - return Value : : null ; <nl> + return NullUniValue ; <nl> <nl> if ( fHelp | | params . size ( ) ! = 1 ) <nl> throw runtime_error ( <nl> mmm a / src / wallet / rpcwallet . cpp <nl> ppp b / src / wallet / rpcwallet . cpp <nl> string AccountFromValue ( const Value & value ) <nl> Value getnewaddress ( const Array & params , bool fHelp ) <nl> { <nl> if ( ! EnsureWalletIsAvailable ( fHelp ) ) <nl> - return Value : : null ; <nl> + return NullUniValue ; <nl> <nl> if ( fHelp | | params . size ( ) > 1 ) <nl> throw runtime_error ( <nl> CBitcoinAddress GetAccountAddress ( string strAccount , bool bForceNew = false ) <nl> Value getaccountaddress ( const Array & params , bool fHelp ) <nl> { <nl> if ( ! EnsureWalletIsAvailable ( fHelp ) ) <nl> - return Value : : null ; <nl> + return NullUniValue ; <nl> <nl> if ( fHelp | | params . size ( ) ! = 1 ) <nl> throw runtime_error ( <nl> Value getaccountaddress ( const Array & params , bool fHelp ) <nl> Value getrawchangeaddress ( const Array & params , bool fHelp ) <nl> { <nl> if ( ! EnsureWalletIsAvailable ( fHelp ) ) <nl> - return Value : : null ; <nl> + return NullUniValue ; <nl> <nl> if ( fHelp | | params . size ( ) > 1 ) <nl> throw runtime_error ( <nl> Value getrawchangeaddress ( const Array & params , bool fHelp ) <nl> Value setaccount ( const Array & params , bool fHelp ) <nl> { <nl> if ( ! EnsureWalletIsAvailable ( fHelp ) ) <nl> - return Value : : null ; <nl> + return NullUniValue ; <nl> <nl> if ( fHelp | | params . size ( ) < 1 | | params . size ( ) > 2 ) <nl> throw runtime_error ( <nl> Value setaccount ( const Array & params , bool fHelp ) <nl> Value getaccount ( const Array & params , bool fHelp ) <nl> { <nl> if ( ! EnsureWalletIsAvailable ( fHelp ) ) <nl> - return Value : : null ; <nl> + return NullUniValue ; <nl> <nl> if ( fHelp | | params . size ( ) ! = 1 ) <nl> throw runtime_error ( <nl> Value getaccount ( const Array & params , bool fHelp ) <nl> Value getaddressesbyaccount ( const Array & params , bool fHelp ) <nl> { <nl> if ( ! EnsureWalletIsAvailable ( fHelp ) ) <nl> - return Value : : null ; <nl> + return NullUniValue ; <nl> <nl> if ( fHelp | | params . size ( ) ! = 1 ) <nl> throw runtime_error ( <nl> static void SendMoney ( const CTxDestination & address , CAmount nValue , bool fSubtr <nl> Value sendtoaddress ( const Array & params , bool fHelp ) <nl> { <nl> if ( ! EnsureWalletIsAvailable ( fHelp ) ) <nl> - return Value : : null ; <nl> + return NullUniValue ; <nl> <nl> if ( fHelp | | params . size ( ) < 2 | | params . size ( ) > 5 ) <nl> throw runtime_error ( <nl> Value sendtoaddress ( const Array & params , bool fHelp ) <nl> Value listaddressgroupings ( const Array & params , bool fHelp ) <nl> { <nl> if ( ! EnsureWalletIsAvailable ( fHelp ) ) <nl> - return Value : : null ; <nl> + return NullUniValue ; <nl> <nl> if ( fHelp ) <nl> throw runtime_error ( <nl> Value listaddressgroupings ( const Array & params , bool fHelp ) <nl> Value signmessage ( const Array & params , bool fHelp ) <nl> { <nl> if ( ! EnsureWalletIsAvailable ( fHelp ) ) <nl> - return Value : : null ; <nl> + return NullUniValue ; <nl> <nl> if ( fHelp | | params . size ( ) ! = 2 ) <nl> throw runtime_error ( <nl> Value signmessage ( const Array & params , bool fHelp ) <nl> Value getreceivedbyaddress ( const Array & params , bool fHelp ) <nl> { <nl> if ( ! EnsureWalletIsAvailable ( fHelp ) ) <nl> - return Value : : null ; <nl> + return NullUniValue ; <nl> <nl> if ( fHelp | | params . size ( ) < 1 | | params . size ( ) > 2 ) <nl> throw runtime_error ( <nl> Value getreceivedbyaddress ( const Array & params , bool fHelp ) <nl> Value getreceivedbyaccount ( const Array & params , bool fHelp ) <nl> { <nl> if ( ! EnsureWalletIsAvailable ( fHelp ) ) <nl> - return Value : : null ; <nl> + return NullUniValue ; <nl> <nl> if ( fHelp | | params . size ( ) < 1 | | params . size ( ) > 2 ) <nl> throw runtime_error ( <nl> CAmount GetAccountBalance ( const string & strAccount , int nMinDepth , const isminef <nl> Value getbalance ( const Array & params , bool fHelp ) <nl> { <nl> if ( ! EnsureWalletIsAvailable ( fHelp ) ) <nl> - return Value : : null ; <nl> + return NullUniValue ; <nl> <nl> if ( fHelp | | params . size ( ) > 3 ) <nl> throw runtime_error ( <nl> Value getbalance ( const Array & params , bool fHelp ) <nl> Value getunconfirmedbalance ( const Array & params , bool fHelp ) <nl> { <nl> if ( ! EnsureWalletIsAvailable ( fHelp ) ) <nl> - return Value : : null ; <nl> + return NullUniValue ; <nl> <nl> if ( fHelp | | params . size ( ) > 0 ) <nl> throw runtime_error ( <nl> Value getunconfirmedbalance ( const Array & params , bool fHelp ) <nl> Value movecmd ( const Array & params , bool fHelp ) <nl> { <nl> if ( ! EnsureWalletIsAvailable ( fHelp ) ) <nl> - return Value : : null ; <nl> + return NullUniValue ; <nl> <nl> if ( fHelp | | params . size ( ) < 3 | | params . size ( ) > 5 ) <nl> throw runtime_error ( <nl> Value movecmd ( const Array & params , bool fHelp ) <nl> Value sendfrom ( const Array & params , bool fHelp ) <nl> { <nl> if ( ! EnsureWalletIsAvailable ( fHelp ) ) <nl> - return Value : : null ; <nl> + return NullUniValue ; <nl> <nl> if ( fHelp | | params . size ( ) < 3 | | params . size ( ) > 6 ) <nl> throw runtime_error ( <nl> Value sendfrom ( const Array & params , bool fHelp ) <nl> Value sendmany ( const Array & params , bool fHelp ) <nl> { <nl> if ( ! EnsureWalletIsAvailable ( fHelp ) ) <nl> - return Value : : null ; <nl> + return NullUniValue ; <nl> <nl> if ( fHelp | | params . size ( ) < 2 | | params . size ( ) > 5 ) <nl> throw runtime_error ( <nl> Value sendmany ( const Array & params , bool fHelp ) <nl> totalAmount + = nAmount ; <nl> <nl> bool fSubtractFeeFromAmount = false ; <nl> - BOOST_FOREACH ( const Value & addr , subtractFeeFromAmount ) <nl> - if ( addr . get_str ( ) = = s . name_ ) <nl> + for ( unsigned int idx = 0 ; idx < subtractFeeFromAmount . size ( ) ; idx + + ) { <nl> + const Value & addr = subtractFeeFromAmount [ idx ] ; <nl> + if ( addr . get_str ( ) = = name_ ) <nl> fSubtractFeeFromAmount = true ; <nl> + } <nl> <nl> CRecipient recipient = { scriptPubKey , nAmount , fSubtractFeeFromAmount } ; <nl> vecSend . push_back ( recipient ) ; <nl> extern CScript _createmultisig_redeemScript ( const Array & params ) ; <nl> Value addmultisigaddress ( const Array & params , bool fHelp ) <nl> { <nl> if ( ! EnsureWalletIsAvailable ( fHelp ) ) <nl> - return Value : : null ; <nl> + return NullUniValue ; <nl> <nl> if ( fHelp | | params . size ( ) < 2 | | params . size ( ) > 3 ) <nl> { <nl> Value ListReceived ( const Array & params , bool fByAccounts ) <nl> Value listreceivedbyaddress ( const Array & params , bool fHelp ) <nl> { <nl> if ( ! EnsureWalletIsAvailable ( fHelp ) ) <nl> - return Value : : null ; <nl> + return NullUniValue ; <nl> <nl> if ( fHelp | | params . size ( ) > 3 ) <nl> throw runtime_error ( <nl> Value listreceivedbyaddress ( const Array & params , bool fHelp ) <nl> Value listreceivedbyaccount ( const Array & params , bool fHelp ) <nl> { <nl> if ( ! EnsureWalletIsAvailable ( fHelp ) ) <nl> - return Value : : null ; <nl> + return NullUniValue ; <nl> <nl> if ( fHelp | | params . size ( ) > 3 ) <nl> throw runtime_error ( <nl> void AcentryToJSON ( const CAccountingEntry & acentry , const string & strAccount , Ar <nl> Value listtransactions ( const Array & params , bool fHelp ) <nl> { <nl> if ( ! EnsureWalletIsAvailable ( fHelp ) ) <nl> - return Value : : null ; <nl> + return NullUniValue ; <nl> <nl> if ( fHelp | | params . size ( ) > 4 ) <nl> throw runtime_error ( <nl> Value listtransactions ( const Array & params , bool fHelp ) <nl> Value listaccounts ( const Array & params , bool fHelp ) <nl> { <nl> if ( ! EnsureWalletIsAvailable ( fHelp ) ) <nl> - return Value : : null ; <nl> + return NullUniValue ; <nl> <nl> if ( fHelp | | params . size ( ) > 2 ) <nl> throw runtime_error ( <nl> Value listaccounts ( const Array & params , bool fHelp ) <nl> Value listsinceblock ( const Array & params , bool fHelp ) <nl> { <nl> if ( ! EnsureWalletIsAvailable ( fHelp ) ) <nl> - return Value : : null ; <nl> + return NullUniValue ; <nl> <nl> if ( fHelp ) <nl> throw runtime_error ( <nl> Value listsinceblock ( const Array & params , bool fHelp ) <nl> Value gettransaction ( const Array & params , bool fHelp ) <nl> { <nl> if ( ! EnsureWalletIsAvailable ( fHelp ) ) <nl> - return Value : : null ; <nl> + return NullUniValue ; <nl> <nl> if ( fHelp | | params . size ( ) < 1 | | params . size ( ) > 2 ) <nl> throw runtime_error ( <nl> Value gettransaction ( const Array & params , bool fHelp ) <nl> Value backupwallet ( const Array & params , bool fHelp ) <nl> { <nl> if ( ! EnsureWalletIsAvailable ( fHelp ) ) <nl> - return Value : : null ; <nl> + return NullUniValue ; <nl> <nl> if ( fHelp | | params . size ( ) ! = 1 ) <nl> throw runtime_error ( <nl> Value backupwallet ( const Array & params , bool fHelp ) <nl> Value keypoolrefill ( const Array & params , bool fHelp ) <nl> { <nl> if ( ! EnsureWalletIsAvailable ( fHelp ) ) <nl> - return Value : : null ; <nl> + return NullUniValue ; <nl> <nl> if ( fHelp | | params . size ( ) > 1 ) <nl> throw runtime_error ( <nl> static void LockWallet ( CWallet * pWallet ) <nl> Value walletpassphrase ( const Array & params , bool fHelp ) <nl> { <nl> if ( ! EnsureWalletIsAvailable ( fHelp ) ) <nl> - return Value : : null ; <nl> + return NullUniValue ; <nl> <nl> if ( pwalletMain - > IsCrypted ( ) & & ( fHelp | | params . size ( ) ! = 2 ) ) <nl> throw runtime_error ( <nl> Value walletpassphrase ( const Array & params , bool fHelp ) <nl> Value walletpassphrasechange ( const Array & params , bool fHelp ) <nl> { <nl> if ( ! EnsureWalletIsAvailable ( fHelp ) ) <nl> - return Value : : null ; <nl> + return NullUniValue ; <nl> <nl> if ( pwalletMain - > IsCrypted ( ) & & ( fHelp | | params . size ( ) ! = 2 ) ) <nl> throw runtime_error ( <nl> Value walletpassphrasechange ( const Array & params , bool fHelp ) <nl> Value walletlock ( const Array & params , bool fHelp ) <nl> { <nl> if ( ! EnsureWalletIsAvailable ( fHelp ) ) <nl> - return Value : : null ; <nl> + return NullUniValue ; <nl> <nl> if ( pwalletMain - > IsCrypted ( ) & & ( fHelp | | params . size ( ) ! = 0 ) ) <nl> throw runtime_error ( <nl> Value walletlock ( const Array & params , bool fHelp ) <nl> Value encryptwallet ( const Array & params , bool fHelp ) <nl> { <nl> if ( ! EnsureWalletIsAvailable ( fHelp ) ) <nl> - return Value : : null ; <nl> + return NullUniValue ; <nl> <nl> if ( ! pwalletMain - > IsCrypted ( ) & & ( fHelp | | params . size ( ) ! = 1 ) ) <nl> throw runtime_error ( <nl> Value encryptwallet ( const Array & params , bool fHelp ) <nl> Value lockunspent ( const Array & params , bool fHelp ) <nl> { <nl> if ( ! EnsureWalletIsAvailable ( fHelp ) ) <nl> - return Value : : null ; <nl> + return NullUniValue ; <nl> <nl> if ( fHelp | | params . size ( ) < 1 | | params . size ( ) > 2 ) <nl> throw runtime_error ( <nl> Value lockunspent ( const Array & params , bool fHelp ) <nl> Value listlockunspent ( const Array & params , bool fHelp ) <nl> { <nl> if ( ! EnsureWalletIsAvailable ( fHelp ) ) <nl> - return Value : : null ; <nl> + return NullUniValue ; <nl> <nl> if ( fHelp | | params . size ( ) > 0 ) <nl> throw runtime_error ( <nl> Value listlockunspent ( const Array & params , bool fHelp ) <nl> Value settxfee ( const Array & params , bool fHelp ) <nl> { <nl> if ( ! EnsureWalletIsAvailable ( fHelp ) ) <nl> - return Value : : null ; <nl> + return NullUniValue ; <nl> <nl> if ( fHelp | | params . size ( ) < 1 | | params . size ( ) > 1 ) <nl> throw runtime_error ( <nl> Value settxfee ( const Array & params , bool fHelp ) <nl> Value getwalletinfo ( const Array & params , bool fHelp ) <nl> { <nl> if ( ! EnsureWalletIsAvailable ( fHelp ) ) <nl> - return Value : : null ; <nl> + return NullUniValue ; <nl> <nl> if ( fHelp | | params . size ( ) ! = 0 ) <nl> throw runtime_error ( <nl> Value getwalletinfo ( const Array & params , bool fHelp ) <nl> Value resendwallettransactions ( const Array & params , bool fHelp ) <nl> { <nl> if ( ! EnsureWalletIsAvailable ( fHelp ) ) <nl> - return Value : : null ; <nl> + return NullUniValue ; <nl> <nl> if ( fHelp | | params . size ( ) ! = 0 ) <nl> throw runtime_error ( <nl> Value resendwallettransactions ( const Array & params , bool fHelp ) <nl> Value listunspent ( const Array & params , bool fHelp ) <nl> { <nl> if ( ! EnsureWalletIsAvailable ( fHelp ) ) <nl> - return Value : : null ; <nl> + return NullUniValue ; <nl> <nl> if ( fHelp | | params . size ( ) > 3 ) <nl> throw runtime_error ( <nl> Value listunspent ( const Array & params , bool fHelp ) <nl> + HelpExampleRpc ( " listunspent " , " 6 , 9999999 \ " [ \ \ \ " 1PGFqEzfmQch1gKD3ra4k18PNj3tTUUSqg \ \ \ " , \ \ \ " 1LtvqCaApEdUGFkpKMM4MstjcaL4dKg8SP \ \ \ " ] \ " " ) <nl> ) ; <nl> <nl> - RPCTypeCheck ( params , boost : : assign : : list_of ( int_type ) ( int_type ) ( array_type ) ) ; <nl> + RPCTypeCheck ( params , boost : : assign : : list_of ( UniValue : : VNUM ) ( UniValue : : VNUM ) ( UniValue : : VARR ) ) ; <nl> <nl> int nMinDepth = 1 ; <nl> if ( params . size ( ) > 0 ) <nl> Value listunspent ( const Array & params , bool fHelp ) <nl> set < CBitcoinAddress > setAddress ; <nl> if ( params . size ( ) > 2 ) { <nl> Array inputs = params [ 2 ] . get_array ( ) ; <nl> - BOOST_FOREACH ( Value & input , inputs ) { <nl> + for ( unsigned int idx = 0 ; idx < inputs . size ( ) ; idx + + ) { <nl> + const Value & input = inputs [ idx ] ; <nl> CBitcoinAddress address ( input . get_str ( ) ) ; <nl> if ( ! address . IsValid ( ) ) <nl> throw JSONRPCError ( RPC_INVALID_ADDRESS_OR_KEY , string ( " Invalid Bitcoin address : " ) + input . get_str ( ) ) ; <nl>
extend conversion to UniValue
bitcoin/bitcoin
53b4671a9de75f7c8e2903d510cf88867c3f6b97
2015-06-04T07:16:05Z
mmm a / x64_dbg_gui / Project / Src / BasicView / AbstractTableView . cpp <nl> ppp b / x64_dbg_gui / Project / Src / BasicView / AbstractTableView . cpp <nl> void AbstractTableView : : fontsUpdated ( ) <nl> * / <nl> void AbstractTableView : : paintEvent ( QPaintEvent * event ) <nl> { <nl> + int lastColumn = getColumnCount ( ) - 1 ; <nl> + int lastColumnWidth = 0 ; <nl> if ( getColumnCount ( ) ) / / make sure the last column is never smaller than the window <nl> { <nl> int totalWidth = 0 ; <nl> void AbstractTableView : : paintEvent ( QPaintEvent * event ) <nl> lastWidth + = getColumnWidth ( i ) ; <nl> int width = this - > viewport ( ) - > width ( ) ; <nl> lastWidth = width > lastWidth ? width - lastWidth : 0 ; <nl> - int last = getColumnCount ( ) - 1 ; <nl> if ( totalWidth < width ) <nl> - setColumnWidth ( last , lastWidth ) ; <nl> + lastColumnWidth = lastWidth ; <nl> else <nl> - setColumnWidth ( last , getColumnWidth ( last ) ) ; <nl> + lastColumnWidth = getColumnWidth ( lastColumn ) ; <nl> } <nl> <nl> Q_UNUSED ( event ) ; <nl> void AbstractTableView : : paintEvent ( QPaintEvent * event ) <nl> { <nl> for ( int i = 0 ; i < getColumnCount ( ) ; i + + ) <nl> { <nl> + int columnWidth = getColumnWidth ( i ) ; <nl> + if ( i = = lastColumn ) <nl> + columnWidth = lastColumnWidth ; <nl> QStyleOptionButton wOpt ; <nl> if ( ( mColumnList [ i ] . header . isPressed = = true ) & & ( mColumnList [ i ] . header . isMouseOver = = true ) ) <nl> wOpt . state = QStyle : : State_Sunken ; <nl> else <nl> wOpt . state = QStyle : : State_Enabled ; <nl> <nl> - wOpt . rect = QRect ( x , y , getColumnWidth ( i ) , getHeaderHeight ( ) ) ; <nl> + wOpt . rect = QRect ( x , y , columnWidth , getHeaderHeight ( ) ) ; <nl> <nl> mHeaderButtonSytle . style ( ) - > drawControl ( QStyle : : CE_PushButton , & wOpt , & wPainter , & mHeaderButtonSytle ) ; <nl> <nl> wPainter . setPen ( headerTextColor ) ; <nl> - wPainter . drawText ( QRect ( x + 4 , y , getColumnWidth ( i ) - 8 , getHeaderHeight ( ) ) , Qt : : AlignVCenter | Qt : : AlignLeft , mColumnList [ i ] . title ) ; <nl> + wPainter . drawText ( QRect ( x + 4 , y , columnWidth - 8 , getHeaderHeight ( ) ) , Qt : : AlignVCenter | Qt : : AlignLeft , mColumnList [ i ] . title ) ; <nl> <nl> - x + = getColumnWidth ( i ) ; <nl> + x + = columnWidth ; <nl> } <nl> } <nl> <nl> void AbstractTableView : : paintEvent ( QPaintEvent * event ) <nl> / / Iterate over all columns and cells <nl> for ( int j = 0 ; j < getColumnCount ( ) ; j + + ) <nl> { <nl> + int columnWidth = getColumnWidth ( j ) ; <nl> + if ( j = = lastColumn ) <nl> + columnWidth = lastColumnWidth ; <nl> for ( int i = 0 ; i < wViewableRowsCount ; i + + ) <nl> { <nl> / / Paints cell contents <nl> if ( i < mNbrOfLineToPrint ) <nl> { <nl> - QString wStr = paintContent ( & wPainter , mTableOffset , i , j , x , y , getColumnWidth ( j ) , getRowHeight ( ) ) ; <nl> + QString wStr = paintContent ( & wPainter , mTableOffset , i , j , x , y , columnWidth , getRowHeight ( ) ) ; <nl> if ( wStr . length ( ) ) <nl> { <nl> wPainter . setPen ( textColor ) ; <nl> - wPainter . drawText ( QRect ( x + 4 , y , getColumnWidth ( j ) - 4 , getRowHeight ( ) ) , Qt : : AlignVCenter | Qt : : AlignLeft , wStr ) ; <nl> + wPainter . drawText ( QRect ( x + 4 , y , columnWidth - 4 , getRowHeight ( ) ) , Qt : : AlignVCenter | Qt : : AlignLeft , wStr ) ; <nl> } <nl> } <nl> <nl> / / Paints cell right borders <nl> wPainter . setPen ( separatorColor ) ; <nl> - wPainter . drawLine ( x + getColumnWidth ( j ) - 1 , y , x + getColumnWidth ( j ) - 1 , y + getRowHeight ( ) - 1 ) ; <nl> + wPainter . drawLine ( x + columnWidth - 1 , y , x + columnWidth - 1 , y + getRowHeight ( ) - 1 ) ; <nl> <nl> / / Update y for the next iteration <nl> y + = getRowHeight ( ) ; <nl> } <nl> <nl> y = getHeaderHeight ( ) ; <nl> - x + = getColumnWidth ( j ) ; <nl> + x + = columnWidth ; <nl> } <nl> emit repainted ( ) ; <nl> } <nl>
GUI : fixed a bug with setting the column width in the paint event when not appropriate ( this would cause the last column to disappear )
x64dbg/x64dbg
592c0a332acdd3ff8f2b0affd7d04682b3cbfb13
2015-04-06T20:30:11Z
mmm a / . gitignore <nl> ppp b / . gitignore <nl> <nl> * . autosave <nl> * . pyc <nl> * . user <nl> + * ~ <nl> . * . swp <nl> . DS_Store <nl> . sw [ a - z ] <nl>
Merge pull request from ilya - lavrenov : gitignore
opencv/opencv
9628abc7867c507201da2c5030195264de81aa27
2014-01-13T12:33:16Z
mmm a / src / builtins / arm / builtins - arm . cc <nl> ppp b / src / builtins / arm / builtins - arm . cc <nl> void Generate_JSConstructStubGeneric ( MacroAssembler * masm , <nl> <nl> __ ldr ( r4 , FieldMemOperand ( r1 , JSFunction : : kSharedFunctionInfoOffset ) ) ; <nl> __ ldr ( r4 , FieldMemOperand ( r4 , SharedFunctionInfo : : kCompilerHintsOffset ) ) ; <nl> - __ tst ( r4 , Operand ( SharedFunctionInfo : : IsDerivedConstructorBit : : kMask ) ) ; <nl> + __ tst ( r4 , Operand ( SharedFunctionInfo : : kDerivedConstructorMask ) ) ; <nl> __ b ( ne , & not_create_implicit_receiver ) ; <nl> <nl> / / If not derived class constructor : Allocate the new receiver object . <nl> void Generate_JSConstructStubGeneric ( MacroAssembler * masm , <nl> __ ldr ( r4 , MemOperand ( fp , ConstructFrameConstants : : kConstructorOffset ) ) ; <nl> __ ldr ( r4 , FieldMemOperand ( r4 , JSFunction : : kSharedFunctionInfoOffset ) ) ; <nl> __ ldr ( r4 , FieldMemOperand ( r4 , SharedFunctionInfo : : kCompilerHintsOffset ) ) ; <nl> - __ tst ( r4 , Operand ( SharedFunctionInfo : : IsClassConstructorBit : : kMask ) ) ; <nl> + __ tst ( r4 , Operand ( SharedFunctionInfo : : kClassConstructorMask ) ) ; <nl> <nl> if ( restrict_constructor_return ) { <nl> / / Throw if constructor function is a class constructor <nl> void Builtins : : Generate_CallFunction ( MacroAssembler * masm , <nl> Label class_constructor ; <nl> __ ldr ( r2 , FieldMemOperand ( r1 , JSFunction : : kSharedFunctionInfoOffset ) ) ; <nl> __ ldr ( r3 , FieldMemOperand ( r2 , SharedFunctionInfo : : kCompilerHintsOffset ) ) ; <nl> - __ tst ( r3 , Operand ( SharedFunctionInfo : : IsClassConstructorBit : : kMask ) ) ; <nl> + __ tst ( r3 , Operand ( SharedFunctionInfo : : kClassConstructorMask ) ) ; <nl> __ b ( ne , & class_constructor ) ; <nl> <nl> / / Enter the context of the function ; ToObject has to run in the function <nl> mmm a / src / builtins / arm64 / builtins - arm64 . cc <nl> ppp b / src / builtins / arm64 / builtins - arm64 . cc <nl> void Generate_JSConstructStubGeneric ( MacroAssembler * masm , <nl> <nl> __ Ldr ( x4 , FieldMemOperand ( x1 , JSFunction : : kSharedFunctionInfoOffset ) ) ; <nl> __ Ldr ( w4 , FieldMemOperand ( x4 , SharedFunctionInfo : : kCompilerHintsOffset ) ) ; <nl> - __ TestAndBranchIfAnySet ( w4 , <nl> - SharedFunctionInfo : : IsDerivedConstructorBit : : kMask , <nl> + __ TestAndBranchIfAnySet ( w4 , SharedFunctionInfo : : kDerivedConstructorMask , <nl> & not_create_implicit_receiver ) ; <nl> <nl> / / If not derived class constructor : Allocate the new receiver object . <nl> void Generate_JSConstructStubGeneric ( MacroAssembler * masm , <nl> <nl> if ( restrict_constructor_return ) { <nl> / / Throw if constructor function is a class constructor <nl> - __ TestAndBranchIfAllClear ( <nl> - w4 , SharedFunctionInfo : : IsClassConstructorBit : : kMask , & use_receiver ) ; <nl> + __ TestAndBranchIfAllClear ( w4 , SharedFunctionInfo : : kClassConstructorMask , <nl> + & use_receiver ) ; <nl> } else { <nl> - __ TestAndBranchIfAnySet ( <nl> - w4 , SharedFunctionInfo : : IsClassConstructorBit : : kMask , & use_receiver ) ; <nl> + __ TestAndBranchIfAnySet ( w4 , SharedFunctionInfo : : kClassConstructorMask , <nl> + & use_receiver ) ; <nl> __ CallRuntime ( <nl> Runtime : : kIncrementUseCounterConstructorReturnNonUndefinedPrimitive ) ; <nl> __ B ( & use_receiver ) ; <nl> void Builtins : : Generate_CallFunction ( MacroAssembler * masm , <nl> Label class_constructor ; <nl> __ Ldr ( x2 , FieldMemOperand ( x1 , JSFunction : : kSharedFunctionInfoOffset ) ) ; <nl> __ Ldr ( w3 , FieldMemOperand ( x2 , SharedFunctionInfo : : kCompilerHintsOffset ) ) ; <nl> - __ TestAndBranchIfAnySet ( w3 , SharedFunctionInfo : : IsClassConstructorBit : : kMask , <nl> + __ TestAndBranchIfAnySet ( w3 , SharedFunctionInfo : : kClassConstructorMask , <nl> & class_constructor ) ; <nl> <nl> / / Enter the context of the function ; ToObject has to run in the function <nl> mmm a / src / builtins / ia32 / builtins - ia32 . cc <nl> ppp b / src / builtins / ia32 / builtins - ia32 . cc <nl> void Generate_JSConstructStubGeneric ( MacroAssembler * masm , <nl> <nl> __ mov ( ebx , FieldOperand ( edi , JSFunction : : kSharedFunctionInfoOffset ) ) ; <nl> __ test ( FieldOperand ( ebx , SharedFunctionInfo : : kCompilerHintsOffset ) , <nl> - Immediate ( SharedFunctionInfo : : IsDerivedConstructorBit : : kMask ) ) ; <nl> + Immediate ( SharedFunctionInfo : : kDerivedConstructorMask ) ) ; <nl> __ j ( not_zero , & not_create_implicit_receiver ) ; <nl> <nl> / / If not derived class constructor : Allocate the new receiver object . <nl> void Generate_JSConstructStubGeneric ( MacroAssembler * masm , <nl> __ mov ( ebx , Operand ( ebp , ConstructFrameConstants : : kConstructorOffset ) ) ; <nl> __ mov ( ebx , FieldOperand ( ebx , JSFunction : : kSharedFunctionInfoOffset ) ) ; <nl> __ test ( FieldOperand ( ebx , SharedFunctionInfo : : kCompilerHintsOffset ) , <nl> - Immediate ( SharedFunctionInfo : : IsClassConstructorBit : : kMask ) ) ; <nl> + Immediate ( SharedFunctionInfo : : kClassConstructorMask ) ) ; <nl> <nl> if ( restrict_constructor_return ) { <nl> / / Throw if constructor function is a class constructor <nl> void Builtins : : Generate_CallFunction ( MacroAssembler * masm , <nl> Label class_constructor ; <nl> __ mov ( edx , FieldOperand ( edi , JSFunction : : kSharedFunctionInfoOffset ) ) ; <nl> __ test ( FieldOperand ( edx , SharedFunctionInfo : : kCompilerHintsOffset ) , <nl> - Immediate ( SharedFunctionInfo : : IsClassConstructorBit : : kMask ) ) ; <nl> + Immediate ( SharedFunctionInfo : : kClassConstructorMask ) ) ; <nl> __ j ( not_zero , & class_constructor ) ; <nl> <nl> / / Enter the context of the function ; ToObject has to run in the function <nl> mmm a / src / builtins / mips / builtins - mips . cc <nl> ppp b / src / builtins / mips / builtins - mips . cc <nl> void Generate_JSConstructStubGeneric ( MacroAssembler * masm , <nl> <nl> __ lw ( t2 , FieldMemOperand ( a1 , JSFunction : : kSharedFunctionInfoOffset ) ) ; <nl> __ lw ( t2 , FieldMemOperand ( t2 , SharedFunctionInfo : : kCompilerHintsOffset ) ) ; <nl> - __ And ( t2 , t2 , Operand ( SharedFunctionInfo : : IsDerivedConstructorBit : : kMask ) ) ; <nl> + __ And ( t2 , t2 , Operand ( SharedFunctionInfo : : kDerivedConstructorMask ) ) ; <nl> __ Branch ( & not_create_implicit_receiver , ne , t2 , Operand ( zero_reg ) ) ; <nl> <nl> / / If not derived class constructor : Allocate the new receiver object . <nl> void Generate_JSConstructStubGeneric ( MacroAssembler * masm , <nl> __ lw ( a1 , MemOperand ( fp , ConstructFrameConstants : : kConstructorOffset ) ) ; <nl> __ lw ( t2 , FieldMemOperand ( a1 , JSFunction : : kSharedFunctionInfoOffset ) ) ; <nl> __ lw ( t2 , FieldMemOperand ( t2 , SharedFunctionInfo : : kCompilerHintsOffset ) ) ; <nl> - __ And ( t2 , t2 , Operand ( SharedFunctionInfo : : IsClassConstructorBit : : kMask ) ) ; <nl> + __ And ( t2 , t2 , Operand ( SharedFunctionInfo : : kClassConstructorMask ) ) ; <nl> <nl> if ( restrict_constructor_return ) { <nl> / / Throw if constructor function is a class constructor <nl> void Builtins : : Generate_CallFunction ( MacroAssembler * masm , <nl> Label class_constructor ; <nl> __ lw ( a2 , FieldMemOperand ( a1 , JSFunction : : kSharedFunctionInfoOffset ) ) ; <nl> __ lw ( a3 , FieldMemOperand ( a2 , SharedFunctionInfo : : kCompilerHintsOffset ) ) ; <nl> - __ And ( at , a3 , Operand ( SharedFunctionInfo : : IsClassConstructorBit : : kMask ) ) ; <nl> + __ And ( at , a3 , Operand ( SharedFunctionInfo : : kClassConstructorMask ) ) ; <nl> __ Branch ( & class_constructor , ne , at , Operand ( zero_reg ) ) ; <nl> <nl> / / Enter the context of the function ; ToObject has to run in the function <nl> mmm a / src / builtins / mips64 / builtins - mips64 . cc <nl> ppp b / src / builtins / mips64 / builtins - mips64 . cc <nl> void Generate_JSConstructStubGeneric ( MacroAssembler * masm , <nl> <nl> __ Ld ( t2 , FieldMemOperand ( a1 , JSFunction : : kSharedFunctionInfoOffset ) ) ; <nl> __ lwu ( t2 , FieldMemOperand ( t2 , SharedFunctionInfo : : kCompilerHintsOffset ) ) ; <nl> - __ And ( t2 , t2 , Operand ( SharedFunctionInfo : : IsDerivedConstructorBit : : kMask ) ) ; <nl> + __ And ( t2 , t2 , Operand ( SharedFunctionInfo : : kDerivedConstructorMask ) ) ; <nl> __ Branch ( & not_create_implicit_receiver , ne , t2 , Operand ( zero_reg ) ) ; <nl> <nl> / / If not derived class constructor : Allocate the new receiver object . <nl> void Generate_JSConstructStubGeneric ( MacroAssembler * masm , <nl> __ Ld ( a1 , MemOperand ( fp , ConstructFrameConstants : : kConstructorOffset ) ) ; <nl> __ Ld ( t2 , FieldMemOperand ( a1 , JSFunction : : kSharedFunctionInfoOffset ) ) ; <nl> __ lwu ( t2 , FieldMemOperand ( t2 , SharedFunctionInfo : : kCompilerHintsOffset ) ) ; <nl> - __ And ( t2 , t2 , Operand ( SharedFunctionInfo : : IsClassConstructorBit : : kMask ) ) ; <nl> + __ And ( t2 , t2 , Operand ( SharedFunctionInfo : : kClassConstructorMask ) ) ; <nl> <nl> if ( restrict_constructor_return ) { <nl> / / Throw if constructor function is a class constructor <nl> void Builtins : : Generate_CallFunction ( MacroAssembler * masm , <nl> Label class_constructor ; <nl> __ Ld ( a2 , FieldMemOperand ( a1 , JSFunction : : kSharedFunctionInfoOffset ) ) ; <nl> __ Lwu ( a3 , FieldMemOperand ( a2 , SharedFunctionInfo : : kCompilerHintsOffset ) ) ; <nl> - __ And ( at , a3 , Operand ( SharedFunctionInfo : : IsClassConstructorBit : : kMask ) ) ; <nl> + __ And ( at , a3 , Operand ( SharedFunctionInfo : : kClassConstructorMask ) ) ; <nl> __ Branch ( & class_constructor , ne , at , Operand ( zero_reg ) ) ; <nl> <nl> / / Enter the context of the function ; ToObject has to run in the function <nl> mmm a / src / builtins / ppc / builtins - ppc . cc <nl> ppp b / src / builtins / ppc / builtins - ppc . cc <nl> void Generate_JSConstructStubGeneric ( MacroAssembler * masm , <nl> <nl> __ LoadP ( r7 , FieldMemOperand ( r4 , JSFunction : : kSharedFunctionInfoOffset ) ) ; <nl> __ lwz ( r7 , FieldMemOperand ( r7 , SharedFunctionInfo : : kCompilerHintsOffset ) ) ; <nl> - __ TestBitMask ( r7 , SharedFunctionInfo : : IsDerivedConstructorBit : : kMask , r0 ) ; <nl> + __ TestBitMask ( r7 , SharedFunctionInfo : : kDerivedConstructorMask , r0 ) ; <nl> __ bne ( & not_create_implicit_receiver , cr0 ) ; <nl> <nl> / / If not derived class constructor : Allocate the new receiver object . <nl> void Generate_JSConstructStubGeneric ( MacroAssembler * masm , <nl> __ LoadP ( r7 , MemOperand ( fp , ConstructFrameConstants : : kConstructorOffset ) ) ; <nl> __ LoadP ( r7 , FieldMemOperand ( r7 , JSFunction : : kSharedFunctionInfoOffset ) ) ; <nl> __ lwz ( r7 , FieldMemOperand ( r7 , SharedFunctionInfo : : kCompilerHintsOffset ) ) ; <nl> - __ TestBitMask ( r7 , SharedFunctionInfo : : IsClassConstructorBit : : kMask , r0 ) ; <nl> + __ TestBitMask ( r7 , SharedFunctionInfo : : kClassConstructorMask , r0 ) ; <nl> __ beq ( & use_receiver , cr0 ) ; <nl> <nl> } else { <nl> void Builtins : : Generate_CallFunction ( MacroAssembler * masm , <nl> Label class_constructor ; <nl> __ LoadP ( r5 , FieldMemOperand ( r4 , JSFunction : : kSharedFunctionInfoOffset ) ) ; <nl> __ lwz ( r6 , FieldMemOperand ( r5 , SharedFunctionInfo : : kCompilerHintsOffset ) ) ; <nl> - __ TestBitMask ( r6 , SharedFunctionInfo : : IsClassConstructorBit : : kMask , r0 ) ; <nl> + __ TestBitMask ( r6 , SharedFunctionInfo : : kClassConstructorMask , r0 ) ; <nl> __ bne ( & class_constructor , cr0 ) ; <nl> <nl> / / Enter the context of the function ; ToObject has to run in the function <nl> mmm a / src / builtins / s390 / builtins - s390 . cc <nl> ppp b / src / builtins / s390 / builtins - s390 . cc <nl> void Generate_JSConstructStubGeneric ( MacroAssembler * masm , <nl> __ LoadP ( r6 , FieldMemOperand ( r3 , JSFunction : : kSharedFunctionInfoOffset ) ) ; <nl> __ LoadlW ( r6 , <nl> FieldMemOperand ( r6 , SharedFunctionInfo : : kCompilerHintsOffset ) ) ; <nl> - __ TestBitMask ( r6 , SharedFunctionInfo : : IsDerivedConstructorBit : : kMask , r0 ) ; <nl> + __ TestBitMask ( r6 , SharedFunctionInfo : : kDerivedConstructorMask , r0 ) ; <nl> __ bne ( & not_create_implicit_receiver ) ; <nl> <nl> / / If not derived class constructor : Allocate the new receiver object . <nl> void Generate_JSConstructStubGeneric ( MacroAssembler * masm , <nl> __ LoadP ( r6 , FieldMemOperand ( r6 , JSFunction : : kSharedFunctionInfoOffset ) ) ; <nl> __ LoadlW ( r6 , <nl> FieldMemOperand ( r6 , SharedFunctionInfo : : kCompilerHintsOffset ) ) ; <nl> - __ TestBitMask ( r6 , SharedFunctionInfo : : IsClassConstructorBit : : kMask , r0 ) ; <nl> + __ TestBitMask ( r6 , SharedFunctionInfo : : kClassConstructorMask , r0 ) ; <nl> __ beq ( & use_receiver ) ; <nl> } else { <nl> __ b ( & use_receiver ) ; <nl> void Builtins : : Generate_CallFunction ( MacroAssembler * masm , <nl> Label class_constructor ; <nl> __ LoadP ( r4 , FieldMemOperand ( r3 , JSFunction : : kSharedFunctionInfoOffset ) ) ; <nl> __ LoadlW ( r5 , FieldMemOperand ( r4 , SharedFunctionInfo : : kCompilerHintsOffset ) ) ; <nl> - __ TestBitMask ( r5 , SharedFunctionInfo : : IsClassConstructorBit : : kMask , r0 ) ; <nl> + __ TestBitMask ( r5 , SharedFunctionInfo : : kClassConstructorMask , r0 ) ; <nl> __ bne ( & class_constructor ) ; <nl> <nl> / / Enter the context of the function ; ToObject has to run in the function <nl> mmm a / src / builtins / x64 / builtins - x64 . cc <nl> ppp b / src / builtins / x64 / builtins - x64 . cc <nl> void Generate_JSConstructStubGeneric ( MacroAssembler * masm , <nl> <nl> __ movp ( rbx , FieldOperand ( rdi , JSFunction : : kSharedFunctionInfoOffset ) ) ; <nl> __ testl ( FieldOperand ( rbx , SharedFunctionInfo : : kCompilerHintsOffset ) , <nl> - Immediate ( SharedFunctionInfo : : IsDerivedConstructorBit : : kMask ) ) ; <nl> + Immediate ( SharedFunctionInfo : : kDerivedConstructorMask ) ) ; <nl> __ j ( not_zero , & not_create_implicit_receiver , Label : : kNear ) ; <nl> <nl> / / If not derived class constructor : Allocate the new receiver object . <nl> void Generate_JSConstructStubGeneric ( MacroAssembler * masm , <nl> __ movp ( rbx , Operand ( rbp , ConstructFrameConstants : : kConstructorOffset ) ) ; <nl> __ movp ( rbx , FieldOperand ( rbx , JSFunction : : kSharedFunctionInfoOffset ) ) ; <nl> __ testl ( FieldOperand ( rbx , SharedFunctionInfo : : kCompilerHintsOffset ) , <nl> - Immediate ( SharedFunctionInfo : : IsClassConstructorBit : : kMask ) ) ; <nl> + Immediate ( SharedFunctionInfo : : kClassConstructorMask ) ) ; <nl> <nl> if ( restrict_constructor_return ) { <nl> / / Throw if constructor function is a class constructor <nl> void Builtins : : Generate_CallFunction ( MacroAssembler * masm , <nl> Label class_constructor ; <nl> __ movp ( rdx , FieldOperand ( rdi , JSFunction : : kSharedFunctionInfoOffset ) ) ; <nl> __ testl ( FieldOperand ( rdx , SharedFunctionInfo : : kCompilerHintsOffset ) , <nl> - Immediate ( SharedFunctionInfo : : IsClassConstructorBit : : kMask ) ) ; <nl> + Immediate ( SharedFunctionInfo : : kClassConstructorMask ) ) ; <nl> __ j ( not_zero , & class_constructor ) ; <nl> <nl> / / mmmmmmmmm - - S t a t e mmmmmmmmmmmm - <nl> mmm a / src / factory . cc <nl> ppp b / src / factory . cc <nl> void Factory : : ReinitializeJSGlobalProxy ( Handle < JSGlobalProxy > object , <nl> Handle < SharedFunctionInfo > Factory : : NewSharedFunctionInfo ( <nl> MaybeHandle < String > name , FunctionKind kind , Handle < Code > code , <nl> Handle < ScopeInfo > scope_info ) { <nl> + DCHECK ( IsValidFunctionKind ( kind ) ) ; <nl> Handle < SharedFunctionInfo > shared = <nl> NewSharedFunctionInfo ( name , code , IsConstructable ( kind ) , kind ) ; <nl> shared - > set_scope_info ( * scope_info ) ; <nl> mmm a / src / globals . h <nl> ppp b / src / globals . h <nl> enum MinusZeroMode { <nl> <nl> enum Signedness { kSigned , kUnsigned } ; <nl> <nl> - enum FunctionKind : uint8_t { <nl> - kNormalFunction , <nl> - kArrowFunction , <nl> - kGeneratorFunction , <nl> - kConciseMethod , <nl> - kDerivedConstructor , <nl> - kBaseConstructor , <nl> - kGetterFunction , <nl> - kSetterFunction , <nl> - kAsyncFunction , <nl> - kModule , <nl> - kClassFieldsInitializerFunction , <nl> - <nl> - kDefaultBaseConstructor , <nl> - kDefaultDerivedConstructor , <nl> - kAsyncArrowFunction , <nl> - kAsyncConciseMethod , <nl> - <nl> - kConciseGeneratorMethod , <nl> - kAsyncConciseGeneratorMethod , <nl> - kAsyncGeneratorFunction , <nl> - kLastFunctionKind , <nl> + enum FunctionKind : uint16_t { <nl> + kNormalFunction = 0 , <nl> + kArrowFunction = 1 < < 0 , <nl> + kGeneratorFunction = 1 < < 1 , <nl> + kConciseMethod = 1 < < 2 , <nl> + kDefaultConstructor = 1 < < 3 , <nl> + kDerivedConstructor = 1 < < 4 , <nl> + kBaseConstructor = 1 < < 5 , <nl> + kGetterFunction = 1 < < 6 , <nl> + kSetterFunction = 1 < < 7 , <nl> + kAsyncFunction = 1 < < 8 , <nl> + kModule = 1 < < 9 , <nl> + kClassFieldsInitializerFunction = 1 < < 10 | kConciseMethod , <nl> + kLastFunctionKind = kClassFieldsInitializerFunction , <nl> + <nl> + kConciseGeneratorMethod = kGeneratorFunction | kConciseMethod , <nl> + kAccessorFunction = kGetterFunction | kSetterFunction , <nl> + kDefaultBaseConstructor = kDefaultConstructor | kBaseConstructor , <nl> + kDefaultDerivedConstructor = kDefaultConstructor | kDerivedConstructor , <nl> + kClassConstructor = <nl> + kBaseConstructor | kDerivedConstructor | kDefaultConstructor , <nl> + kAsyncArrowFunction = kArrowFunction | kAsyncFunction , <nl> + kAsyncConciseMethod = kAsyncFunction | kConciseMethod , <nl> + <nl> + / / https : / / tc39 . github . io / proposal - async - iteration / <nl> + kAsyncConciseGeneratorMethod = kAsyncFunction | kConciseGeneratorMethod , <nl> + kAsyncGeneratorFunction = kAsyncFunction | kGeneratorFunction <nl> } ; <nl> <nl> - inline bool IsArrowFunction ( FunctionKind kind ) { <nl> - return kind = = FunctionKind : : kArrowFunction | | <nl> - kind = = FunctionKind : : kAsyncArrowFunction ; <nl> + inline bool IsValidFunctionKind ( FunctionKind kind ) { <nl> + return kind = = FunctionKind : : kNormalFunction | | <nl> + kind = = FunctionKind : : kArrowFunction | | <nl> + kind = = FunctionKind : : kGeneratorFunction | | <nl> + kind = = FunctionKind : : kModule | | <nl> + kind = = FunctionKind : : kConciseMethod | | <nl> + kind = = FunctionKind : : kConciseGeneratorMethod | | <nl> + kind = = FunctionKind : : kGetterFunction | | <nl> + kind = = FunctionKind : : kSetterFunction | | <nl> + kind = = FunctionKind : : kAccessorFunction | | <nl> + kind = = FunctionKind : : kDefaultBaseConstructor | | <nl> + kind = = FunctionKind : : kDefaultDerivedConstructor | | <nl> + kind = = FunctionKind : : kBaseConstructor | | <nl> + kind = = FunctionKind : : kDerivedConstructor | | <nl> + kind = = FunctionKind : : kAsyncFunction | | <nl> + kind = = FunctionKind : : kAsyncArrowFunction | | <nl> + kind = = FunctionKind : : kAsyncConciseMethod | | <nl> + kind = = FunctionKind : : kAsyncConciseGeneratorMethod | | <nl> + kind = = FunctionKind : : kAsyncGeneratorFunction | | <nl> + kind = = FunctionKind : : kClassFieldsInitializerFunction ; <nl> } <nl> <nl> - inline bool IsModule ( FunctionKind kind ) { <nl> - return kind = = FunctionKind : : kModule ; <nl> - } <nl> <nl> - inline bool IsAsyncGeneratorFunction ( FunctionKind kind ) { <nl> - return kind = = FunctionKind : : kAsyncGeneratorFunction | | <nl> - kind = = FunctionKind : : kAsyncConciseGeneratorMethod ; <nl> + inline bool IsArrowFunction ( FunctionKind kind ) { <nl> + DCHECK ( IsValidFunctionKind ( kind ) ) ; <nl> + return ( kind & FunctionKind : : kArrowFunction ) ! = 0 ; <nl> } <nl> <nl> + <nl> inline bool IsGeneratorFunction ( FunctionKind kind ) { <nl> - return kind = = FunctionKind : : kGeneratorFunction | | <nl> - kind = = FunctionKind : : kConciseGeneratorMethod | | <nl> - IsAsyncGeneratorFunction ( kind ) ; <nl> + DCHECK ( IsValidFunctionKind ( kind ) ) ; <nl> + return ( kind & FunctionKind : : kGeneratorFunction ) ! = 0 ; <nl> + } <nl> + <nl> + inline bool IsModule ( FunctionKind kind ) { <nl> + DCHECK ( IsValidFunctionKind ( kind ) ) ; <nl> + return ( kind & FunctionKind : : kModule ) ! = 0 ; <nl> } <nl> <nl> inline bool IsAsyncFunction ( FunctionKind kind ) { <nl> - return kind = = FunctionKind : : kAsyncFunction | | <nl> - kind = = FunctionKind : : kAsyncArrowFunction | | <nl> - kind = = FunctionKind : : kAsyncConciseMethod | | <nl> - IsAsyncGeneratorFunction ( kind ) ; <nl> + DCHECK ( IsValidFunctionKind ( kind ) ) ; <nl> + return ( kind & FunctionKind : : kAsyncFunction ) ! = 0 ; <nl> + } <nl> + <nl> + inline bool IsAsyncGeneratorFunction ( FunctionKind kind ) { <nl> + DCHECK ( IsValidFunctionKind ( kind ) ) ; <nl> + const FunctionKind kMask = FunctionKind : : kAsyncGeneratorFunction ; <nl> + return ( kind & kMask ) = = kMask ; <nl> } <nl> <nl> inline bool IsResumableFunction ( FunctionKind kind ) { <nl> inline bool IsResumableFunction ( FunctionKind kind ) { <nl> } <nl> <nl> inline bool IsConciseMethod ( FunctionKind kind ) { <nl> - return kind = = FunctionKind : : kConciseMethod | | <nl> - kind = = FunctionKind : : kConciseGeneratorMethod | | <nl> - kind = = FunctionKind : : kAsyncConciseMethod | | <nl> - kind = = FunctionKind : : kAsyncConciseGeneratorMethod | | <nl> - kind = = FunctionKind : : kClassFieldsInitializerFunction ; <nl> + DCHECK ( IsValidFunctionKind ( kind ) ) ; <nl> + return ( kind & FunctionKind : : kConciseMethod ) ! = 0 ; <nl> } <nl> <nl> inline bool IsGetterFunction ( FunctionKind kind ) { <nl> - return kind = = FunctionKind : : kGetterFunction ; <nl> + DCHECK ( IsValidFunctionKind ( kind ) ) ; <nl> + return ( kind & FunctionKind : : kGetterFunction ) ! = 0 ; <nl> } <nl> <nl> inline bool IsSetterFunction ( FunctionKind kind ) { <nl> - return kind = = FunctionKind : : kSetterFunction ; <nl> + DCHECK ( IsValidFunctionKind ( kind ) ) ; <nl> + return ( kind & FunctionKind : : kSetterFunction ) ! = 0 ; <nl> } <nl> <nl> inline bool IsAccessorFunction ( FunctionKind kind ) { <nl> - return kind = = FunctionKind : : kGetterFunction | | <nl> - kind = = FunctionKind : : kSetterFunction ; <nl> + DCHECK ( IsValidFunctionKind ( kind ) ) ; <nl> + return ( kind & FunctionKind : : kAccessorFunction ) ! = 0 ; <nl> } <nl> <nl> + <nl> inline bool IsDefaultConstructor ( FunctionKind kind ) { <nl> - return kind = = FunctionKind : : kDefaultBaseConstructor | | <nl> - kind = = FunctionKind : : kDefaultDerivedConstructor ; <nl> + DCHECK ( IsValidFunctionKind ( kind ) ) ; <nl> + return ( kind & FunctionKind : : kDefaultConstructor ) ! = 0 ; <nl> } <nl> <nl> + <nl> inline bool IsBaseConstructor ( FunctionKind kind ) { <nl> - return kind = = FunctionKind : : kBaseConstructor | | <nl> - kind = = FunctionKind : : kDefaultBaseConstructor ; <nl> + DCHECK ( IsValidFunctionKind ( kind ) ) ; <nl> + return ( kind & FunctionKind : : kBaseConstructor ) ! = 0 ; <nl> } <nl> <nl> inline bool IsDerivedConstructor ( FunctionKind kind ) { <nl> - return kind = = FunctionKind : : kDerivedConstructor | | <nl> - kind = = FunctionKind : : kDefaultDerivedConstructor ; <nl> + DCHECK ( IsValidFunctionKind ( kind ) ) ; <nl> + return ( kind & FunctionKind : : kDerivedConstructor ) ! = 0 ; <nl> } <nl> <nl> <nl> inline bool IsClassConstructor ( FunctionKind kind ) { <nl> - return IsBaseConstructor ( kind ) | | IsDerivedConstructor ( kind ) ; <nl> + DCHECK ( IsValidFunctionKind ( kind ) ) ; <nl> + return ( kind & FunctionKind : : kClassConstructor ) ! = 0 ; <nl> } <nl> <nl> inline bool IsClassFieldsInitializerFunction ( FunctionKind kind ) { <nl> + DCHECK ( IsValidFunctionKind ( kind ) ) ; <nl> return kind = = FunctionKind : : kClassFieldsInitializerFunction ; <nl> } <nl> <nl> inline bool IsConstructable ( FunctionKind kind ) { <nl> return true ; <nl> } <nl> <nl> - inline std : : ostream & operator < < ( std : : ostream & os , FunctionKind kind ) { <nl> - switch ( kind ) { <nl> - case FunctionKind : : kNormalFunction : <nl> - return os < < " NormalFunction " ; <nl> - case FunctionKind : : kArrowFunction : <nl> - return os < < " ArrowFunction " ; <nl> - case FunctionKind : : kGeneratorFunction : <nl> - return os < < " GeneratorFunction " ; <nl> - case FunctionKind : : kConciseMethod : <nl> - return os < < " ConciseMethod " ; <nl> - case FunctionKind : : kDerivedConstructor : <nl> - return os < < " DerivedConstructor " ; <nl> - case FunctionKind : : kBaseConstructor : <nl> - return os < < " BaseConstructor " ; <nl> - case FunctionKind : : kGetterFunction : <nl> - return os < < " GetterFunction " ; <nl> - case FunctionKind : : kSetterFunction : <nl> - return os < < " SetterFunction " ; <nl> - case FunctionKind : : kAsyncFunction : <nl> - return os < < " AsyncFunction " ; <nl> - case FunctionKind : : kModule : <nl> - return os < < " Module " ; <nl> - case FunctionKind : : kClassFieldsInitializerFunction : <nl> - return os < < " ClassFieldsInitializerFunction " ; <nl> - case FunctionKind : : kDefaultBaseConstructor : <nl> - return os < < " DefaultBaseConstructor " ; <nl> - case FunctionKind : : kDefaultDerivedConstructor : <nl> - return os < < " DefaultDerivedConstructor " ; <nl> - case FunctionKind : : kAsyncArrowFunction : <nl> - return os < < " AsyncArrowFunction " ; <nl> - case FunctionKind : : kAsyncConciseMethod : <nl> - return os < < " AsyncConciseMethod " ; <nl> - case FunctionKind : : kConciseGeneratorMethod : <nl> - return os < < " ConciseGeneratorMethod " ; <nl> - case FunctionKind : : kAsyncConciseGeneratorMethod : <nl> - return os < < " AsyncConciseGeneratorMethod " ; <nl> - case FunctionKind : : kAsyncGeneratorFunction : <nl> - return os < < " AsyncGeneratorFunction " ; <nl> - case FunctionKind : : kLastFunctionKind : <nl> - UNREACHABLE ( ) ; <nl> - } <nl> - UNREACHABLE ( ) ; <nl> - } <nl> - <nl> enum class InterpreterPushArgsMode : unsigned { <nl> kJSFunction , <nl> kWithFinalSpread , <nl> mmm a / src / objects - printer . cc <nl> ppp b / src / objects - printer . cc <nl> void JSBoundFunction : : JSBoundFunctionPrint ( std : : ostream & os ) { / / NOLINT <nl> JSObjectPrintBody ( os , this ) ; <nl> } <nl> <nl> + <nl> + namespace { <nl> + <nl> + std : : ostream & operator < < ( std : : ostream & os , FunctionKind kind ) { <nl> + os < < " [ " ; <nl> + if ( kind = = FunctionKind : : kNormalFunction ) { <nl> + os < < " NormalFunction " ; <nl> + } else { <nl> + # define PRINT_FLAG ( name ) \ <nl> + if ( static_cast < int > ( kind ) & static_cast < int > ( FunctionKind : : k # # name ) ) { \ <nl> + os < < " " < < # name ; \ <nl> + } <nl> + <nl> + PRINT_FLAG ( ArrowFunction ) <nl> + PRINT_FLAG ( GeneratorFunction ) <nl> + PRINT_FLAG ( ConciseMethod ) <nl> + PRINT_FLAG ( DefaultConstructor ) <nl> + PRINT_FLAG ( DerivedConstructor ) <nl> + PRINT_FLAG ( BaseConstructor ) <nl> + PRINT_FLAG ( GetterFunction ) <nl> + PRINT_FLAG ( SetterFunction ) <nl> + PRINT_FLAG ( AsyncFunction ) <nl> + PRINT_FLAG ( Module ) <nl> + # undef PRINT_FLAG <nl> + } <nl> + return os < < " ] " ; <nl> + } <nl> + <nl> + } / / namespace <nl> + <nl> void JSFunction : : JSFunctionPrint ( std : : ostream & os ) { / / NOLINT <nl> JSObjectPrintHeader ( os , this , " Function " ) ; <nl> os < < " \ n - function prototype = " ; <nl> mmm a / src / objects / shared - function - info - inl . h <nl> ppp b / src / objects / shared - function - info - inl . h <nl> FunctionKind SharedFunctionInfo : : kind ( ) const { <nl> } <nl> <nl> void SharedFunctionInfo : : set_kind ( FunctionKind kind ) { <nl> + DCHECK ( IsValidFunctionKind ( kind ) ) ; <nl> int hints = compiler_hints ( ) ; <nl> hints = FunctionKindBits : : update ( hints , kind ) ; <nl> - hints = IsClassConstructorBit : : update ( hints , IsClassConstructor ( kind ) ) ; <nl> - hints = IsDerivedConstructorBit : : update ( hints , IsDerivedConstructor ( kind ) ) ; <nl> set_compiler_hints ( hints ) ; <nl> UpdateFunctionMapIndex ( ) ; <nl> } <nl> mmm a / src / objects / shared - function - info . h <nl> ppp b / src / objects / shared - function - info . h <nl> class SharedFunctionInfo : public HeapObject { <nl> V ( IsNativeBit , bool , 1 , _ ) \ <nl> V ( IsStrictBit , bool , 1 , _ ) \ <nl> V ( IsWrappedBit , bool , 1 , _ ) \ <nl> - V ( IsClassConstructorBit , bool , 1 , _ ) \ <nl> - V ( IsDerivedConstructorBit , bool , 1 , _ ) \ <nl> - V ( FunctionKindBits , FunctionKind , 5 , _ ) \ <nl> + V ( FunctionKindBits , FunctionKind , 11 , _ ) \ <nl> V ( HasDuplicateParametersBit , bool , 1 , _ ) \ <nl> V ( AllowLazyCompilationBit , bool , 1 , _ ) \ <nl> V ( NeedsHomeObjectBit , bool , 1 , _ ) \ <nl> class SharedFunctionInfo : public HeapObject { <nl> DisabledOptimizationReasonBits : : kMax ) ; <nl> <nl> STATIC_ASSERT ( kLastFunctionKind < = FunctionKindBits : : kMax ) ; <nl> + / / Masks for checking if certain FunctionKind bits are set without fully <nl> + / / decoding of the FunctionKind bit field . <nl> + static const int kClassConstructorMask = FunctionKind : : kClassConstructor <nl> + < < FunctionKindBits : : kShift ; <nl> + static const int kDerivedConstructorMask = FunctionKind : : kDerivedConstructor <nl> + < < FunctionKindBits : : kShift ; <nl> <nl> / / Bit positions in | debugger_hints | . <nl> # define DEBUGGER_HINTS_BIT_FIELDS ( V , _ ) \ <nl>
Revert " Simplify FunctionKind , saving 4 bits in SharedFunctionInfo "
v8/v8
bb7138f67a68f3a70e13eade90255b82cdfd035a
2018-01-13T11:16:28Z
mmm a / toolsrc / include / PackageSpec . h <nl> ppp b / toolsrc / include / PackageSpec . h <nl> namespace vcpkg <nl> <nl> const PackageSpec & spec ( ) const { return m_spec ; } <nl> <nl> + std : : string to_string ( ) const ; <nl> + <nl> static std : : vector < FeatureSpec > from_strings_and_triplet ( const std : : vector < std : : string > & depends , <nl> const Triplet & t ) ; <nl> <nl> mmm a / toolsrc / src / PackageSpec . cpp <nl> ppp b / toolsrc / src / PackageSpec . cpp <nl> namespace vcpkg <nl> return ( c = = ' - ' ) | | isdigit ( c ) | | ( isalpha ( c ) & & islower ( c ) ) | | ( c = = ' [ ' ) | | ( c = = ' ] ' ) ; <nl> } <nl> <nl> + std : : string FeatureSpec : : to_string ( ) const <nl> + { <nl> + if ( feature ( ) . empty ( ) ) return spec ( ) . to_string ( ) ; <nl> + return Strings : : format ( " % s [ % s ] : % s " , name ( ) , feature ( ) , triplet ( ) ) ; <nl> + } <nl> + <nl> std : : vector < FeatureSpec > FeatureSpec : : from_strings_and_triplet ( const std : : vector < std : : string > & depends , <nl> const Triplet & triplet ) <nl> { <nl> namespace vcpkg <nl> } <nl> else <nl> { <nl> - Checks : : exit_with_message ( <nl> - VCPKG_LINE_INFO , " error while parsing feature list : % s : % s " , to_string ( maybe_spec . error ( ) ) , depend ) ; <nl> + Checks : : exit_with_message ( VCPKG_LINE_INFO , <nl> + " error while parsing feature list : % s : % s " , <nl> + vcpkg : : to_string ( maybe_spec . error ( ) ) , <nl> + depend ) ; <nl> } <nl> } <nl> return f_specs ; <nl> mmm a / toolsrc / src / test_install_plan . cpp <nl> ppp b / toolsrc / src / test_install_plan . cpp <nl> namespace UnitTest1 <nl> remove_plan_check ( & install_plan [ 1 ] , " b " ) ; <nl> <nl> / / TODO : order here may change but A < X , and B anywhere <nl> - features_check ( & install_plan [ 2 ] , " a " , { " core " } ) ; <nl> - features_check ( & install_plan [ 3 ] , " x " , { " core " } ) ; <nl> - features_check ( & install_plan [ 4 ] , " b " , { " core " , " 1 " } ) ; <nl> + features_check ( & install_plan [ 2 ] , " b " , { " core " , " 1 " } ) ; <nl> + features_check ( & install_plan [ 3 ] , " a " , { " core " } ) ; <nl> + features_check ( & install_plan [ 4 ] , " x " , { " core " } ) ; <nl> } <nl> <nl> TEST_METHOD ( basic_feature_test_8 ) <nl> mmm a / toolsrc / src / vcpkg_Dependencies . cpp <nl> ppp b / toolsrc / src / vcpkg_Dependencies . cpp <nl> namespace vcpkg : : Dependencies <nl> return toposort ; <nl> } <nl> <nl> - void mark_plus ( const std : : string & feature , Cluster & cluster , ClusterGraph & pkg_to_cluster , GraphPlan & graph_plan ) ; <nl> + enum class MarkPlusResult <nl> + { <nl> + FEATURE_NOT_FOUND , <nl> + SUCCESS , <nl> + } ; <nl> + <nl> + MarkPlusResult mark_plus ( const std : : string & feature , <nl> + Cluster & cluster , <nl> + ClusterGraph & pkg_to_cluster , <nl> + GraphPlan & graph_plan ) ; <nl> void mark_minus ( Cluster & cluster , ClusterGraph & pkg_to_cluster , GraphPlan & graph_plan ) ; <nl> <nl> - void mark_plus ( const std : : string & feature , Cluster & cluster , ClusterGraph & graph , GraphPlan & graph_plan ) <nl> + MarkPlusResult mark_plus ( const std : : string & feature , Cluster & cluster , ClusterGraph & graph , GraphPlan & graph_plan ) <nl> { <nl> if ( feature = = " " ) <nl> { <nl> / / Indicates that core was not specified in the reference <nl> return mark_plus ( " core " , cluster , graph , graph_plan ) ; <nl> } <nl> + <nl> auto it = cluster . edges . find ( feature ) ; <nl> - if ( it = = cluster . edges . end ( ) ) <nl> - { <nl> - Checks : : unreachable ( VCPKG_LINE_INFO ) ; <nl> - } <nl> + if ( it = = cluster . edges . end ( ) ) return MarkPlusResult : : FEATURE_NOT_FOUND ; <nl> <nl> - if ( cluster . edges [ feature ] . plus ) return ; <nl> + if ( cluster . edges [ feature ] . plus ) return MarkPlusResult : : SUCCESS ; <nl> <nl> if ( cluster . original_features . find ( feature ) = = cluster . original_features . end ( ) ) <nl> { <nl> namespace vcpkg : : Dependencies <nl> <nl> if ( ! cluster . transient_uninstalled ) <nl> { <nl> - return ; <nl> + return MarkPlusResult : : SUCCESS ; <nl> } <nl> cluster . edges [ feature ] . plus = true ; <nl> <nl> namespace vcpkg : : Dependencies <nl> if ( feature ! = " core " ) <nl> { <nl> / / All features implicitly depend on core <nl> - mark_plus ( " core " , cluster , graph , graph_plan ) ; <nl> + auto res = mark_plus ( " core " , cluster , graph , graph_plan ) ; <nl> + <nl> + / / Should be impossible for " core " to not exist <nl> + Checks : : check_exit ( VCPKG_LINE_INFO , res = = MarkPlusResult : : SUCCESS ) ; <nl> } <nl> <nl> for ( auto & & depend : cluster . edges [ feature ] . build_edges ) <nl> { <nl> auto & depend_cluster = graph . get ( depend . spec ( ) ) ; <nl> - mark_plus ( depend . feature ( ) , depend_cluster , graph , graph_plan ) ; <nl> + auto res = mark_plus ( depend . feature ( ) , depend_cluster , graph , graph_plan ) ; <nl> + <nl> + Checks : : check_exit ( VCPKG_LINE_INFO , <nl> + res = = MarkPlusResult : : SUCCESS , <nl> + " Error : Unable to satisfy dependency % s of % s " , <nl> + depend , <nl> + FeatureSpec ( cluster . spec , feature ) ) ; <nl> + <nl> if ( & depend_cluster = = & cluster ) continue ; <nl> graph_plan . install_graph . add_edge ( { & cluster } , { & depend_cluster } ) ; <nl> } <nl> + <nl> + return MarkPlusResult : : SUCCESS ; <nl> } <nl> <nl> void mark_minus ( Cluster & cluster , ClusterGraph & graph , GraphPlan & graph_plan ) <nl> namespace vcpkg : : Dependencies <nl> cluster . transient_uninstalled = true ; <nl> for ( auto & & original_feature : cluster . original_features ) <nl> { <nl> - mark_plus ( original_feature , cluster , graph , graph_plan ) ; <nl> + auto res = mark_plus ( original_feature , cluster , graph , graph_plan ) ; <nl> + if ( res ! = MarkPlusResult : : SUCCESS ) <nl> + { <nl> + System : : println ( System : : Color : : warning , <nl> + " Warning : could not reinstall feature % s " , <nl> + FeatureSpec { cluster . spec , original_feature } ) ; <nl> + } <nl> } <nl> } <nl> <nl> namespace vcpkg : : Dependencies <nl> { <nl> Cluster & spec_cluster = graph . get ( spec . spec ( ) ) ; <nl> spec_cluster . request_type = RequestType : : USER_REQUESTED ; <nl> - mark_plus ( spec . feature ( ) , spec_cluster , graph , graph_plan ) ; <nl> + auto res = mark_plus ( spec . feature ( ) , spec_cluster , graph , graph_plan ) ; <nl> + <nl> + Checks : : check_exit ( <nl> + VCPKG_LINE_INFO , res = = MarkPlusResult : : SUCCESS , " Error : Unable to locate feature % s " , spec ) ; <nl> + <nl> graph_plan . install_graph . add_vertex ( ClusterPtr { & spec_cluster } ) ; <nl> } <nl> <nl>
[ vcpkg ] Improve error messages when a feature is requested that doesn ' t exist .
microsoft/vcpkg
6784704638f46d89d01458b1004e588f535958aa
2017-08-22T04:08:43Z
mmm a / src / modules / connections - tree / iconproxy . h <nl> ppp b / src / modules / connections - tree / iconproxy . h <nl> <nl> - # ifndef ICONPROXY_H <nl> - # define ICONPROXY_H <nl> - <nl> + # pragma once <nl> # include < QIcon > <nl> # include < QString > <nl> # include < QSharedPointer > <nl> namespace ConnectionsTree { <nl> private : <nl> IconProxy ( ) ; <nl> } ; <nl> - <nl> } <nl> - <nl> - # endif / / ICONPROXY_H <nl> mmm a / src / modules / connections - tree / items / databaseitem . cpp <nl> ppp b / src / modules / connections - tree / items / databaseitem . cpp <nl> <nl> # include < QDebug > <nl> # include < QMenu > <nl> # include < QInputDialog > <nl> + # include " connections - tree / utils . h " <nl> <nl> using namespace ConnectionsTree ; <nl> <nl> void DatabaseItem : : onWheelClick ( TreeItem : : ParentView & ) <nl> <nl> QSharedPointer < QMenu > DatabaseItem : : getContextMenu ( TreeItem : : ParentView & treeView ) <nl> { <nl> - Q_UNUSED ( treeView ) ; <nl> QSharedPointer < QMenu > menu ( new QMenu ( ) ) ; <nl> - <nl> - / / new key action <nl> - QAction * newKey = new QAction ( QIcon ( " : / images / add . png " ) , " Add new key " , menu . data ( ) ) ; <nl> - QObject : : connect ( newKey , & QAction : : triggered , this , [ this ] ( ) { m_operations - > openNewKeyDialog ( m_index ) ; } ) ; <nl> - menu - > addAction ( newKey ) ; <nl> + menu - > addAction ( createMenuAction ( " : / images / add . png " , " Add new key " , menu . data ( ) , this , <nl> + [ this ] ( ) { m_operations - > openNewKeyDialog ( m_index ) ; } ) ) ; <nl> menu - > addSeparator ( ) ; <nl> <nl> - / / filter action <nl> - QAction * search = new QAction ( QIcon ( " : / images / filter . png " ) , " Filter keys " , menu . data ( ) ) ; <nl> - QObject : : connect ( search , & QAction : : triggered , this , [ this , & treeView ] ( ) { <nl> - QString text = QInputDialog : : getText ( treeView . getParentWidget ( ) , tr ( " Filter keys : " ) , <nl> - tr ( " Filter regex : " ) ) ; <nl> - if ( ! text . isEmpty ( ) ) <nl> - filterKeys ( QRegExp ( text ) ) ; <nl> - } ) ; <nl> - <nl> - QAction * reset = new QAction ( QIcon ( " : / images / clear . png " ) , " Reset keys filter " , menu . data ( ) ) ; <nl> - QObject : : connect ( reset , & QAction : : triggered , this , [ this ] ( ) { <nl> - resetFilter ( ) ; <nl> - } ) ; <nl> - <nl> if ( m_filter . isEmpty ( ) ) { <nl> - menu - > addAction ( search ) ; <nl> + menu - > addAction ( createMenuAction ( " : / images / filter . png " , " Filter keys " , menu . data ( ) , this , <nl> + [ this , & treeView ] ( ) <nl> + { <nl> + QString text = QInputDialog : : getText ( treeView . getParentWidget ( ) , <nl> + tr ( " Filter keys : " ) , <nl> + tr ( " Filter regex : " ) ) ; <nl> + if ( ! text . isEmpty ( ) ) filterKeys ( QRegExp ( text ) ) ; <nl> + } ) ) ; <nl> } else { <nl> - menu - > addAction ( reset ) ; <nl> + menu - > addAction ( createMenuAction ( " : / images / clear . png " , " Reset keys filter " , menu . data ( ) , this , <nl> + [ this ] ( ) { resetFilter ( ) ; } ) ) ; <nl> } <nl> menu - > addSeparator ( ) ; <nl> <nl> - / / reload action <nl> - QAction * reload = new QAction ( QIcon ( " : / images / refreshdb . png " ) , " Reload " , menu . data ( ) ) ; <nl> - QObject : : connect ( reload , & QAction : : triggered , this , [ this ] { this - > reload ( ) ; } ) ; <nl> - menu - > addAction ( reload ) ; <nl> - <nl> + menu - > addAction ( createMenuAction ( " : / images / refreshdb . png " , " Reload " , menu . data ( ) , this , <nl> + [ this ] { this - > reload ( ) ; } ) ) ; <nl> return menu ; <nl> } <nl> <nl> mmm a / src / modules / connections - tree / items / keyitem . cpp <nl> ppp b / src / modules / connections - tree / items / keyitem . cpp <nl> <nl> # include " keyitem . h " <nl> - # include " connections - tree / iconproxy . h " <nl> # include < QMenu > <nl> <nl> + # include " connections - tree / iconproxy . h " <nl> + # include " connections - tree / utils . h " <nl> + <nl> + <nl> using namespace ConnectionsTree ; <nl> <nl> KeyItem : : KeyItem ( const QString & fullPath , unsigned short dbIndex , QSharedPointer < Operations > operations , QWeakPointer < TreeItem > parent ) <nl> QSharedPointer < QMenu > KeyItem : : getContextMenu ( ParentView & ) <nl> { <nl> QSharedPointer < QMenu > menu ( new QMenu ( ) ) ; <nl> <nl> - QAction * openKey = new QAction ( QIcon ( " : / images / add . png " ) , " Open key " , menu . data ( ) ) ; <nl> - QObject : : connect ( openKey , & QAction : : triggered , [ this ] { m_operations - > openKeyTab ( * this , false ) ; } ) ; <nl> - menu - > addAction ( openKey ) ; <nl> + if ( ! m_signalReciever ) { <nl> + m_signalReciever = QSharedPointer < QObject > ( new QObject ( ) ) ; <nl> + } <nl> <nl> - QAction * openInNewTab = new QAction ( QIcon ( " : / images / add . png " ) , " Open key value in new tab " , menu . data ( ) ) ; <nl> - QObject : : connect ( openInNewTab , & QAction : : triggered , [ this ] { m_operations - > openKeyTab ( * this , true ) ; } ) ; <nl> - menu - > addAction ( openInNewTab ) ; <nl> + menu - > addAction ( createMenuAction ( " : / images / add . png " , " Open key " , menu . data ( ) , m_signalReciever . data ( ) , <nl> + [ this ] { m_operations - > openKeyTab ( * this , false ) ; } ) ) ; <nl> <nl> + menu - > addAction ( createMenuAction ( " : / images / add . png " , " Open key value in new tab " , menu . data ( ) , m_signalReciever . data ( ) , <nl> + [ this ] { m_operations - > openKeyTab ( * this , true ) ; } ) ) ; <nl> return menu ; <nl> } <nl> <nl> mmm a / src / modules / connections - tree / items / keyitem . h <nl> ppp b / src / modules / connections - tree / items / keyitem . h <nl> namespace ConnectionsTree { <nl> QString m_fullPath ; <nl> unsigned short int m_dbIndex ; <nl> QSharedPointer < Operations > m_operations ; <nl> - QWeakPointer < TreeItem > m_parent ; <nl> + QWeakPointer < TreeItem > m_parent ; <nl> + QSharedPointer < QObject > m_signalReciever ; <nl> bool m_removed ; <nl> } ; <nl> <nl> mmm a / src / modules / connections - tree / items / namespaceitem . h <nl> ppp b / src / modules / connections - tree / items / namespaceitem . h <nl> <nl> - # ifndef NAMESPACEITEM_H <nl> - # define NAMESPACEITEM_H <nl> - <nl> + # pragma once <nl> # include " treeitem . h " <nl> # include " connections - tree / operations . h " <nl> <nl> namespace ConnectionsTree { <nl> bool m_locked ; <nl> QList < QSharedPointer < TreeItem > > m_childItems ; <nl> } ; <nl> - <nl> } <nl> - # endif / / NAMESPACEITEM_H <nl> mmm a / src / modules / connections - tree / items / serveritem . cpp <nl> ppp b / src / modules / connections - tree / items / serveritem . cpp <nl> <nl> # include " serveritem . h " <nl> - # include " connections - tree / iconproxy . h " <nl> - # include " databaseitem . h " <nl> # include < QAction > <nl> # include < QMenu > <nl> - # include < QMessageBox > <nl> # include < functional > <nl> # include < QDebug > <nl> # include < algorithm > <nl> + # include < QMessageBox > <nl> + <nl> + # include " connections - tree / iconproxy . h " <nl> + # include " connections - tree / utils . h " <nl> + # include " databaseitem . h " <nl> <nl> using namespace ConnectionsTree ; <nl> <nl> bool ServerItem : : onClick ( TreeItem : : ParentView & view ) <nl> try { <nl> load ( ) ; <nl> } catch ( . . . ) { <nl> - QMessageBox : : warning ( <nl> - view . getParentWidget ( ) , <nl> - " Server error " , <nl> - " Cannot load databases list . " <nl> - ) ; <nl> + QMessageBox : : warning ( view . getParentWidget ( ) , tr ( " Server error " ) , <nl> + tr ( " Cannot load databases list . " ) ) ; <nl> m_locked = false ; <nl> } <nl> <nl> void ServerItem : : setRow ( int r ) <nl> <nl> QSharedPointer < QMenu > ServerItem : : getContextMenu ( TreeItem : : ParentView & treeView ) <nl> { <nl> - QSharedPointer < QMenu > menu ( new QMenu ( ) ) ; <nl> - <nl> - / / console action <nl> - QAction * console = new QAction ( QIcon ( " : / images / terminal . png " ) , " Console " , menu . data ( ) ) ; <nl> - QObject : : connect ( console , & QAction : : triggered , this , [ this ] ( ) { m_operations - > openConsoleTab ( ) ; } ) ; <nl> - menu - > addAction ( console ) ; <nl> + QSharedPointer < QMenu > menu ( new QMenu ( ) ) ; <nl> + menu - > addAction ( createMenuAction ( " : / images / terminal . png " , " Console " , menu . data ( ) , this , <nl> + [ this ] ( ) { m_operations - > openConsoleTab ( ) ; } ) ) ; <nl> menu - > addSeparator ( ) ; <nl> <nl> - / / reload action <nl> - QAction * reload = new QAction ( QIcon ( " : / images / refreshdb . png " ) , " Reload " , menu . data ( ) ) ; <nl> - QObject : : connect ( reload , & QAction : : triggered , this , [ this ] { this - > reload ( ) ; } ) ; <nl> - menu - > addAction ( reload ) ; <nl> - <nl> - / / disconnect action <nl> - QAction * disconnect = new QAction ( QIcon ( " : / images / redisIcon_offline . png " ) , " Disconnect " , menu . data ( ) ) ; <nl> - QObject : : connect ( disconnect , & QAction : : triggered , this , [ this ] { unload ( ) ; } ) ; <nl> - menu - > addAction ( disconnect ) ; <nl> - menu - > addSeparator ( ) ; <nl> + menu - > addAction ( createMenuAction ( " : / images / refreshdb . png " , " Reload " , menu . data ( ) , this , <nl> + [ this ] { this - > reload ( ) ; } ) ) ; <nl> <nl> - / / edit action <nl> - QAction * edit = new QAction ( QIcon ( " : / images / editdb . png " ) , " Edit " , menu . data ( ) ) ; <nl> - QObject : : connect ( edit , & QAction : : triggered , this , [ this , & treeView ] { <nl> + menu - > addAction ( createMenuAction ( " : / images / redisIcon_offline . png " , " Disconnect " , menu . data ( ) , this , <nl> + [ this ] { unload ( ) ; } ) ) ; <nl> <nl> - QMessageBox : : StandardButton reply = QMessageBox : : question ( <nl> - treeView . getParentWidget ( ) , " Confirm action " , <nl> - " All value and console tabs related to this " <nl> - " connection will be closed . Do you want to continue ? " , <nl> - QMessageBox : : Yes | QMessageBox : : No ) ; <nl> - <nl> - if ( reply = = QMessageBox : : Yes ) { <nl> + menu - > addSeparator ( ) ; <nl> + menu - > addAction ( createMenuAction ( " : / images / editdb . png " , " Edit " , menu . data ( ) , this , <nl> + [ this , & treeView ] <nl> + { <nl> + confirmAction ( treeView . getParentWidget ( ) , <nl> + tr ( " All value and console tabs related to this " <nl> + " connection will be closed . Do you want to continue ? " ) , <nl> + [ this ] ( ) <nl> + { <nl> unload ( ) ; <nl> emit editActionRequested ( ) ; <nl> - } <nl> - } ) ; <nl> - menu - > addAction ( edit ) ; <nl> - <nl> - / / delete action <nl> - QAction * del = new QAction ( QIcon ( " : / images / delete . png " ) , " Delete " , menu . data ( ) ) ; <nl> - QObject : : connect ( del , & QAction : : triggered , this , [ this , & treeView ] { <nl> - <nl> - QMessageBox : : StandardButton reply = QMessageBox : : question ( <nl> - treeView . getParentWidget ( ) , " Confirm action " , <nl> - " Do you really want delete connection ? " , <nl> - QMessageBox : : Yes | QMessageBox : : No ) ; <nl> - <nl> - if ( reply = = QMessageBox : : Yes ) { <nl> - unload ( ) ; <nl> - emit deleteActionRequested ( ) ; <nl> - } <nl> - } ) ; <nl> - menu - > addAction ( del ) ; <nl> + } ) ; <nl> + } ) ) ; <nl> + <nl> + / / delete action <nl> + menu - > addAction ( createMenuAction ( " : / images / delete . png " , " Delete " , menu . data ( ) , this , <nl> + [ this , & treeView ] <nl> + { <nl> + confirmAction ( treeView . getParentWidget ( ) , <nl> + tr ( " Do you really want delete connection ? " ) , <nl> + [ this ] ( ) <nl> + { <nl> + unload ( ) ; <nl> + emit deleteActionRequested ( ) ; <nl> + } ) ; <nl> + } ) ) ; <nl> <nl> return menu ; <nl> } <nl> mmm a / src / modules / connections - tree / items / serveritem . h <nl> ppp b / src / modules / connections - tree / items / serveritem . h <nl> namespace ConnectionsTree { <nl> class ServerItem : public QObject , public TreeItem <nl> { <nl> Q_OBJECT <nl> - <nl> public : <nl> ServerItem ( const QString & name , QSharedPointer < Operations > operations , <nl> const Model & model ) ; <nl> mmm a / src / modules / connections - tree / items / treeitem . h <nl> ppp b / src / modules / connections - tree / items / treeitem . h <nl> <nl> - # ifndef TREEITEM_H <nl> - # define TREEITEM_H <nl> - <nl> - # define QT_SHAREDPOINTER_TRACK_POINTERS <nl> + # pragma once <nl> + # include < functional > <nl> # include < QSharedPointer > <nl> # include < QWeakPointer > <nl> # include < QString > <nl> # include < QIcon > <nl> # include < QList > <nl> # include < QWidget > <nl> - <nl> - class QMenu ; <nl> + # include < QMenu > <nl> <nl> namespace ConnectionsTree { <nl> <nl> class TreeItem { <nl> <nl> virtual ~ TreeItem ( ) { } <nl> } ; <nl> + <nl> } <nl> - # endif / / TREEITEM_H <nl> mmm a / src / modules / connections - tree / model . h <nl> ppp b / src / modules / connections - tree / model . h <nl> <nl> # pragma once <nl> - <nl> # include < QAbstractItemModel > <nl> # include < QList > <nl> # include < QVariant > <nl> mmm a / src / modules / connections - tree / operations . h <nl> ppp b / src / modules / connections - tree / operations . h <nl> <nl> - # ifndef OPERATIONS_H <nl> - # define OPERATIONS_H <nl> - <nl> + # pragma once <nl> # include < QString > <nl> # include < QHash > <nl> # include < QSharedPointer > <nl> namespace ConnectionsTree { <nl> <nl> } ; <nl> } <nl> - <nl> - <nl> - # endif / / OPERATIONS_H <nl> new file mode 100644 <nl> index 00000000 . . 0a5b4b44 <nl> mmm / dev / null <nl> ppp b / src / modules / connections - tree / utils . cpp <nl> <nl> + # include " utils . h " <nl> + # include < QMessageBox > <nl> + # include < qtranslator . h > <nl> + <nl> + QAction * ConnectionsTree : : createMenuAction ( const QString & iconRef , const QString & title , QMenu * parent , QObject * owner , std : : function < void ( ) > callback ) <nl> + { <nl> + QAction * action = new QAction ( QIcon ( iconRef ) , title , parent ) ; <nl> + QObject : : connect ( action , & QAction : : triggered , owner , callback ) ; <nl> + return action ; <nl> + } <nl> + <nl> + <nl> + void ConnectionsTree : : confirmAction ( QWidget * parent , const QString & msg , <nl> + std : : function < void ( ) > action ) <nl> + { <nl> + QMessageBox : : StandardButton reply = QMessageBox : : question ( parent , " Confirm action " , <nl> + msg , QMessageBox : : Yes | QMessageBox : : No ) ; <nl> + if ( reply = = QMessageBox : : Yes ) { <nl> + action ( ) ; <nl> + } <nl> + } <nl> new file mode 100644 <nl> index 00000000 . . 7df0c3d7 <nl> mmm / dev / null <nl> ppp b / src / modules / connections - tree / utils . h <nl> <nl> + # pragma once <nl> + # include < functional > <nl> + # include < QMenu > <nl> + # include < QWidget > <nl> + <nl> + namespace ConnectionsTree { <nl> + <nl> + QAction * createMenuAction ( const QString & iconRef , const QString & title , <nl> + QMenu * parent , QObject * owner , std : : function < void ( ) > callback ) ; <nl> + <nl> + void confirmAction ( QWidget * parent , const QString & msg , std : : function < void ( ) > action ) ; <nl> + <nl> + } <nl>
Clean - up connections tree module
uglide/RedisDesktopManager
a1f55fdd2fc383593ca362635863e7d6f6fdb75f
2015-07-30T07:40:05Z
mmm a / tensorflow / compiler / jit / mark_for_compilation_pass . cc <nl> ppp b / tensorflow / compiler / jit / mark_for_compilation_pass . cc <nl> Status MarkForCompilationPass : : Run ( <nl> VLOG ( 1 ) < < " flags - > tf_xla_auto_jit = " < < flags - > tf_xla_auto_jit ; <nl> const FunctionLibraryDefinition * fld = options . flib_def ; <nl> <nl> + / / Deadness analysis expects a graph with source and sink edges properly <nl> + / / connected but sometimes the incoming graph does not follow this invariant . <nl> + / / So fix up the source and sink edges before calling into deadness analysis . <nl> + FixupSourceAndSinkEdges ( options . graph - > get ( ) ) ; <nl> + <nl> std : : unique_ptr < DeadnessAnalysis > deadness ; <nl> { <nl> XLA_SCOPED_LOGGING_TIMER_LEVEL ( " DeadnessAnalysis " , 1 ) ; <nl>
Be resilient towards graphs without source / sink connectivity .
tensorflow/tensorflow
0b3c3c55e177b35d38ba33170ebe2baa3f5badff
2019-01-10T20:56:21Z
mmm a / src / util . cc <nl> ppp b / src / util . cc <nl> std : : string getHomeDir ( ) <nl> <nl> int64_t getRealSize ( const std : : string & sizeWithUnit ) <nl> { <nl> - std : : string : : size_type p = sizeWithUnit . find_first_of ( " KM " ) ; <nl> + std : : string : : size_type p = sizeWithUnit . find_first_of ( " KMkm " ) ; <nl> std : : string size ; <nl> int32_t mult = 1 ; <nl> if ( p = = std : : string : : npos ) { <nl> size = sizeWithUnit ; <nl> } else { <nl> - if ( sizeWithUnit [ p ] = = ' K ' ) { <nl> + switch ( sizeWithUnit [ p ] ) { <nl> + case ' K ' : <nl> + case ' k ' : <nl> mult = 1024 ; <nl> - } else if ( sizeWithUnit [ p ] = = ' M ' ) { <nl> + break ; <nl> + case ' M ' : <nl> + case ' m ' : <nl> mult = 1024 * 1024 ; <nl> + break ; <nl> } <nl> size . assign ( sizeWithUnit . begin ( ) , sizeWithUnit . begin ( ) + p ) ; <nl> } <nl> mmm a / test / UtilTest . cc <nl> ppp b / test / UtilTest . cc <nl> void UtilTest : : testGetRealSize ( ) <nl> { <nl> CPPUNIT_ASSERT_EQUAL ( ( int64_t ) 4294967296LL , util : : getRealSize ( " 4096M " ) ) ; <nl> CPPUNIT_ASSERT_EQUAL ( ( int64_t ) 1024 , util : : getRealSize ( " 1K " ) ) ; <nl> + CPPUNIT_ASSERT_EQUAL ( ( int64_t ) 4294967296LL , util : : getRealSize ( " 4096m " ) ) ; <nl> + CPPUNIT_ASSERT_EQUAL ( ( int64_t ) 1024 , util : : getRealSize ( " 1k " ) ) ; <nl> try { <nl> util : : getRealSize ( " " ) ; <nl> CPPUNIT_FAIL ( " exception must be thrown . " ) ; <nl>
Accept k and m as well as K and M in util : : getRealSize ( )
aria2/aria2
6a976a4118b230eb3f579965f300cec8c9f2e1e0
2013-01-15T12:36:25Z
mmm a / src / wasm / wasm - code - manager . cc <nl> ppp b / src / wasm / wasm - code - manager . cc <nl> void WasmCode : : Validate ( ) const { <nl> switch ( mode ) { <nl> case RelocInfo : : WASM_CALL : { <nl> Address target = it . rinfo ( ) - > wasm_call_address ( ) ; <nl> - DCHECK ( native_module_ - > is_jump_table_slot ( target ) ) ; <nl> + WasmCode * code = native_module_ - > Lookup ( target ) ; <nl> + CHECK_NOT_NULL ( code ) ; <nl> + CHECK_EQ ( WasmCode : : kJumpTable , code - > kind ( ) ) ; <nl> + CHECK ( code - > contains ( target ) ) ; <nl> break ; <nl> } <nl> case RelocInfo : : WASM_STUB_CALL : { <nl> std : : unique_ptr < WasmCode > NativeModule : : AddCodeWithCodeSpace ( <nl> RelocInfo : : Mode mode = it . rinfo ( ) - > rmode ( ) ; <nl> if ( RelocInfo : : IsWasmCall ( mode ) ) { <nl> uint32_t call_tag = it . rinfo ( ) - > wasm_call_tag ( ) ; <nl> - Address target = GetCallTargetForFunction ( call_tag ) ; <nl> + Address target = GetNearCallTargetForFunction ( call_tag , code_start ) ; <nl> it . rinfo ( ) - > set_wasm_call_address ( target , SKIP_ICACHE_FLUSH ) ; <nl> } else if ( RelocInfo : : IsWasmStubCall ( mode ) ) { <nl> uint32_t stub_call_tag = it . rinfo ( ) - > wasm_call_tag ( ) ; <nl> Address NativeModule : : GetCallTargetForFunction ( uint32_t func_index ) const { <nl> return main_jump_table_ - > instruction_start ( ) + slot_offset ; <nl> } <nl> <nl> + Address NativeModule : : GetNearCallTargetForFunction ( uint32_t func_index , <nl> + Address near_to ) const { <nl> + uint32_t slot_offset = GetJumpTableOffset ( func_index ) ; <nl> + base : : MutexGuard guard ( & allocation_mutex_ ) ; <nl> + for ( auto & code_space_data : code_space_data_ ) { <nl> + const bool jump_table_reachable = ! kNeedsFarJumpsBetweenCodeSpaces | | <nl> + code_space_data . region . contains ( near_to ) ; <nl> + if ( jump_table_reachable & & code_space_data . jump_table ) { <nl> + DCHECK_LT ( slot_offset , code_space_data . jump_table - > instructions ( ) . size ( ) ) ; <nl> + return code_space_data . jump_table - > instruction_start ( ) + slot_offset ; <nl> + } <nl> + } <nl> + FATAL ( " near_to is not part of a code space " ) ; <nl> + } <nl> + <nl> Address NativeModule : : GetNearRuntimeStubEntry ( WasmCode : : RuntimeStubId index , <nl> Address near_to ) const { <nl> base : : MutexGuard guard ( & allocation_mutex_ ) ; <nl> Address NativeModule : : GetNearRuntimeStubEntry ( WasmCode : : RuntimeStubId index , <nl> <nl> uint32_t NativeModule : : GetFunctionIndexFromJumpTableSlot ( <nl> Address slot_address ) const { <nl> - DCHECK ( is_jump_table_slot ( slot_address ) ) ; <nl> - uint32_t slot_offset = static_cast < uint32_t > ( <nl> - slot_address - main_jump_table_ - > instruction_start ( ) ) ; <nl> + WasmCodeRefScope code_refs ; <nl> + WasmCode * code = Lookup ( slot_address ) ; <nl> + DCHECK_NOT_NULL ( code ) ; <nl> + DCHECK_EQ ( WasmCode : : kJumpTable , code - > kind ( ) ) ; <nl> + uint32_t slot_offset = <nl> + static_cast < uint32_t > ( slot_address - code - > instruction_start ( ) ) ; <nl> uint32_t slot_idx = JumpTableAssembler : : SlotOffsetToIndex ( slot_offset ) ; <nl> DCHECK_LT ( slot_idx , module_ - > num_declared_functions ) ; <nl> + DCHECK_EQ ( slot_address , <nl> + code - > instruction_start ( ) + <nl> + JumpTableAssembler : : JumpSlotIndexToOffset ( slot_idx ) ) ; <nl> return module_ - > num_imported_functions + slot_idx ; <nl> } <nl> <nl> mmm a / src / wasm / wasm - code - manager . h <nl> ppp b / src / wasm / wasm - code - manager . h <nl> class WasmCodeAllocator { <nl> <nl> bool is_executable_ = false ; <nl> <nl> + / / TODO ( clemensh ) : Remove this field once multiple code spaces are supported <nl> + / / everywhere . <nl> const bool can_request_more_memory_ ; <nl> <nl> std : : shared_ptr < Counters > async_counters_ ; <nl> class V8_EXPORT_PRIVATE NativeModule final { <nl> <nl> uint32_t GetJumpTableOffset ( uint32_t func_index ) const ; <nl> <nl> - bool is_jump_table_slot ( Address address ) const { <nl> - return main_jump_table_ - > contains ( address ) ; <nl> - } <nl> - <nl> / / Returns the canonical target to call for the given function ( the slot in <nl> / / the first jump table ) . <nl> Address GetCallTargetForFunction ( uint32_t func_index ) const ; <nl> <nl> + / / Similarly to { GetCallTargetForFunction } , but ensures that the returned <nl> + / / address is near to the { near_to } address by finding the closest jump table . <nl> + Address GetNearCallTargetForFunction ( uint32_t func_index , <nl> + Address near_to ) const ; <nl> + <nl> / / Get a runtime stub entry ( which is a far jump table slot ) within near - call <nl> / / distance to { near_to } . Fails if { near_to } is not part of any code space of <nl> / / this module . <nl> Address GetNearRuntimeStubEntry ( WasmCode : : RuntimeStubId index , <nl> Address near_to ) const ; <nl> <nl> - / / Reverse lookup from a given call target ( i . e . a jump table slot as the <nl> - / / above { GetCallTargetForFunction } returns ) to a function index . <nl> + / / Reverse lookup from a given call target ( which must be a jump table slot ) <nl> + / / to a function index . <nl> uint32_t GetFunctionIndexFromJumpTableSlot ( Address slot_address ) const ; <nl> <nl> bool SetExecutable ( bool executable ) { <nl> mmm a / src / wasm / wasm - interpreter . cc <nl> ppp b / src / wasm / wasm - interpreter . cc <nl> class ThreadImpl { <nl> static WasmCode * GetTargetCode ( Isolate * isolate , Address target ) { <nl> WasmCodeManager * code_manager = isolate - > wasm_engine ( ) - > code_manager ( ) ; <nl> NativeModule * native_module = code_manager - > LookupNativeModule ( target ) ; <nl> - if ( native_module - > is_jump_table_slot ( target ) ) { <nl> + WasmCode * code = native_module - > Lookup ( target ) ; <nl> + if ( code - > kind ( ) = = WasmCode : : kJumpTable ) { <nl> uint32_t func_index = <nl> native_module - > GetFunctionIndexFromJumpTableSlot ( target ) ; <nl> <nl> class ThreadImpl { <nl> <nl> return native_module - > GetCode ( func_index ) ; <nl> } <nl> - WasmCode * code = native_module - > Lookup ( target ) ; <nl> DCHECK_EQ ( code - > instruction_start ( ) , target ) ; <nl> return code ; <nl> } <nl> mmm a / src / wasm / wasm - serialization . cc <nl> ppp b / src / wasm / wasm - serialization . cc <nl> bool NativeModuleDeserializer : : ReadCode ( uint32_t fn_index , Reader * reader ) { <nl> switch ( mode ) { <nl> case RelocInfo : : WASM_CALL : { <nl> uint32_t tag = GetWasmCalleeTag ( iter . rinfo ( ) ) ; <nl> - Address target = native_module_ - > GetCallTargetForFunction ( tag ) ; <nl> + Address target = native_module_ - > GetNearCallTargetForFunction ( <nl> + tag , code - > instruction_start ( ) ) ; <nl> iter . rinfo ( ) - > set_wasm_call_address ( target , SKIP_ICACHE_FLUSH ) ; <nl> break ; <nl> } <nl>
[ wasm ] Prepare for multiple jump tables
v8/v8
4d97099c65e934f7e656bdcd4e00269211501ce9
2019-09-13T15:27:43Z
mmm a / include / swift / AST / Attr . h <nl> ppp b / include / swift / AST / Attr . h <nl> class InfixData { <nl> } <nl> } ; <nl> <nl> + namespace IntrinsicPrecedences { <nl> + enum : unsigned char { <nl> + MinPrecedence = 0 , <nl> + IfExpr = 100 , / / ? : <nl> + AssignExpr = 90 , / / = <nl> + ExplicitCastExpr = 132 , / / ' is ' and ' as ' <nl> + MaxPrecedence = 255 <nl> + } ; <nl> + } <nl> + <nl> / / / ABI resilience . Language structures are resilient if the details <nl> / / / of their implementation may be changed without requiring <nl> / / / associated code to be reprocessed . Different structures are resilient <nl> mmm a / lib / Sema / CSApply . cpp <nl> ppp b / lib / Sema / CSApply . cpp <nl> static bool diagnoseRelabel ( TypeChecker & tc , Expr * expr , <nl> return true ; <nl> } <nl> <nl> + / / Return the precedence - yielding parent of ' expr ' , along with the index of <nl> + / / ' expr ' as the child of that parent . The precedence - yielding parent is the <nl> + / / nearest ancestor of ' expr ' which imposes a minimum precedence on ' expr ' . <nl> + / / Right now that just means skipping over TupleExpr instances that only exist <nl> + / / to hold arguments to binary operators . <nl> + static std : : pair < Expr * , unsigned > getPrecedenceParentAndIndex ( Expr * expr , <nl> + Expr * rootExpr ) <nl> + { <nl> + auto parentMap = rootExpr - > getParentMap ( ) ; <nl> + auto it = parentMap . find ( expr ) ; <nl> + if ( it = = parentMap . end ( ) ) { <nl> + return { nullptr , 0 } ; <nl> + } <nl> + Expr * parent = it - > second ; <nl> + <nl> + / / Handle all cases where the answer isn ' t just going to be { parent , 0 } . <nl> + if ( auto tuple = dyn_cast < TupleExpr > ( parent ) ) { <nl> + / / Get index of expression in tuple . <nl> + auto tupleElems = tuple - > getElements ( ) ; <nl> + auto elemIt = std : : find ( tupleElems . begin ( ) , tupleElems . end ( ) , expr ) ; <nl> + assert ( elemIt ! = tupleElems . end ( ) & & " expr not found in parent TupleExpr " ) ; <nl> + unsigned index = elemIt - tupleElems . begin ( ) ; <nl> + <nl> + it = parentMap . find ( parent ) ; <nl> + if ( it ! = parentMap . end ( ) ) { <nl> + Expr * gparent = it - > second ; <nl> + <nl> + / / Was this tuple just constructed for a binop ? <nl> + if ( isa < BinaryExpr > ( gparent ) ) { <nl> + return { gparent , index } ; <nl> + } <nl> + } <nl> + <nl> + / / Must be a tuple literal , function arg list , collection , etc . <nl> + return { parent , index } ; <nl> + } else if ( auto ifExpr = dyn_cast < IfExpr > ( parent ) ) { <nl> + unsigned index ; <nl> + if ( expr = = ifExpr - > getCondExpr ( ) ) { <nl> + index = 0 ; <nl> + } else if ( expr = = ifExpr - > getThenExpr ( ) ) { <nl> + index = 1 ; <nl> + } else if ( expr = = ifExpr - > getElseExpr ( ) ) { <nl> + index = 2 ; <nl> + } else { <nl> + llvm_unreachable ( " expr not found in parent IfExpr " ) ; <nl> + } <nl> + return { ifExpr , index } ; <nl> + } else if ( auto assignExpr = dyn_cast < AssignExpr > ( parent ) ) { <nl> + unsigned index ; <nl> + if ( expr = = assignExpr - > getSrc ( ) ) { <nl> + index = 0 ; <nl> + } else if ( expr = = assignExpr - > getDest ( ) ) { <nl> + index = 1 ; <nl> + } else { <nl> + llvm_unreachable ( " expr not found in parent AssignExpr " ) ; <nl> + } <nl> + return { assignExpr , index } ; <nl> + } <nl> + <nl> + return { parent , 0 } ; <nl> + } <nl> + <nl> + / / Return infix data representing the precedence of E . <nl> + / / FIXME : unify this with getInfixData ( ) in lib / Sema / TypeCheckExpr . cpp ; the <nl> + / / function there is meant to return infix data for expressions that have not <nl> + / / yet been folded , so currently the correct behavor for this infixData ( ) and <nl> + / / that one are mutually exclusive . <nl> + static InfixData getInfixData ( DeclContext * DC , Expr * E ) { <nl> + assert ( E ) ; <nl> + if ( isa < IfExpr > ( E ) ) { <nl> + return InfixData ( IntrinsicPrecedences : : IfExpr , <nl> + Associativity : : Right , <nl> + / * assignment * / false ) ; <nl> + } else if ( isa < AssignExpr > ( E ) ) { <nl> + return InfixData ( IntrinsicPrecedences : : AssignExpr , <nl> + Associativity : : Right , <nl> + / * assignment * / true ) ; <nl> + } else if ( isa < ExplicitCastExpr > ( E ) ) { <nl> + return InfixData ( IntrinsicPrecedences : : ExplicitCastExpr , <nl> + Associativity : : None , <nl> + / * assignment * / false ) ; <nl> + } else if ( auto * binary = dyn_cast < BinaryExpr > ( E ) ) { <nl> + auto * fn = binary - > getFn ( ) ; <nl> + if ( auto * DRE = dyn_cast < DeclRefExpr > ( fn ) ) { <nl> + SourceFile * SF = DC - > getParentSourceFile ( ) ; <nl> + Identifier name = DRE - > getDecl ( ) - > getName ( ) ; <nl> + bool isCascading = DC - > isCascadingContextForLookup ( true ) ; <nl> + if ( InfixOperatorDecl * op = SF - > lookupInfixOperator ( name , isCascading , <nl> + E - > getLoc ( ) ) ) <nl> + return op - > getInfixData ( ) ; <nl> + } else if ( auto * OO = dyn_cast < OverloadedDeclRefExpr > ( fn ) ) { <nl> + SourceFile * SF = DC - > getParentSourceFile ( ) ; <nl> + Identifier name = OO - > getDecls ( ) [ 0 ] - > getName ( ) ; <nl> + bool isCascading = DC - > isCascadingContextForLookup ( true ) ; <nl> + if ( InfixOperatorDecl * op = SF - > lookupInfixOperator ( name , isCascading , <nl> + E - > getLoc ( ) ) ) <nl> + return op - > getInfixData ( ) ; <nl> + } <nl> + } <nl> + <nl> + return InfixData ( IntrinsicPrecedences : : MaxPrecedence , <nl> + Associativity : : Left , <nl> + / * assignment * / false ) ; <nl> + } <nl> + <nl> + / / Return the minimum precedence that an expression in the place of ' expr ' must <nl> + / / have without needing to be surrounded by parentheses . <nl> + static unsigned char getMinPrecedenceForExpr ( DeclContext * DC , Expr * expr , <nl> + Expr * rootExpr ) { <nl> + Expr * parent ; <nl> + unsigned index ; <nl> + std : : tie ( parent , index ) = getPrecedenceParentAndIndex ( expr , rootExpr ) ; <nl> + if ( ! parent | | isa < TupleExpr > ( parent ) | | isa < ParenExpr > ( parent ) ) { <nl> + return IntrinsicPrecedences : : MinPrecedence ; <nl> + } else if ( isa < BinaryExpr > ( parent ) | | isa < IfExpr > ( parent ) | | <nl> + isa < AssignExpr > ( parent ) | | isa < ExplicitCastExpr > ( parent ) ) { <nl> + auto infixData = getInfixData ( DC , parent ) ; <nl> + unsigned result = infixData . getPrecedence ( ) ; <nl> + if ( result < IntrinsicPrecedences : : MaxPrecedence & & <nl> + ( ( index = = 0 & & ! infixData . isLeftAssociative ( ) ) | | <nl> + ( index > 0 & & ! infixData . isRightAssociative ( ) ) ) ) { <nl> + result + + ; <nl> + } <nl> + return result ; <nl> + } else { <nl> + return IntrinsicPrecedences : : MaxPrecedence ; <nl> + } <nl> + } <nl> + <nl> + / / Return true if , when replacing " < expr > " with " < expr > as T " , parentheses need <nl> + / / to be added around the new expression in order to maintain the correct <nl> + / / precedence . <nl> + static bool exprNeedsParensWhenAddingAs ( DeclContext * DC , Expr * expr , <nl> + Expr * rootExpr ) { <nl> + return ( IntrinsicPrecedences : : ExplicitCastExpr < <nl> + getMinPrecedenceForExpr ( DC , expr , rootExpr ) ) ; <nl> + } <nl> + <nl> / / / \ brief Apply a given solution to the expression , producing a fully <nl> / / / type - checked expression . <nl> Expr * ConstraintSystem : : applySolution ( Solution & solution , Expr * expr , <nl> Expr * ConstraintSystem : : applySolution ( Solution & solution , Expr * expr , <nl> SourceLoc afterAffectedLoc <nl> = Lexer : : getLocForEndOfToken ( TC . Context . SourceMgr , <nl> affected - > getEndLoc ( ) ) ; <nl> + bool needsParens = exprNeedsParensWhenAddingAs ( DC , affected , expr ) ; <nl> if ( TC . isExplicitlyConvertibleTo ( fromType , toType , DC ) ) { <nl> llvm : : SmallString < 32 > asCastStr ; <nl> asCastStr + = " as " ; <nl> asCastStr + = toType . getString ( ) ; <nl> - TC . diagnose ( affected - > getLoc ( ) , diag : : missing_explicit_conversion , <nl> - fromType , toType ) <nl> - . fixItInsert ( afterAffectedLoc , asCastStr ) ; <nl> + auto diagnosis = TC . diagnose ( affected - > getLoc ( ) , <nl> + diag : : missing_explicit_conversion , <nl> + fromType , toType ) ; <nl> + if ( needsParens ) { <nl> + diagnosis . fixItInsert ( affected - > getStartLoc ( ) , " ( " ) ; <nl> + asCastStr + = " ) " ; <nl> + } <nl> + diagnosis . fixItInsert ( afterAffectedLoc , asCastStr ) ; <nl> } else { <nl> llvm : : SmallString < 32 > asCastStr ; <nl> asCastStr + = " as ! " ; <nl> asCastStr + = toType . getString ( ) ; <nl> - TC . diagnose ( affected - > getLoc ( ) , diag : : missing_forced_downcast , <nl> - fromType , toType ) <nl> - . fixItInsert ( afterAffectedLoc , asCastStr ) ; <nl> + auto diagnosis = TC . diagnose ( affected - > getLoc ( ) , <nl> + diag : : missing_forced_downcast , <nl> + fromType , toType ) ; <nl> + if ( needsParens ) { <nl> + diagnosis . fixItInsert ( affected - > getStartLoc ( ) , " ( " ) ; <nl> + asCastStr + = " ) " ; <nl> + } <nl> + diagnosis . fixItInsert ( afterAffectedLoc , asCastStr ) ; <nl> } <nl> <nl> diagnosed = true ; <nl> - / / FIXME : Add parentheses if we now need them . <nl> break ; <nl> } <nl> <nl> mmm a / lib / Sema / TypeCheckExpr . cpp <nl> ppp b / lib / Sema / TypeCheckExpr . cpp <nl> Expr * TypeChecker : : substituteInputSugarTypeForResult ( ApplyExpr * E ) { <nl> return E ; <nl> } <nl> <nl> - / / / Precedences for intrinsic operators . <nl> - namespace { <nl> - namespace IntrinsicPrecedences { <nl> - enum : unsigned char { <nl> - IfExpr = 100 , / / ? : <nl> - AssignExpr = 90 , / / = <nl> - ExplicitCastExpr = 132 , / / ' is ' and ' as ' <nl> - } ; <nl> - } <nl> - } <nl> - <nl> / / / getInfixData - If the specified expression is an infix binary <nl> / / / operator , return its infix operator attributes . <nl> static InfixData getInfixData ( TypeChecker & TC , DeclContext * DC , Expr * E ) { <nl> mmm a / test / Constraints / bridging . swift <nl> ppp b / test / Constraints / bridging . swift <nl> testCallback { return getArrayOfAnyObject ( $ 0 ) } <nl> func rdar19724719 ( f : ( String ) - > ( ) , s1 : NSString ? , s2 : NSString ) { <nl> f ( ( s1 ? ? s2 ) as String ) <nl> } <nl> + <nl> + / / < rdar : / / problem / 19770981 > <nl> + func rdar19770981 ( s : String , ns : NSString ) { <nl> + func f ( s : String ) { } <nl> + f ( ns ) / / expected - error { { ' NSString ' is not implicitly convertible to ' String ' ; did you mean to use ' as ' to explicitly convert ? } } { { 7 - 7 = as String } } <nl> + f ( ns as String ) <nl> + / / ' as ' has higher precedence than ' > ' so no parens are necessary with the fixit : <nl> + s > ns / / expected - error { { ' NSString ' is not implicitly convertible to ' String ' ; did you mean to use ' as ' to explicitly convert ? } } { { 9 - 9 = as String } } <nl> + s > ns as String <nl> + ns > s / / expected - error { { ' NSString ' is not implicitly convertible to ' String ' ; did you mean to use ' as ' to explicitly convert ? } } { { 5 - 5 = as String } } <nl> + ns as String > s <nl> + <nl> + / / ' as ' has lower precedence than ' + ' so add parens with the fixit : <nl> + s + ns / / expected - error { { ' NSString ' is not implicitly convertible to ' String ' ; did you mean to use ' as ' to explicitly convert ? } } { { 7 - 7 = ( } } { { 9 - 9 = as String ) } } <nl> + s + ( ns as String ) <nl> + ns + s / / expected - error { { ' NSString ' is not implicitly convertible to ' String ' ; did you mean to use ' as ' to explicitly convert ? } } { { 3 - 3 = ( } } { { 5 - 5 = as String ) } } <nl> + ( ns as String ) + s <nl> + } <nl>
< rdar : / / problem / 19770981 > Swift doesn ' t recognize that NSString has been as ! converted to String and continually suggests conversion
apple/swift
ee342c15c441617e96e456d3e6854084085158dd
2015-02-11T04:49:34Z
mmm a / torch / lib / THD / master_worker / common / RPC . cpp <nl> ppp b / torch / lib / THD / master_worker / common / RPC . cpp <nl> <nl> # include < memory > <nl> # include < stdexcept > <nl> <nl> - namespace thd { namespace rpc { <nl> + namespace thd { <nl> + RPCType type_traits < char > : : type = RPCType : : CHAR ; <nl> + RPCType type_traits < int8_t > : : type = RPCType : : CHAR ; <nl> + RPCType type_traits < uint8_t > : : type = RPCType : : UCHAR ; <nl> + RPCType type_traits < float > : : type = RPCType : : FLOAT ; <nl> + RPCType type_traits < double > : : type = RPCType : : DOUBLE ; <nl> + RPCType type_traits < int16_t > : : type = RPCType : : SHORT ; <nl> + RPCType type_traits < int32_t > : : type = RPCType : : INT ; <nl> + RPCType type_traits < uint32_t > : : type = RPCType : : UINT ; <nl> + RPCType type_traits < uint16_t > : : type = RPCType : : USHORT ; <nl> + RPCType type_traits < int64_t > : : type = std : : is_same < int64_t , long > : : value ? RPCType : : LONG : RPCType : : LONG_LONG ; <nl> + RPCType type_traits < uint64_t > : : type = std : : is_same < uint64_t , unsigned long > : : value ? RPCType : : ULONG : RPCType : : ULONG_LONG ; <nl> + RPCType type_traits < std : : conditional < std : : is_same < int64_t , long > : : value , long long , long > : : type > : : type = std : : is_same < int64_t , long > : : value ? RPCType : : LONG_LONG : RPCType : : LONG ; <nl> + RPCType type_traits < std : : conditional < std : : is_same < uint64_t , unsigned long > : : value , unsigned long long , unsigned long > : : type > : : type = std : : is_same < uint64_t , unsigned long > : : value ? RPCType : : ULONG_LONG : RPCType : : ULONG ; <nl> + namespace rpc { <nl> <nl> RPCMessage : : RPCMessage ( ) <nl> : _msg ( 0 ) <nl> mmm a / torch / lib / THD / master_worker / common / RPCType . hpp <nl> ppp b / torch / lib / THD / master_worker / common / RPCType . hpp <nl> struct type_traits { } ; <nl> <nl> template < > <nl> struct type_traits < char > { <nl> - static constexpr RPCType type = RPCType : : CHAR ; <nl> + static RPCType type ; <nl> static constexpr bool is_floating_point = false ; <nl> } ; <nl> <nl> template < > <nl> struct type_traits < int8_t > { <nl> - static constexpr RPCType type = RPCType : : CHAR ; <nl> + static RPCType type ; <nl> static constexpr bool is_floating_point = false ; <nl> } ; <nl> <nl> template < > <nl> struct type_traits < uint8_t > { <nl> - static constexpr RPCType type = RPCType : : UCHAR ; <nl> + static RPCType type ; <nl> static constexpr bool is_floating_point = false ; <nl> } ; <nl> <nl> template < > <nl> struct type_traits < float > { <nl> - static constexpr RPCType type = RPCType : : FLOAT ; <nl> + static RPCType type ; <nl> static constexpr bool is_floating_point = true ; <nl> } ; <nl> <nl> template < > <nl> struct type_traits < double > { <nl> - static constexpr RPCType type = RPCType : : DOUBLE ; <nl> + static RPCType type ; <nl> static constexpr bool is_floating_point = true ; <nl> } ; <nl> <nl> template < > <nl> struct type_traits < int16_t > { <nl> - static constexpr RPCType type = RPCType : : SHORT ; <nl> + static RPCType type ; <nl> static constexpr bool is_floating_point = false ; <nl> } ; <nl> <nl> template < > <nl> struct type_traits < uint16_t > { <nl> - static constexpr RPCType type = RPCType : : USHORT ; <nl> + static RPCType type ; <nl> static constexpr bool is_floating_point = false ; <nl> } ; <nl> <nl> template < > <nl> struct type_traits < int32_t > { <nl> - static constexpr RPCType type = RPCType : : INT ; <nl> + static RPCType type ; <nl> static constexpr bool is_floating_point = false ; <nl> } ; <nl> <nl> template < > <nl> struct type_traits < uint32_t > { <nl> - static constexpr RPCType type = RPCType : : UINT ; <nl> + static RPCType type ; <nl> static constexpr bool is_floating_point = false ; <nl> } ; <nl> <nl> template < > <nl> struct type_traits < int64_t > { <nl> - static constexpr RPCType type = std : : is_same < int64_t , long > : : value ? RPCType : : LONG : RPCType : : LONG_LONG ; <nl> + static RPCType type ; <nl> static constexpr bool is_floating_point = false ; <nl> } ; <nl> <nl> template < > <nl> struct type_traits < uint64_t > { <nl> - static constexpr RPCType type = std : : is_same < uint64_t , unsigned long > : : value ? RPCType : : ULONG : RPCType : : ULONG_LONG ; <nl> + static RPCType type ; <nl> static constexpr bool is_floating_point = false ; <nl> } ; <nl> <nl> template < > <nl> struct type_traits < std : : conditional < std : : is_same < int64_t , long > : : value , long long , long > : : type > { <nl> - static constexpr RPCType type = std : : is_same < int64_t , long > : : value ? RPCType : : LONG_LONG : RPCType : : LONG ; <nl> + static RPCType type ; <nl> static constexpr bool is_floating_point = false ; <nl> } ; <nl> <nl> template < > <nl> struct type_traits < std : : conditional < std : : is_same < uint64_t , unsigned long > : : value , unsigned long long , unsigned long > : : type > { <nl> - static constexpr RPCType type = std : : is_same < uint64_t , unsigned long > : : value ? RPCType : : ULONG_LONG : RPCType : : ULONG ; <nl> + static RPCType type ; <nl> static constexpr bool is_floating_point = false ; <nl> } ; <nl> <nl>
Define RPC types out of source ( )
pytorch/pytorch
514f87a16cda5f0a5b0fe8dfbfac4c12fe4162e0
2018-03-15T01:36:54Z
mmm a / src / mongo / db / repl / rs_sync . cpp <nl> ppp b / src / mongo / db / repl / rs_sync . cpp <nl> namespace replset { <nl> verify ( ! Lock : : isLocked ( ) ) ; <nl> <nl> / / always fetch a few ops first <nl> - tryPopAndWaitForMore ( & ops ) ; <nl> - <nl> - while ( ops . size ( ) < replBatchSize ) { <nl> + <nl> + / / tryPopAndWaitForMore returns true when we need to end a batch early <nl> + while ( ! tryPopAndWaitForMore ( & ops ) & & <nl> + ( ops . size ( ) < replBatchSize ) ) { <nl> <nl> if ( theReplSet - > isPrimary ( ) ) { <nl> return ; <nl> namespace replset { <nl> return ; <nl> } <nl> } <nl> - <nl> - if ( tryPopAndWaitForMore ( & ops ) ) { <nl> - break ; <nl> - } <nl> } <nl> const BSONObj & lastOp = ops . back ( ) ; <nl> handleSlaveDelay ( lastOp ) ; <nl>
SERVER - 5685 check end - batch - early status for all calls to tryPopAndWaitForMore
mongodb/mongo
7d932daed48e51cea98129be39d2ae296aa27b3f
2012-06-19T19:08:56Z
mmm a / tensorflow / lite / delegates / gpu / cl / kernels / BUILD <nl> ppp b / tensorflow / lite / delegates / gpu / cl / kernels / BUILD <nl> cc_library ( <nl> hdrs = [ " fully_connected . h " ] , <nl> deps = [ <nl> " : gpu_operation " , <nl> + " : tuning_parameters " , <nl> " : util " , <nl> + " / / tensorflow / lite / delegates / gpu / cl : arguments " , <nl> " / / tensorflow / lite / delegates / gpu / cl : buffer " , <nl> + " / / tensorflow / lite / delegates / gpu / cl : cl_kernel " , <nl> + " / / tensorflow / lite / delegates / gpu / cl : device_info " , <nl> " / / tensorflow / lite / delegates / gpu / cl : linear_storage " , <nl> - " / / tensorflow / lite / delegates / gpu / cl : tensor " , <nl> - " / / tensorflow / lite / delegates / gpu / cl : util " , <nl> + " / / tensorflow / lite / delegates / gpu / cl : precision " , <nl> " / / tensorflow / lite / delegates / gpu / common : data_type " , <nl> " / / tensorflow / lite / delegates / gpu / common : operations " , <nl> " / / tensorflow / lite / delegates / gpu / common : shape " , <nl> - " / / tensorflow / lite / delegates / gpu / common : status " , <nl> " / / tensorflow / lite / delegates / gpu / common : tensor " , <nl> " / / tensorflow / lite / delegates / gpu / common : types " , <nl> + " / / tensorflow / lite / delegates / gpu / common : util " , <nl> + " @ com_google_absl / / absl / memory " , <nl> ] , <nl> ) <nl> <nl> cc_test ( <nl> deps = [ <nl> " : cl_test " , <nl> " : fully_connected " , <nl> + " : gpu_operation " , <nl> + " / / tensorflow / lite / delegates / gpu / cl : environment " , <nl> + " / / tensorflow / lite / delegates / gpu / cl : precision " , <nl> + " / / tensorflow / lite / delegates / gpu / cl : tensor_type " , <nl> + " / / tensorflow / lite / delegates / gpu / common : data_type " , <nl> " / / tensorflow / lite / delegates / gpu / common : operations " , <nl> - " / / tensorflow / lite / delegates / gpu / common : status " , <nl> + " / / tensorflow / lite / delegates / gpu / common : shape " , <nl> + " / / tensorflow / lite / delegates / gpu / common : tensor " , <nl> " @ com_google_googletest / / : gtest_main " , <nl> ] , <nl> ) <nl> mmm a / tensorflow / lite / delegates / gpu / cl / kernels / fully_connected . h <nl> ppp b / tensorflow / lite / delegates / gpu / cl / kernels / fully_connected . h <nl> limitations under the License . <nl> # ifndef TENSORFLOW_LITE_DELEGATES_GPU_CL_KERNELS_FULLY_CONNECTED_H_ <nl> # define TENSORFLOW_LITE_DELEGATES_GPU_CL_KERNELS_FULLY_CONNECTED_H_ <nl> <nl> + # include < string > <nl> + # include < utility > <nl> # include < vector > <nl> <nl> + # include " absl / memory / memory . h " <nl> + # include " tensorflow / lite / delegates / gpu / cl / arguments . h " <nl> # include " tensorflow / lite / delegates / gpu / cl / buffer . h " <nl> + # include " tensorflow / lite / delegates / gpu / cl / cl_kernel . h " <nl> + # include " tensorflow / lite / delegates / gpu / cl / device_info . h " <nl> # include " tensorflow / lite / delegates / gpu / cl / kernels / gpu_operation . h " <nl> + # include " tensorflow / lite / delegates / gpu / cl / kernels / tuning_parameters . h " <nl> # include " tensorflow / lite / delegates / gpu / cl / linear_storage . h " <nl> - # include " tensorflow / lite / delegates / gpu / cl / tensor . h " <nl> - # include " tensorflow / lite / delegates / gpu / cl / util . h " <nl> + # include " tensorflow / lite / delegates / gpu / cl / precision . h " <nl> # include " tensorflow / lite / delegates / gpu / common / data_type . h " <nl> # include " tensorflow / lite / delegates / gpu / common / operations . h " <nl> # include " tensorflow / lite / delegates / gpu / common / shape . h " <nl> - # include " tensorflow / lite / delegates / gpu / common / status . h " <nl> # include " tensorflow / lite / delegates / gpu / common / tensor . h " <nl> # include " tensorflow / lite / delegates / gpu / common / types . h " <nl> + # include " tensorflow / lite / delegates / gpu / common / util . h " <nl> <nl> namespace tflite { <nl> namespace gpu { <nl> namespace cl { <nl> <nl> template < DataType T , typename S > <nl> void RearrangeFCWeightsToIOO4I4 ( const tflite : : gpu : : Tensor < OHWI , T > & weights , <nl> - absl : : Span < S > dst ) { <nl> + S * dst ) { <nl> const int src_channels = weights . shape . i ; <nl> const int padded_src_channels = AlignByN ( src_channels , 4 ) ; <nl> const int dst_channels = weights . shape . o ; <nl> const int padded_dst_channels = AlignByN ( dst_channels , 4 ) ; <nl> <nl> - / / The weights are to be rearranged in such a way that the first 4 elements of <nl> - / / each row , starting from row_0 , are copied onto the destination buffer . The <nl> - / / next set of 4 elements are then copied and so on . As an example , an 8x8 <nl> - / / matrix would be rearranged as below . <nl> + / / Change the travelsal order of the weight matrix in such a way that the <nl> + / / first 4 elements of all rows are scanned first , followed by elements 5 to 8 <nl> + / / of all rows , then elements 9 to 12 of all rows , and so on . As an example , <nl> + / / an 8x8 matrix would be traversed as below . <nl> / / <nl> - / / | a0 a1 a2 a3 a4 a5 a6 a7 | | a0 a1 a2 a3 b0 b1 b2 b3 | <nl> - / / | b0 b1 b2 b3 b4 b5 b6 b7 | | c0 c1 c2 c3 d0 d1 d2 d3 | <nl> - / / | c0 c1 c2 c3 c4 c5 c6 c7 | | e0 e1 e2 e3 f0 f1 f2 f3 | <nl> - / / | d0 d1 d2 d3 d4 d5 d6 d7 | mmmmmmmmm > | g0 g1 g2 g3 h0 h1 h2 h3 | <nl> - / / | e0 e1 e2 e3 e4 e5 e6 e7 | | a4 a5 a6 a7 b4 b5 b6 b7 | <nl> - / / | f0 f1 f2 f3 f4 f5 f6 f7 | | c4 c5 c6 c7 d4 d5 d6 d7 | <nl> - / / | g0 g1 g2 g3 g4 g5 g6 g7 | | e4 e5 e6 e7 f4 f5 f6 f7 | <nl> - / / | h0 h1 h2 h3 h4 h5 h6 h7 | | g4 g5 g6 g7 h4 h5 h6 h7 | <nl> - <nl> - for ( int y = 0 ; y < dst_channels ; y + + ) { <nl> - int x = 0 ; <nl> - for ( ; x + 4 < = src_channels ; x + = 4 ) { <nl> - const int idx_data_0 = src_channels * y + x ; <nl> - S filter = S ( weights . data [ idx_data_0 ] , weights . data [ idx_data_0 + 1 ] , <nl> - weights . data [ idx_data_0 + 2 ] , weights . data [ idx_data_0 + 3 ] ) ; <nl> - dst [ y + padded_dst_channels * x / 4 ] = filter ; <nl> - } <nl> - <nl> - / / If the width is not a multiple of 4 , padding is required and the padded <nl> - / / region is filled with zeros . <nl> - if ( src_channels ! = padded_src_channels ) { <nl> - const int idx_data_0 = src_channels * y + x ; <nl> - <nl> - S filter = S ( x < src_channels ? weights . data [ idx_data_0 ] : 0 . 0 , <nl> - x + 1 < src_channels ? weights . data [ idx_data_0 + 1 ] : 0 . 0 , <nl> - x + 2 < src_channels ? weights . data [ idx_data_0 + 2 ] : 0 . 0 , <nl> - x + 3 < src_channels ? weights . data [ idx_data_0 + 3 ] : 0 . 0 ) ; <nl> - dst [ y + padded_dst_channels * x / 4 ] = filter ; <nl> - } <nl> - } <nl> - <nl> - / / Fill the padded columns with zeros . <nl> - for ( int y = dst_channels ; y < padded_dst_channels ; y + + ) { <nl> - for ( int x = 0 ; x < padded_src_channels ; x + = 4 ) { <nl> - dst [ y + padded_dst_channels * x / 4 ] = S ( 0 . 0 ) ; <nl> + / / | 0 1 2 3 32 33 34 35 | <nl> + / / | 4 5 6 7 36 37 38 39 | <nl> + / / | 8 9 10 11 40 41 42 43 | <nl> + / / | 12 13 14 15 44 45 46 47 | <nl> + / / | 16 17 18 19 48 49 50 51 | <nl> + / / | 20 21 22 23 52 53 54 55 | <nl> + / / | 24 25 26 27 56 57 58 59 | <nl> + / / | 28 29 30 31 60 61 62 63 | <nl> + / / <nl> + / / If ( any ) dimension of the weight matrix size is not divisible by 4 , then <nl> + / / the output is padded with zeros . <nl> + / / <nl> + / / The benefit of doing this is that reading contigous 16 elements gives a 4x4 <nl> + / / block of the matrix , where the first 4 elements is the first row of the <nl> + / / block , second 4 elements is the second row of the block , etc . <nl> + <nl> + for ( int y = 0 ; y < padded_dst_channels ; y + + ) { <nl> + for ( int block_x = 0 ; 4 * block_x < padded_src_channels ; block_x + + ) { <nl> + for ( int x_in_block = 0 ; x_in_block < 4 ; x_in_block + + ) { <nl> + int x = 4 * block_x + x_in_block ; <nl> + int dst_index = padded_dst_channels * 4 * block_x + 4 * y + x_in_block ; <nl> + if ( x < src_channels & & y < dst_channels ) { <nl> + dst [ dst_index ] = weights . data [ src_channels * y + x ] ; <nl> + } else { <nl> + dst [ dst_index ] = 0 . 0f ; <nl> + } <nl> + } <nl> } <nl> } <nl> } <nl> void FullyConnected : : UploadWeights ( <nl> desc . data . resize ( desc . size ) ; <nl> <nl> if ( f32_weights ) { <nl> - float4 * ptr = reinterpret_cast < float4 * > ( desc . data . data ( ) ) ; <nl> - RearrangeFCWeightsToIOO4I4 ( weights , absl : : MakeSpan ( ptr , elements_count ) ) ; <nl> + float * ptr = reinterpret_cast < float * > ( desc . data . data ( ) ) ; <nl> + RearrangeFCWeightsToIOO4I4 ( weights , ptr ) ; <nl> } else { <nl> - half4 * ptr = reinterpret_cast < half4 * > ( desc . data . data ( ) ) ; <nl> - RearrangeFCWeightsToIOO4I4 ( weights , absl : : MakeSpan ( ptr , elements_count ) ) ; <nl> + half * ptr = reinterpret_cast < half * > ( desc . data . data ( ) ) ; <nl> + RearrangeFCWeightsToIOO4I4 ( weights , ptr ) ; <nl> } <nl> <nl> args_ . AddObject ( " weights " , <nl> mmm a / tensorflow / lite / delegates / gpu / cl / kernels / fully_connected_test . cc <nl> ppp b / tensorflow / lite / delegates / gpu / cl / kernels / fully_connected_test . cc <nl> limitations under the License . <nl> <nl> # include < gmock / gmock . h > <nl> # include < gtest / gtest . h > <nl> + # include " tensorflow / lite / delegates / gpu / cl / environment . h " <nl> # include " tensorflow / lite / delegates / gpu / cl / kernels / cl_test . h " <nl> + # include " tensorflow / lite / delegates / gpu / cl / kernels / gpu_operation . h " <nl> # include " tensorflow / lite / delegates / gpu / cl / precision . h " <nl> + # include " tensorflow / lite / delegates / gpu / cl / tensor_type . h " <nl> + # include " tensorflow / lite / delegates / gpu / common / data_type . h " <nl> # include " tensorflow / lite / delegates / gpu / common / operations . h " <nl> - # include " tensorflow / lite / delegates / gpu / common / status . h " <nl> + # include " tensorflow / lite / delegates / gpu / common / shape . h " <nl> + # include " tensorflow / lite / delegates / gpu / common / tensor . h " <nl> <nl> using : : testing : : ElementsAreArray ; <nl> using : : testing : : FloatNear ; <nl> TEST_F ( OpenCLOperationTest , RearrageWeights ) { <nl> } ; <nl> <nl> std : : vector < float > data ( 8 * 8 ) ; <nl> - float4 * data_ptr = static_cast < float4 * > ( static_cast < void * > ( data . data ( ) ) ) ; <nl> - RearrangeFCWeightsToIOO4I4 ( weights , absl : : MakeSpan ( data_ptr , 8 * 8 / 4 ) ) ; <nl> + RearrangeFCWeightsToIOO4I4 ( weights , data . data ( ) ) ; <nl> <nl> EXPECT_THAT ( data , ElementsAreArray ( expected_rearranged_data ) ) ; <nl> } <nl> TEST_F ( OpenCLOperationTest , RearrageWeightsWhenPaddingIsRequired ) { <nl> } ; <nl> <nl> std : : vector < float > data ( 8 * 8 ) ; <nl> - float4 * data_ptr = static_cast < float4 * > ( static_cast < void * > ( data . data ( ) ) ) ; <nl> - RearrangeFCWeightsToIOO4I4 ( weights , absl : : MakeSpan ( data_ptr , 8 * 8 / 4 ) ) ; <nl> + RearrangeFCWeightsToIOO4I4 ( weights , data . data ( ) ) ; <nl> <nl> EXPECT_THAT ( data , ElementsAreArray ( expected_rearranged_data ) ) ; <nl> } <nl>
Simplify RearrangeFCWeightsToIOO4I4 and expand comment .
tensorflow/tensorflow
ea0e3c53dfb0268d48f7fc0b35a975f0a22d60ff
2020-09-16T20:12:02Z
mmm a / Marlin / Configuration_adv . h <nl> ppp b / Marlin / Configuration_adv . h <nl> <nl> / / once . ( 2nd extruder x offset and temp offset are set using : M605 S2 [ Xnnn ] [ Rmmm ] ) <nl> <nl> / / This is the default power - up mode which can be later using M605 . <nl> - # define DEFAULT_DUAL_X_CARRIAGE_MODE 0 <nl> + # define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE <nl> <nl> / / Default settings in " Auto - park Mode " <nl> # define TOOLCHANGE_PARK_ZLIFT 0 . 2 / / the distance to raise Z axis when parking an extruder <nl> mmm a / Marlin / Marlin_main . cpp <nl> ppp b / Marlin / Marlin_main . cpp <nl> bool get_target_extruder_from_command ( int code ) { <nl> <nl> # if ENABLED ( DUAL_X_CARRIAGE ) <nl> <nl> - # define DXC_FULL_CONTROL_MODE 0 <nl> - # define DXC_AUTO_PARK_MODE 1 <nl> - # define DXC_DUPLICATION_MODE 2 <nl> - <nl> - static int dual_x_carriage_mode = DEFAULT_DUAL_X_CARRIAGE_MODE ; <nl> + static DualXMode dual_x_carriage_mode = DEFAULT_DUAL_X_CARRIAGE_MODE ; <nl> <nl> static float x_home_pos ( int extruder ) { <nl> if ( extruder = = 0 ) <nl> inline void gcode_M503 ( ) { <nl> * / <nl> inline void gcode_M605 ( ) { <nl> stepper . synchronize ( ) ; <nl> - if ( code_seen ( ' S ' ) ) dual_x_carriage_mode = code_value_byte ( ) ; <nl> + if ( code_seen ( ' S ' ) ) dual_x_carriage_mode = ( DualXMode ) code_value_byte ( ) ; <nl> switch ( dual_x_carriage_mode ) { <nl> + case DXC_FULL_CONTROL_MODE : <nl> + case DXC_AUTO_PARK_MODE : <nl> + break ; <nl> case DXC_DUPLICATION_MODE : <nl> if ( code_seen ( ' X ' ) ) duplicate_extruder_x_offset = max ( code_value_axis_units ( X_AXIS ) , X2_MIN_POS - x_home_pos ( 0 ) ) ; <nl> if ( code_seen ( ' R ' ) ) duplicate_extruder_temp_offset = code_value_temp_diff ( ) ; <nl> inline void gcode_M503 ( ) { <nl> SERIAL_CHAR ( ' , ' ) ; <nl> SERIAL_ECHOLN ( hotend_offset [ Y_AXIS ] [ 1 ] ) ; <nl> break ; <nl> - case DXC_FULL_CONTROL_MODE : <nl> - case DXC_AUTO_PARK_MODE : <nl> - break ; <nl> default : <nl> dual_x_carriage_mode = DEFAULT_DUAL_X_CARRIAGE_MODE ; <nl> break ; <nl> void tool_change ( const uint8_t tmp_extruder , const float fr_mm_s / * = 0 . 0 * / , bool n <nl> if ( DEBUGGING ( LEVELING ) ) { <nl> SERIAL_ECHOPGM ( " Dual X Carriage Mode " ) ; <nl> switch ( dual_x_carriage_mode ) { <nl> - case DXC_DUPLICATION_MODE : SERIAL_ECHOLNPGM ( " DXC_DUPLICATION_MODE " ) ; break ; <nl> - case DXC_AUTO_PARK_MODE : SERIAL_ECHOLNPGM ( " DXC_AUTO_PARK_MODE " ) ; break ; <nl> case DXC_FULL_CONTROL_MODE : SERIAL_ECHOLNPGM ( " DXC_FULL_CONTROL_MODE " ) ; break ; <nl> + case DXC_AUTO_PARK_MODE : SERIAL_ECHOLNPGM ( " DXC_AUTO_PARK_MODE " ) ; break ; <nl> + case DXC_DUPLICATION_MODE : SERIAL_ECHOLNPGM ( " DXC_DUPLICATION_MODE " ) ; break ; <nl> } <nl> } <nl> # endif <nl> void tool_change ( const uint8_t tmp_extruder , const float fr_mm_s / * = 0 . 0 * / , bool n <nl> current_position [ X_AXIS ] = LOGICAL_X_POSITION ( inactive_extruder_x_pos ) ; <nl> inactive_extruder_x_pos = RAW_X_POSITION ( destination [ X_AXIS ] ) ; <nl> break ; <nl> + case DXC_AUTO_PARK_MODE : <nl> + / / record raised toolhead position for use by unpark <nl> + memcpy ( raised_parked_position , current_position , sizeof ( raised_parked_position ) ) ; <nl> + raised_parked_position [ Z_AXIS ] + = TOOLCHANGE_UNPARK_ZLIFT ; <nl> + # if ENABLED ( max_software_endstops ) <nl> + NOMORE ( raised_parked_position [ Z_AXIS ] , soft_endstop_max [ Z_AXIS ] ) ; <nl> + # endif <nl> + active_extruder_parked = true ; <nl> + delayed_move_time = 0 ; <nl> + break ; <nl> case DXC_DUPLICATION_MODE : <nl> active_extruder_parked = ( active_extruder = = 0 ) ; / / this triggers the second extruder to move into the duplication position <nl> if ( active_extruder_parked ) <nl> void tool_change ( const uint8_t tmp_extruder , const float fr_mm_s / * = 0 . 0 * / , bool n <nl> inactive_extruder_x_pos = RAW_X_POSITION ( destination [ X_AXIS ] ) ; <nl> extruder_duplication_enabled = false ; <nl> break ; <nl> - default : <nl> - / / record raised toolhead position for use by unpark <nl> - memcpy ( raised_parked_position , current_position , sizeof ( raised_parked_position ) ) ; <nl> - raised_parked_position [ Z_AXIS ] + = TOOLCHANGE_UNPARK_ZLIFT ; <nl> - active_extruder_parked = true ; <nl> - delayed_move_time = 0 ; <nl> - break ; <nl> } <nl> <nl> # if ENABLED ( DEBUG_LEVELING_FEATURE ) <nl> void set_current_from_steppers_for_axis ( const AxisEnum axis ) { <nl> * / <nl> inline bool prepare_move_to_destination_dualx ( ) { <nl> if ( active_extruder_parked ) { <nl> - if ( dual_x_carriage_mode = = DXC_DUPLICATION_MODE & & active_extruder = = 0 ) { <nl> - / / move duplicate extruder into correct duplication position . <nl> - planner . set_position_mm ( <nl> - LOGICAL_X_POSITION ( inactive_extruder_x_pos ) , <nl> - current_position [ Y_AXIS ] , <nl> - current_position [ Z_AXIS ] , <nl> - current_position [ E_AXIS ] <nl> - ) ; <nl> - planner . buffer_line ( current_position [ X_AXIS ] + duplicate_extruder_x_offset , <nl> - current_position [ Y_AXIS ] , current_position [ Z_AXIS ] , current_position [ E_AXIS ] , planner . max_feedrate_mm_s [ X_AXIS ] , 1 ) ; <nl> - SYNC_PLAN_POSITION_KINEMATIC ( ) ; <nl> - stepper . synchronize ( ) ; <nl> - extruder_duplication_enabled = true ; <nl> - active_extruder_parked = false ; <nl> - } <nl> - else if ( dual_x_carriage_mode = = DXC_AUTO_PARK_MODE ) { / / handle unparking of head <nl> - if ( current_position [ E_AXIS ] = = destination [ E_AXIS ] ) { <nl> - / / This is a travel move ( with no extrusion ) <nl> - / / Skip it , but keep track of the current position <nl> - / / ( so it can be used as the start of the next non - travel move ) <nl> - if ( delayed_move_time ! = 0xFFFFFFFFUL ) { <nl> - set_current_to_destination ( ) ; <nl> - NOLESS ( raised_parked_position [ Z_AXIS ] , destination [ Z_AXIS ] ) ; <nl> - delayed_move_time = millis ( ) ; <nl> - return false ; <nl> + switch ( dual_x_carriage_mode ) { <nl> + case DXC_FULL_CONTROL_MODE : <nl> + break ; <nl> + case DXC_DUPLICATION_MODE : <nl> + if ( active_extruder = = 0 ) { <nl> + / / move duplicate extruder into correct duplication position . <nl> + planner . set_position_mm ( <nl> + LOGICAL_X_POSITION ( inactive_extruder_x_pos ) , <nl> + current_position [ Y_AXIS ] , <nl> + current_position [ Z_AXIS ] , <nl> + current_position [ E_AXIS ] <nl> + ) ; <nl> + planner . buffer_line ( current_position [ X_AXIS ] + duplicate_extruder_x_offset , <nl> + current_position [ Y_AXIS ] , current_position [ Z_AXIS ] , current_position [ E_AXIS ] , planner . max_feedrate_mm_s [ X_AXIS ] , 1 ) ; <nl> + SYNC_PLAN_POSITION_KINEMATIC ( ) ; <nl> + stepper . synchronize ( ) ; <nl> + extruder_duplication_enabled = true ; <nl> + active_extruder_parked = false ; <nl> } <nl> - } <nl> - delayed_move_time = 0 ; <nl> - / / unpark extruder : 1 ) raise , 2 ) move into starting XY position , 3 ) lower <nl> - planner . buffer_line ( raised_parked_position [ X_AXIS ] , raised_parked_position [ Y_AXIS ] , raised_parked_position [ Z_AXIS ] , current_position [ E_AXIS ] , planner . max_feedrate_mm_s [ Z_AXIS ] , active_extruder ) ; <nl> - planner . buffer_line ( current_position [ X_AXIS ] , current_position [ Y_AXIS ] , raised_parked_position [ Z_AXIS ] , current_position [ E_AXIS ] , PLANNER_XY_FEEDRATE ( ) , active_extruder ) ; <nl> - planner . buffer_line ( current_position [ X_AXIS ] , current_position [ Y_AXIS ] , current_position [ Z_AXIS ] , current_position [ E_AXIS ] , planner . max_feedrate_mm_s [ Z_AXIS ] , active_extruder ) ; <nl> - active_extruder_parked = false ; <nl> + break ; <nl> + case DXC_AUTO_PARK_MODE : <nl> + if ( current_position [ E_AXIS ] = = destination [ E_AXIS ] ) { <nl> + / / This is a travel move ( with no extrusion ) <nl> + / / Skip it , but keep track of the current position <nl> + / / ( so it can be used as the start of the next non - travel move ) <nl> + if ( delayed_move_time ! = 0xFFFFFFFFUL ) { <nl> + set_current_to_destination ( ) ; <nl> + NOLESS ( raised_parked_position [ Z_AXIS ] , destination [ Z_AXIS ] ) ; <nl> + delayed_move_time = millis ( ) ; <nl> + return false ; <nl> + } <nl> + } <nl> + delayed_move_time = 0 ; <nl> + / / unpark extruder : 1 ) raise , 2 ) move into starting XY position , 3 ) lower <nl> + planner . buffer_line ( raised_parked_position [ X_AXIS ] , raised_parked_position [ Y_AXIS ] , raised_parked_position [ Z_AXIS ] , current_position [ E_AXIS ] , planner . max_feedrate_mm_s [ Z_AXIS ] , active_extruder ) ; <nl> + planner . buffer_line ( current_position [ X_AXIS ] , current_position [ Y_AXIS ] , raised_parked_position [ Z_AXIS ] , current_position [ E_AXIS ] , PLANNER_XY_FEEDRATE ( ) , active_extruder ) ; <nl> + planner . buffer_line ( current_position [ X_AXIS ] , current_position [ Y_AXIS ] , current_position [ Z_AXIS ] , current_position [ E_AXIS ] , planner . max_feedrate_mm_s [ Z_AXIS ] , active_extruder ) ; <nl> + active_extruder_parked = false ; <nl> + break ; <nl> } <nl> } <nl> return true ; <nl> mmm a / Marlin / enum . h <nl> ppp b / Marlin / enum . h <nl> enum LCDViewAction { <nl> LCDVIEW_CALL_NO_REDRAW <nl> } ; <nl> <nl> + # if ENABLED ( DUAL_X_CARRIAGE ) <nl> + enum DualXMode { <nl> + DXC_FULL_CONTROL_MODE , <nl> + DXC_AUTO_PARK_MODE , <nl> + DXC_DUPLICATION_MODE <nl> + } ; <nl> + # endif <nl> + <nl> # endif / / __ENUM_H__ <nl> mmm a / Marlin / example_configurations / Cartesio / Configuration_adv . h <nl> ppp b / Marlin / example_configurations / Cartesio / Configuration_adv . h <nl> <nl> / / once . ( 2nd extruder x offset and temp offset are set using : M605 S2 [ Xnnn ] [ Rmmm ] ) <nl> <nl> / / This is the default power - up mode which can be later using M605 . <nl> - # define DEFAULT_DUAL_X_CARRIAGE_MODE 0 <nl> + # define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE <nl> <nl> / / Default settings in " Auto - park Mode " <nl> # define TOOLCHANGE_PARK_ZLIFT 0 . 2 / / the distance to raise Z axis when parking an extruder <nl> mmm a / Marlin / example_configurations / Felix / Configuration_adv . h <nl> ppp b / Marlin / example_configurations / Felix / Configuration_adv . h <nl> <nl> / / once . ( 2nd extruder x offset and temp offset are set using : M605 S2 [ Xnnn ] [ Rmmm ] ) <nl> <nl> / / This is the default power - up mode which can be later using M605 . <nl> - # define DEFAULT_DUAL_X_CARRIAGE_MODE 0 <nl> + # define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE <nl> <nl> / / Default settings in " Auto - park Mode " <nl> # define TOOLCHANGE_PARK_ZLIFT 0 . 2 / / the distance to raise Z axis when parking an extruder <nl> mmm a / Marlin / example_configurations / Hephestos / Configuration_adv . h <nl> ppp b / Marlin / example_configurations / Hephestos / Configuration_adv . h <nl> <nl> / / once . ( 2nd extruder x offset and temp offset are set using : M605 S2 [ Xnnn ] [ Rmmm ] ) <nl> <nl> / / This is the default power - up mode which can be later using M605 . <nl> - # define DEFAULT_DUAL_X_CARRIAGE_MODE 0 <nl> + # define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE <nl> <nl> / / Default settings in " Auto - park Mode " <nl> # define TOOLCHANGE_PARK_ZLIFT 0 . 2 / / the distance to raise Z axis when parking an extruder <nl> mmm a / Marlin / example_configurations / Hephestos_2 / Configuration_adv . h <nl> ppp b / Marlin / example_configurations / Hephestos_2 / Configuration_adv . h <nl> <nl> / / once . ( 2nd extruder x offset and temp offset are set using : M605 S2 [ Xnnn ] [ Rmmm ] ) <nl> <nl> / / This is the default power - up mode which can be later using M605 . <nl> - # define DEFAULT_DUAL_X_CARRIAGE_MODE 0 <nl> + # define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE <nl> <nl> / / Default settings in " Auto - park Mode " <nl> # define TOOLCHANGE_PARK_ZLIFT 0 . 2 / / the distance to raise Z axis when parking an extruder <nl> mmm a / Marlin / example_configurations / K8200 / Configuration_adv . h <nl> ppp b / Marlin / example_configurations / K8200 / Configuration_adv . h <nl> <nl> / / once . ( 2nd extruder x offset and temp offset are set using : M605 S2 [ Xnnn ] [ Rmmm ] ) <nl> <nl> / / This is the default power - up mode which can be later using M605 . <nl> - # define DEFAULT_DUAL_X_CARRIAGE_MODE 0 <nl> + # define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE <nl> <nl> / / Default settings in " Auto - park Mode " <nl> # define TOOLCHANGE_PARK_ZLIFT 0 . 2 / / the distance to raise Z axis when parking an extruder <nl> mmm a / Marlin / example_configurations / K8400 / Configuration_adv . h <nl> ppp b / Marlin / example_configurations / K8400 / Configuration_adv . h <nl> <nl> / / once . ( 2nd extruder x offset and temp offset are set using : M605 S2 [ Xnnn ] [ Rmmm ] ) <nl> <nl> / / This is the default power - up mode which can be later using M605 . <nl> - # define DEFAULT_DUAL_X_CARRIAGE_MODE 0 <nl> + # define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE <nl> <nl> / / Default settings in " Auto - park Mode " <nl> # define TOOLCHANGE_PARK_ZLIFT 0 . 2 / / the distance to raise Z axis when parking an extruder <nl> mmm a / Marlin / example_configurations / RigidBot / Configuration_adv . h <nl> ppp b / Marlin / example_configurations / RigidBot / Configuration_adv . h <nl> <nl> / / once . ( 2nd extruder x offset and temp offset are set using : M605 S2 [ Xnnn ] [ Rmmm ] ) <nl> <nl> / / This is the default power - up mode which can be later using M605 . <nl> - # define DEFAULT_DUAL_X_CARRIAGE_MODE 0 <nl> + # define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE <nl> <nl> / / Default settings in " Auto - park Mode " <nl> # define TOOLCHANGE_PARK_ZLIFT 0 . 2 / / the distance to raise Z axis when parking an extruder <nl> mmm a / Marlin / example_configurations / SCARA / Configuration_adv . h <nl> ppp b / Marlin / example_configurations / SCARA / Configuration_adv . h <nl> <nl> / / once . ( 2nd extruder x offset and temp offset are set using : M605 S2 [ Xnnn ] [ Rmmm ] ) <nl> <nl> / / This is the default power - up mode which can be later using M605 . <nl> - # define DEFAULT_DUAL_X_CARRIAGE_MODE 0 <nl> + # define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE <nl> <nl> / / Default settings in " Auto - park Mode " <nl> # define TOOLCHANGE_PARK_ZLIFT 0 . 2 / / the distance to raise Z axis when parking an extruder <nl> mmm a / Marlin / example_configurations / TAZ4 / Configuration_adv . h <nl> ppp b / Marlin / example_configurations / TAZ4 / Configuration_adv . h <nl> <nl> / / once . ( 2nd extruder x offset and temp offset are set using : M605 S2 [ Xnnn ] [ Rmmm ] ) <nl> <nl> / / This is the default power - up mode which can be later using M605 . <nl> - # define DEFAULT_DUAL_X_CARRIAGE_MODE 0 <nl> + # define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE <nl> <nl> / / Default settings in " Auto - park Mode " <nl> # define TOOLCHANGE_PARK_ZLIFT 0 . 2 / / the distance to raise Z axis when parking an extruder <nl> mmm a / Marlin / example_configurations / WITBOX / Configuration_adv . h <nl> ppp b / Marlin / example_configurations / WITBOX / Configuration_adv . h <nl> <nl> / / once . ( 2nd extruder x offset and temp offset are set using : M605 S2 [ Xnnn ] [ Rmmm ] ) <nl> <nl> / / This is the default power - up mode which can be later using M605 . <nl> - # define DEFAULT_DUAL_X_CARRIAGE_MODE 0 <nl> + # define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE <nl> <nl> / / Default settings in " Auto - park Mode " <nl> # define TOOLCHANGE_PARK_ZLIFT 0 . 2 / / the distance to raise Z axis when parking an extruder <nl> mmm a / Marlin / example_configurations / delta / biv2 . 5 / Configuration_adv . h <nl> ppp b / Marlin / example_configurations / delta / biv2 . 5 / Configuration_adv . h <nl> <nl> / / once . ( 2nd extruder x offset and temp offset are set using : M605 S2 [ Xnnn ] [ Rmmm ] ) <nl> <nl> / / This is the default power - up mode which can be later using M605 . <nl> - # define DEFAULT_DUAL_X_CARRIAGE_MODE 0 <nl> + # define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE <nl> <nl> / / Default settings in " Auto - park Mode " <nl> # define TOOLCHANGE_PARK_ZLIFT 0 . 2 / / the distance to raise Z axis when parking an extruder <nl> mmm a / Marlin / example_configurations / delta / generic / Configuration_adv . h <nl> ppp b / Marlin / example_configurations / delta / generic / Configuration_adv . h <nl> <nl> / / once . ( 2nd extruder x offset and temp offset are set using : M605 S2 [ Xnnn ] [ Rmmm ] ) <nl> <nl> / / This is the default power - up mode which can be later using M605 . <nl> - # define DEFAULT_DUAL_X_CARRIAGE_MODE 0 <nl> + # define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE <nl> <nl> / / Default settings in " Auto - park Mode " <nl> # define TOOLCHANGE_PARK_ZLIFT 0 . 2 / / the distance to raise Z axis when parking an extruder <nl> mmm a / Marlin / example_configurations / delta / kossel_mini / Configuration_adv . h <nl> ppp b / Marlin / example_configurations / delta / kossel_mini / Configuration_adv . h <nl> <nl> / / once . ( 2nd extruder x offset and temp offset are set using : M605 S2 [ Xnnn ] [ Rmmm ] ) <nl> <nl> / / This is the default power - up mode which can be later using M605 . <nl> - # define DEFAULT_DUAL_X_CARRIAGE_MODE 0 <nl> + # define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE <nl> <nl> / / Default settings in " Auto - park Mode " <nl> # define TOOLCHANGE_PARK_ZLIFT 0 . 2 / / the distance to raise Z axis when parking an extruder <nl> mmm a / Marlin / example_configurations / delta / kossel_pro / Configuration_adv . h <nl> ppp b / Marlin / example_configurations / delta / kossel_pro / Configuration_adv . h <nl> <nl> / / once . ( 2nd extruder x offset and temp offset are set using : M605 S2 [ Xnnn ] [ Rmmm ] ) <nl> <nl> / / This is the default power - up mode which can be later using M605 . <nl> - # define DEFAULT_DUAL_X_CARRIAGE_MODE 0 <nl> + # define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE <nl> <nl> / / Default settings in " Auto - park Mode " <nl> # define TOOLCHANGE_PARK_ZLIFT 0 . 2 / / the distance to raise Z axis when parking an extruder <nl> mmm a / Marlin / example_configurations / delta / kossel_xl / Configuration_adv . h <nl> ppp b / Marlin / example_configurations / delta / kossel_xl / Configuration_adv . h <nl> <nl> / / once . ( 2nd extruder x offset and temp offset are set using : M605 S2 [ Xnnn ] [ Rmmm ] ) <nl> <nl> / / This is the default power - up mode which can be later using M605 . <nl> - # define DEFAULT_DUAL_X_CARRIAGE_MODE 0 <nl> + # define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE <nl> <nl> / / Default settings in " Auto - park Mode " <nl> # define TOOLCHANGE_PARK_ZLIFT 0 . 2 / / the distance to raise Z axis when parking an extruder <nl> mmm a / Marlin / example_configurations / makibox / Configuration_adv . h <nl> ppp b / Marlin / example_configurations / makibox / Configuration_adv . h <nl> <nl> / / once . ( 2nd extruder x offset and temp offset are set using : M605 S2 [ Xnnn ] [ Rmmm ] ) <nl> <nl> / / This is the default power - up mode which can be later using M605 . <nl> - # define DEFAULT_DUAL_X_CARRIAGE_MODE 0 <nl> + # define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE <nl> <nl> / / Default settings in " Auto - park Mode " <nl> # define TOOLCHANGE_PARK_ZLIFT 0 . 2 / / the distance to raise Z axis when parking an extruder <nl> mmm a / Marlin / example_configurations / tvrrug / Round2 / Configuration_adv . h <nl> ppp b / Marlin / example_configurations / tvrrug / Round2 / Configuration_adv . h <nl> <nl> / / once . ( 2nd extruder x offset and temp offset are set using : M605 S2 [ Xnnn ] [ Rmmm ] ) <nl> <nl> / / This is the default power - up mode which can be later using M605 . <nl> - # define DEFAULT_DUAL_X_CARRIAGE_MODE 0 <nl> + # define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE <nl> <nl> / / Default settings in " Auto - park Mode " <nl> # define TOOLCHANGE_PARK_ZLIFT 0 . 2 / / the distance to raise Z axis when parking an extruder <nl>
Merge pull request from thinkyhead / rc_dual_tool_z_limit
MarlinFirmware/Marlin
3b6a43f7ad9cde49fdd396a306c2042cc2999033
2016-11-03T02:52:44Z
new file mode 100644 <nl> index 0000000000000 . . 4f62b849d56cd <nl> mmm / dev / null <nl> ppp b / tensorflow / tools / git / . gitignore <nl> @ @ - 0 , 0 + 1 @ @ <nl> + gen <nl> mmm a / util / python / python_config . sh <nl> ppp b / util / python / python_config . sh <nl> function setup_python { <nl> python_lib_path = ( $ ( python_path ) ) <nl> unset IFS <nl> <nl> - if [ 1 - eq $ USE_DEFAULT_PYTHON_LIB_PATH ] ; then <nl> + if [ 1 = " $ USE_DEFAULT_PYTHON_LIB_PATH " ] ; then <nl> PYTHON_LIB_PATH = " $ ( default_python_path " $ { python_lib_path [ 0 ] } " ) " <nl> echo " Using python library path : $ PYTHON_LIB_PATH " <nl> <nl> function setup_python { <nl> read b | | true <nl> if [ " $ b " = = " " ] ; then <nl> PYTHON_LIB_PATH = " $ ( default_python_path " $ { python_lib_path [ 0 ] } " ) " <nl> - echo $ PYTHON_LIB_PATH <nl> + echo " Using python library path : $ PYTHON_LIB_PATH " <nl> else <nl> PYTHON_LIB_PATH = " $ b " <nl> fi <nl> fi <nl> fi <nl> - <nl> + <nl> if test - d " $ PYTHON_LIB_PATH " - a - x " $ PYTHON_LIB_PATH " ; then <nl> python_lib = " $ PYTHON_LIB_PATH " <nl> else <nl>
Ignore tools / git / gen and fix a bash error in python_config . sh ( )
tensorflow/tensorflow
197230147c7636c28ebf1a49c51706cf5c1eb9f1
2016-11-04T22:47:59Z
mmm a / src / video_core / shader / decode / memory . cpp <nl> ppp b / src / video_core / shader / decode / memory . cpp <nl> Node GetAtomOperation ( AtomicOp op , bool is_signed , Node memory , Node data ) { <nl> return OperationCode : : AtomicIXor ; <nl> case AtomicOp : : Exch : <nl> return OperationCode : : AtomicIExchange ; <nl> + default : <nl> + UNIMPLEMENTED_MSG ( " op = { } " , static_cast < int > ( op ) ) ; <nl> + return OperationCode : : AtomicIAdd ; <nl> } <nl> } ( ) ; <nl> return SignedOperation ( operation_code , is_signed , std : : move ( memory ) , std : : move ( data ) ) ; <nl>
Merge pull request from ReinUsesLisp / c4715 - silence
yuzu-emu/yuzu
0d4ca5a8fc79c3b2a4b33ee65e8b27da5caebeb2
2020-04-02T18:32:19Z
mmm a / src / compiler / analysis / analysis_result . cpp <nl> ppp b / src / compiler / analysis / analysis_result . cpp <nl> void AnalysisResult : : outputCPPNamedLiteralStrings ( bool genStatic , <nl> <nl> if ( genStatic | | nstrings = = 0 ) return ; <nl> <nl> - int chunkSize = ( nstrings + Option : : LiteralStringFileCount ) / <nl> - Option : : LiteralStringFileCount ; <nl> - if ( chunkSize < Option : : LiteralStringFileCount ) { <nl> - chunkSize = Option : : LiteralStringFileCount ; <nl> + int chunkSize ; <nl> + if ( ar - > isSystem ( ) ) { <nl> + / / generate one single literal_strings file for system <nl> + chunkSize = nstrings ; <nl> + } else { <nl> + chunkSize = ( nstrings + Option : : LiteralStringFileCount ) / <nl> + Option : : LiteralStringFileCount ; <nl> } <nl> int count = 0 ; <nl> <nl> mmm a / src / system / gen / sys / literal_strings_0 . no . cpp <nl> ppp b / src / system / gen / sys / literal_strings_0 . no . cpp <nl> StaticString s_sys_ss961c2365 ( " getDelayedByKey " ) ; <nl> StaticString s_sys_ss9621feb5 ( " \ 000Continuation \ 000args " , 18 ) ; <nl> StaticString s_sys_ss9631f2ea ( " isDestructor " ) ; <nl> StaticString s_sys_ss963681e7 ( " __setsoapheaders " ) ; <nl> + StaticString s_sys_ss969a2913 ( " getClass " ) ; <nl> + StaticString s_sys_ss96f7c57c ( " fflush " ) ; <nl> + StaticString s_sys_ss9795dfc8 ( " Property " ) ; <nl> + StaticString s_sys_ss97b15062 ( " getModifiers " ) ; <nl> + StaticString s_sys_ss985d885e ( " Function " ) ; <nl> + StaticString s_sys_ss993f2e69 ( " ArrayIterator " ) ; <nl> + StaticString s_sys_ss9943cbf4 ( " valid " ) ; <nl> + StaticString s_sys_ss99f908fe ( " ReflectionFunction " ) ; <nl> + StaticString s_sys_ss9a04b6ca ( " isWritable " ) ; <nl> + StaticString s_sys_ss9b1f3b88 ( " numcolumns " ) ; <nl> + StaticString s_sys_ss9ba95c5a ( " getDocNamespaces " ) ; <nl> + StaticString s_sys_ss9cfa17a6 ( " doc " ) ; <nl> + StaticString s_sys_ss9d68a010 ( " offsetGet " ) ; <nl> + StaticString s_sys_ss9dad4367 ( " isDefault " ) ; <nl> + StaticString s_sys_ss9e5158a7 ( " error " ) ; <nl> + StaticString s_sys_ss9ea65e74 ( " registerNamespace " ) ; <nl> + StaticString s_sys_ss9f244c80 ( " modifiers " ) ; <nl> + StaticString s_sys_ss9f7d7f06 ( " createElement " ) ; <nl> + StaticString s_sys_ss9fa37b08 ( " getFileInfo " ) ; <nl> + StaticString s_sys_ss9fb56979 ( " protected " ) ; <nl> + StaticString s_sys_ssa13cba49 ( " writeAttributeNS " ) ; <nl> + StaticString s_sys_ssa1b87da7 ( " __construct " ) ; <nl> + StaticString s_sys_ssa20217b5 ( " getFlags " ) ; <nl> + StaticString s_sys_ssa23e236b ( " __tostring " ) ; <nl> + StaticString s_sys_ssa26bedd7 ( " __init__ " ) ; <nl> + StaticString s_sys_ssa2784203 ( " xend " ) ; <nl> + StaticString s_sys_ssa2c3ffd2 ( " splitText " ) ; <nl> + StaticString s_sys_ssa3157835 ( " startComment " ) ; <nl> + StaticString s_sys_ssa3425730 ( " listAbbreviations " ) ; <nl> + StaticString s_sys_ssa37fe34e ( " LogicException " ) ; <nl> + StaticString s_sys_ssa4e142d1 ( " getINIEntries " ) ; <nl> + StaticString s_sys_ssa5a7f4f9 ( " __destruct " ) ; <nl> + StaticString s_sys_ssa6bc4f55 ( " endAttribute " ) ; <nl> + StaticString s_sys_ssa6cfea13 ( " test " ) ; <nl> + StaticString s_sys_ssa78ef7eb ( " Class " ) ; <nl> + StaticString s_sys_ssa7dd9b60 ( " appendXML " ) ; <nl> + StaticString s_sys_ssa7f86c5a ( " commit " ) ; <nl> + StaticString s_sys_ssa812760b ( " isPrivate " ) ; <nl> + StaticString s_sys_ssa93e2205 ( " flush " ) ; <nl> + StaticString s_sys_ssa9a8d951 ( " isExecutable " ) ; <nl> + StaticString s_sys_ssaa14dfdd ( " detect " ) ; <nl> + StaticString s_sys_ssaa916331 ( " lasterrorcode " ) ; <nl> + StaticString s_sys_ssab7a1dec ( " code " ) ; <nl> + StaticString s_sys_ssabd12782 ( " setcompressthreshold " ) ; <nl> + StaticString s_sys_ssac0b0f60 ( " ErrorException " ) ; <nl> + StaticString s_sys_ssac2b8cd6 ( " fgets " ) ; <nl> + StaticString s_sys_ssac3b59a3 ( " registerPHPFunctions " ) ; <nl> + StaticString s_sys_ssac67a3b5 ( " connect " ) ; <nl> + StaticString s_sys_ssacf726a1 ( " __cont__ " ) ; <nl> + StaticString s_sys_ssad18c6ae ( " create " ) ; <nl> + StaticString s_sys_ssad33d956 ( " startElement " ) ; <nl> + StaticString s_sys_ssad6f5b8c ( " setChecks " ) ; <nl> + StaticString s_sys_ssada05422 ( " startPI " ) ; <nl> + StaticString s_sys_ssadd5fee2 ( " LengthException " ) ; <nl> + StaticString s_sys_ssae8717ad ( " exception " ) ; <nl> + StaticString s_sys_ssaeb53ef3 ( " argRest " ) ; <nl> + StaticString s_sys_ssb0933c52 ( " getLine " ) ; <nl> + StaticString s_sys_ssb122eff8 ( " getRealPath " ) ; <nl> + StaticString s_sys_ssb17013df ( " openURI " ) ; <nl> + StaticString s_sys_ssb1c4aa6f ( " getATime " ) ; <nl> + StaticString s_sys_ssb303f411 ( " __isset " ) ; <nl> + StaticString s_sys_ssb30ca8a5 ( " setMaxLineLen " ) ; <nl> + StaticString s_sys_ssb3a5c1b3 ( " current " ) ; <nl> + StaticString s_sys_ssb3fce46e ( " \ 000AppendIterator \ 000iterators " , 25 ) ; <nl> + StaticString s_sys_ssb5a1e6bc ( " ReflectionObject " ) ; <nl> + StaticString s_sys_ssb5d283cb ( " receive " ) ; <nl> + StaticString s_sys_ssb6132cef ( " setoptimeout " ) ; <nl> + StaticString s_sys_ssb65737a4 ( " DomainException " ) ; <nl> + StaticString s_sys_ssb69f1960 ( " getTransitions " ) ; <nl> + StaticString s_sys_ssb6bff43f ( " getElementsByTagNameNS " ) ; <nl> + StaticString s_sys_ssb7ae555d ( " class_exists " ) ; <nl> + StaticString s_sys_ssb7fa1eb1 ( " validate " ) ; <nl> + StaticString s_sys_ssb84c8cfa ( " severity " ) ; <nl> + StaticString s_sys_ssb8a9ecc6 ( " UnderflowException " ) ; <nl> + StaticString s_sys_ssb8f33aef ( " writeElementNS " ) ; <nl> + StaticString s_sys_ssba65d5ee ( " append " ) ; <nl> + StaticString s_sys_ssbac40e3d ( " fseek " ) ; <nl> + StaticString s_sys_ssbad150b1 ( " pconnect " ) ; <nl> + StaticString s_sys_ssbc297b7f ( " OverflowException " ) ; <nl> + StaticString s_sys_ssbc590ceb ( " isArray " ) ; <nl> + StaticString s_sys_ssbd66b015 ( " fetcharray " ) ; <nl> + StaticString s_sys_ssbd8183dc ( " saveHTMLFile " ) ; <nl> + StaticString s_sys_ssbda189a5 ( " __setlocation " ) ; <nl> + StaticString s_sys_ssbdaacf24 ( " help " ) ; <nl> + StaticString s_sys_ssbe2ba1ac ( " offsetSet " ) ; <nl> + StaticString s_sys_ssbe346e77 ( " addServers " ) ; <nl> + StaticString s_sys_ssbefe32a8 ( " line2 " ) ; <nl> + StaticString s_sys_ssc035d638 ( " removeAttributeNS " ) ; <nl> + StaticString s_sys_ssc09df55f ( " isFile " ) ; <nl> + StaticString s_sys_ssc0ff3081 ( " index " ) ; <nl> + StaticString s_sys_ssc103992f ( " appendData " ) ; <nl> + StaticString s_sys_ssc1c38583 ( " SeekableIterator " ) ; <nl> + StaticString s_sys_ssc2defd5c ( " setAttributeNS " ) ; <nl> + StaticString s_sys_ssc2df217e ( " getName " ) ; <nl> + StaticString s_sys_ssc2fd8845 ( " setIndent " ) ; <nl> + StaticString s_sys_ssc4385198 ( " endDTD " ) ; <nl> + StaticString s_sys_ssc483d02b ( " relaxNGValidateSource " ) ; <nl> + StaticString s_sys_ssc556d1b5 ( " isFinal " ) ; <nl> + StaticString s_sys_ssc57472df ( " RecursiveIteratorIterator " ) ; <nl> + StaticString s_sys_ssc589966e ( " getUTF8 " ) ; <nl> + StaticString s_sys_ssc5f10d1a ( " getStats " ) ; <nl> + StaticString s_sys_ssc60228c6 ( " open " ) ; <nl> + StaticString s_sys_ssc64ebfff ( " Iterator " ) ; <nl> + StaticString s_sys_ssc72eef1f ( " DirectoryIterator " ) ; <nl> + StaticString s_sys_ssc7d7a51a ( " getDefaultProperties " ) ; <nl> + StaticString s_sys_ssc82dbd12 ( " class " ) ; <nl> + StaticString s_sys_ssc8396b02 ( " functions " ) ; <nl> + StaticString s_sys_ssc880eb8a ( " __call " ) ; <nl> + StaticString s_sys_ssc89c1797 ( " asort " ) ; <nl> + StaticString s_sys_ssc8ce68a6 ( " print " ) ; <nl> + StaticString s_sys_ssc8d87985 ( " getElementById " ) ; <nl> + StaticString s_sys_ssc90e239b ( " invoke " ) ; <nl> + StaticString s_sys_ssc95caa7e ( " getNamespaces " ) ; <nl> + StaticString s_sys_ssc9ae0c06 ( " \ 000Continuation \ 000obj " , 17 ) ; <nl> + StaticString s_sys_ssca0f1ff4 ( " startDTDEntity " ) ; <nl> + StaticString s_sys_sscaf1930c ( " __getlastresponseheaders " ) ; <nl> + StaticString s_sys_sscafbef71 ( " getversion " ) ; <nl> + StaticString s_sys_sscb20b361 ( " setAttributeNodeNS " ) ; <nl> + StaticString s_sys_sscb2328b2 ( " cloneNode " ) ; <nl> + StaticString s_sys_sscb34fe23 ( " isnormalized " ) ; <nl> + StaticString s_sys_sscbecc3ad ( " \ 000Continuation \ 000index " , 19 ) ; <nl> + StaticString s_sys_sscca6e52d ( " getByKey " ) ; <nl> + StaticString s_sys_ssccbba71e ( " getTrace " ) ; <nl> + StaticString s_sys_sscd0bfaee ( " getExtension " ) ; <nl> + StaticString s_sys_sscd5dc41e ( " ReflectionParameter " ) ; <nl> + StaticString s_sys_sscdbb2d67 ( " getMethod " ) ; <nl> + StaticString s_sys_ssce568670 ( " appendByKey " ) ; <nl> + StaticString s_sys_ssce80f767 ( " isProtected " ) ; <nl> + StaticString s_sys_ssced27431 ( " increment " ) ; <nl> + StaticString s_sys_sscedef5dc ( " ini " ) ; <nl> + StaticString s_sys_sscfb8e254 ( " interfaces " ) ; <nl> + StaticString s_sys_sscfd63bc6 ( " replace " ) ; <nl> + StaticString s_sys_ssd029c1ac ( " getProperty " ) ; <nl> + StaticString s_sys_ssd04b2eb8 ( " export " ) ; <nl> + StaticString s_sys_ssd04bc523 ( " endDocument " ) ; <nl> + StaticString s_sys_ssd073a009 ( " getserverstatus " ) ; <nl> + StaticString s_sys_ssd0eae9b1 ( " ftell " ) ; <nl> + StaticString s_sys_ssd13a269b ( " importNode " ) ; <nl> + StaticString s_sys_ssd13b20f5 ( " getResultMessage " ) ; <nl> + StaticString s_sys_ssd14ebd08 ( " getValue " ) ; <nl> + StaticString s_sys_ssd222d509 ( " Continuation is already finished " ) ; <nl> + StaticString s_sys_ssd26edebe ( " setserverparams " ) ; <nl> + StaticString s_sys_ssd28c05f3 ( " debugdumpparams " ) ; <nl> + StaticString s_sys_ssd323f9f4 ( " getSeverity " ) ; <nl> + StaticString s_sys_ssd332baa7 ( " , " ) ; <nl> + StaticString s_sys_ssd371b205 ( " getNodePath " ) ; <nl> + StaticString s_sys_ssd4097a2c ( " __soapcall " ) ; <nl> + StaticString s_sys_ssd44d37cf ( " XhprofFrame " ) ; <nl> + StaticString s_sys_ssd47ba3c5 ( " columncount " ) ; <nl> + StaticString s_sys_ssd492d56b ( " getElementsByTagName " ) ; <nl> + StaticString s_sys_ssd4af8244 ( " iterators " ) ; <nl> + StaticString s_sys_ssd4c67725 ( " line1 " ) ; <nl> + StaticString s_sys_ssd59e789f ( " \ \ " ) ; <nl> + StaticString s_sys_ssd5cc982b ( " getClasses " ) ; <nl> + StaticString s_sys_ssd5dbbd47 ( " getDocComment " ) ; <nl> + StaticString s_sys_ssd6b8bbae ( " getAttributeNS " ) ; <nl> + StaticString s_sys_ssd6eedaeb ( " getInterfaces " ) ; <nl> + StaticString s_sys_ssd766aa9d ( " hasAttribute " ) ; <nl> + StaticString s_sys_ssd816f860 ( " Class constant " ) ; <nl> + StaticString s_sys_ssd8580167 ( " writeCData " ) ; <nl> + StaticString s_sys_ssd8c10a25 ( " __PHP_Incomplete_Class " ) ; <nl> + StaticString s_sys_ssd8c7abd7 ( " newInstanceArgs " ) ; <nl> + StaticString s_sys_ssd9632345 ( " geterrorcode " ) ; <nl> + StaticString s_sys_ssdb381ae8 ( " : " ) ; <nl> + StaticString s_sys_ssdc3cbddc ( " name " ) ; <nl> + StaticString s_sys_ssdc6e02c2 ( " Method " ) ; <nl> + StaticString s_sys_ssdc71ce35 ( " fault " ) ; <nl> + StaticString s_sys_ssdcae3319 ( " openblob " ) ; <nl> + StaticString s_sys_ssdd233bb0 ( " DirectoryIterator : : __construct ( " ) ; <nl> + StaticString s_sys_ssdd355b2b ( " isSubclassOf " ) ; <nl> + StaticString s_sys_ssddf8728c ( " line " ) ; <nl> + StaticString s_sys_ssde0994ef ( " insertData " ) ; <nl> + StaticString s_sys_ssde0dbfb2 ( " \ 000Continuation \ 000running " , 21 ) ; <nl> + StaticString s_sys_ssde22f98d ( " fetchAll " ) ; <nl> + StaticString s_sys_ssdec3c0f0 ( " isPublic " ) ; <nl> + StaticString s_sys_ssdec966e8 ( " getNamedItem " ) ; <nl> + StaticString s_sys_ssded23afd ( " createDocumentFragment " ) ; <nl> + StaticString s_sys_ssdef06d86 ( " openMemory " ) ; <nl> + StaticString s_sys_ssdef8398d ( " replaceData " ) ; <nl> + StaticString s_sys_ssdf34c0b4 ( " isAbstract " ) ; <nl> + StaticString s_sys_sse051f235 ( " helpCmds " ) ; <nl> + StaticString s_sys_sse09ed13c ( " createfunction " ) ; <nl> + StaticString s_sys_sse0c88471 ( " value " ) ; <nl> + StaticString s_sys_sse1ffa7cf ( " hasMethod " ) ; <nl> + StaticString s_sys_sse26c5698 ( " addFile " ) ; <nl> + StaticString s_sys_sse27b119d ( " fgetc " ) ; <nl> + StaticString s_sys_sse2be8bf1 ( " endComment " ) ; <nl> + StaticString s_sys_sse3783d41 ( " getSubPath " ) ; <nl> + StaticString s_sys_sse3f54806 ( " query " ) ; <nl> + StaticString s_sys_sse41ca304 ( " addString " ) ; <nl> + StaticString s_sys_sse48e511b ( " setattribute " ) ; <nl> + StaticString s_sys_sse4a1cad7 ( " getVersion " ) ; <nl> + StaticString s_sys_sse5340a31 ( " mapping " ) ; <nl> + StaticString s_sys_sse590286e ( " offsetUnset " ) ; <nl> + StaticString s_sys_sse5c78f27 ( " begintransaction " ) ; <nl> + StaticString s_sys_sse63d8c2d ( " func " ) ; <nl> + StaticString s_sys_sse68e7bf5 ( " getArrayCopy " ) ; <nl> + StaticString s_sys_sse73b3a2c ( " eof " ) ; <nl> + StaticString s_sys_sse781f7da ( " private " ) ; <nl> + StaticString s_sys_sse867e166 ( " __set " ) ; <nl> + StaticString s_sys_sse896cb09 ( " read " ) ; <nl> + StaticString s_sys_sse8a6ad69 ( " getMaxLineLen " ) ; <nl> + StaticString s_sys_sse9bf4500 ( " extension " ) ; <nl> + StaticString s_sys_sse9da2c6e ( " setText " ) ; <nl> + StaticString s_sys_ssea00c58c ( " isLink " ) ; <nl> + StaticString s_sys_ssea339844 ( " createComment " ) ; <nl> + StaticString s_sys_sseac4979f ( " get " ) ; <nl> + StaticString s_sys_sseacf71c9 ( " Exception " ) ; <nl> + StaticString s_sys_ssec6b7b45 ( " isLocal " ) ; <nl> + StaticString s_sys_ssec8fccc4 ( " ReflectionProperty " ) ; <nl> + StaticString s_sys_ssedd47a43 ( " nullable " ) ; <nl> + StaticString s_sys_ssee030a49 ( " replaceChild " ) ; <nl> + StaticString s_sys_ssee112c62 ( " Continuation is already running " ) ; <nl> + StaticString s_sys_ssee3325ed ( " writeRaw " ) ; <nl> + StaticString s_sys_ssef33be8d ( " \ 000SplObjectStorage \ 000index " , 23 ) ; <nl> + StaticString s_sys_ssef52e4e1 ( " implementsInterface " ) ; <nl> + StaticString s_sys_ssefecb9dd ( " constructor " ) ; <nl> + StaticString s_sys_ssf04bce93 ( " loadHTMLFile " ) ; <nl> + StaticString s_sys_ssf052ec6b ( " close " ) ; <nl> + StaticString s_sys_ssf08d205d ( " static " ) ; <nl> + StaticString s_sys_ssf0e3c7d6 ( " getSubPathname " ) ; <nl> + StaticString s_sys_ssf0ea8ac1 ( " RecursiveDirectoryIterator : : __construct ( " ) ; <nl> + StaticString s_sys_ssf1bd1a9d ( " getPosition " ) ; <nl> + StaticString s_sys_ssf1d09588 ( " bindvalue " ) ; <nl> + StaticString s_sys_ssf220c3cc ( " ask " ) ; <nl> + StaticString s_sys_ssf2460018 ( " update " ) ; <nl> + StaticString s_sys_ssf362b3c4 ( " path " ) ; <nl> + StaticString s_sys_ssf38cf473 ( " wrap " ) ; <nl> + StaticString s_sys_ssf3f5d744 ( " hasProperty " ) ; <nl> + StaticString s_sys_ssf401cc22 ( " getFile " ) ; <nl> + StaticString s_sys_ssf4426a16 ( " evaluate " ) ; <nl> + StaticString s_sys_ssf45b9a33 ( " isValid " ) ; <nl> + StaticString s_sys_ssf46d6580 ( " fetch " ) ; <nl> + StaticString s_sys_ssf4c4a1fc ( " getAttributeNode " ) ; <nl> + StaticString s_sys_ssf4c6e0f5 ( " isWhitespaceInElementContent " ) ; <nl> + StaticString s_sys_ssf4dfdccf ( " isDefaultValueAvailable " ) ; <nl> + StaticString s_sys_ssf528fa86 ( " endDTDEntity " ) ; <nl> + StaticString s_sys_ssf56a53de ( " rowcount " ) ; <nl> + StaticString s_sys_ssf578e813 ( " getInode " ) ; <nl> + StaticString s_sys_ssf5eb6fb9 ( " fwrite " ) ; <nl> + StaticString s_sys_ssf6be66f9 ( " hasChildren " ) ; <nl> + StaticString s_sys_ssf6c6cae3 ( " getMulti " ) ; <nl> + StaticString s_sys_ssf72d4a28 ( " hasFeature " ) ; <nl> + StaticString s_sys_ssf7da8a33 ( " tutorial " ) ; <nl> + StaticString s_sys_ssf7fe16d3 ( " loadDims " ) ; <nl> + StaticString s_sys_ssf82f565f ( " ReflectionProperty : : setAccessible is not supported " ) ; <nl> + StaticString s_sys_ssf833b943 ( " loadImages " ) ; <nl> + StaticString s_sys_ssf8395a4d ( " getStartLine " ) ; <nl> + StaticString s_sys_ssf88f9505 ( " errorinfo " ) ; <nl> + StaticString s_sys_ssf976719e ( " args " ) ; <nl> + StaticString s_sys_ssf99443fd ( " openFile " ) ; <nl> + StaticString s_sys_ssfab32402 ( " { main } " ) ; <nl> + StaticString s_sys_ssfb10fd8c ( " parent " ) ; <nl> + StaticString s_sys_ssfb433b54 ( " nextrowset " ) ; <nl> + StaticString s_sys_ssfb6412d4 ( " ) : failed to open dir " ) ; <nl> + StaticString s_sys_ssfb726449 ( " Cannot rewind on a Continuation object " ) ; <nl> + StaticString s_sys_ssfbb3eb52 ( " addUrl " ) ; <nl> + StaticString s_sys_ssfc2d4779 ( " getType " ) ; <nl> + StaticString s_sys_ssfc63c2bb ( " ReflectionClass " ) ; <nl> + StaticString s_sys_ssfdbe04fa ( " set " ) ; <nl> + StaticString s_sys_ssfe3209ac ( " uksort " ) ; <nl> + StaticString s_sys_ssfe470f29 ( " startDTDElement " ) ; <nl> + StaticString s_sys_ssfe98adf4 ( " getIterator " ) ; <nl> + StaticString s_sys_ssfebd5e9a ( " natsort " ) ; <nl> + StaticString s_sys_ssff10260d ( " ReflectionExtension " ) ; <nl> + StaticString s_sys_ss00000000 ( " " ) ; <nl> + StaticString s_sys_ss01c141eb ( " deleteData " ) ; <nl> + StaticString s_sys_ss033e1025 ( " BadMethodCallException " ) ; <nl> + StaticString s_sys_ss038035c6 ( " setMulti " ) ; <nl> + StaticString s_sys_ss0415e4a0 ( " classes " ) ; <nl> + StaticString s_sys_ss05c2645c ( " substringData " ) ; <nl> + StaticString s_sys_ss0626a7ce ( " uasort " ) ; <nl> + StaticString s_sys_ss06d80b5c ( " returnsReference " ) ; <nl> + StaticString s_sys_ss0723515e ( " __wakeup " ) ; <nl> + StaticString s_sys_ss0727dc04 ( " getConfidence " ) ; <nl> + StaticString s_sys_ss07445cb3 ( " num_args " ) ; <nl> + StaticString s_sys_ss077ab997 ( " getFilename " ) ; <nl> + StaticString s_sys_ss079dd82d ( " InvalidArgumentException " ) ; <nl> + StaticString s_sys_ss0915cca1 ( " registerNodeClass " ) ; <nl> + StaticString s_sys_ss09d4c665 ( " getClassNames " ) ; <nl> + StaticString s_sys_ss0a49a8a1 ( " getAttribute " ) ; <nl> + StaticString s_sys_ss0a60a5a3 ( " OutOfRangeException " ) ; <nl> + StaticString s_sys_ss0ab49528 ( " printFrame " ) ; <nl> + StaticString s_sys_ss0bb83e44 ( " lastinsertid " ) ; <nl> + StaticString s_sys_ss0bbec676 ( " getLabel " ) ; <nl> + StaticString s_sys_ss0bfd696f ( " setIDAttributeNS " ) ; <nl> + StaticString s_sys_ss0c3a6c4a ( " getPath " ) ; <nl> + StaticString s_sys_ss0c50ad86 ( " OutOfBoundsException " ) ; <nl> + StaticString s_sys_ss0c905545 ( " __sleep " ) ; <nl> + StaticString s_sys_ss0d42ecf6 ( " r " ) ; <nl> + StaticString s_sys_ss0d54babb ( " count " ) ; <nl> + StaticString s_sys_ss0d7533cf ( " Reflector " ) ; <nl> + StaticString s_sys_ss0e0c542f ( " appendChild " ) ; <nl> + StaticString s_sys_ss0e5b3f43 ( " writeComment " ) ; <nl> + StaticString s_sys_ss0eb9302b ( " addserver " ) ; <nl> + StaticString s_sys_ss0ec14ee2 ( " SplObjectStorage " ) ; <nl> + StaticString s_sys_ss0f30800a ( " vars " ) ; <nl> + StaticString s_sys_ss0f61bd03 ( " obj " ) ; <nl> + StaticString s_sys_ss0f90caf6 ( " getConstant " ) ; <nl> + StaticString s_sys_ss0fad9ac4 ( " AppendIterator " ) ; <nl> + StaticString s_sys_ss0fc37e03 ( " attributes " ) ; <nl> + StaticString s_sys_ss0fe15fdf ( " getServerByKey " ) ; <nl> + StaticString s_sys_ss102b70c6 ( " setIDAttribute " ) ; <nl> + StaticString s_sys_ss106b4dd7 ( " prependByKey " ) ; <nl> + StaticString s_sys_ss11603299 ( " get_arg " ) ; <nl> + StaticString s_sys_ss11bc49d2 ( " isReadable " ) ; <nl> + StaticString s_sys_ss11e815e7 ( " xinclude " ) ; <nl> + StaticString s_sys_ss1247a693 ( " item " ) ; <nl> + StaticString s_sys_ss12c8a8a6 ( " abstract " ) ; <nl> + StaticString s_sys_ss12e90587 ( " key " ) ; <nl> + StaticString s_sys_ss1303cc56 ( " hasAttributeNS " ) ; <nl> + StaticString s_sys_ss134fd5fa ( " ref " ) ; <nl> + StaticString s_sys_ss135934b0 ( " getPathInfo " ) ; <nl> + StaticString s_sys_ss135b2bb6 ( " lookupPrefix " ) ; <nl> + StaticString s_sys_ss13622d08 ( " removeChild " ) ; <nl> + StaticString s_sys_ss143f106a ( " getFrame " ) ; <nl> + StaticString s_sys_ss1491baad ( " label " ) ; <nl> + StaticString s_sys_ss14e5c43c ( " running " ) ; <nl> + StaticString s_sys_ss14eade34 ( " hasChildNodes " ) ; <nl> + StaticString s_sys_ss155366df ( " message " ) ; <nl> + StaticString s_sys_ss15921d14 ( " areConfusable " ) ; <nl> + StaticString s_sys_ss15a9d310 ( " fgetcsv " ) ; <nl> + StaticString s_sys_ss163bad01 ( " addServer " ) ; <nl> + StaticString s_sys_ss164363b4 ( " getPathname " ) ; <nl> + StaticString s_sys_ss172df677 ( " deleteByKey " ) ; <nl> + StaticString s_sys_ss17c3d085 ( " fullEndElement " ) ; <nl> + StaticString s_sys_ss17f0e883 ( " exec " ) ; <nl> + StaticString s_sys_ss1863b3c7 ( " getGroup " ) ; <nl> + StaticString s_sys_ss18bebdc2 ( " replaceByKey " ) ; <nl> + StaticString s_sys_ss1902bc14 ( " getParameters " ) ; <nl> + StaticString s_sys_ss19136311 ( " \ 000Continuation \ 000received " , 22 ) ; <nl> + StaticString s_sys_ss19281e76 ( " format " ) ; <nl> + StaticString s_sys_ss1b64dec9 ( " bindparam " ) ; <nl> + StaticString s_sys_ss1bbd440a ( " lastinsertrowid " ) ; <nl> + StaticString s_sys_ss1c65f80a ( " getDefaultValue " ) ; <nl> + StaticString s_sys_ss1ce69cd5 ( " getStaticProperties " ) ; <nl> + StaticString s_sys_ss1cfbc2c8 ( " setMultiByKey " ) ; <nl> + StaticString s_sys_ss1d6e06d8 ( " getFunctions " ) ; <nl> + StaticString s_sys_ss1da57557 ( " ReflectionException " ) ; <nl> + StaticString s_sys_ss1f20ac62 ( " params " ) ; <nl> + StaticString s_sys_ss1fa13716 ( " invokeArgs " ) ; <nl> + StaticString s_sys_ss1fa5c668 ( " setFlags " ) ; <nl> + StaticString s_sys_ss1fe1e1ea ( " xpath " ) ; <nl> + StaticString s_sys_ss20098bac ( " asXML " ) ; <nl> + StaticString s_sys_ss2145036e ( " final " ) ; <nl> + StaticString s_sys_ss225c5a00 ( " endPI " ) ; <nl> + StaticString s_sys_ss22bfe43e ( " Traversable " ) ; <nl> + StaticString s_sys_ss23afce76 ( " setVars " ) ; <nl> + StaticString s_sys_ss24749844 ( " getParentClass " ) ; <nl> + StaticString s_sys_ss25294c59 ( " getEncoding " ) ; <nl> + StaticString s_sys_ss2559ca9a ( " startDTD " ) ; <nl> + StaticString s_sys_ss26e41480 ( " fscanf " ) ; <nl> + StaticString s_sys_ss26fb679a ( " get_args " ) ; <nl> + StaticString s_sys_ss274b0685 ( " loadHTML " ) ; <nl> + StaticString s_sys_ss27634730 ( " isInterface " ) ; <nl> + StaticString s_sys_ss28e44b58 ( " setAttributeNode " ) ; <nl> + StaticString s_sys_ss28fae70d ( " flags " ) ; <nl> + StaticString s_sys_ss299bd55e ( " OuterIterator " ) ; <nl> + StaticString s_sys_ss29d06307 ( " helpSection " ) ; <nl> + StaticString s_sys_ss2a19cdf6 ( " decrement " ) ; <nl> + StaticString s_sys_ss2a44d071 ( " changes " ) ; <nl> + StaticString s_sys_ss2a6293f6 ( " getSize " ) ; <nl> + StaticString s_sys_ss2aa43f67 ( " getAttributeNodeNS " ) ; <nl> + StaticString s_sys_ss2c18aae1 ( " natcasesort " ) ; <nl> + StaticString s_sys_ss2cb2e0eb ( " setstrength " ) ; <nl> + StaticString s_sys_ss2d350426 ( " finalize " ) ; <nl> + StaticString s_sys_ss2d431bd1 ( " writeDTDEntity " ) ; <nl> + StaticString s_sys_ss2d5cec41 ( " __getlastrequest " ) ; <nl> + StaticString s_sys_ss2da130db ( " prepend " ) ; <nl> + StaticString s_sys_ss2dd6aec3 ( " Closure " ) ; <nl> + StaticString s_sys_ss2f8e5140 ( " setOption " ) ; <nl> + StaticString s_sys_ss2fd353cc ( " iterator " ) ; <nl> + StaticString s_sys_ss30120c29 ( " __setcookie " ) ; <nl> + StaticString s_sys_ss305b0746 ( " received " ) ; <nl> + StaticString s_sys_ss309aefff ( " msg " ) ; <nl> + StaticString s_sys_ss31a11388 ( " errorcode " ) ; <nl> + StaticString s_sys_ss31ec77af ( " insertBefore " ) ; <nl> + StaticString s_sys_ss325815c1 ( " setValue " ) ; <nl> + StaticString s_sys_ss32d46a21 ( " __unset " ) ; <nl> + StaticString s_sys_ss331d21f7 ( " createAttribute " ) ; <nl> + StaticString s_sys_ss337f2a0c ( " MutableArrayIterator " ) ; <nl> + StaticString s_sys_ss3382a209 ( " contains " ) ; <nl> + StaticString s_sys_ss33872dc4 ( " getStaticVariables " ) ; <nl> + StaticString s_sys_ss33896428 ( " writeElement " ) ; <nl> + StaticString s_sys_ss33988b3e ( " info " ) ; <nl> + StaticString s_sys_ss3403085f ( " getstats " ) ; <nl> + StaticString s_sys_ss343a37dc ( " geterrormessage " ) ; <nl> + StaticString s_sys_ss344c5db6 ( " hasAttributes " ) ; <nl> + StaticString s_sys_ss37217e60 ( " hasConstant " ) ; <nl> + StaticString s_sys_ss372c9151 ( " ksort " ) ; <nl> + StaticString s_sys_ss37eff1c8 ( " getInnerIterator " ) ; <nl> + StaticString s_sys_ss38d893f5 ( " addCompletion " ) ; <nl> + StaticString s_sys_ss3983a61c ( " createElementNS " ) ; <nl> + StaticString s_sys_ss3a783e44 ( " getFileName " ) ; <nl> + StaticString s_sys_ss3bb8fb3e ( " createTextNode " ) ; <nl> + StaticString s_sys_ss3bd544b6 ( " casByKey " ) ; <nl> + StaticString s_sys_ss3bdd1f72 ( " getCsvControl " ) ; <nl> + StaticString s_sys_ss3c4bceb1 ( " columntype " ) ; <nl> + StaticString s_sys_ss3d09e8a5 ( " startDTDAttlist " ) ; <nl> + StaticString s_sys_ss3d6f0745 ( " quote " ) ; <nl> + StaticString s_sys_ss3dea3a84 ( " createDocument " ) ; <nl> + StaticString s_sys_ss3f63bb07 ( " getextendedstats " ) ; <nl> + StaticString s_sys_ss3fe4822b ( " setAccessible " ) ; <nl> + StaticString s_sys_ss404bf1b4 ( " isStatic " ) ; <nl> + StaticString s_sys_ss406322f2 ( " currentRef " ) ; <nl> + StaticString s_sys_ss40877955 ( " \ 000Continuation \ 000label " , 19 ) ; <nl> + StaticString s_sys_ss41c7a197 ( " stdclass " ) ; <nl> + StaticString s_sys_ss42161ae0 ( " nextImpl " ) ; <nl> + StaticString s_sys_ss424e8241 ( " getTimezone " ) ; <nl> + StaticString s_sys_ss426361a3 ( " stdClass " ) ; <nl> + StaticString s_sys_ss42a11cef ( " setobject " ) ; <nl> + StaticString s_sys_ss42fc2063 ( " startAttributens " ) ; <nl> + StaticString s_sys_ss43d0dde2 ( " isInstance " ) ; <nl> + StaticString s_sys_ss4431a364 ( " isSameNode " ) ; <nl> + StaticString s_sys_ss4483b6ae ( " getMethods " ) ; <nl> + StaticString s_sys_ss449b0823 ( " cas " ) ; <nl> + StaticString s_sys_ss44a1dc88 ( " isSupported " ) ; <nl> + StaticString s_sys_ss44fe7272 ( " Interface " ) ; <nl> + StaticString s_sys_ss45739f33 ( " getCTime " ) ; <nl> + StaticString s_sys_ss45e71386 ( " getCommand " ) ; <nl> + StaticString s_sys_ss45f15bcd ( " fetchobject " ) ; <nl> + StaticString s_sys_ss46bad435 ( " setDeclaredEncoding " ) ; <nl> + StaticString s_sys_ss46e7e29a ( " fetchcolumn " ) ; <nl> + StaticString s_sys_ss46e9d423 ( " schemaValidate " ) ; <nl> + StaticString s_sys_ss46eeef5c ( " handle " ) ; <nl> + StaticString s_sys_ss4723e39a ( " getCurrentLocation " ) ; <nl> + StaticString s_sys_ss474ef858 ( " Continuation " ) ; <nl> + StaticString s_sys_ss47724c46 ( " setclass " ) ; <nl> + StaticString s_sys_ss48139170 ( " addAttribute " ) ; <nl> + StaticString s_sys_ss48724660 ( " prepare " ) ; <nl> + StaticString s_sys_ss49963173 ( " RecursiveIterator " ) ; <nl> + StaticString s_sys_ss49fef19f ( " getPerms " ) ; <nl> + StaticString s_sys_ss4ad0c110 ( " Parameter is not optional " ) ; <nl> + StaticString s_sys_ss4ae2597c ( " __getlastresponse " ) ; <nl> + StaticString s_sys_ss4b959501 ( " __gettypes " ) ; <nl> + StaticString s_sys_ss4bab1591 ( " getDelayed " ) ; <nl> + StaticString s_sys_ss4c77dad1 ( " is a Class " ) ; <nl> + StaticString s_sys_ss4ca209c3 ( " delete " ) ; <nl> + StaticString s_sys_ss4ccc4d04 ( " flock " ) ; <nl> + StaticString s_sys_ss4cd61020 ( " closure " ) ; <nl> + StaticString s_sys_ss4ce85288 ( " public " ) ; <nl> + StaticString s_sys_ss4d19daaa ( " loadextension " ) ; <nl> + StaticString s_sys_ss4d3aaeee ( " createCDATASection " ) ; <nl> + StaticString s_sys_ss4d6442de ( " isInstantiable " ) ; <nl> + StaticString s_sys_ss4db221b9 ( " setInfoClass " ) ; <nl> + StaticString s_sys_ss4dd3a743 ( " text " ) ; <nl> + StaticString s_sys_ss4e21b0f1 ( " rollback " ) ; <nl> + StaticString s_sys_ss4e3b07b3 ( " detach " ) ; <nl> + StaticString s_sys_ss4e65aff3 ( " \ 000Continuation \ 000value " , 19 ) ; <nl> + StaticString s_sys_ss4efec04e ( " getResultCode " ) ; <nl> + StaticString s_sys_ss4f2f48c7 ( " getMessage " ) ; <nl> + StaticString s_sys_ss4fa2c4dd ( " helpTitle " ) ; <nl> + StaticString s_sys_ss500f232f ( " lasterrormsg " ) ; <nl> + StaticString s_sys_ss504bc94d ( " isInternal " ) ; <nl> + StaticString s_sys_ss50652d33 ( " next " ) ; <nl> + StaticString s_sys_ss508b1d41 ( " addfunction " ) ; <nl> + StaticString s_sys_ss5097084d ( " setByKey " ) ; <nl> + StaticString s_sys_ss50ad79e8 ( " registerXPathNamespace " ) ; <nl> + StaticString s_sys_ss52403931 ( " function " ) ; <nl> + StaticString s_sys_ss52fe5cd5 ( " getLineNo " ) ; <nl> + StaticString s_sys_ss53950219 ( " setTimezone " ) ; <nl> + StaticString s_sys_ss53ec6e8f ( " getConstructor " ) ; <nl> + StaticString s_sys_ss540d86c3 ( " writeDTDElement " ) ; <nl> + StaticString s_sys_ss5596f6c8 ( " \ 000ReflectionExtension \ 000info " , 25 ) ; <nl> + StaticString s_sys_ss55bd51a4 ( " startDocument " ) ; <nl> + StaticString s_sys_ss55c15f8a ( " bindcolumn " ) ; <nl> + StaticString s_sys_ss55fe8ad6 ( " Directory " ) ; <nl> + StaticString s_sys_ss56c85b78 ( " newInstance " ) ; <nl> + StaticString s_sys_ss570270cc ( " default " ) ; <nl> + StaticString s_sys_ss5784ed2b ( " does not exist " ) ; <nl> + StaticString s_sys_ss57956ee3 ( " BadFunctionCallException " ) ; <nl> + StaticString s_sys_ss5853bc97 ( " load " ) ; <nl> + StaticString s_sys_ss587edbef ( " relaxNGValidate " ) ; <nl> + StaticString s_sys_ss58a78f5c ( " setIDAttributeNode " ) ; <nl> + StaticString s_sys_ss5916f77a ( " argCount " ) ; <nl> + StaticString s_sys_ss5ac66c5d ( " execute " ) ; <nl> + StaticString s_sys_ss5b229ad5 ( " methods " ) ; <nl> + StaticString s_sys_ss5b2a52c1 ( " ReflectionFunctionAbstract " ) ; <nl> + StaticString s_sys_ss5b474ef3 ( " getLanguage " ) ; <nl> + StaticString s_sys_ss5b753b53 ( " Countable " ) ; <nl> + StaticString s_sys_ss5baf0fe3 ( " isDot " ) ; <nl> + StaticString s_sys_ss5be7a94a ( " static_variables " ) ; <nl> + StaticString s_sys_ss5bfa95ac ( " allowsNull " ) ; <nl> + StaticString s_sys_ss5c8999e5 ( " reset " ) ; <nl> + StaticString s_sys_ss5d0c7971 ( " normalizeDocument " ) ; <nl> + StaticString s_sys_ss5d909898 ( " SplFileObject " ) ; <nl> + StaticString s_sys_ss5e0a51ee ( " isUserDefined " ) ; <nl> + StaticString s_sys_ss5e1f54fe ( " getStaticPropertyValue " ) ; <nl> + StaticString s_sys_ss5e40e701 ( " RuntimeException " ) ; <nl> + StaticString s_sys_ss5ea3f5ac ( " startElementNS " ) ; <nl> + StaticString s_sys_ss5eba20da ( " addsoapheader " ) ; <nl> + StaticString s_sys_ss5ee96b8f ( " startAttribute " ) ; <nl> + StaticString s_sys_ss5ef289b7 ( " setFileClass " ) ; <nl> + StaticString s_sys_ss5ef57bc3 ( " removeAttribute " ) ; <nl> + StaticString s_sys_ss5f48f4d6 ( " interface_exists " ) ; <nl> + StaticString s_sys_ss6018bb35 ( " fetchall " ) ; <nl> + StaticString s_sys_ss61185a01 ( " setIndentString " ) ; <nl> + StaticString s_sys_ss61782b95 ( " setTime " ) ; <nl> + StaticString s_sys_ss61f821f0 ( " sortwithsortkeys " ) ; <nl> + StaticString s_sys_ss623ae369 ( " constants " ) ; <nl> + StaticString s_sys_ss625d0a69 ( " setAttribute " ) ; <nl> + StaticString s_sys_ss63639ccf ( " getVars " ) ; <nl> + StaticString s_sys_ss63eef794 ( " __getfunctions " ) ; <nl> + StaticString s_sys_ss6412883b ( " c14n " ) ; <nl> + StaticString s_sys_ss6415a5db ( " __get " ) ; <nl> + StaticString s_sys_ss64fc2cb1 ( " storage " ) ; <nl> + StaticString s_sys_ss651e56d8 ( " arg " ) ; <nl> + StaticString s_sys_ss658c946d ( " setDate " ) ; <nl> + StaticString s_sys_ss6640e60f ( " listIdentifiers " ) ; <nl> + StaticString s_sys_ss6677e6df ( " fgetss " ) ; <nl> + StaticString s_sys_ss672a5730 ( " css " ) ; <nl> + StaticString s_sys_ss6775c5a7 ( " __getlastrequestheaders " ) ; <nl> + StaticString s_sys_ss679e8b98 ( " normalize " ) ; <nl> + StaticString s_sys_ss6863d210 ( " schemaValidateSource " ) ; <nl> + StaticString s_sys_ss68bc25e3 ( " __dorequest " ) ; <nl> + StaticString s_sys_ss68d731f7 ( " getChildren " ) ; <nl> + StaticString s_sys_ss690e46e7 ( " saveHTML " ) ; <nl> + StaticString s_sys_ss6974a1cc ( " __toString " ) ; <nl> + StaticString s_sys_ss69f4b5d8 ( " escapestring " ) ; <nl> + StaticString s_sys_ss6a9626a3 ( " seek " ) ; <nl> + StaticString s_sys_ss6aa5ef61 ( " helpBody " ) ; <nl> + StaticString s_sys_ss6ae7fa54 ( " addByKey " ) ; <nl> + StaticString s_sys_ss6b51d6cb ( " getcolumnmeta " ) ; <nl> + StaticString s_sys_ss6b750a79 ( " endElement " ) ; <nl> + StaticString s_sys_ss6b8aaff2 ( " setStaticPropertyValue " ) ; <nl> + StaticString s_sys_ss6bb66679 ( " fstat " ) ; <nl> + StaticString s_sys_ss6c17831d ( " getConstants " ) ; <nl> + StaticString s_sys_ss6c5c70db ( " getCode " ) ; <nl> + StaticString s_sys_ss6cc6b367 ( " offsetExists " ) ; <nl> + StaticString s_sys_ss6cdf7ec6 ( " writeDTD " ) ; <nl> + StaticString s_sys_ss6d15497b ( " endDTDElement " ) ; <nl> + StaticString s_sys_ss6d67e79b ( " createEntityReference " ) ; <nl> + StaticString s_sys_ss6d9ef7e5 ( " isOptional " ) ; <nl> + StaticString s_sys_ss6e47b4b1 ( " isPassedByReference " ) ; <nl> + StaticString s_sys_ss6e6aaece ( " RangeException " ) ; <nl> + StaticString s_sys_ss6e9f1eba ( " lookupNamespaceUri " ) ; <nl> + StaticString s_sys_ss6ec1e6d8 ( " detectAll " ) ; <nl> + StaticString s_sys_ss70529da2 ( " modify " ) ; <nl> + StaticString s_sys_ss70eaeb85 ( " send " ) ; <nl> + StaticString s_sys_ss71028683 ( " getOffset " ) ; <nl> + StaticString s_sys_ss71377747 ( " save " ) ; <nl> + StaticString s_sys_ss7157d1ae ( " getExtensionName " ) ; <nl> + StaticString s_sys_ss7165f45b ( " setCsvControl " ) ; <nl> + StaticString s_sys_ss717877f6 ( " children " ) ; <nl> + StaticString s_sys_ss717a7024 ( " getavailabledrivers " ) ; <nl> + StaticString s_sys_ss717b8b62 ( " c14nfile " ) ; <nl> + StaticString s_sys_ss7228e959 ( " interface " ) ; <nl> + StaticString s_sys_ss724a760a ( " type " ) ; <nl> + StaticString s_sys_ss7257a6f2 ( " setpersistence " ) ; <nl> + StaticString s_sys_ss7358e00d ( " setISODate " ) ; <nl> + StaticString s_sys_ss73e73811 ( " writeDTDAttlist " ) ; <nl> + StaticString s_sys_ss7416f7f1 ( " sort " ) ; <nl> + StaticString s_sys_ss74691b30 ( " done " ) ; <nl> + StaticString s_sys_ss750cda3b ( " access " ) ; <nl> + StaticString s_sys_ss75ec94fd ( " endDTDAttlist " ) ; <nl> + StaticString s_sys_ss764ad06c ( " fpassthru " ) ; <nl> + StaticString s_sys_ss7732a9a6 ( " hphp_get_class_info " ) ; <nl> + StaticString s_sys_ss7854bd7b ( " getTraceAsString " ) ; <nl> + StaticString s_sys_ss78cb1b27 ( " \ 000SplObjectStorage \ 000storage " , 25 ) ; <nl> + StaticString s_sys_ss791c5872 ( " Need to call next ( ) first " ) ; <nl> + StaticString s_sys_ss79892305 ( " getStackTrace " ) ; <nl> + StaticString s_sys_ss7a0832b7 ( " writePI " ) ; <nl> + StaticString s_sys_ss7a1c6fcd ( " createDocumentType " ) ; <nl> + StaticString s_sys_ss7a5dbb24 ( " output " ) ; <nl> + StaticString s_sys_ss7ace3627 ( " getProperties " ) ; <nl> + StaticString s_sys_ss7c2432f2 ( " UnexpectedValueException " ) ; <nl> + StaticString s_sys_ss7cb08d68 ( " arr " ) ; <nl> + StaticString s_sys_ss7cd91db4 ( " version " ) ; <nl> + StaticString s_sys_ss7d1afda2 ( " getBasename " ) ; <nl> + StaticString s_sys_ss7d2a9ef4 ( " getOption " ) ; <nl> + StaticString s_sys_ss7e545a5a ( " quit " ) ; <nl> + StaticString s_sys_ss7e5fc106 ( " \ " " ) ; <nl> + StaticString s_sys_ss7ef23ee0 ( " getErrors " ) ; <nl> + StaticString s_sys_ss7fd7d2bc ( " setfetchmode " ) ; <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> } <nl> deleted file mode 100644 <nl> index befa58d75f6 . . 00000000000 <nl> mmm a / src / system / gen / sys / literal_strings_1 . no . cpp <nl> ppp / dev / null <nl> <nl> - / * <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | HipHop for PHP | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | Copyright ( c ) 2010 Facebook , Inc . ( http : / / www . facebook . com ) | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | This source file is subject to version 3 . 01 of the PHP license , | <nl> - | that is bundled with this package in the file LICENSE , and is | <nl> - | available through the world - wide - web at the following url : | <nl> - | http : / / www . php . net / license / 3_01 . txt | <nl> - | If you did not receive a copy of the PHP license and are unable to | <nl> - | obtain it through the world - wide - web , please send a note to | <nl> - | license @ php . net so we can mail you a copy immediately . | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - * / <nl> - / / @ generated by HipHop Compiler <nl> - <nl> - # include < runtime / base / complex_types . h > <nl> - # include < sys / literal_strings_remap . h > <nl> - <nl> - <nl> - namespace HPHP { <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - StaticString s_sys_ss969a2913 ( " getClass " ) ; <nl> - StaticString s_sys_ss96f7c57c ( " fflush " ) ; <nl> - StaticString s_sys_ss9795dfc8 ( " Property " ) ; <nl> - StaticString s_sys_ss97b15062 ( " getModifiers " ) ; <nl> - StaticString s_sys_ss985d885e ( " Function " ) ; <nl> - StaticString s_sys_ss993f2e69 ( " ArrayIterator " ) ; <nl> - StaticString s_sys_ss9943cbf4 ( " valid " ) ; <nl> - StaticString s_sys_ss99f908fe ( " ReflectionFunction " ) ; <nl> - StaticString s_sys_ss9a04b6ca ( " isWritable " ) ; <nl> - StaticString s_sys_ss9b1f3b88 ( " numcolumns " ) ; <nl> - StaticString s_sys_ss9ba95c5a ( " getDocNamespaces " ) ; <nl> - StaticString s_sys_ss9cfa17a6 ( " doc " ) ; <nl> - StaticString s_sys_ss9d68a010 ( " offsetGet " ) ; <nl> - StaticString s_sys_ss9dad4367 ( " isDefault " ) ; <nl> - StaticString s_sys_ss9e5158a7 ( " error " ) ; <nl> - StaticString s_sys_ss9ea65e74 ( " registerNamespace " ) ; <nl> - StaticString s_sys_ss9f244c80 ( " modifiers " ) ; <nl> - StaticString s_sys_ss9f7d7f06 ( " createElement " ) ; <nl> - StaticString s_sys_ss9fa37b08 ( " getFileInfo " ) ; <nl> - StaticString s_sys_ss9fb56979 ( " protected " ) ; <nl> - StaticString s_sys_ssa13cba49 ( " writeAttributeNS " ) ; <nl> - StaticString s_sys_ssa1b87da7 ( " __construct " ) ; <nl> - StaticString s_sys_ssa20217b5 ( " getFlags " ) ; <nl> - StaticString s_sys_ssa23e236b ( " __tostring " ) ; <nl> - StaticString s_sys_ssa26bedd7 ( " __init__ " ) ; <nl> - StaticString s_sys_ssa2784203 ( " xend " ) ; <nl> - StaticString s_sys_ssa2c3ffd2 ( " splitText " ) ; <nl> - StaticString s_sys_ssa3157835 ( " startComment " ) ; <nl> - StaticString s_sys_ssa3425730 ( " listAbbreviations " ) ; <nl> - StaticString s_sys_ssa37fe34e ( " LogicException " ) ; <nl> - StaticString s_sys_ssa4e142d1 ( " getINIEntries " ) ; <nl> - StaticString s_sys_ssa5a7f4f9 ( " __destruct " ) ; <nl> - StaticString s_sys_ssa6bc4f55 ( " endAttribute " ) ; <nl> - StaticString s_sys_ssa6cfea13 ( " test " ) ; <nl> - StaticString s_sys_ssa78ef7eb ( " Class " ) ; <nl> - StaticString s_sys_ssa7dd9b60 ( " appendXML " ) ; <nl> - StaticString s_sys_ssa7f86c5a ( " commit " ) ; <nl> - StaticString s_sys_ssa812760b ( " isPrivate " ) ; <nl> - StaticString s_sys_ssa93e2205 ( " flush " ) ; <nl> - StaticString s_sys_ssa9a8d951 ( " isExecutable " ) ; <nl> - StaticString s_sys_ssaa14dfdd ( " detect " ) ; <nl> - StaticString s_sys_ssaa916331 ( " lasterrorcode " ) ; <nl> - StaticString s_sys_ssab7a1dec ( " code " ) ; <nl> - StaticString s_sys_ssabd12782 ( " setcompressthreshold " ) ; <nl> - StaticString s_sys_ssac0b0f60 ( " ErrorException " ) ; <nl> - StaticString s_sys_ssac2b8cd6 ( " fgets " ) ; <nl> - StaticString s_sys_ssac3b59a3 ( " registerPHPFunctions " ) ; <nl> - StaticString s_sys_ssac67a3b5 ( " connect " ) ; <nl> - StaticString s_sys_ssacf726a1 ( " __cont__ " ) ; <nl> - StaticString s_sys_ssad18c6ae ( " create " ) ; <nl> - StaticString s_sys_ssad33d956 ( " startElement " ) ; <nl> - StaticString s_sys_ssad6f5b8c ( " setChecks " ) ; <nl> - StaticString s_sys_ssada05422 ( " startPI " ) ; <nl> - StaticString s_sys_ssadd5fee2 ( " LengthException " ) ; <nl> - StaticString s_sys_ssae8717ad ( " exception " ) ; <nl> - StaticString s_sys_ssaeb53ef3 ( " argRest " ) ; <nl> - StaticString s_sys_ssb0933c52 ( " getLine " ) ; <nl> - StaticString s_sys_ssb122eff8 ( " getRealPath " ) ; <nl> - StaticString s_sys_ssb17013df ( " openURI " ) ; <nl> - StaticString s_sys_ssb1c4aa6f ( " getATime " ) ; <nl> - StaticString s_sys_ssb303f411 ( " __isset " ) ; <nl> - StaticString s_sys_ssb30ca8a5 ( " setMaxLineLen " ) ; <nl> - StaticString s_sys_ssb3a5c1b3 ( " current " ) ; <nl> - StaticString s_sys_ssb3fce46e ( " \ 000AppendIterator \ 000iterators " , 25 ) ; <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - } <nl> deleted file mode 100644 <nl> index 7b2615bbbfe . . 00000000000 <nl> mmm a / src / system / gen / sys / literal_strings_2 . no . cpp <nl> ppp / dev / null <nl> <nl> - / * <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | HipHop for PHP | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | Copyright ( c ) 2010 Facebook , Inc . ( http : / / www . facebook . com ) | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | This source file is subject to version 3 . 01 of the PHP license , | <nl> - | that is bundled with this package in the file LICENSE , and is | <nl> - | available through the world - wide - web at the following url : | <nl> - | http : / / www . php . net / license / 3_01 . txt | <nl> - | If you did not receive a copy of the PHP license and are unable to | <nl> - | obtain it through the world - wide - web , please send a note to | <nl> - | license @ php . net so we can mail you a copy immediately . | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - * / <nl> - / / @ generated by HipHop Compiler <nl> - <nl> - # include < runtime / base / complex_types . h > <nl> - # include < sys / literal_strings_remap . h > <nl> - <nl> - <nl> - namespace HPHP { <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - StaticString s_sys_ssb5a1e6bc ( " ReflectionObject " ) ; <nl> - StaticString s_sys_ssb5d283cb ( " receive " ) ; <nl> - StaticString s_sys_ssb6132cef ( " setoptimeout " ) ; <nl> - StaticString s_sys_ssb65737a4 ( " DomainException " ) ; <nl> - StaticString s_sys_ssb69f1960 ( " getTransitions " ) ; <nl> - StaticString s_sys_ssb6bff43f ( " getElementsByTagNameNS " ) ; <nl> - StaticString s_sys_ssb7ae555d ( " class_exists " ) ; <nl> - StaticString s_sys_ssb7fa1eb1 ( " validate " ) ; <nl> - StaticString s_sys_ssb84c8cfa ( " severity " ) ; <nl> - StaticString s_sys_ssb8a9ecc6 ( " UnderflowException " ) ; <nl> - StaticString s_sys_ssb8f33aef ( " writeElementNS " ) ; <nl> - StaticString s_sys_ssba65d5ee ( " append " ) ; <nl> - StaticString s_sys_ssbac40e3d ( " fseek " ) ; <nl> - StaticString s_sys_ssbad150b1 ( " pconnect " ) ; <nl> - StaticString s_sys_ssbc297b7f ( " OverflowException " ) ; <nl> - StaticString s_sys_ssbc590ceb ( " isArray " ) ; <nl> - StaticString s_sys_ssbd66b015 ( " fetcharray " ) ; <nl> - StaticString s_sys_ssbd8183dc ( " saveHTMLFile " ) ; <nl> - StaticString s_sys_ssbda189a5 ( " __setlocation " ) ; <nl> - StaticString s_sys_ssbdaacf24 ( " help " ) ; <nl> - StaticString s_sys_ssbe2ba1ac ( " offsetSet " ) ; <nl> - StaticString s_sys_ssbe346e77 ( " addServers " ) ; <nl> - StaticString s_sys_ssbefe32a8 ( " line2 " ) ; <nl> - StaticString s_sys_ssc035d638 ( " removeAttributeNS " ) ; <nl> - StaticString s_sys_ssc09df55f ( " isFile " ) ; <nl> - StaticString s_sys_ssc0ff3081 ( " index " ) ; <nl> - StaticString s_sys_ssc103992f ( " appendData " ) ; <nl> - StaticString s_sys_ssc1c38583 ( " SeekableIterator " ) ; <nl> - StaticString s_sys_ssc2defd5c ( " setAttributeNS " ) ; <nl> - StaticString s_sys_ssc2df217e ( " getName " ) ; <nl> - StaticString s_sys_ssc2fd8845 ( " setIndent " ) ; <nl> - StaticString s_sys_ssc4385198 ( " endDTD " ) ; <nl> - StaticString s_sys_ssc483d02b ( " relaxNGValidateSource " ) ; <nl> - StaticString s_sys_ssc556d1b5 ( " isFinal " ) ; <nl> - StaticString s_sys_ssc57472df ( " RecursiveIteratorIterator " ) ; <nl> - StaticString s_sys_ssc589966e ( " getUTF8 " ) ; <nl> - StaticString s_sys_ssc5f10d1a ( " getStats " ) ; <nl> - StaticString s_sys_ssc60228c6 ( " open " ) ; <nl> - StaticString s_sys_ssc64ebfff ( " Iterator " ) ; <nl> - StaticString s_sys_ssc72eef1f ( " DirectoryIterator " ) ; <nl> - StaticString s_sys_ssc7d7a51a ( " getDefaultProperties " ) ; <nl> - StaticString s_sys_ssc82dbd12 ( " class " ) ; <nl> - StaticString s_sys_ssc8396b02 ( " functions " ) ; <nl> - StaticString s_sys_ssc880eb8a ( " __call " ) ; <nl> - StaticString s_sys_ssc89c1797 ( " asort " ) ; <nl> - StaticString s_sys_ssc8ce68a6 ( " print " ) ; <nl> - StaticString s_sys_ssc8d87985 ( " getElementById " ) ; <nl> - StaticString s_sys_ssc90e239b ( " invoke " ) ; <nl> - StaticString s_sys_ssc95caa7e ( " getNamespaces " ) ; <nl> - StaticString s_sys_ssc9ae0c06 ( " \ 000Continuation \ 000obj " , 17 ) ; <nl> - StaticString s_sys_ssca0f1ff4 ( " startDTDEntity " ) ; <nl> - StaticString s_sys_sscaf1930c ( " __getlastresponseheaders " ) ; <nl> - StaticString s_sys_sscafbef71 ( " getversion " ) ; <nl> - StaticString s_sys_sscb20b361 ( " setAttributeNodeNS " ) ; <nl> - StaticString s_sys_sscb2328b2 ( " cloneNode " ) ; <nl> - StaticString s_sys_sscb34fe23 ( " isnormalized " ) ; <nl> - StaticString s_sys_sscbecc3ad ( " \ 000Continuation \ 000index " , 19 ) ; <nl> - StaticString s_sys_sscca6e52d ( " getByKey " ) ; <nl> - StaticString s_sys_ssccbba71e ( " getTrace " ) ; <nl> - StaticString s_sys_sscd0bfaee ( " getExtension " ) ; <nl> - StaticString s_sys_sscd5dc41e ( " ReflectionParameter " ) ; <nl> - StaticString s_sys_sscdbb2d67 ( " getMethod " ) ; <nl> - StaticString s_sys_ssce568670 ( " appendByKey " ) ; <nl> - StaticString s_sys_ssce80f767 ( " isProtected " ) ; <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - } <nl> deleted file mode 100644 <nl> index 2f3b81132e6 . . 00000000000 <nl> mmm a / src / system / gen / sys / literal_strings_3 . no . cpp <nl> ppp / dev / null <nl> <nl> - / * <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | HipHop for PHP | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | Copyright ( c ) 2010 Facebook , Inc . ( http : / / www . facebook . com ) | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | This source file is subject to version 3 . 01 of the PHP license , | <nl> - | that is bundled with this package in the file LICENSE , and is | <nl> - | available through the world - wide - web at the following url : | <nl> - | http : / / www . php . net / license / 3_01 . txt | <nl> - | If you did not receive a copy of the PHP license and are unable to | <nl> - | obtain it through the world - wide - web , please send a note to | <nl> - | license @ php . net so we can mail you a copy immediately . | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - * / <nl> - / / @ generated by HipHop Compiler <nl> - <nl> - # include < runtime / base / complex_types . h > <nl> - # include < sys / literal_strings_remap . h > <nl> - <nl> - <nl> - namespace HPHP { <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - StaticString s_sys_ssced27431 ( " increment " ) ; <nl> - StaticString s_sys_sscedef5dc ( " ini " ) ; <nl> - StaticString s_sys_sscfb8e254 ( " interfaces " ) ; <nl> - StaticString s_sys_sscfd63bc6 ( " replace " ) ; <nl> - StaticString s_sys_ssd029c1ac ( " getProperty " ) ; <nl> - StaticString s_sys_ssd04b2eb8 ( " export " ) ; <nl> - StaticString s_sys_ssd04bc523 ( " endDocument " ) ; <nl> - StaticString s_sys_ssd073a009 ( " getserverstatus " ) ; <nl> - StaticString s_sys_ssd0eae9b1 ( " ftell " ) ; <nl> - StaticString s_sys_ssd13a269b ( " importNode " ) ; <nl> - StaticString s_sys_ssd13b20f5 ( " getResultMessage " ) ; <nl> - StaticString s_sys_ssd14ebd08 ( " getValue " ) ; <nl> - StaticString s_sys_ssd222d509 ( " Continuation is already finished " ) ; <nl> - StaticString s_sys_ssd26edebe ( " setserverparams " ) ; <nl> - StaticString s_sys_ssd28c05f3 ( " debugdumpparams " ) ; <nl> - StaticString s_sys_ssd323f9f4 ( " getSeverity " ) ; <nl> - StaticString s_sys_ssd332baa7 ( " , " ) ; <nl> - StaticString s_sys_ssd371b205 ( " getNodePath " ) ; <nl> - StaticString s_sys_ssd4097a2c ( " __soapcall " ) ; <nl> - StaticString s_sys_ssd44d37cf ( " XhprofFrame " ) ; <nl> - StaticString s_sys_ssd47ba3c5 ( " columncount " ) ; <nl> - StaticString s_sys_ssd492d56b ( " getElementsByTagName " ) ; <nl> - StaticString s_sys_ssd4af8244 ( " iterators " ) ; <nl> - StaticString s_sys_ssd4c67725 ( " line1 " ) ; <nl> - StaticString s_sys_ssd59e789f ( " \ \ " ) ; <nl> - StaticString s_sys_ssd5cc982b ( " getClasses " ) ; <nl> - StaticString s_sys_ssd5dbbd47 ( " getDocComment " ) ; <nl> - StaticString s_sys_ssd6b8bbae ( " getAttributeNS " ) ; <nl> - StaticString s_sys_ssd6eedaeb ( " getInterfaces " ) ; <nl> - StaticString s_sys_ssd766aa9d ( " hasAttribute " ) ; <nl> - StaticString s_sys_ssd816f860 ( " Class constant " ) ; <nl> - StaticString s_sys_ssd8580167 ( " writeCData " ) ; <nl> - StaticString s_sys_ssd8c10a25 ( " __PHP_Incomplete_Class " ) ; <nl> - StaticString s_sys_ssd8c7abd7 ( " newInstanceArgs " ) ; <nl> - StaticString s_sys_ssd9632345 ( " geterrorcode " ) ; <nl> - StaticString s_sys_ssdb381ae8 ( " : " ) ; <nl> - StaticString s_sys_ssdc3cbddc ( " name " ) ; <nl> - StaticString s_sys_ssdc6e02c2 ( " Method " ) ; <nl> - StaticString s_sys_ssdc71ce35 ( " fault " ) ; <nl> - StaticString s_sys_ssdcae3319 ( " openblob " ) ; <nl> - StaticString s_sys_ssdd233bb0 ( " DirectoryIterator : : __construct ( " ) ; <nl> - StaticString s_sys_ssdd355b2b ( " isSubclassOf " ) ; <nl> - StaticString s_sys_ssddf8728c ( " line " ) ; <nl> - StaticString s_sys_ssde0994ef ( " insertData " ) ; <nl> - StaticString s_sys_ssde0dbfb2 ( " \ 000Continuation \ 000running " , 21 ) ; <nl> - StaticString s_sys_ssde22f98d ( " fetchAll " ) ; <nl> - StaticString s_sys_ssdec3c0f0 ( " isPublic " ) ; <nl> - StaticString s_sys_ssdec966e8 ( " getNamedItem " ) ; <nl> - StaticString s_sys_ssded23afd ( " createDocumentFragment " ) ; <nl> - StaticString s_sys_ssdef06d86 ( " openMemory " ) ; <nl> - StaticString s_sys_ssdef8398d ( " replaceData " ) ; <nl> - StaticString s_sys_ssdf34c0b4 ( " isAbstract " ) ; <nl> - StaticString s_sys_sse051f235 ( " helpCmds " ) ; <nl> - StaticString s_sys_sse09ed13c ( " createfunction " ) ; <nl> - StaticString s_sys_sse0c88471 ( " value " ) ; <nl> - StaticString s_sys_sse1ffa7cf ( " hasMethod " ) ; <nl> - StaticString s_sys_sse26c5698 ( " addFile " ) ; <nl> - StaticString s_sys_sse27b119d ( " fgetc " ) ; <nl> - StaticString s_sys_sse2be8bf1 ( " endComment " ) ; <nl> - StaticString s_sys_sse3783d41 ( " getSubPath " ) ; <nl> - StaticString s_sys_sse3f54806 ( " query " ) ; <nl> - StaticString s_sys_sse41ca304 ( " addString " ) ; <nl> - StaticString s_sys_sse48e511b ( " setattribute " ) ; <nl> - StaticString s_sys_sse4a1cad7 ( " getVersion " ) ; <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - } <nl> deleted file mode 100644 <nl> index cc08936d8cd . . 00000000000 <nl> mmm a / src / system / gen / sys / literal_strings_4 . no . cpp <nl> ppp / dev / null <nl> <nl> - / * <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | HipHop for PHP | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | Copyright ( c ) 2010 Facebook , Inc . ( http : / / www . facebook . com ) | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | This source file is subject to version 3 . 01 of the PHP license , | <nl> - | that is bundled with this package in the file LICENSE , and is | <nl> - | available through the world - wide - web at the following url : | <nl> - | http : / / www . php . net / license / 3_01 . txt | <nl> - | If you did not receive a copy of the PHP license and are unable to | <nl> - | obtain it through the world - wide - web , please send a note to | <nl> - | license @ php . net so we can mail you a copy immediately . | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - * / <nl> - / / @ generated by HipHop Compiler <nl> - <nl> - # include < runtime / base / complex_types . h > <nl> - # include < sys / literal_strings_remap . h > <nl> - <nl> - <nl> - namespace HPHP { <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - StaticString s_sys_sse5340a31 ( " mapping " ) ; <nl> - StaticString s_sys_sse590286e ( " offsetUnset " ) ; <nl> - StaticString s_sys_sse5c78f27 ( " begintransaction " ) ; <nl> - StaticString s_sys_sse63d8c2d ( " func " ) ; <nl> - StaticString s_sys_sse68e7bf5 ( " getArrayCopy " ) ; <nl> - StaticString s_sys_sse73b3a2c ( " eof " ) ; <nl> - StaticString s_sys_sse781f7da ( " private " ) ; <nl> - StaticString s_sys_sse867e166 ( " __set " ) ; <nl> - StaticString s_sys_sse896cb09 ( " read " ) ; <nl> - StaticString s_sys_sse8a6ad69 ( " getMaxLineLen " ) ; <nl> - StaticString s_sys_sse9bf4500 ( " extension " ) ; <nl> - StaticString s_sys_sse9da2c6e ( " setText " ) ; <nl> - StaticString s_sys_ssea00c58c ( " isLink " ) ; <nl> - StaticString s_sys_ssea339844 ( " createComment " ) ; <nl> - StaticString s_sys_sseac4979f ( " get " ) ; <nl> - StaticString s_sys_sseacf71c9 ( " Exception " ) ; <nl> - StaticString s_sys_ssec6b7b45 ( " isLocal " ) ; <nl> - StaticString s_sys_ssec8fccc4 ( " ReflectionProperty " ) ; <nl> - StaticString s_sys_ssedd47a43 ( " nullable " ) ; <nl> - StaticString s_sys_ssee030a49 ( " replaceChild " ) ; <nl> - StaticString s_sys_ssee112c62 ( " Continuation is already running " ) ; <nl> - StaticString s_sys_ssee3325ed ( " writeRaw " ) ; <nl> - StaticString s_sys_ssef33be8d ( " \ 000SplObjectStorage \ 000index " , 23 ) ; <nl> - StaticString s_sys_ssef52e4e1 ( " implementsInterface " ) ; <nl> - StaticString s_sys_ssefecb9dd ( " constructor " ) ; <nl> - StaticString s_sys_ssf04bce93 ( " loadHTMLFile " ) ; <nl> - StaticString s_sys_ssf052ec6b ( " close " ) ; <nl> - StaticString s_sys_ssf08d205d ( " static " ) ; <nl> - StaticString s_sys_ssf0e3c7d6 ( " getSubPathname " ) ; <nl> - StaticString s_sys_ssf0ea8ac1 ( " RecursiveDirectoryIterator : : __construct ( " ) ; <nl> - StaticString s_sys_ssf1bd1a9d ( " getPosition " ) ; <nl> - StaticString s_sys_ssf1d09588 ( " bindvalue " ) ; <nl> - StaticString s_sys_ssf220c3cc ( " ask " ) ; <nl> - StaticString s_sys_ssf2460018 ( " update " ) ; <nl> - StaticString s_sys_ssf362b3c4 ( " path " ) ; <nl> - StaticString s_sys_ssf38cf473 ( " wrap " ) ; <nl> - StaticString s_sys_ssf3f5d744 ( " hasProperty " ) ; <nl> - StaticString s_sys_ssf401cc22 ( " getFile " ) ; <nl> - StaticString s_sys_ssf4426a16 ( " evaluate " ) ; <nl> - StaticString s_sys_ssf45b9a33 ( " isValid " ) ; <nl> - StaticString s_sys_ssf46d6580 ( " fetch " ) ; <nl> - StaticString s_sys_ssf4c4a1fc ( " getAttributeNode " ) ; <nl> - StaticString s_sys_ssf4c6e0f5 ( " isWhitespaceInElementContent " ) ; <nl> - StaticString s_sys_ssf4dfdccf ( " isDefaultValueAvailable " ) ; <nl> - StaticString s_sys_ssf528fa86 ( " endDTDEntity " ) ; <nl> - StaticString s_sys_ssf56a53de ( " rowcount " ) ; <nl> - StaticString s_sys_ssf578e813 ( " getInode " ) ; <nl> - StaticString s_sys_ssf5eb6fb9 ( " fwrite " ) ; <nl> - StaticString s_sys_ssf6be66f9 ( " hasChildren " ) ; <nl> - StaticString s_sys_ssf6c6cae3 ( " getMulti " ) ; <nl> - StaticString s_sys_ssf72d4a28 ( " hasFeature " ) ; <nl> - StaticString s_sys_ssf7da8a33 ( " tutorial " ) ; <nl> - StaticString s_sys_ssf7fe16d3 ( " loadDims " ) ; <nl> - StaticString s_sys_ssf82f565f ( " ReflectionProperty : : setAccessible is not supported " ) ; <nl> - StaticString s_sys_ssf833b943 ( " loadImages " ) ; <nl> - StaticString s_sys_ssf8395a4d ( " getStartLine " ) ; <nl> - StaticString s_sys_ssf88f9505 ( " errorinfo " ) ; <nl> - StaticString s_sys_ssf976719e ( " args " ) ; <nl> - StaticString s_sys_ssf99443fd ( " openFile " ) ; <nl> - StaticString s_sys_ssfab32402 ( " { main } " ) ; <nl> - StaticString s_sys_ssfb10fd8c ( " parent " ) ; <nl> - StaticString s_sys_ssfb433b54 ( " nextrowset " ) ; <nl> - StaticString s_sys_ssfb6412d4 ( " ) : failed to open dir " ) ; <nl> - StaticString s_sys_ssfb726449 ( " Cannot rewind on a Continuation object " ) ; <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - } <nl> deleted file mode 100644 <nl> index 291c7377954 . . 00000000000 <nl> mmm a / src / system / gen / sys / literal_strings_5 . no . cpp <nl> ppp / dev / null <nl> <nl> - / * <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | HipHop for PHP | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | Copyright ( c ) 2010 Facebook , Inc . ( http : / / www . facebook . com ) | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | This source file is subject to version 3 . 01 of the PHP license , | <nl> - | that is bundled with this package in the file LICENSE , and is | <nl> - | available through the world - wide - web at the following url : | <nl> - | http : / / www . php . net / license / 3_01 . txt | <nl> - | If you did not receive a copy of the PHP license and are unable to | <nl> - | obtain it through the world - wide - web , please send a note to | <nl> - | license @ php . net so we can mail you a copy immediately . | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - * / <nl> - / / @ generated by HipHop Compiler <nl> - <nl> - # include < runtime / base / complex_types . h > <nl> - # include < sys / literal_strings_remap . h > <nl> - <nl> - <nl> - namespace HPHP { <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - StaticString s_sys_ssfbb3eb52 ( " addUrl " ) ; <nl> - StaticString s_sys_ssfc2d4779 ( " getType " ) ; <nl> - StaticString s_sys_ssfc63c2bb ( " ReflectionClass " ) ; <nl> - StaticString s_sys_ssfdbe04fa ( " set " ) ; <nl> - StaticString s_sys_ssfe3209ac ( " uksort " ) ; <nl> - StaticString s_sys_ssfe470f29 ( " startDTDElement " ) ; <nl> - StaticString s_sys_ssfe98adf4 ( " getIterator " ) ; <nl> - StaticString s_sys_ssfebd5e9a ( " natsort " ) ; <nl> - StaticString s_sys_ssff10260d ( " ReflectionExtension " ) ; <nl> - StaticString s_sys_ss00000000 ( " " ) ; <nl> - StaticString s_sys_ss01c141eb ( " deleteData " ) ; <nl> - StaticString s_sys_ss033e1025 ( " BadMethodCallException " ) ; <nl> - StaticString s_sys_ss038035c6 ( " setMulti " ) ; <nl> - StaticString s_sys_ss0415e4a0 ( " classes " ) ; <nl> - StaticString s_sys_ss05c2645c ( " substringData " ) ; <nl> - StaticString s_sys_ss0626a7ce ( " uasort " ) ; <nl> - StaticString s_sys_ss06d80b5c ( " returnsReference " ) ; <nl> - StaticString s_sys_ss0723515e ( " __wakeup " ) ; <nl> - StaticString s_sys_ss0727dc04 ( " getConfidence " ) ; <nl> - StaticString s_sys_ss07445cb3 ( " num_args " ) ; <nl> - StaticString s_sys_ss077ab997 ( " getFilename " ) ; <nl> - StaticString s_sys_ss079dd82d ( " InvalidArgumentException " ) ; <nl> - StaticString s_sys_ss0915cca1 ( " registerNodeClass " ) ; <nl> - StaticString s_sys_ss09d4c665 ( " getClassNames " ) ; <nl> - StaticString s_sys_ss0a49a8a1 ( " getAttribute " ) ; <nl> - StaticString s_sys_ss0a60a5a3 ( " OutOfRangeException " ) ; <nl> - StaticString s_sys_ss0ab49528 ( " printFrame " ) ; <nl> - StaticString s_sys_ss0bb83e44 ( " lastinsertid " ) ; <nl> - StaticString s_sys_ss0bbec676 ( " getLabel " ) ; <nl> - StaticString s_sys_ss0bfd696f ( " setIDAttributeNS " ) ; <nl> - StaticString s_sys_ss0c3a6c4a ( " getPath " ) ; <nl> - StaticString s_sys_ss0c50ad86 ( " OutOfBoundsException " ) ; <nl> - StaticString s_sys_ss0c905545 ( " __sleep " ) ; <nl> - StaticString s_sys_ss0d42ecf6 ( " r " ) ; <nl> - StaticString s_sys_ss0d54babb ( " count " ) ; <nl> - StaticString s_sys_ss0d7533cf ( " Reflector " ) ; <nl> - StaticString s_sys_ss0e0c542f ( " appendChild " ) ; <nl> - StaticString s_sys_ss0e5b3f43 ( " writeComment " ) ; <nl> - StaticString s_sys_ss0eb9302b ( " addserver " ) ; <nl> - StaticString s_sys_ss0ec14ee2 ( " SplObjectStorage " ) ; <nl> - StaticString s_sys_ss0f30800a ( " vars " ) ; <nl> - StaticString s_sys_ss0f61bd03 ( " obj " ) ; <nl> - StaticString s_sys_ss0f90caf6 ( " getConstant " ) ; <nl> - StaticString s_sys_ss0fad9ac4 ( " AppendIterator " ) ; <nl> - StaticString s_sys_ss0fc37e03 ( " attributes " ) ; <nl> - StaticString s_sys_ss0fe15fdf ( " getServerByKey " ) ; <nl> - StaticString s_sys_ss102b70c6 ( " setIDAttribute " ) ; <nl> - StaticString s_sys_ss106b4dd7 ( " prependByKey " ) ; <nl> - StaticString s_sys_ss11603299 ( " get_arg " ) ; <nl> - StaticString s_sys_ss11bc49d2 ( " isReadable " ) ; <nl> - StaticString s_sys_ss11e815e7 ( " xinclude " ) ; <nl> - StaticString s_sys_ss1247a693 ( " item " ) ; <nl> - StaticString s_sys_ss12c8a8a6 ( " abstract " ) ; <nl> - StaticString s_sys_ss12e90587 ( " key " ) ; <nl> - StaticString s_sys_ss1303cc56 ( " hasAttributeNS " ) ; <nl> - StaticString s_sys_ss134fd5fa ( " ref " ) ; <nl> - StaticString s_sys_ss135934b0 ( " getPathInfo " ) ; <nl> - StaticString s_sys_ss135b2bb6 ( " lookupPrefix " ) ; <nl> - StaticString s_sys_ss13622d08 ( " removeChild " ) ; <nl> - StaticString s_sys_ss143f106a ( " getFrame " ) ; <nl> - StaticString s_sys_ss1491baad ( " label " ) ; <nl> - StaticString s_sys_ss14e5c43c ( " running " ) ; <nl> - StaticString s_sys_ss14eade34 ( " hasChildNodes " ) ; <nl> - StaticString s_sys_ss155366df ( " message " ) ; <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - } <nl> deleted file mode 100644 <nl> index 85fbdbe3661 . . 00000000000 <nl> mmm a / src / system / gen / sys / literal_strings_6 . no . cpp <nl> ppp / dev / null <nl> <nl> - / * <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | HipHop for PHP | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | Copyright ( c ) 2010 Facebook , Inc . ( http : / / www . facebook . com ) | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | This source file is subject to version 3 . 01 of the PHP license , | <nl> - | that is bundled with this package in the file LICENSE , and is | <nl> - | available through the world - wide - web at the following url : | <nl> - | http : / / www . php . net / license / 3_01 . txt | <nl> - | If you did not receive a copy of the PHP license and are unable to | <nl> - | obtain it through the world - wide - web , please send a note to | <nl> - | license @ php . net so we can mail you a copy immediately . | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - * / <nl> - / / @ generated by HipHop Compiler <nl> - <nl> - # include < runtime / base / complex_types . h > <nl> - # include < sys / literal_strings_remap . h > <nl> - <nl> - <nl> - namespace HPHP { <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - StaticString s_sys_ss15921d14 ( " areConfusable " ) ; <nl> - StaticString s_sys_ss15a9d310 ( " fgetcsv " ) ; <nl> - StaticString s_sys_ss163bad01 ( " addServer " ) ; <nl> - StaticString s_sys_ss164363b4 ( " getPathname " ) ; <nl> - StaticString s_sys_ss172df677 ( " deleteByKey " ) ; <nl> - StaticString s_sys_ss17c3d085 ( " fullEndElement " ) ; <nl> - StaticString s_sys_ss17f0e883 ( " exec " ) ; <nl> - StaticString s_sys_ss1863b3c7 ( " getGroup " ) ; <nl> - StaticString s_sys_ss18bebdc2 ( " replaceByKey " ) ; <nl> - StaticString s_sys_ss1902bc14 ( " getParameters " ) ; <nl> - StaticString s_sys_ss19136311 ( " \ 000Continuation \ 000received " , 22 ) ; <nl> - StaticString s_sys_ss19281e76 ( " format " ) ; <nl> - StaticString s_sys_ss1b64dec9 ( " bindparam " ) ; <nl> - StaticString s_sys_ss1bbd440a ( " lastinsertrowid " ) ; <nl> - StaticString s_sys_ss1c65f80a ( " getDefaultValue " ) ; <nl> - StaticString s_sys_ss1ce69cd5 ( " getStaticProperties " ) ; <nl> - StaticString s_sys_ss1cfbc2c8 ( " setMultiByKey " ) ; <nl> - StaticString s_sys_ss1d6e06d8 ( " getFunctions " ) ; <nl> - StaticString s_sys_ss1da57557 ( " ReflectionException " ) ; <nl> - StaticString s_sys_ss1f20ac62 ( " params " ) ; <nl> - StaticString s_sys_ss1fa13716 ( " invokeArgs " ) ; <nl> - StaticString s_sys_ss1fa5c668 ( " setFlags " ) ; <nl> - StaticString s_sys_ss1fe1e1ea ( " xpath " ) ; <nl> - StaticString s_sys_ss20098bac ( " asXML " ) ; <nl> - StaticString s_sys_ss2145036e ( " final " ) ; <nl> - StaticString s_sys_ss225c5a00 ( " endPI " ) ; <nl> - StaticString s_sys_ss22bfe43e ( " Traversable " ) ; <nl> - StaticString s_sys_ss23afce76 ( " setVars " ) ; <nl> - StaticString s_sys_ss24749844 ( " getParentClass " ) ; <nl> - StaticString s_sys_ss25294c59 ( " getEncoding " ) ; <nl> - StaticString s_sys_ss2559ca9a ( " startDTD " ) ; <nl> - StaticString s_sys_ss26e41480 ( " fscanf " ) ; <nl> - StaticString s_sys_ss26fb679a ( " get_args " ) ; <nl> - StaticString s_sys_ss274b0685 ( " loadHTML " ) ; <nl> - StaticString s_sys_ss27634730 ( " isInterface " ) ; <nl> - StaticString s_sys_ss28e44b58 ( " setAttributeNode " ) ; <nl> - StaticString s_sys_ss28fae70d ( " flags " ) ; <nl> - StaticString s_sys_ss299bd55e ( " OuterIterator " ) ; <nl> - StaticString s_sys_ss29d06307 ( " helpSection " ) ; <nl> - StaticString s_sys_ss2a19cdf6 ( " decrement " ) ; <nl> - StaticString s_sys_ss2a44d071 ( " changes " ) ; <nl> - StaticString s_sys_ss2a6293f6 ( " getSize " ) ; <nl> - StaticString s_sys_ss2aa43f67 ( " getAttributeNodeNS " ) ; <nl> - StaticString s_sys_ss2c18aae1 ( " natcasesort " ) ; <nl> - StaticString s_sys_ss2cb2e0eb ( " setstrength " ) ; <nl> - StaticString s_sys_ss2d350426 ( " finalize " ) ; <nl> - StaticString s_sys_ss2d431bd1 ( " writeDTDEntity " ) ; <nl> - StaticString s_sys_ss2d5cec41 ( " __getlastrequest " ) ; <nl> - StaticString s_sys_ss2da130db ( " prepend " ) ; <nl> - StaticString s_sys_ss2dd6aec3 ( " Closure " ) ; <nl> - StaticString s_sys_ss2f8e5140 ( " setOption " ) ; <nl> - StaticString s_sys_ss2fd353cc ( " iterator " ) ; <nl> - StaticString s_sys_ss30120c29 ( " __setcookie " ) ; <nl> - StaticString s_sys_ss305b0746 ( " received " ) ; <nl> - StaticString s_sys_ss309aefff ( " msg " ) ; <nl> - StaticString s_sys_ss31a11388 ( " errorcode " ) ; <nl> - StaticString s_sys_ss31ec77af ( " insertBefore " ) ; <nl> - StaticString s_sys_ss325815c1 ( " setValue " ) ; <nl> - StaticString s_sys_ss32d46a21 ( " __unset " ) ; <nl> - StaticString s_sys_ss331d21f7 ( " createAttribute " ) ; <nl> - StaticString s_sys_ss337f2a0c ( " MutableArrayIterator " ) ; <nl> - StaticString s_sys_ss3382a209 ( " contains " ) ; <nl> - StaticString s_sys_ss33872dc4 ( " getStaticVariables " ) ; <nl> - StaticString s_sys_ss33896428 ( " writeElement " ) ; <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - } <nl> deleted file mode 100644 <nl> index e1e8e23ff59 . . 00000000000 <nl> mmm a / src / system / gen / sys / literal_strings_7 . no . cpp <nl> ppp / dev / null <nl> <nl> - / * <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | HipHop for PHP | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | Copyright ( c ) 2010 Facebook , Inc . ( http : / / www . facebook . com ) | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | This source file is subject to version 3 . 01 of the PHP license , | <nl> - | that is bundled with this package in the file LICENSE , and is | <nl> - | available through the world - wide - web at the following url : | <nl> - | http : / / www . php . net / license / 3_01 . txt | <nl> - | If you did not receive a copy of the PHP license and are unable to | <nl> - | obtain it through the world - wide - web , please send a note to | <nl> - | license @ php . net so we can mail you a copy immediately . | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - * / <nl> - / / @ generated by HipHop Compiler <nl> - <nl> - # include < runtime / base / complex_types . h > <nl> - # include < sys / literal_strings_remap . h > <nl> - <nl> - <nl> - namespace HPHP { <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - StaticString s_sys_ss33988b3e ( " info " ) ; <nl> - StaticString s_sys_ss3403085f ( " getstats " ) ; <nl> - StaticString s_sys_ss343a37dc ( " geterrormessage " ) ; <nl> - StaticString s_sys_ss344c5db6 ( " hasAttributes " ) ; <nl> - StaticString s_sys_ss37217e60 ( " hasConstant " ) ; <nl> - StaticString s_sys_ss372c9151 ( " ksort " ) ; <nl> - StaticString s_sys_ss37eff1c8 ( " getInnerIterator " ) ; <nl> - StaticString s_sys_ss38d893f5 ( " addCompletion " ) ; <nl> - StaticString s_sys_ss3983a61c ( " createElementNS " ) ; <nl> - StaticString s_sys_ss3a783e44 ( " getFileName " ) ; <nl> - StaticString s_sys_ss3bb8fb3e ( " createTextNode " ) ; <nl> - StaticString s_sys_ss3bd544b6 ( " casByKey " ) ; <nl> - StaticString s_sys_ss3bdd1f72 ( " getCsvControl " ) ; <nl> - StaticString s_sys_ss3c4bceb1 ( " columntype " ) ; <nl> - StaticString s_sys_ss3d09e8a5 ( " startDTDAttlist " ) ; <nl> - StaticString s_sys_ss3d6f0745 ( " quote " ) ; <nl> - StaticString s_sys_ss3dea3a84 ( " createDocument " ) ; <nl> - StaticString s_sys_ss3f63bb07 ( " getextendedstats " ) ; <nl> - StaticString s_sys_ss3fe4822b ( " setAccessible " ) ; <nl> - StaticString s_sys_ss404bf1b4 ( " isStatic " ) ; <nl> - StaticString s_sys_ss406322f2 ( " currentRef " ) ; <nl> - StaticString s_sys_ss40877955 ( " \ 000Continuation \ 000label " , 19 ) ; <nl> - StaticString s_sys_ss41c7a197 ( " stdclass " ) ; <nl> - StaticString s_sys_ss42161ae0 ( " nextImpl " ) ; <nl> - StaticString s_sys_ss424e8241 ( " getTimezone " ) ; <nl> - StaticString s_sys_ss426361a3 ( " stdClass " ) ; <nl> - StaticString s_sys_ss42a11cef ( " setobject " ) ; <nl> - StaticString s_sys_ss42fc2063 ( " startAttributens " ) ; <nl> - StaticString s_sys_ss43d0dde2 ( " isInstance " ) ; <nl> - StaticString s_sys_ss4431a364 ( " isSameNode " ) ; <nl> - StaticString s_sys_ss4483b6ae ( " getMethods " ) ; <nl> - StaticString s_sys_ss449b0823 ( " cas " ) ; <nl> - StaticString s_sys_ss44a1dc88 ( " isSupported " ) ; <nl> - StaticString s_sys_ss44fe7272 ( " Interface " ) ; <nl> - StaticString s_sys_ss45739f33 ( " getCTime " ) ; <nl> - StaticString s_sys_ss45e71386 ( " getCommand " ) ; <nl> - StaticString s_sys_ss45f15bcd ( " fetchobject " ) ; <nl> - StaticString s_sys_ss46bad435 ( " setDeclaredEncoding " ) ; <nl> - StaticString s_sys_ss46e7e29a ( " fetchcolumn " ) ; <nl> - StaticString s_sys_ss46e9d423 ( " schemaValidate " ) ; <nl> - StaticString s_sys_ss46eeef5c ( " handle " ) ; <nl> - StaticString s_sys_ss4723e39a ( " getCurrentLocation " ) ; <nl> - StaticString s_sys_ss474ef858 ( " Continuation " ) ; <nl> - StaticString s_sys_ss47724c46 ( " setclass " ) ; <nl> - StaticString s_sys_ss48139170 ( " addAttribute " ) ; <nl> - StaticString s_sys_ss48724660 ( " prepare " ) ; <nl> - StaticString s_sys_ss49963173 ( " RecursiveIterator " ) ; <nl> - StaticString s_sys_ss49fef19f ( " getPerms " ) ; <nl> - StaticString s_sys_ss4ad0c110 ( " Parameter is not optional " ) ; <nl> - StaticString s_sys_ss4ae2597c ( " __getlastresponse " ) ; <nl> - StaticString s_sys_ss4b959501 ( " __gettypes " ) ; <nl> - StaticString s_sys_ss4bab1591 ( " getDelayed " ) ; <nl> - StaticString s_sys_ss4c77dad1 ( " is a Class " ) ; <nl> - StaticString s_sys_ss4ca209c3 ( " delete " ) ; <nl> - StaticString s_sys_ss4ccc4d04 ( " flock " ) ; <nl> - StaticString s_sys_ss4cd61020 ( " closure " ) ; <nl> - StaticString s_sys_ss4ce85288 ( " public " ) ; <nl> - StaticString s_sys_ss4d19daaa ( " loadextension " ) ; <nl> - StaticString s_sys_ss4d3aaeee ( " createCDATASection " ) ; <nl> - StaticString s_sys_ss4d6442de ( " isInstantiable " ) ; <nl> - StaticString s_sys_ss4db221b9 ( " setInfoClass " ) ; <nl> - StaticString s_sys_ss4dd3a743 ( " text " ) ; <nl> - StaticString s_sys_ss4e21b0f1 ( " rollback " ) ; <nl> - StaticString s_sys_ss4e3b07b3 ( " detach " ) ; <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - } <nl> deleted file mode 100644 <nl> index e72149b5b3f . . 00000000000 <nl> mmm a / src / system / gen / sys / literal_strings_8 . no . cpp <nl> ppp / dev / null <nl> <nl> - / * <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | HipHop for PHP | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | Copyright ( c ) 2010 Facebook , Inc . ( http : / / www . facebook . com ) | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | This source file is subject to version 3 . 01 of the PHP license , | <nl> - | that is bundled with this package in the file LICENSE , and is | <nl> - | available through the world - wide - web at the following url : | <nl> - | http : / / www . php . net / license / 3_01 . txt | <nl> - | If you did not receive a copy of the PHP license and are unable to | <nl> - | obtain it through the world - wide - web , please send a note to | <nl> - | license @ php . net so we can mail you a copy immediately . | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - * / <nl> - / / @ generated by HipHop Compiler <nl> - <nl> - # include < runtime / base / complex_types . h > <nl> - # include < sys / literal_strings_remap . h > <nl> - <nl> - <nl> - namespace HPHP { <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - StaticString s_sys_ss4e65aff3 ( " \ 000Continuation \ 000value " , 19 ) ; <nl> - StaticString s_sys_ss4efec04e ( " getResultCode " ) ; <nl> - StaticString s_sys_ss4f2f48c7 ( " getMessage " ) ; <nl> - StaticString s_sys_ss4fa2c4dd ( " helpTitle " ) ; <nl> - StaticString s_sys_ss500f232f ( " lasterrormsg " ) ; <nl> - StaticString s_sys_ss504bc94d ( " isInternal " ) ; <nl> - StaticString s_sys_ss50652d33 ( " next " ) ; <nl> - StaticString s_sys_ss508b1d41 ( " addfunction " ) ; <nl> - StaticString s_sys_ss5097084d ( " setByKey " ) ; <nl> - StaticString s_sys_ss50ad79e8 ( " registerXPathNamespace " ) ; <nl> - StaticString s_sys_ss52403931 ( " function " ) ; <nl> - StaticString s_sys_ss52fe5cd5 ( " getLineNo " ) ; <nl> - StaticString s_sys_ss53950219 ( " setTimezone " ) ; <nl> - StaticString s_sys_ss53ec6e8f ( " getConstructor " ) ; <nl> - StaticString s_sys_ss540d86c3 ( " writeDTDElement " ) ; <nl> - StaticString s_sys_ss5596f6c8 ( " \ 000ReflectionExtension \ 000info " , 25 ) ; <nl> - StaticString s_sys_ss55bd51a4 ( " startDocument " ) ; <nl> - StaticString s_sys_ss55c15f8a ( " bindcolumn " ) ; <nl> - StaticString s_sys_ss55fe8ad6 ( " Directory " ) ; <nl> - StaticString s_sys_ss56c85b78 ( " newInstance " ) ; <nl> - StaticString s_sys_ss570270cc ( " default " ) ; <nl> - StaticString s_sys_ss5784ed2b ( " does not exist " ) ; <nl> - StaticString s_sys_ss57956ee3 ( " BadFunctionCallException " ) ; <nl> - StaticString s_sys_ss5853bc97 ( " load " ) ; <nl> - StaticString s_sys_ss587edbef ( " relaxNGValidate " ) ; <nl> - StaticString s_sys_ss58a78f5c ( " setIDAttributeNode " ) ; <nl> - StaticString s_sys_ss5916f77a ( " argCount " ) ; <nl> - StaticString s_sys_ss5ac66c5d ( " execute " ) ; <nl> - StaticString s_sys_ss5b229ad5 ( " methods " ) ; <nl> - StaticString s_sys_ss5b2a52c1 ( " ReflectionFunctionAbstract " ) ; <nl> - StaticString s_sys_ss5b474ef3 ( " getLanguage " ) ; <nl> - StaticString s_sys_ss5b753b53 ( " Countable " ) ; <nl> - StaticString s_sys_ss5baf0fe3 ( " isDot " ) ; <nl> - StaticString s_sys_ss5be7a94a ( " static_variables " ) ; <nl> - StaticString s_sys_ss5bfa95ac ( " allowsNull " ) ; <nl> - StaticString s_sys_ss5c8999e5 ( " reset " ) ; <nl> - StaticString s_sys_ss5d0c7971 ( " normalizeDocument " ) ; <nl> - StaticString s_sys_ss5d909898 ( " SplFileObject " ) ; <nl> - StaticString s_sys_ss5e0a51ee ( " isUserDefined " ) ; <nl> - StaticString s_sys_ss5e1f54fe ( " getStaticPropertyValue " ) ; <nl> - StaticString s_sys_ss5e40e701 ( " RuntimeException " ) ; <nl> - StaticString s_sys_ss5ea3f5ac ( " startElementNS " ) ; <nl> - StaticString s_sys_ss5eba20da ( " addsoapheader " ) ; <nl> - StaticString s_sys_ss5ee96b8f ( " startAttribute " ) ; <nl> - StaticString s_sys_ss5ef289b7 ( " setFileClass " ) ; <nl> - StaticString s_sys_ss5ef57bc3 ( " removeAttribute " ) ; <nl> - StaticString s_sys_ss5f48f4d6 ( " interface_exists " ) ; <nl> - StaticString s_sys_ss6018bb35 ( " fetchall " ) ; <nl> - StaticString s_sys_ss61185a01 ( " setIndentString " ) ; <nl> - StaticString s_sys_ss61782b95 ( " setTime " ) ; <nl> - StaticString s_sys_ss61f821f0 ( " sortwithsortkeys " ) ; <nl> - StaticString s_sys_ss623ae369 ( " constants " ) ; <nl> - StaticString s_sys_ss625d0a69 ( " setAttribute " ) ; <nl> - StaticString s_sys_ss63639ccf ( " getVars " ) ; <nl> - StaticString s_sys_ss63eef794 ( " __getfunctions " ) ; <nl> - StaticString s_sys_ss6412883b ( " c14n " ) ; <nl> - StaticString s_sys_ss6415a5db ( " __get " ) ; <nl> - StaticString s_sys_ss64fc2cb1 ( " storage " ) ; <nl> - StaticString s_sys_ss651e56d8 ( " arg " ) ; <nl> - StaticString s_sys_ss658c946d ( " setDate " ) ; <nl> - StaticString s_sys_ss6640e60f ( " listIdentifiers " ) ; <nl> - StaticString s_sys_ss6677e6df ( " fgetss " ) ; <nl> - StaticString s_sys_ss672a5730 ( " css " ) ; <nl> - StaticString s_sys_ss6775c5a7 ( " __getlastrequestheaders " ) ; <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - } <nl> deleted file mode 100644 <nl> index e09d85e762e . . 00000000000 <nl> mmm a / src / system / gen / sys / literal_strings_9 . no . cpp <nl> ppp / dev / null <nl> <nl> - / * <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | HipHop for PHP | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | Copyright ( c ) 2010 Facebook , Inc . ( http : / / www . facebook . com ) | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - | This source file is subject to version 3 . 01 of the PHP license , | <nl> - | that is bundled with this package in the file LICENSE , and is | <nl> - | available through the world - wide - web at the following url : | <nl> - | http : / / www . php . net / license / 3_01 . txt | <nl> - | If you did not receive a copy of the PHP license and are unable to | <nl> - | obtain it through the world - wide - web , please send a note to | <nl> - | license @ php . net so we can mail you a copy immediately . | <nl> - + mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - + <nl> - * / <nl> - / / @ generated by HipHop Compiler <nl> - <nl> - # include < runtime / base / complex_types . h > <nl> - # include < sys / literal_strings_remap . h > <nl> - <nl> - <nl> - namespace HPHP { <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - StaticString s_sys_ss679e8b98 ( " normalize " ) ; <nl> - StaticString s_sys_ss6863d210 ( " schemaValidateSource " ) ; <nl> - StaticString s_sys_ss68bc25e3 ( " __dorequest " ) ; <nl> - StaticString s_sys_ss68d731f7 ( " getChildren " ) ; <nl> - StaticString s_sys_ss690e46e7 ( " saveHTML " ) ; <nl> - StaticString s_sys_ss6974a1cc ( " __toString " ) ; <nl> - StaticString s_sys_ss69f4b5d8 ( " escapestring " ) ; <nl> - StaticString s_sys_ss6a9626a3 ( " seek " ) ; <nl> - StaticString s_sys_ss6aa5ef61 ( " helpBody " ) ; <nl> - StaticString s_sys_ss6ae7fa54 ( " addByKey " ) ; <nl> - StaticString s_sys_ss6b51d6cb ( " getcolumnmeta " ) ; <nl> - StaticString s_sys_ss6b750a79 ( " endElement " ) ; <nl> - StaticString s_sys_ss6b8aaff2 ( " setStaticPropertyValue " ) ; <nl> - StaticString s_sys_ss6bb66679 ( " fstat " ) ; <nl> - StaticString s_sys_ss6c17831d ( " getConstants " ) ; <nl> - StaticString s_sys_ss6c5c70db ( " getCode " ) ; <nl> - StaticString s_sys_ss6cc6b367 ( " offsetExists " ) ; <nl> - StaticString s_sys_ss6cdf7ec6 ( " writeDTD " ) ; <nl> - StaticString s_sys_ss6d15497b ( " endDTDElement " ) ; <nl> - StaticString s_sys_ss6d67e79b ( " createEntityReference " ) ; <nl> - StaticString s_sys_ss6d9ef7e5 ( " isOptional " ) ; <nl> - StaticString s_sys_ss6e47b4b1 ( " isPassedByReference " ) ; <nl> - StaticString s_sys_ss6e6aaece ( " RangeException " ) ; <nl> - StaticString s_sys_ss6e9f1eba ( " lookupNamespaceUri " ) ; <nl> - StaticString s_sys_ss6ec1e6d8 ( " detectAll " ) ; <nl> - StaticString s_sys_ss70529da2 ( " modify " ) ; <nl> - StaticString s_sys_ss70eaeb85 ( " send " ) ; <nl> - StaticString s_sys_ss71028683 ( " getOffset " ) ; <nl> - StaticString s_sys_ss71377747 ( " save " ) ; <nl> - StaticString s_sys_ss7157d1ae ( " getExtensionName " ) ; <nl> - StaticString s_sys_ss7165f45b ( " setCsvControl " ) ; <nl> - StaticString s_sys_ss717877f6 ( " children " ) ; <nl> - StaticString s_sys_ss717a7024 ( " getavailabledrivers " ) ; <nl> - StaticString s_sys_ss717b8b62 ( " c14nfile " ) ; <nl> - StaticString s_sys_ss7228e959 ( " interface " ) ; <nl> - StaticString s_sys_ss724a760a ( " type " ) ; <nl> - StaticString s_sys_ss7257a6f2 ( " setpersistence " ) ; <nl> - StaticString s_sys_ss7358e00d ( " setISODate " ) ; <nl> - StaticString s_sys_ss73e73811 ( " writeDTDAttlist " ) ; <nl> - StaticString s_sys_ss7416f7f1 ( " sort " ) ; <nl> - StaticString s_sys_ss74691b30 ( " done " ) ; <nl> - StaticString s_sys_ss750cda3b ( " access " ) ; <nl> - StaticString s_sys_ss75ec94fd ( " endDTDAttlist " ) ; <nl> - StaticString s_sys_ss764ad06c ( " fpassthru " ) ; <nl> - StaticString s_sys_ss7732a9a6 ( " hphp_get_class_info " ) ; <nl> - StaticString s_sys_ss7854bd7b ( " getTraceAsString " ) ; <nl> - StaticString s_sys_ss78cb1b27 ( " \ 000SplObjectStorage \ 000storage " , 25 ) ; <nl> - StaticString s_sys_ss791c5872 ( " Need to call next ( ) first " ) ; <nl> - StaticString s_sys_ss79892305 ( " getStackTrace " ) ; <nl> - StaticString s_sys_ss7a0832b7 ( " writePI " ) ; <nl> - StaticString s_sys_ss7a1c6fcd ( " createDocumentType " ) ; <nl> - StaticString s_sys_ss7a5dbb24 ( " output " ) ; <nl> - StaticString s_sys_ss7ace3627 ( " getProperties " ) ; <nl> - StaticString s_sys_ss7c2432f2 ( " UnexpectedValueException " ) ; <nl> - StaticString s_sys_ss7cb08d68 ( " arr " ) ; <nl> - StaticString s_sys_ss7cd91db4 ( " version " ) ; <nl> - StaticString s_sys_ss7d1afda2 ( " getBasename " ) ; <nl> - StaticString s_sys_ss7d2a9ef4 ( " getOption " ) ; <nl> - StaticString s_sys_ss7e545a5a ( " quit " ) ; <nl> - StaticString s_sys_ss7e5fc106 ( " \ " " ) ; <nl> - StaticString s_sys_ss7ef23ee0 ( " getErrors " ) ; <nl> - StaticString s_sys_ss7fd7d2bc ( " setfetchmode " ) ; <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - } <nl>
Generate one single literal_strings file for system
facebook/hhvm
fa99ded62524b51f1e93f84c898df40f31904460
2011-03-21T19:43:06Z
mmm a / core / bind / core_bind . cpp <nl> ppp b / core / bind / core_bind . cpp <nl> void _Directory : : _bind_methods ( ) { <nl> ObjectTypeDB : : bind_method ( _MD ( " get_drive " , " idx " ) , & _Directory : : get_drive ) ; <nl> ObjectTypeDB : : bind_method ( _MD ( " change_dir : Error " , " todir " ) , & _Directory : : change_dir ) ; <nl> ObjectTypeDB : : bind_method ( _MD ( " get_current_dir " ) , & _Directory : : get_current_dir ) ; <nl> - ObjectTypeDB : : bind_method ( _MD ( " make_dir : Error " , " name " ) , & _Directory : : make_dir ) ; <nl> - ObjectTypeDB : : bind_method ( _MD ( " make_dir_recursive : Error " , " name " ) , & _Directory : : make_dir_recursive ) ; <nl> - ObjectTypeDB : : bind_method ( _MD ( " file_exists " , " name " ) , & _Directory : : file_exists ) ; <nl> - ObjectTypeDB : : bind_method ( _MD ( " dir_exists " , " name " ) , & _Directory : : dir_exists ) ; <nl> + ObjectTypeDB : : bind_method ( _MD ( " make_dir : Error " , " path " ) , & _Directory : : make_dir ) ; <nl> + ObjectTypeDB : : bind_method ( _MD ( " make_dir_recursive : Error " , " path " ) , & _Directory : : make_dir_recursive ) ; <nl> + ObjectTypeDB : : bind_method ( _MD ( " file_exists " , " path " ) , & _Directory : : file_exists ) ; <nl> + ObjectTypeDB : : bind_method ( _MD ( " dir_exists " , " path " ) , & _Directory : : dir_exists ) ; <nl> / / ObjectTypeDB : : bind_method ( _MD ( " get_modified_time " , " file " ) , & _Directory : : get_modified_time ) ; <nl> ObjectTypeDB : : bind_method ( _MD ( " get_space_left " ) , & _Directory : : get_space_left ) ; <nl> ObjectTypeDB : : bind_method ( _MD ( " copy : Error " , " from " , " to " ) , & _Directory : : copy ) ; <nl> ObjectTypeDB : : bind_method ( _MD ( " rename : Error " , " from " , " to " ) , & _Directory : : rename ) ; <nl> - ObjectTypeDB : : bind_method ( _MD ( " remove : Error " , " file " ) , & _Directory : : remove ) ; <nl> + ObjectTypeDB : : bind_method ( _MD ( " remove : Error " , " path " ) , & _Directory : : remove ) ; <nl> <nl> } <nl> <nl> mmm a / core / io / config_file . cpp <nl> ppp b / core / io / config_file . cpp <nl> Error ConfigFile : : load ( const String & p_path ) { <nl> void ConfigFile : : _bind_methods ( ) { <nl> <nl> ObjectTypeDB : : bind_method ( _MD ( " set_value " , " section " , " key " , " value " ) , & ConfigFile : : set_value ) ; <nl> - ObjectTypeDB : : bind_method ( _MD ( " get_value " , " section " , " key " , " default " ) , & ConfigFile : : get_value , DEFVAL ( Variant ( ) ) ) ; <nl> + ObjectTypeDB : : bind_method ( _MD ( " get_value : Variant " , " section " , " key " , " default " ) , & ConfigFile : : get_value , DEFVAL ( Variant ( ) ) ) ; <nl> <nl> ObjectTypeDB : : bind_method ( _MD ( " has_section " , " section " ) , & ConfigFile : : has_section ) ; <nl> ObjectTypeDB : : bind_method ( _MD ( " has_section_key " , " section " , " key " ) , & ConfigFile : : has_section_key ) ; <nl> mmm a / doc / base / classes . xml <nl> ppp b / doc / base / classes . xml <nl> <nl> < / class > <nl> < class name = " ConfigFile " inherits = " Reference " category = " Core " > <nl> < brief_description > <nl> + Helper class to handle INI - style files . <nl> < / brief_description > <nl> < description > <nl> + This helper class can be used to store [ Variant ] values on the filesystem using an INI - style formatting . The stored values as referenced by a section and a key . The stored data can be saved to or parsed from a file , though ConfigFile objects can also be used directly with accessing the filesystem . <nl> + The following example shows how to parse a INI - style file from the system , read its contents and store new values in it : <nl> + [ codeblock ] <nl> + var config = ConfigFile . new ( ) <nl> + var err = config . load ( " user : / / settings . cfg " ) <nl> + if err = = OK : # if not , something went wrong with the file loading <nl> + # Look for the display / width pair , and default to 1024 if missing <nl> + var screen_width = get_value ( " display " , " width " , 1024 ) <nl> + # Store a variable if and only it hasn ' t been defined yet <nl> + if not config . has_section_key ( " audio " , " mute " ) : <nl> + config . set_value ( " audio " , " mute " , false ) <nl> + # Save the changes by overwriting the previous file <nl> + config . save ( " user : / / settings . cfg " ) <nl> + [ / codeblock ] <nl> < / description > <nl> < methods > <nl> < method name = " set_value " > <nl> <nl> < argument index = " 2 " name = " value " type = " Variant " > <nl> < / argument > <nl> < description > <nl> + Assign a value to the specified key of the the specified section . If the section and / or the key do not exist , they are created . Passing a [ code ] NULL [ / code ] value deletes the specified key if it exists ( and deletes the section if it ends up empty once the key has been removed ) . <nl> < / description > <nl> < / method > <nl> < method name = " get_value " qualifiers = " const " > <nl> + < return type = " Variant " > <nl> + < / return > <nl> < argument index = " 0 " name = " section " type = " String " > <nl> < / argument > <nl> < argument index = " 1 " name = " key " type = " String " > <nl> <nl> < argument index = " 2 " name = " default " type = " Variant " default = " NULL " > <nl> < / argument > <nl> < description > <nl> + Return the current value for the specified section and key . If the section and / or the key do not exist , the method returns the value of the optional [ i ] default [ / i ] argument ( and thus [ code ] NULL [ / code ] if not specified ) . <nl> < / description > <nl> < / method > <nl> < method name = " has_section " qualifiers = " const " > <nl> <nl> < argument index = " 0 " name = " section " type = " String " > <nl> < / argument > <nl> < description > <nl> + Check if the specified section exists . <nl> < / description > <nl> < / method > <nl> < method name = " has_section_key " qualifiers = " const " > <nl> <nl> < argument index = " 1 " name = " key " type = " String " > <nl> < / argument > <nl> < description > <nl> + Check if the specified section - key pair exists . <nl> < / description > <nl> < / method > <nl> < method name = " get_sections " qualifiers = " const " > <nl> < return type = " StringArray " > <nl> < / return > <nl> < description > <nl> + Return an array of all defined section identifiers . <nl> < / description > <nl> < / method > <nl> < method name = " get_section_keys " qualifiers = " const " > <nl> <nl> < argument index = " 0 " name = " section " type = " String " > <nl> < / argument > <nl> < description > <nl> + Return an array of all defined key identifiers in the specified section . <nl> < / description > <nl> < / method > <nl> < method name = " load " > <nl> <nl> < argument index = " 0 " name = " path " type = " String " > <nl> < / argument > <nl> < description > <nl> + Load the config file specified as a parameter . The file ' s contents are parsed and loaded in the ConfigFile object from which the method was called . The return value is one of the OK , FAILED or ERR_ * constants listed in [ @ Global Scope ] ( if the load was successful , it returns OK ) . <nl> < / description > <nl> < / method > <nl> < method name = " save " > <nl> <nl> < argument index = " 0 " name = " path " type = " String " > <nl> < / argument > <nl> < description > <nl> + Save the contents of the ConfigFile object to the file specified as a parameter . The output file uses an INI - style structure . <nl> + The return value is one of the OK , FAILED or ERR_ * constants listed in [ @ Global Scope ] ( if the save was successful , it returns OK ) . <nl> < / description > <nl> < / method > <nl> < / methods > <nl> This approximation makes straight segments between each point , then subdivides t <nl> Type used to handle the filesystem . <nl> < / brief_description > <nl> < description > <nl> - Directory type . Is used to manage directories and their content ( not restricted to the project folder ) . <nl> - Example for how to iterate through the files of a directory : <nl> + Directory type . It is used to manage directories and their content ( not restricted to the project folder ) . <nl> + Here is an example on how to iterate through the files of a directory : <nl> [ codeblock ] <nl> - func dir ( path ) : <nl> - var d = Directory . new ( ) <nl> - if d . open ( path ) = = 0 : <nl> - d . list_dir_begin ( ) <nl> - var file_name = d . get_next ( ) <nl> - while ( file_name ! = " " ) : <nl> - if d . current_is_dir ( ) : <nl> + func dir_contents ( path ) : <nl> + var dir = Directory . new ( ) <nl> + if dir . open ( path ) = = OK : <nl> + dir . list_dir_begin ( ) <nl> + var file_name = dir . get_next ( ) <nl> + while ( file_name ! = " " ) : <nl> + if dir . current_is_dir ( ) : <nl> print ( " Found directory : " + file_name ) <nl> else : <nl> - print ( " Found file : " + file_name ) <nl> - file_name = d . get_next ( ) <nl> + print ( " Found file : " + file_name ) <nl> + file_name = dir . get_next ( ) <nl> else : <nl> - print ( " Some open Error , maybe directory not found ? " ) <nl> + print ( " An error occurred when trying to access the path . " ) <nl> [ / codeblock ] <nl> < / description > <nl> < methods > <nl> This approximation makes straight segments between each point , then subdivides t <nl> < argument index = " 0 " name = " path " type = " String " > <nl> < / argument > <nl> < description > <nl> - Opens a directory to work with . Needs a path , example " res : / / folder " <nl> + Open an existing directory of the filesystem . The [ i ] path [ / i ] argument can be within the project tree ( [ code ] res : / / folder [ / code ] ) , the user directory ( [ code ] user : / / folder [ / code ] ) or an absolute path of the user filesystem ( e . g . [ code ] / tmp / folder [ / code ] or [ code ] C : \ tmp \ folder [ / code ] ) . <nl> + The method returns one of the error code constants defined in [ @ Global Scope ] ( OK or ERR_ * ) . <nl> < / description > <nl> < / method > <nl> < method name = " list_dir_begin " > <nl> < return type = " bool " > <nl> < / return > <nl> < description > <nl> - Loads all file names of the current directory ( prepares the get_next ( ) function ) . <nl> + Initialise the stream used to list all files and directories using the [ method get_next ] function , closing the current opened stream if needed . Once the stream has been processed , it should typically be closed with [ method list_dir_end ] . <nl> + Return false if the stream could not be initialised . <nl> < / description > <nl> < / method > <nl> < method name = " get_next " > <nl> < return type = " String " > <nl> < / return > <nl> < description > <nl> - Is used to iterate through the files of the current directory . Returns the name ( no path ) of the current file / directory , it also contains " . " and " . . " . <nl> - Returns an empty String " " at the end of the list . <nl> + Return the next element ( file or directory ) in the current directory ( including [ code ] . [ / code ] and [ code ] . . [ / code ] ) . The name of the file or directory is returned ( and not its full path ) . Once the stream has been fully processed , the method returns an empty String and closes the stream automatically ( i . e . [ method list_dir_end ] would not be mandatory in such a case ) . <nl> < / description > <nl> < / method > <nl> < method name = " current_is_dir " qualifiers = " const " > <nl> < return type = " bool " > <nl> < / return > <nl> < description > <nl> - Returns true if the current file you are looking at with get_next ( ) is a directory or " . " or " . . " otherwise false . <nl> + Return whether the current item processed with the last [ method get_next ] call is a directory ( [ code ] . [ / code ] and [ code ] . . [ / code ] are considered directories ) . <nl> < / description > <nl> < / method > <nl> < method name = " list_dir_end " > <nl> < description > <nl> - Run this to empty the list of remaining files in get_next ( ) . You can use it to end the iteration , as soon as your goal is reached . <nl> + Close the current stream opened with [ method list_dir_begin ] ( whether it has been fully processed with [ method get_next ] or not does not matter ) . <nl> < / description > <nl> < / method > <nl> < method name = " get_drive_count " > <nl> < return type = " int " > <nl> < / return > <nl> < description > <nl> + On Windows , return the number of drives ( partitions ) mounted on the current filesystem . On other platforms , the method returns 0 . <nl> < / description > <nl> < / method > <nl> < method name = " get_drive " > <nl> Returns an empty String " " at the end of the list . <nl> < argument index = " 0 " name = " idx " type = " int " > <nl> < / argument > <nl> < description > <nl> + On Windows , return the name of the drive ( partition ) passed as an argument ( e . g . [ code ] C : [ / code ] ) . On other platforms , or if the requested drive does not existed , the method returns an empty String . <nl> < / description > <nl> < / method > <nl> < method name = " change_dir " > <nl> Returns an empty String " " at the end of the list . <nl> < argument index = " 0 " name = " todir " type = " String " > <nl> < / argument > <nl> < description > <nl> - Needs a path or name to the next directory . When the target directory is in the current directory you can use " newfolder " otherwise you need the full path " res : / / currentfolder / newfolder " <nl> + Change the currently opened directory to the one passed as an argument . The argument can be relative to the current directory ( e . g . [ code ] newdir [ / code ] or [ code ] . . / newdir [ / code ] ) , or an absolute path ( e . g . [ code ] / tmp / newdir [ / code ] or [ code ] res : / / somedir / newdir [ / code ] ) . <nl> + The method returns one of the error code constants defined in [ @ Global Scope ] ( OK or ERR_ * ) . <nl> < / description > <nl> < / method > <nl> < method name = " get_current_dir " > <nl> < return type = " String " > <nl> < / return > <nl> < description > <nl> - Returns a path to the current directory , example : " res : / / folder " <nl> + Return the absolute path to the currently opened directory ( e . g . [ code ] res : / / folder [ / code ] or [ code ] C : \ tmp \ folder [ / code ] ) . <nl> < / description > <nl> < / method > <nl> < method name = " make_dir " > <nl> < return type = " Error " > <nl> < / return > <nl> - < argument index = " 0 " name = " name " type = " String " > <nl> + < argument index = " 0 " name = " path " type = " String " > <nl> < / argument > <nl> < description > <nl> + Create a directory . The argument can be relative to the current directory , or an absolute path . The target directory should be placed in an already existing directory ( to create the full path recursively , see [ method make_dir_recursive ] ) . <nl> + The method returns one of the error code constants defined in [ @ Global Scope ] ( OK , FAILED or ERR_ * ) . <nl> < / description > <nl> < / method > <nl> < method name = " make_dir_recursive " > <nl> < return type = " Error " > <nl> < / return > <nl> - < argument index = " 0 " name = " name " type = " String " > <nl> + < argument index = " 0 " name = " path " type = " String " > <nl> < / argument > <nl> < description > <nl> + Create a target directory and all necessary intermediate directories in its path , by calling [ method make_dir ] recursively . The argument can be relative to the current directory , or an absolute path . <nl> + Returns one of the error code constants defined in [ @ Global Scope ] ( OK , FAILED or ERR_ * ) . <nl> < / description > <nl> < / method > <nl> < method name = " file_exists " > <nl> < return type = " bool " > <nl> < / return > <nl> - < argument index = " 0 " name = " name " type = " String " > <nl> + < argument index = " 0 " name = " path " type = " String " > <nl> < / argument > <nl> < description > <nl> + Return whether the target file exists . The argument can be relative to the current directory , or an absolute path . <nl> < / description > <nl> < / method > <nl> < method name = " dir_exists " > <nl> < return type = " bool " > <nl> < / return > <nl> - < argument index = " 0 " name = " name " type = " String " > <nl> + < argument index = " 0 " name = " path " type = " String " > <nl> < / argument > <nl> < description > <nl> - Returns true if directory exists otherwise false . Needs a path , example : " res : / / folder " <nl> + Return whether the target directory exists . The argument can be relative to the current directory , or an absolute path . <nl> < / description > <nl> < / method > <nl> < method name = " get_space_left " > <nl> < return type = " int " > <nl> < / return > <nl> < description > <nl> + On Unix desktop systems , return the available space on the current directory ' s disk . On other platforms , this information is not available and the method returns 0 or - 1 . <nl> < / description > <nl> < / method > <nl> < method name = " copy " > <nl> Returns an empty String " " at the end of the list . <nl> < argument index = " 1 " name = " to " type = " String " > <nl> < / argument > <nl> < description > <nl> + Copy the [ i ] from [ / i ] file to the [ i ] to [ / i ] destination . Both arguments should be paths to files , either relative or absolute . If the destination file exists and is not access - protected , it will be overwritten . <nl> + Returns one of the error code constants defined in [ @ Global Scope ] ( OK , FAILED or ERR_ * ) . <nl> < / description > <nl> < / method > <nl> < method name = " rename " > <nl> Returns an empty String " " at the end of the list . <nl> < argument index = " 1 " name = " to " type = " String " > <nl> < / argument > <nl> < description > <nl> + Rename ( move ) the [ i ] from [ / i ] file to the [ i ] to [ / i ] destination . Both arguments should be paths to files , either relative or absolute . If the destination file exists and is not access - protected , it will be overwritten . <nl> + Returns one of the error code constants defined in [ @ Global Scope ] ( OK or FAILED ) . <nl> < / description > <nl> < / method > <nl> < method name = " remove " > <nl> < return type = " Error " > <nl> < / return > <nl> - < argument index = " 0 " name = " file " type = " String " > <nl> + < argument index = " 0 " name = " path " type = " String " > <nl> < / argument > <nl> < description > <nl> + Delete the target file or an empty directory . The argument can be relative to the current directory , or an absolute path . If the target directory is not empty , the operation will fail . <nl> + Returns one of the error code constants defined in [ @ Global Scope ] ( OK or FAILED ) . <nl> < / description > <nl> < / method > <nl> < / methods > <nl> Example : ( content - length : 12 ) , ( Content - Type : application / json ; charset = UTF - 8 ) <nl> < description > <nl> < / description > <nl> < / method > <nl> + < method name = " get_item_at_pos " qualifiers = " const " > <nl> + < return type = " int " > <nl> + < / return > <nl> + < argument index = " 0 " name = " pos " type = " Vector2 " > <nl> + < / argument > <nl> + < description > <nl> + < / description > <nl> + < / method > <nl> < method name = " ensure_current_is_visible " > <nl> < description > <nl> < / description > <nl> Example : ( content - length : 12 ) , ( Content - Type : application / json ; charset = UTF - 8 ) <nl> < / constant > <nl> < constant name = " NOTIFICATION_INSTANCED " value = " 20 " > <nl> < / constant > <nl> + < constant name = " NOTIFICATION_DRAG_BEGIN " value = " 21 " > <nl> + < / constant > <nl> + < constant name = " NOTIFICATION_DRAG_END " value = " 22 " > <nl> + < / constant > <nl> < constant name = " PAUSE_MODE_INHERIT " value = " 0 " > <nl> < / constant > <nl> < constant name = " PAUSE_MODE_STOP " value = " 1 " > <nl> This method controls whether the position between two cached points is interpola <nl> < method name = " strip_edges " > <nl> < return type = " String " > <nl> < / return > <nl> + < argument index = " 0 " name = " left " type = " bool " default = " True " > <nl> + < / argument > <nl> + < argument index = " 1 " name = " right " type = " bool " default = " True " > <nl> + < / argument > <nl> < description > <nl> - Return a copy of the string stripped of any non - printable character at the beginning and the end . <nl> + Return a copy of the string stripped of any non - printable character at the beginning and the end . The optional arguments are used to toggle stripping on the left and right edges respectively . <nl> < / description > <nl> < / method > <nl> < method name = " substr " > <nl> This method controls whether the position between two cached points is interpola <nl> < / description > <nl> < / method > <nl> < method name = " cursor_get_blink_enabled " qualifiers = " const " > <nl> - < return type = " float " > <nl> + < return type = " bool " > <nl> < / return > <nl> < description > <nl> Gets whether the text editor caret is blinking . <nl> This method controls whether the position between two cached points is interpola <nl> < description > <nl> < / description > <nl> < / method > <nl> + < method name = " get_item_at_pos " qualifiers = " const " > <nl> + < return type = " TreeItem " > <nl> + < / return > <nl> + < argument index = " 0 " name = " pos " type = " Vector2 " > <nl> + < / argument > <nl> + < description > <nl> + < / description > <nl> + < / method > <nl> + < method name = " get_column_at_pos " qualifiers = " const " > <nl> + < return type = " int " > <nl> + < / return > <nl> + < argument index = " 0 " name = " pos " type = " Vector2 " > <nl> + < / argument > <nl> + < description > <nl> + < / description > <nl> + < / method > <nl> < method name = " ensure_cursor_is_visible " > <nl> < description > <nl> < / description > <nl> This method controls whether the position between two cached points is interpola <nl> < description > <nl> < / description > <nl> < / method > <nl> + < method name = " set_drop_mode_flags " > <nl> + < argument index = " 0 " name = " flags " type = " int " > <nl> + < / argument > <nl> + < description > <nl> + < / description > <nl> + < / method > <nl> + < method name = " get_drop_mode_flags " qualifiers = " const " > <nl> + < return type = " int " > <nl> + < / return > <nl> + < description > <nl> + < / description > <nl> + < / method > <nl> < / methods > <nl> < signals > <nl> < signal name = " item_activated " > <nl> This method controls whether the position between two cached points is interpola <nl> < / constant > <nl> < constant name = " SELECT_MULTI " value = " 2 " > <nl> < / constant > <nl> + < constant name = " DROP_MODE_DISABLED " value = " 0 " > <nl> + < / constant > <nl> + < constant name = " DROP_MODE_ON_ITEM " value = " 1 " > <nl> + < / constant > <nl> + < constant name = " DROP_MODE_INBETWEEN " value = " 2 " > <nl> + < / constant > <nl> < / constants > <nl> < theme_items > <nl> < theme_item name = " item_margin " type = " int " > <nl> This method controls whether the position between two cached points is interpola <nl> < / theme_item > <nl> < theme_item name = " font_color " type = " Color " > <nl> < / theme_item > <nl> + < theme_item name = " drop_position_color " type = " Color " > <nl> + < / theme_item > <nl> < theme_item name = " arrow " type = " Texture " > <nl> < / theme_item > <nl> < theme_item name = " updown " type = " Texture " > <nl> This method controls whether the position between two cached points is interpola <nl> < / argument > <nl> < argument index = " 1 " name = " color " type = " Color " > <nl> < / argument > <nl> + < argument index = " 2 " name = " just_outline " type = " bool " default = " false " > <nl> + < / argument > <nl> < description > <nl> < / description > <nl> < / method > <nl> This method controls whether the position between two cached points is interpola <nl> < description > <nl> < / description > <nl> < / method > <nl> + < method name = " gui_get_drag_data " qualifiers = " const " > <nl> + < return type = " Variant " > <nl> + < / return > <nl> + < description > <nl> + < / description > <nl> + < / method > <nl> < method name = " set_disable_input " > <nl> < argument index = " 0 " name = " disable " type = " bool " > <nl> < / argument > <nl>
Merge pull request from akien - mga / pr - classref
godotengine/godot
48dc4d92a8f3c9eb42456eda2433c6fcaff0c723
2016-05-12T06:42:57Z
mmm a / src / heap / heap - inl . h <nl> ppp b / src / heap / heap - inl . h <nl> void Heap : : update_external_memory ( int64_t delta ) { <nl> } <nl> } <nl> <nl> - void Heap : : update_external_memory_concurrently_freed ( uintptr_t freed ) { <nl> - external_memory_concurrently_freed_ + = freed ; <nl> - } <nl> - <nl> - void Heap : : account_external_memory_concurrently_freed ( ) { <nl> - update_external_memory ( <nl> - - static_cast < int64_t > ( external_memory_concurrently_freed_ ) ) ; <nl> - external_memory_concurrently_freed_ = 0 ; <nl> - } <nl> - <nl> RootsTable & Heap : : roots_table ( ) { return isolate ( ) - > roots_table ( ) ; } <nl> <nl> # define ROOT_ACCESSOR ( Type , name , CamelName ) \ <nl> mmm a / src / heap / heap . h <nl> ppp b / src / heap / heap . h <nl> class Heap { <nl> <nl> V8_INLINE int64_t external_memory ( ) ; <nl> V8_INLINE void update_external_memory ( int64_t delta ) ; <nl> - V8_INLINE void update_external_memory_concurrently_freed ( uintptr_t freed ) ; <nl> - V8_INLINE void account_external_memory_concurrently_freed ( ) ; <nl> <nl> V8_EXPORT_PRIVATE size_t YoungArrayBufferBytes ( ) ; <nl> V8_EXPORT_PRIVATE size_t OldArrayBufferBytes ( ) ; <nl> mmm a / src / heap / mark - compact . cc <nl> ppp b / src / heap / mark - compact . cc <nl> void MarkCompactCollector : : Prepare ( ) { <nl> heap_ - > safepoint ( ) - > IterateLocalHeaps ( <nl> [ ] ( LocalHeap * local_heap ) { local_heap - > FreeLinearAllocationArea ( ) ; } ) ; <nl> } <nl> - <nl> - heap ( ) - > account_external_memory_concurrently_freed ( ) ; <nl> } <nl> <nl> void MarkCompactCollector : : FinishConcurrentMarking ( <nl> void MinorMarkCompactCollector : : CollectGarbage ( ) { <nl> heap ( ) - > new_lo_space ( ) - > FreeDeadObjects ( [ ] ( HeapObject ) { return true ; } ) ; <nl> } <nl> <nl> - heap ( ) - > account_external_memory_concurrently_freed ( ) ; <nl> - <nl> SweepArrayBufferExtensions ( ) ; <nl> } <nl> <nl>
[ heap ] Remove Heap : : external_memory_concurrently_freed
v8/v8
9f26032cfb0754bfacad30ec7295bbf0e3eefee7
2020-08-12T09:56:27Z
mmm a / tensorflow / contrib / layers / python / layers / layers . py <nl> ppp b / tensorflow / contrib / layers / python / layers / layers . py <nl> def batch_norm ( <nl> trainable = trainable ) <nl> <nl> # Create moving_mean and moving_variance variables and add them to the <nl> - # appropiate collections . <nl> - moving_mean_collections = utils . get_variable_collections ( <nl> - variables_collections , ' moving_mean ' ) <nl> - moving_mean_initializer = param_initializers . get ( ' moving_mean ' , <nl> - init_ops . zeros_initializer ) <nl> - moving_mean = variables . model_variable ( <nl> - ' moving_mean ' , <nl> - shape = params_shape , <nl> - dtype = dtype , <nl> - initializer = moving_mean_initializer , <nl> - trainable = False , <nl> - collections = moving_mean_collections ) <nl> - moving_variance_collections = utils . get_variable_collections ( <nl> - variables_collections , ' moving_variance ' ) <nl> - moving_variance_initializer = param_initializers . get ( <nl> - ' moving_variance ' , init_ops . ones_initializer ) <nl> - moving_variance = variables . model_variable ( <nl> - ' moving_variance ' , <nl> - shape = params_shape , <nl> - dtype = dtype , <nl> - initializer = moving_variance_initializer , <nl> - trainable = False , <nl> - collections = moving_variance_collections ) <nl> + # appropiate collections . We disable variable partitioning while creating <nl> + # them , because assign_moving_average is not yet supported for partitioned <nl> + # variables . <nl> + partitioner = variable_scope . get_variable_scope ( ) . partitioner <nl> + try : <nl> + variable_scope . get_variable_scope ( ) . set_partitioner ( None ) <nl> + moving_mean_collections = utils . get_variable_collections ( <nl> + variables_collections , ' moving_mean ' ) <nl> + moving_mean_initializer = param_initializers . get ( <nl> + ' moving_mean ' , init_ops . zeros_initializer ) <nl> + moving_mean = variables . model_variable ( <nl> + ' moving_mean ' , <nl> + shape = params_shape , <nl> + dtype = dtype , <nl> + initializer = moving_mean_initializer , <nl> + trainable = False , <nl> + collections = moving_mean_collections ) <nl> + moving_variance_collections = utils . get_variable_collections ( <nl> + variables_collections , ' moving_variance ' ) <nl> + moving_variance_initializer = param_initializers . get ( <nl> + ' moving_variance ' , init_ops . ones_initializer ) <nl> + moving_variance = variables . model_variable ( <nl> + ' moving_variance ' , <nl> + shape = params_shape , <nl> + dtype = dtype , <nl> + initializer = moving_variance_initializer , <nl> + trainable = False , <nl> + collections = moving_variance_collections ) <nl> + finally : <nl> + variable_scope . get_variable_scope ( ) . set_partitioner ( partitioner ) <nl> <nl> # If ` is_training ` doesn ' t have a constant value , because it is a ` Tensor ` , <nl> # a ` Variable ` or ` Placeholder ` then is_training_value will be None and <nl> mmm a / tensorflow / contrib / layers / python / layers / layers_test . py <nl> ppp b / tensorflow / contrib / layers / python / layers / layers_test . py <nl> def testEvalMovingVars ( self ) : <nl> self . assertAllClose ( mean , expected_mean ) <nl> self . assertAllClose ( variance , expected_var ) <nl> <nl> + def testEvalMovingVarsWithPartitioner ( self ) : <nl> + # This test makes sure that the moving - mean and moving - variance logic works <nl> + # when ` batch_norm ` is called within a variable - scope that has a variable <nl> + # partitioner . <nl> + partitioner = tf . fixed_size_partitioner ( 2 , axis = 0 ) <nl> + with tf . variable_scope ( tf . get_variable_scope ( ) , partitioner = partitioner ) : <nl> + self . testEvalMovingVars ( ) <nl> + <nl> def _testReuseVars ( self , fused ) : <nl> height , width = 3 , 3 <nl> batch_size = 10 <nl>
Disable partitioning of variable in batch_norm .
tensorflow/tensorflow
e12d18cfe417ae610575a8c63a9ff6fd226d5888
2016-10-14T00:34:11Z
mmm a / xbmc / input / touch / generic / GenericTouchInputHandler . cpp <nl> ppp b / xbmc / input / touch / generic / GenericTouchInputHandler . cpp <nl> bool CGenericTouchInputHandler : : HandleTouchInput ( TouchInput event , float x , floa <nl> } <nl> <nl> setGestureState ( TouchGestureUnknown ) ; <nl> - m_pointers [ pointer ] . reset ( ) ; <nl> } <nl> + m_pointers [ pointer ] . reset ( ) ; <nl> <nl> return result ; <nl> } <nl>
Fix invalidating old pointer on multi - touch up
xbmc/xbmc
ed2702f700c65cc1a9b5265640eacc3006c4d5b4
2017-08-06T13:03:21Z
mmm a / example / README . md <nl> ppp b / example / README . md <nl> <nl> - MXNet Examples and Resources <nl> - = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> - This folder contains links to all the examples and resources related to MXNet . <nl> - If you think you have anything belongs to here , please open a new pull request . <nl> + # Awesome MXNet <nl> <nl> - Langauges Bindings <nl> + This page contains a curated list of awesome MXnet examples , tutorials and blogs . It is inspired by [ awesome - php ] ( https : / / github . com / ziadoz / awesome - php ) and [ awesome - machine - learning ] ( https : / / github . com / josephmisiti / awesome - machine - learning ) . <nl> + <nl> + # # Contributing <nl> + <nl> + If you want to contribute to this list and the examples , please open a new pull request . <nl> + <nl> + # # List of examples <nl> + <nl> + # # # Langauges Binding Examples <nl> mmmmmmmmmmmmmmmmmm <nl> + * [ C + + examples ] ( https : / / github . com / dmlc / mxnet / tree / master / example / cpp ) - Example code for using C + + interface , including NDArray , symbolic layer and models . <nl> * [ MXNet Python ] ( http : / / mxnet . readthedocs . org / en / latest / python / index . html ) - Python libary <nl> * [ MXNetR ] ( http : / / mxnet . readthedocs . org / en / latest / R - package / index . html ) - R library <nl> * [ MXNet . jl ] ( http : / / mxnetjl . readthedocs . org / en / latest / ) - Julia library <nl> * [ gomxnet ] ( https : / / github . com / jdeng / gomxnet ) - Go binding <nl> * [ MXNet JNI ] ( https : / / github . com / dmlc / mxnet / tree / master / amalgamation / jni ) - JNI ( Android ) library <nl> - * [ MXNet Amalgamation ] ( https : / / github . com / dmlc / mxnet / tree / master / amalgamation ) - Amalgamation ( entire library in a single file ) <nl> + * [ MXNet Amalgamation ] ( https : / / github . com / dmlc / mxnet / tree / master / amalgamation ) - Amalgamation ( entire library in a single file ) <nl> + * [ MXNet Javascript ] ( https : / / github . com / dmlc / mxnet . js / ) - MXNetJS : Javascript Package for Deep Learning in Browser ( without server ) <nl> <nl> - Examples Codes <nl> + # # # Deep Learning Examples <nl> mmmmmmmmmmmm - - <nl> - * [ C + + examples ] ( https : / / github . com / dmlc / mxnet / tree / master / example / cpp ) - Example code for using C + + interface , including NDArray , symbolic layer and models . <nl> * [ Image classification ] ( https : / / github . com / dmlc / mxnet / tree / master / example / image - classification ) - Image classification on MNIST , CIFAR , ImageNet - 1k , ImageNet - Full , * * * with multiple GPU and distributed training * * * . <nl> - * [ Recurrent Neural Net ] ( https : / / github . com / dmlc / mxnet / tree / master / example / rnn ) - LSTM and RNN for language modeling and character level generation . <nl> + * [ Recurrent Neural Net ] ( https : / / github . com / dmlc / mxnet / tree / master / example / rnn ) - LSTM and RNN for language modeling and character level generation ( Char - RNN ) . <nl> * [ Autoencoder ] ( https : / / github . com / dmlc / mxnet / tree / master / example / autoencoder ) - Auto encoder training . <nl> * [ Numpy Operator Customization ] ( https : / / github . com / dmlc / mxnet / tree / master / example / numpy - ops ) - Example on quick customize new ops with numpy . <nl> * [ Adversary Sample Generation ] ( adversary ) - Find adversary sample by using fast sign method . <nl> * [ Neural Art ] ( neural - style ) - Generate artistic style images . <nl> + * [ Kaggle 1st national data science bowl ] ( https : / / github . com / dmlc / mxnet / tree / master / example / kaggle - ndsb1 ) - a MXnet example for Kaggle Nation Data Science Bowl 1 <nl> + * [ Kaggle 2nd national data science bowl ] ( https : / / github . com / dmlc / mxnet / tree / master / example / kaggle - ndsb2 ) - a tutorial for Kaggle Second Nation Data Science Bowl <nl> <nl> - IPython Notebooks <nl> + <nl> + # # # IPython Notebooks <nl> mmmmmmmmmmmmmmm - - <nl> * [ Predict with Pre - trained model ] ( https : / / github . com / dmlc / mxnet / blob / master / example / notebooks / predict - with - pretrained - model . ipynb ) - Notebook on how to predict with pretrained model . <nl> * [ composite symbol ] ( notebooks / composite_symbol . ipynb ) - A demo of how to composite a symbolic Inception - BatchNorm Network <nl> IPython Notebooks <nl> * [ cifar - 100 ] ( notebooks / cifar - 100 . ipynb ) - A demo of how to train a 75 . 68 % accuracy CIFAR - 100 model <nl> * [ simple bind ] ( notebooks / simple_bind . ipynb ) - A demo of low level training API . <nl> <nl> - Mobile Applications <nl> + # # # Mobile App Examples <nl> mmmmmmmmmmmmmmmmmm - <nl> - * [ MXNet Android Classification App ] ( https : / / github . com / Leliana / WhatsThis ) - Image classification on mobile with MXNet . <nl> + * [ MXNet Android Classification App ] ( https : / / github . com / Leliana / WhatsThis ) - Image classification on Android with MXNet . <nl> + * [ MXNet iOS Classification App ] ( https : / / github . com / pppoe / WhatsThis - iOS ) - Image classification on iOS with MXNet . <nl> + * [ Compile MXnet on Xcode ( in Chinese ) ] ( http : / / www . liuxiao . org / 2015 / 12 / ios - mxnet - % E7 % 9A % 84 - ios - % E7 % 89 % 88 % E6 % 9C % AC % E7 % BC % 96 % E8 % AF % 91 / ) - a step - by - step tutorial of compiling MXnet on Xcode for iOS app <nl> <nl> - Web Predictive Services <nl> + # # # Web Predictive Services <nl> mmmmmmmmmmmmmmmmmmmmm - - <nl> - * [ MXNet Shinny ] ( https : / / github . com / thirdwing / mxnet_shiny ) - Source code for quickly create a Shiny R app to host online image classification . <nl> + * [ MXNet Shinny ] ( https : / / github . com / thirdwing / mxnet_shiny ) - Source code for quickly creating a Shiny R app to host online image classification . <nl> + <nl> + # # List of tutorials <nl> + <nl> + # # # Deep learning for hackers with MXnet <nl> + <nl> + * Deep learning for hackers with MXnet ( 1 ) GPU installation and MNIST [ English ] ( https : / / no2147483647 . wordpress . com / 2015 / 12 / 07 / deep - learning - for - hackers - with - mxnet - 1 / ) [ Chinese ] ( http : / / phunter . farbox . com / post / mxnet - tutorial1 ) - a tutorial of installing MXnet with GPU and introduction to deep learning by MNIST example . <nl> + * Deep learning for hackers with MXnet ( 2 ) : Neural art [ English ] ( https : / / no2147483647 . wordpress . com / 2015 / 12 / 21 / deep - learning - for - hackers - with - mxnet - 2 / ) [ Chinese ] ( http : / / phunter . farbox . com / post / mxnet - tutorial2 ) - a tutorial of generating Van Gogh style cat paintings . <nl> + <nl> + # # # Setup AWS instance with MXnet <nl> + * [ Setup Amazon AWS GPU instance with MXnet ] ( https : / / no2147483647 . wordpress . com / 2016 / 01 / 16 / setup - amazon - aws - gpu - instance - with - mxnet / ) - AWS GPU instance setup with GPU ( CUDA with latest cuDNN and S3 support ) <nl> + <nl> + # # # Kaggle tutorials <nl> + * [ Kaggle 2nd Annual Data Science Bowl End - to - End Deep Learning Tutorial ( Python ) ] ( https : / / www . kaggle . com / c / second - annual - data - science - bowl / forums / t / 18079 / end - to - end - deep - learning - tutorial - 0 - 0392 ) - an end - to - end python tutorial for Kaggle heart disease diagnose competition ( public leaderboard score 0 . 0392 ) <nl> + * [ Kaggle 2nd Annual Data Science Bowl End - to - End Deep Learning Tutorial ( R ) ] ( https : / / www . kaggle . com / c / second - annual - data - science - bowl / forums / t / 18122 / deep - learning - model - in - r ) - an end - to - end R tutorial for Kaggle heart disease diagnose competition <nl> \ No newline at end of file <nl>
Merge pull request from phunterlau / master
apache/incubator-mxnet
7d2255efc8a7030a17e59880418fad26f0708a49
2016-02-03T08:15:39Z
mmm a / cmake / OpenCVUtils . cmake <nl> ppp b / cmake / OpenCVUtils . cmake <nl> macro ( ocv_clear_vars ) <nl> endmacro ( ) <nl> <nl> set ( OCV_COMPILER_FAIL_REGEX <nl> - " argument ' . * ' is not valid " # GCC 9 + <nl> + " argument . * is not valid " # GCC 9 + ( including support of unicode quotes ) <nl> " command line option . * is valid for . * but not for C \ \ + \ \ + " # GNU <nl> " command line option . * is valid for . * but not for C " # GNU <nl> " unrecognized . * option " # GNU <nl> mmm a / samples / opencl / opencl - opencv - interop . cpp <nl> ppp b / samples / opencl / opencl - opencv - interop . cpp <nl> <nl> # define CL_USE_DEPRECATED_OPENCL_1_1_APIS <nl> # define CL_USE_DEPRECATED_OPENCL_1_2_APIS <nl> # define CL_USE_DEPRECATED_OPENCL_2_0_APIS / / eliminate build warning <nl> + # define CL_TARGET_OPENCL_VERSION 200 / / 2 . 0 <nl> <nl> # ifdef __APPLE__ <nl> # define CL_SILENCE_DEPRECATION <nl> int App : : initVideoSource ( ) <nl> throw std : : runtime_error ( std : : string ( " specify video source " ) ) ; <nl> } <nl> <nl> - catch ( const std : : exception e ) <nl> + catch ( const std : : exception & e ) <nl> { <nl> cerr < < " ERROR : " < < e . what ( ) < < std : : endl ; <nl> return - 1 ; <nl>
Merge pull request from alalek : eliminate_build_warnings
opencv/opencv
9572895da011c67af1aa0d68869c21a9c42ddce4
2019-12-27T19:38:25Z
mmm a / drivers / rtaudio / RtAudio . cpp <nl> ppp b / drivers / rtaudio / RtAudio . cpp <nl> <nl> # include < cstdlib > <nl> # include < cstring > <nl> # include < climits > <nl> + # include < algorithm > <nl> <nl> / / Static variable definitions . <nl> const unsigned int RtApi : : MAX_SAMPLE_RATES = 14 ; <nl> const unsigned int RtApi : : SAMPLE_RATES [ ] = { <nl> # define MUTEX_DESTROY ( A ) DeleteCriticalSection ( A ) <nl> # define MUTEX_LOCK ( A ) EnterCriticalSection ( A ) <nl> # define MUTEX_UNLOCK ( A ) LeaveCriticalSection ( A ) <nl> + <nl> + # include " tchar . h " <nl> + <nl> + static std : : string convertCharPointerToStdString ( const char * text ) <nl> + { <nl> + return std : : string ( text ) ; <nl> + } <nl> + <nl> + static std : : string convertCharPointerToStdString ( const wchar_t * text ) <nl> + { <nl> + int length = WideCharToMultiByte ( CP_UTF8 , 0 , text , - 1 , NULL , 0 , NULL , NULL ) ; <nl> + std : : string s ( length - 1 , ' \ 0 ' ) ; <nl> + WideCharToMultiByte ( CP_UTF8 , 0 , text , - 1 , & s [ 0 ] , length , NULL , NULL ) ; <nl> + return s ; <nl> + } <nl> + <nl> # elif defined ( __LINUX_ALSA__ ) | | defined ( __LINUX_PULSE__ ) | | defined ( __UNIX_JACK__ ) | | defined ( __LINUX_OSS__ ) | | defined ( __MACOSX_CORE__ ) <nl> / / pthread API <nl> # define MUTEX_INITIALIZE ( A ) pthread_mutex_init ( A , NULL ) <nl> RtAudio : : RtAudio ( RtAudio : : Api api ) <nl> getCompiledApi ( apis ) ; <nl> for ( unsigned int i = 0 ; i < apis . size ( ) ; i + + ) { <nl> openRtApi ( apis [ i ] ) ; <nl> - if ( rtapi_ - > getDeviceCount ( ) ) break ; <nl> + if ( rtapi_ & & rtapi_ - > getDeviceCount ( ) ) break ; <nl> } <nl> <nl> if ( rtapi_ ) return ; <nl> RtAudio : : DeviceInfo RtApiCore : : getDeviceInfo ( unsigned int device ) <nl> bool haveValueRange = false ; <nl> info . sampleRates . clear ( ) ; <nl> for ( UInt32 i = 0 ; i < nRanges ; i + + ) { <nl> - if ( rangeList [ i ] . mMinimum = = rangeList [ i ] . mMaximum ) <nl> - info . sampleRates . push_back ( ( unsigned int ) rangeList [ i ] . mMinimum ) ; <nl> - else { <nl> + if ( rangeList [ i ] . mMinimum = = rangeList [ i ] . mMaximum ) { <nl> + unsigned int tmpSr = ( unsigned int ) rangeList [ i ] . mMinimum ; <nl> + info . sampleRates . push_back ( tmpSr ) ; <nl> + <nl> + if ( ! info . preferredSampleRate | | ( tmpSr < = 48000 & & tmpSr > info . preferredSampleRate ) ) <nl> + info . preferredSampleRate = tmpSr ; <nl> + <nl> + } else { <nl> haveValueRange = true ; <nl> if ( rangeList [ i ] . mMinimum > minimumRate ) minimumRate = rangeList [ i ] . mMinimum ; <nl> if ( rangeList [ i ] . mMaximum < maximumRate ) maximumRate = rangeList [ i ] . mMaximum ; <nl> RtAudio : : DeviceInfo RtApiCore : : getDeviceInfo ( unsigned int device ) <nl> <nl> if ( haveValueRange ) { <nl> for ( unsigned int k = 0 ; k < MAX_SAMPLE_RATES ; k + + ) { <nl> - if ( SAMPLE_RATES [ k ] > = ( unsigned int ) minimumRate & & SAMPLE_RATES [ k ] < = ( unsigned int ) maximumRate ) <nl> + if ( SAMPLE_RATES [ k ] > = ( unsigned int ) minimumRate & & SAMPLE_RATES [ k ] < = ( unsigned int ) maximumRate ) { <nl> info . sampleRates . push_back ( SAMPLE_RATES [ k ] ) ; <nl> + <nl> + if ( ! info . preferredSampleRate | | ( SAMPLE_RATES [ k ] < = 48000 & & SAMPLE_RATES [ k ] > info . preferredSampleRate ) ) <nl> + info . preferredSampleRate = SAMPLE_RATES [ k ] ; <nl> + } <nl> } <nl> } <nl> <nl> void RtApiCore : : closeStream ( void ) <nl> <nl> CoreHandle * handle = ( CoreHandle * ) stream_ . apiHandle ; <nl> if ( stream_ . mode = = OUTPUT | | stream_ . mode = = DUPLEX ) { <nl> + if ( handle ) { <nl> + AudioObjectPropertyAddress property = { kAudioHardwarePropertyDevices , <nl> + kAudioObjectPropertyScopeGlobal , <nl> + kAudioObjectPropertyElementMaster } ; <nl> + <nl> + property . mSelector = kAudioDeviceProcessorOverload ; <nl> + property . mScope = kAudioObjectPropertyScopeGlobal ; <nl> + if ( AudioObjectRemovePropertyListener ( handle - > id [ 0 ] , & property , xrunListener , ( void * ) handle ) ! = noErr ) { <nl> + errorText_ = " RtApiCore : : closeStream ( ) : error removing property listener ! " ; <nl> + error ( RtAudioError : : WARNING ) ; <nl> + } <nl> + } <nl> if ( stream_ . state = = STREAM_RUNNING ) <nl> AudioDeviceStop ( handle - > id [ 0 ] , callbackHandler ) ; <nl> # if defined ( MAC_OS_X_VERSION_10_5 ) & & ( MAC_OS_X_VERSION_MIN_REQUIRED > = MAC_OS_X_VERSION_10_5 ) <nl> void RtApiCore : : closeStream ( void ) <nl> } <nl> <nl> if ( stream_ . mode = = INPUT | | ( stream_ . mode = = DUPLEX & & stream_ . device [ 0 ] ! = stream_ . device [ 1 ] ) ) { <nl> + if ( handle ) { <nl> + AudioObjectPropertyAddress property = { kAudioHardwarePropertyDevices , <nl> + kAudioObjectPropertyScopeGlobal , <nl> + kAudioObjectPropertyElementMaster } ; <nl> + <nl> + property . mSelector = kAudioDeviceProcessorOverload ; <nl> + property . mScope = kAudioObjectPropertyScopeGlobal ; <nl> + if ( AudioObjectRemovePropertyListener ( handle - > id [ 1 ] , & property , xrunListener , ( void * ) handle ) ! = noErr ) { <nl> + errorText_ = " RtApiCore : : closeStream ( ) : error removing property listener ! " ; <nl> + error ( RtAudioError : : WARNING ) ; <nl> + } <nl> + } <nl> if ( stream_ . state = = STREAM_RUNNING ) <nl> AudioDeviceStop ( handle - > id [ 1 ] , callbackHandler ) ; <nl> # if defined ( MAC_OS_X_VERSION_10_5 ) & & ( MAC_OS_X_VERSION_MIN_REQUIRED > = MAC_OS_X_VERSION_10_5 ) <nl> RtAudio : : DeviceInfo RtApiJack : : getDeviceInfo ( unsigned int device ) <nl> <nl> / / Get the current jack server sample rate . <nl> info . sampleRates . clear ( ) ; <nl> - info . sampleRates . push_back ( jack_get_sample_rate ( client ) ) ; <nl> + <nl> + info . preferredSampleRate = jack_get_sample_rate ( client ) ; <nl> + info . sampleRates . push_back ( info . preferredSampleRate ) ; <nl> <nl> / / Count the available ports containing the client name as device <nl> / / channels . Jack " input ports " equal RtAudio output channels . <nl> RtAudio : : DeviceInfo RtApiAsio : : getDeviceInfo ( unsigned int device ) <nl> info . sampleRates . clear ( ) ; <nl> for ( unsigned int i = 0 ; i < MAX_SAMPLE_RATES ; i + + ) { <nl> result = ASIOCanSampleRate ( ( ASIOSampleRate ) SAMPLE_RATES [ i ] ) ; <nl> - if ( result = = ASE_OK ) <nl> + if ( result = = ASE_OK ) { <nl> info . sampleRates . push_back ( SAMPLE_RATES [ i ] ) ; <nl> + <nl> + if ( ! info . preferredSampleRate | | ( SAMPLE_RATES [ i ] < = 48000 & & SAMPLE_RATES [ i ] > info . preferredSampleRate ) ) <nl> + info . preferredSampleRate = SAMPLE_RATES [ i ] ; <nl> + } <nl> } <nl> <nl> / / Determine supported data types . . . just check first channel and assume rest are the same . <nl> bool RtApiAsio : : probeDeviceOpen ( unsigned int device , StreamMode mode , unsigne <nl> unsigned int firstChannel , unsigned int sampleRate , <nl> RtAudioFormat format , unsigned int * bufferSize , <nl> RtAudio : : StreamOptions * options ) <nl> - { <nl> + { / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + <nl> + bool isDuplexInput = mode = = INPUT & & stream_ . mode = = OUTPUT ; <nl> + <nl> / / For ASIO , a duplex stream MUST use the same driver . <nl> - if ( mode = = INPUT & & stream_ . mode = = OUTPUT & & stream_ . device [ 0 ] ! = device ) { <nl> + if ( isDuplexInput & & stream_ . device [ 0 ] ! = device ) { <nl> errorText_ = " RtApiAsio : : probeDeviceOpen : an ASIO duplex stream must use the same device for input and output ! " ; <nl> return FAILURE ; <nl> } <nl> bool RtApiAsio : : probeDeviceOpen ( unsigned int device , StreamMode mode , unsigne <nl> } <nl> <nl> / / Only load the driver once for duplex stream . <nl> - if ( mode ! = INPUT | | stream_ . mode ! = OUTPUT ) { <nl> + if ( ! isDuplexInput ) { <nl> / / The getDeviceInfo ( ) function will not work when a stream is open <nl> / / because ASIO does not allow multiple devices to run at the same <nl> / / time . Thus , we ' ll probe the system before opening a stream and <nl> bool RtApiAsio : : probeDeviceOpen ( unsigned int device , StreamMode mode , unsigne <nl> } <nl> } <nl> <nl> + / / keep them before any " goto error " , they are used for error cleanup + goto device boundary checks <nl> + bool buffersAllocated = false ; <nl> + AsioHandle * handle = ( AsioHandle * ) stream_ . apiHandle ; <nl> + unsigned int nChannels ; <nl> + <nl> + <nl> / / Check the device channel count . <nl> long inputChannels , outputChannels ; <nl> result = ASIOGetChannels ( & inputChannels , & outputChannels ) ; <nl> if ( result ! = ASE_OK ) { <nl> - drivers . removeCurrentDriver ( ) ; <nl> errorStream_ < < " RtApiAsio : : probeDeviceOpen : error ( " < < getAsioErrorString ( result ) < < " ) getting channel count ( " < < driverName < < " ) . " ; <nl> errorText_ = errorStream_ . str ( ) ; <nl> - return FAILURE ; <nl> + goto error ; <nl> } <nl> <nl> if ( ( mode = = OUTPUT & & ( channels + firstChannel ) > ( unsigned int ) outputChannels ) | | <nl> ( mode = = INPUT & & ( channels + firstChannel ) > ( unsigned int ) inputChannels ) ) { <nl> - drivers . removeCurrentDriver ( ) ; <nl> errorStream_ < < " RtApiAsio : : probeDeviceOpen : driver ( " < < driverName < < " ) does not support requested channel count ( " < < channels < < " ) + offset ( " < < firstChannel < < " ) . " ; <nl> errorText_ = errorStream_ . str ( ) ; <nl> - return FAILURE ; <nl> + goto error ; <nl> } <nl> stream_ . nDeviceChannels [ mode ] = channels ; <nl> stream_ . nUserChannels [ mode ] = channels ; <nl> bool RtApiAsio : : probeDeviceOpen ( unsigned int device , StreamMode mode , unsigne <nl> / / Verify the sample rate is supported . <nl> result = ASIOCanSampleRate ( ( ASIOSampleRate ) sampleRate ) ; <nl> if ( result ! = ASE_OK ) { <nl> - drivers . removeCurrentDriver ( ) ; <nl> errorStream_ < < " RtApiAsio : : probeDeviceOpen : driver ( " < < driverName < < " ) does not support requested sample rate ( " < < sampleRate < < " ) . " ; <nl> errorText_ = errorStream_ . str ( ) ; <nl> - return FAILURE ; <nl> + goto error ; <nl> } <nl> <nl> / / Get the current sample rate <nl> ASIOSampleRate currentRate ; <nl> result = ASIOGetSampleRate ( & currentRate ) ; <nl> if ( result ! = ASE_OK ) { <nl> - drivers . removeCurrentDriver ( ) ; <nl> errorStream_ < < " RtApiAsio : : probeDeviceOpen : driver ( " < < driverName < < " ) error getting sample rate . " ; <nl> errorText_ = errorStream_ . str ( ) ; <nl> - return FAILURE ; <nl> + goto error ; <nl> } <nl> <nl> / / Set the sample rate only if necessary <nl> if ( currentRate ! = sampleRate ) { <nl> result = ASIOSetSampleRate ( ( ASIOSampleRate ) sampleRate ) ; <nl> if ( result ! = ASE_OK ) { <nl> - drivers . removeCurrentDriver ( ) ; <nl> errorStream_ < < " RtApiAsio : : probeDeviceOpen : driver ( " < < driverName < < " ) error setting sample rate ( " < < sampleRate < < " ) . " ; <nl> errorText_ = errorStream_ . str ( ) ; <nl> - return FAILURE ; <nl> + goto error ; <nl> } <nl> } <nl> <nl> bool RtApiAsio : : probeDeviceOpen ( unsigned int device , StreamMode mode , unsigne <nl> else channelInfo . isInput = true ; <nl> result = ASIOGetChannelInfo ( & channelInfo ) ; <nl> if ( result ! = ASE_OK ) { <nl> - drivers . removeCurrentDriver ( ) ; <nl> errorStream_ < < " RtApiAsio : : probeDeviceOpen : driver ( " < < driverName < < " ) error ( " < < getAsioErrorString ( result ) < < " ) getting data format . " ; <nl> errorText_ = errorStream_ . str ( ) ; <nl> - return FAILURE ; <nl> + goto error ; <nl> } <nl> <nl> / / Assuming WINDOWS host is always little - endian . <nl> bool RtApiAsio : : probeDeviceOpen ( unsigned int device , StreamMode mode , unsigne <nl> } <nl> <nl> if ( stream_ . deviceFormat [ mode ] = = 0 ) { <nl> - drivers . removeCurrentDriver ( ) ; <nl> errorStream_ < < " RtApiAsio : : probeDeviceOpen : driver ( " < < driverName < < " ) data format not supported by RtAudio . " ; <nl> errorText_ = errorStream_ . str ( ) ; <nl> - return FAILURE ; <nl> + goto error ; <nl> } <nl> <nl> / / Set the buffer size . For a duplex stream , this will end up <nl> bool RtApiAsio : : probeDeviceOpen ( unsigned int device , StreamMode mode , unsigne <nl> long minSize , maxSize , preferSize , granularity ; <nl> result = ASIOGetBufferSize ( & minSize , & maxSize , & preferSize , & granularity ) ; <nl> if ( result ! = ASE_OK ) { <nl> - drivers . removeCurrentDriver ( ) ; <nl> errorStream_ < < " RtApiAsio : : probeDeviceOpen : driver ( " < < driverName < < " ) error ( " < < getAsioErrorString ( result ) < < " ) getting buffer size . " ; <nl> errorText_ = errorStream_ . str ( ) ; <nl> - return FAILURE ; <nl> + goto error ; <nl> } <nl> <nl> - if ( * bufferSize < ( unsigned int ) minSize ) * bufferSize = ( unsigned int ) minSize ; <nl> - else if ( * bufferSize > ( unsigned int ) maxSize ) * bufferSize = ( unsigned int ) maxSize ; <nl> - else if ( granularity = = - 1 ) { <nl> - / / Make sure bufferSize is a power of two . <nl> - int log2_of_min_size = 0 ; <nl> - int log2_of_max_size = 0 ; <nl> + if ( isDuplexInput ) { <nl> + / / When this is the duplex input ( output was opened before ) , then we have to use the same <nl> + / / buffersize as the output , because it might use the preferred buffer size , which most <nl> + / / likely wasn ' t passed as input to this . The buffer sizes have to be identically anyway , <nl> + / / So instead of throwing an error , make them equal . The caller uses the reference <nl> + / / to the " bufferSize " param as usual to set up processing buffers . <nl> <nl> - for ( unsigned int i = 0 ; i < sizeof ( long ) * 8 ; i + + ) { <nl> - if ( minSize & ( ( long ) 1 < < i ) ) log2_of_min_size = i ; <nl> - if ( maxSize & ( ( long ) 1 < < i ) ) log2_of_max_size = i ; <nl> - } <nl> + * bufferSize = stream_ . bufferSize ; <nl> <nl> - long min_delta = std : : abs ( ( long ) * bufferSize - ( ( long ) 1 < < log2_of_min_size ) ) ; <nl> - int min_delta_num = log2_of_min_size ; <nl> + } else { <nl> + if ( * bufferSize = = 0 ) * bufferSize = preferSize ; <nl> + else if ( * bufferSize < ( unsigned int ) minSize ) * bufferSize = ( unsigned int ) minSize ; <nl> + else if ( * bufferSize > ( unsigned int ) maxSize ) * bufferSize = ( unsigned int ) maxSize ; <nl> + else if ( granularity = = - 1 ) { <nl> + / / Make sure bufferSize is a power of two . <nl> + int log2_of_min_size = 0 ; <nl> + int log2_of_max_size = 0 ; <nl> <nl> - for ( int i = log2_of_min_size + 1 ; i < = log2_of_max_size ; i + + ) { <nl> - long current_delta = std : : abs ( ( long ) * bufferSize - ( ( long ) 1 < < i ) ) ; <nl> - if ( current_delta < min_delta ) { <nl> - min_delta = current_delta ; <nl> - min_delta_num = i ; <nl> + for ( unsigned int i = 0 ; i < sizeof ( long ) * 8 ; i + + ) { <nl> + if ( minSize & ( ( long ) 1 < < i ) ) log2_of_min_size = i ; <nl> + if ( maxSize & ( ( long ) 1 < < i ) ) log2_of_max_size = i ; <nl> } <nl> - } <nl> <nl> - * bufferSize = ( ( unsigned int ) 1 < < min_delta_num ) ; <nl> - if ( * bufferSize < ( unsigned int ) minSize ) * bufferSize = ( unsigned int ) minSize ; <nl> - else if ( * bufferSize > ( unsigned int ) maxSize ) * bufferSize = ( unsigned int ) maxSize ; <nl> - } <nl> - else if ( granularity ! = 0 ) { <nl> - / / Set to an even multiple of granularity , rounding up . <nl> - * bufferSize = ( * bufferSize + granularity - 1 ) / granularity * granularity ; <nl> + long min_delta = std : : abs ( ( long ) * bufferSize - ( ( long ) 1 < < log2_of_min_size ) ) ; <nl> + int min_delta_num = log2_of_min_size ; <nl> + <nl> + for ( int i = log2_of_min_size + 1 ; i < = log2_of_max_size ; i + + ) { <nl> + long current_delta = std : : abs ( ( long ) * bufferSize - ( ( long ) 1 < < i ) ) ; <nl> + if ( current_delta < min_delta ) { <nl> + min_delta = current_delta ; <nl> + min_delta_num = i ; <nl> + } <nl> + } <nl> + <nl> + * bufferSize = ( ( unsigned int ) 1 < < min_delta_num ) ; <nl> + if ( * bufferSize < ( unsigned int ) minSize ) * bufferSize = ( unsigned int ) minSize ; <nl> + else if ( * bufferSize > ( unsigned int ) maxSize ) * bufferSize = ( unsigned int ) maxSize ; <nl> + } <nl> + else if ( granularity ! = 0 ) { <nl> + / / Set to an even multiple of granularity , rounding up . <nl> + * bufferSize = ( * bufferSize + granularity - 1 ) / granularity * granularity ; <nl> + } <nl> } <nl> <nl> - if ( mode = = INPUT & & stream_ . mode = = OUTPUT & & stream_ . bufferSize ! = * bufferSize ) { <nl> - drivers . removeCurrentDriver ( ) ; <nl> + / * <nl> + / / we don ' t use it anymore , see above ! <nl> + / / Just left it here for the case . . . <nl> + if ( isDuplexInput & & stream_ . bufferSize ! = * bufferSize ) { <nl> errorText_ = " RtApiAsio : : probeDeviceOpen : input / output buffersize discrepancy ! " ; <nl> - return FAILURE ; <nl> + goto error ; <nl> } <nl> + * / <nl> <nl> stream_ . bufferSize = * bufferSize ; <nl> stream_ . nBuffers = 2 ; <nl> bool RtApiAsio : : probeDeviceOpen ( unsigned int device , StreamMode mode , unsigne <nl> stream_ . deviceInterleaved [ mode ] = false ; <nl> <nl> / / Allocate , if necessary , our AsioHandle structure for the stream . <nl> - AsioHandle * handle = ( AsioHandle * ) stream_ . apiHandle ; <nl> if ( handle = = 0 ) { <nl> try { <nl> handle = new AsioHandle ; <nl> } <nl> catch ( std : : bad_alloc & ) { <nl> - / / if ( handle = = NULL ) { <nl> - drivers . removeCurrentDriver ( ) ; <nl> errorText_ = " RtApiAsio : : probeDeviceOpen : error allocating AsioHandle memory . " ; <nl> - return FAILURE ; <nl> + goto error ; <nl> } <nl> handle - > bufferInfos = 0 ; <nl> <nl> bool RtApiAsio : : probeDeviceOpen ( unsigned int device , StreamMode mode , unsigne <nl> / / Create the ASIO internal buffers . Since RtAudio sets up input <nl> / / and output separately , we ' ll have to dispose of previously <nl> / / created output buffers for a duplex stream . <nl> - long inputLatency , outputLatency ; <nl> if ( mode = = INPUT & & stream_ . mode = = OUTPUT ) { <nl> ASIODisposeBuffers ( ) ; <nl> if ( handle - > bufferInfos ) free ( handle - > bufferInfos ) ; <nl> } <nl> <nl> / / Allocate , initialize , and save the bufferInfos in our stream callbackInfo structure . <nl> - bool buffersAllocated = false ; <nl> - unsigned int i , nChannels = stream_ . nDeviceChannels [ 0 ] + stream_ . nDeviceChannels [ 1 ] ; <nl> + unsigned int i ; <nl> + nChannels = stream_ . nDeviceChannels [ 0 ] + stream_ . nDeviceChannels [ 1 ] ; <nl> handle - > bufferInfos = ( ASIOBufferInfo * ) malloc ( nChannels * sizeof ( ASIOBufferInfo ) ) ; <nl> if ( handle - > bufferInfos = = NULL ) { <nl> errorStream_ < < " RtApiAsio : : probeDeviceOpen : error allocating bufferInfo memory for driver ( " < < driverName < < " ) . " ; <nl> bool RtApiAsio : : probeDeviceOpen ( unsigned int device , StreamMode mode , unsigne <nl> infos - > buffers [ 0 ] = infos - > buffers [ 1 ] = 0 ; <nl> } <nl> <nl> + / / prepare for callbacks <nl> + stream_ . sampleRate = sampleRate ; <nl> + stream_ . device [ mode ] = device ; <nl> + stream_ . mode = isDuplexInput ? DUPLEX : mode ; <nl> + <nl> + / / store this class instance before registering callbacks , that are going to use it <nl> + asioCallbackInfo = & stream_ . callbackInfo ; <nl> + stream_ . callbackInfo . object = ( void * ) this ; <nl> + <nl> / / Set up the ASIO callback structure and create the ASIO data buffers . <nl> asioCallbacks . bufferSwitch = & bufferSwitch ; <nl> asioCallbacks . sampleRateDidChange = & sampleRateChanged ; <nl> asioCallbacks . asioMessage = & asioMessages ; <nl> asioCallbacks . bufferSwitchTimeInfo = NULL ; <nl> result = ASIOCreateBuffers ( handle - > bufferInfos , nChannels , stream_ . bufferSize , & asioCallbacks ) ; <nl> + if ( result ! = ASE_OK ) { <nl> + / / Standard method failed . This can happen with strict / misbehaving drivers that return valid buffer size ranges <nl> + / / but only accept the preferred buffer size as parameter for ASIOCreateBuffers . eg . Creatives ASIO driver <nl> + / / in that case , let ' s be naïve and try that instead <nl> + * bufferSize = preferSize ; <nl> + stream_ . bufferSize = * bufferSize ; <nl> + result = ASIOCreateBuffers ( handle - > bufferInfos , nChannels , stream_ . bufferSize , & asioCallbacks ) ; <nl> + } <nl> + <nl> if ( result ! = ASE_OK ) { <nl> errorStream_ < < " RtApiAsio : : probeDeviceOpen : driver ( " < < driverName < < " ) error ( " < < getAsioErrorString ( result ) < < " ) creating buffers . " ; <nl> errorText_ = errorStream_ . str ( ) ; <nl> goto error ; <nl> } <nl> - buffersAllocated = true ; <nl> + buffersAllocated = true ; <nl> + stream_ . state = STREAM_STOPPED ; <nl> <nl> / / Set flags for buffer conversion . <nl> stream_ . doConvertBuffer [ mode ] = false ; <nl> bool RtApiAsio : : probeDeviceOpen ( unsigned int device , StreamMode mode , unsigne <nl> <nl> bool makeBuffer = true ; <nl> bufferBytes = stream_ . nDeviceChannels [ mode ] * formatBytes ( stream_ . deviceFormat [ mode ] ) ; <nl> - if ( mode = = INPUT ) { <nl> - if ( stream_ . mode = = OUTPUT & & stream_ . deviceBuffer ) { <nl> - unsigned long bytesOut = stream_ . nDeviceChannels [ 0 ] * formatBytes ( stream_ . deviceFormat [ 0 ] ) ; <nl> - if ( bufferBytes < = bytesOut ) makeBuffer = false ; <nl> - } <nl> + if ( isDuplexInput & & stream_ . deviceBuffer ) { <nl> + unsigned long bytesOut = stream_ . nDeviceChannels [ 0 ] * formatBytes ( stream_ . deviceFormat [ 0 ] ) ; <nl> + if ( bufferBytes < = bytesOut ) makeBuffer = false ; <nl> } <nl> <nl> if ( makeBuffer ) { <nl> bool RtApiAsio : : probeDeviceOpen ( unsigned int device , StreamMode mode , unsigne <nl> } <nl> } <nl> <nl> - stream_ . sampleRate = sampleRate ; <nl> - stream_ . device [ mode ] = device ; <nl> - stream_ . state = STREAM_STOPPED ; <nl> - asioCallbackInfo = & stream_ . callbackInfo ; <nl> - stream_ . callbackInfo . object = ( void * ) this ; <nl> - if ( stream_ . mode = = OUTPUT & & mode = = INPUT ) <nl> - / / We had already set up an output stream . <nl> - stream_ . mode = DUPLEX ; <nl> - else <nl> - stream_ . mode = mode ; <nl> - <nl> / / Determine device latencies <nl> + long inputLatency , outputLatency ; <nl> result = ASIOGetLatencies ( & inputLatency , & outputLatency ) ; <nl> if ( result ! = ASE_OK ) { <nl> errorStream_ < < " RtApiAsio : : probeDeviceOpen : driver ( " < < driverName < < " ) error ( " < < getAsioErrorString ( result ) < < " ) getting latency . " ; <nl> bool RtApiAsio : : probeDeviceOpen ( unsigned int device , StreamMode mode , unsigne <nl> return SUCCESS ; <nl> <nl> error : <nl> - if ( buffersAllocated ) <nl> - ASIODisposeBuffers ( ) ; <nl> - drivers . removeCurrentDriver ( ) ; <nl> + if ( ! isDuplexInput ) { <nl> + / / the cleanup for error in the duplex input , is done by RtApi : : openStream <nl> + / / So we clean up for single channel only <nl> <nl> - if ( handle ) { <nl> - CloseHandle ( handle - > condition ) ; <nl> - if ( handle - > bufferInfos ) <nl> - free ( handle - > bufferInfos ) ; <nl> - delete handle ; <nl> - stream_ . apiHandle = 0 ; <nl> - } <nl> + if ( buffersAllocated ) <nl> + ASIODisposeBuffers ( ) ; <nl> <nl> - for ( int i = 0 ; i < 2 ; i + + ) { <nl> - if ( stream_ . userBuffer [ i ] ) { <nl> - free ( stream_ . userBuffer [ i ] ) ; <nl> - stream_ . userBuffer [ i ] = 0 ; <nl> + drivers . removeCurrentDriver ( ) ; <nl> + <nl> + if ( handle ) { <nl> + CloseHandle ( handle - > condition ) ; <nl> + if ( handle - > bufferInfos ) <nl> + free ( handle - > bufferInfos ) ; <nl> + <nl> + delete handle ; <nl> + stream_ . apiHandle = 0 ; <nl> } <nl> - } <nl> <nl> - if ( stream_ . deviceBuffer ) { <nl> - free ( stream_ . deviceBuffer ) ; <nl> - stream_ . deviceBuffer = 0 ; <nl> + <nl> + if ( stream_ . userBuffer [ mode ] ) { <nl> + free ( stream_ . userBuffer [ mode ] ) ; <nl> + stream_ . userBuffer [ mode ] = 0 ; <nl> + } <nl> + <nl> + if ( stream_ . deviceBuffer ) { <nl> + free ( stream_ . deviceBuffer ) ; <nl> + stream_ . deviceBuffer = 0 ; <nl> + } <nl> } <nl> <nl> return FAILURE ; <nl> - } <nl> + } / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> void RtApiAsio : : closeStream ( ) <nl> { <nl> class WasapiBuffer <nl> outIndex_ ( 0 ) { } <nl> <nl> ~ WasapiBuffer ( ) { <nl> - delete buffer_ ; <nl> + free ( buffer_ ) ; <nl> } <nl> <nl> / / sets the length of the internal ring buffer <nl> void setBufferSize ( unsigned int bufferSize , unsigned int formatBytes ) { <nl> - delete buffer_ ; <nl> + free ( buffer_ ) ; <nl> <nl> buffer_ = ( char * ) calloc ( bufferSize , formatBytes ) ; <nl> <nl> void convertBufferWasapi ( char * outBuffer , <nl> float sampleStep = 1 . 0f / sampleRatio ; <nl> float inSampleFraction = 0 . 0f ; <nl> <nl> - outSampleCount = ( unsigned int ) ( inSampleCount * sampleRatio ) ; <nl> + outSampleCount = ( unsigned int ) roundf ( inSampleCount * sampleRatio ) ; <nl> <nl> / / frame - by - frame , copy each relative input sample into it ' s corresponding output sample <nl> for ( unsigned int outSample = 0 ; outSample < outSampleCount ; outSample + + ) <nl> RtAudio : : DeviceInfo RtApiWasapi : : getDeviceInfo ( unsigned int device ) <nl> RtAudio : : DeviceInfo info ; <nl> unsigned int captureDeviceCount = 0 ; <nl> unsigned int renderDeviceCount = 0 ; <nl> - std : : wstring deviceName ; <nl> std : : string defaultDeviceName ; <nl> bool isCaptureDevice = false ; <nl> <nl> RtAudio : : DeviceInfo RtApiWasapi : : getDeviceInfo ( unsigned int device ) <nl> goto Exit ; <nl> } <nl> <nl> - deviceName = defaultDeviceNameProp . pwszVal ; <nl> - defaultDeviceName = std : : string ( deviceName . begin ( ) , deviceName . end ( ) ) ; <nl> + defaultDeviceName = convertCharPointerToStdString ( defaultDeviceNameProp . pwszVal ) ; <nl> <nl> / / name <nl> hr = devicePtr - > OpenPropertyStore ( STGM_READ , & devicePropStore ) ; <nl> RtAudio : : DeviceInfo RtApiWasapi : : getDeviceInfo ( unsigned int device ) <nl> goto Exit ; <nl> } <nl> <nl> - deviceName = deviceNameProp . pwszVal ; <nl> - info . name = std : : string ( deviceName . begin ( ) , deviceName . end ( ) ) ; <nl> + info . name = convertCharPointerToStdString ( deviceNameProp . pwszVal ) ; <nl> <nl> / / is default <nl> if ( isCaptureDevice ) { <nl> RtAudio : : DeviceInfo RtApiWasapi : : getDeviceInfo ( unsigned int device ) <nl> for ( unsigned int i = 0 ; i < MAX_SAMPLE_RATES ; i + + ) { <nl> info . sampleRates . push_back ( SAMPLE_RATES [ i ] ) ; <nl> } <nl> + info . preferredSampleRate = deviceFormat - > nSamplesPerSec ; <nl> <nl> / / native format <nl> info . nativeFormats = 0 ; <nl> unsigned int RtApiDs : : getDeviceCount ( void ) <nl> error ( RtAudioError : : WARNING ) ; <nl> } <nl> <nl> - / / Clean out any devices that may have disappeared . <nl> - std : : vector < int > indices ; <nl> - for ( unsigned int i = 0 ; i < dsDevices . size ( ) ; i + + ) <nl> - if ( dsDevices [ i ] . found = = false ) indices . push_back ( i ) ; <nl> - / / unsigned int nErased = 0 ; <nl> - for ( unsigned int i = 0 ; i < indices . size ( ) ; i + + ) <nl> - dsDevices . erase ( dsDevices . begin ( ) + indices [ i ] ) ; <nl> - / / dsDevices . erase ( dsDevices . begin ( ) - nErased + + ) ; <nl> + / / Clean out any devices that may have disappeared ( code update submitted by Eli Zehngut ) . <nl> + for ( unsigned int i = 0 ; i < dsDevices . size ( ) ; ) { <nl> + if ( dsDevices [ i ] . found = = false ) dsDevices . erase ( dsDevices . begin ( ) + i ) ; <nl> + else i + + ; <nl> + } <nl> <nl> return static_cast < unsigned int > ( dsDevices . size ( ) ) ; <nl> } <nl> RtAudio : : DeviceInfo RtApiDs : : getDeviceInfo ( unsigned int device ) <nl> info . sampleRates . clear ( ) ; <nl> for ( unsigned int k = 0 ; k < MAX_SAMPLE_RATES ; k + + ) { <nl> if ( SAMPLE_RATES [ k ] > = ( unsigned int ) outCaps . dwMinSecondarySampleRate & & <nl> - SAMPLE_RATES [ k ] < = ( unsigned int ) outCaps . dwMaxSecondarySampleRate ) <nl> + SAMPLE_RATES [ k ] < = ( unsigned int ) outCaps . dwMaxSecondarySampleRate ) { <nl> info . sampleRates . push_back ( SAMPLE_RATES [ k ] ) ; <nl> + <nl> + if ( ! info . preferredSampleRate | | ( SAMPLE_RATES [ k ] < = 48000 & & SAMPLE_RATES [ k ] > info . preferredSampleRate ) ) <nl> + info . preferredSampleRate = SAMPLE_RATES [ k ] ; <nl> + } <nl> } <nl> <nl> / / Get format information . <nl> void RtApiDs : : callbackEvent ( ) <nl> if ( FAILED ( result ) ) { <nl> errorStream_ < < " RtApiDs : : callbackEvent : error ( " < < getErrorString ( result ) < < " ) getting current write position ! " ; <nl> errorText_ = errorStream_ . str ( ) ; <nl> + MUTEX_UNLOCK ( & stream_ . mutex ) ; <nl> error ( RtAudioError : : SYSTEM_ERROR ) ; <nl> return ; <nl> } <nl> void RtApiDs : : callbackEvent ( ) <nl> if ( FAILED ( result ) ) { <nl> errorStream_ < < " RtApiDs : : callbackEvent : error ( " < < getErrorString ( result ) < < " ) getting current read position ! " ; <nl> errorText_ = errorStream_ . str ( ) ; <nl> + MUTEX_UNLOCK ( & stream_ . mutex ) ; <nl> error ( RtAudioError : : SYSTEM_ERROR ) ; <nl> return ; <nl> } <nl> void RtApiDs : : callbackEvent ( ) <nl> if ( FAILED ( result ) ) { <nl> errorStream_ < < " RtApiDs : : callbackEvent : error ( " < < getErrorString ( result ) < < " ) getting current write position ! " ; <nl> errorText_ = errorStream_ . str ( ) ; <nl> + MUTEX_UNLOCK ( & stream_ . mutex ) ; <nl> error ( RtAudioError : : SYSTEM_ERROR ) ; <nl> return ; <nl> } <nl> void RtApiDs : : callbackEvent ( ) <nl> if ( FAILED ( result ) ) { <nl> errorStream_ < < " RtApiDs : : callbackEvent : error ( " < < getErrorString ( result ) < < " ) getting current read position ! " ; <nl> errorText_ = errorStream_ . str ( ) ; <nl> + MUTEX_UNLOCK ( & stream_ . mutex ) ; <nl> error ( RtAudioError : : SYSTEM_ERROR ) ; <nl> return ; <nl> } <nl> void RtApiDs : : callbackEvent ( ) <nl> if ( FAILED ( result ) ) { <nl> errorStream_ < < " RtApiDs : : callbackEvent : error ( " < < getErrorString ( result ) < < " ) getting current write position ! " ; <nl> errorText_ = errorStream_ . str ( ) ; <nl> + MUTEX_UNLOCK ( & stream_ . mutex ) ; <nl> error ( RtAudioError : : SYSTEM_ERROR ) ; <nl> return ; <nl> } <nl> void RtApiDs : : callbackEvent ( ) <nl> if ( FAILED ( result ) ) { <nl> errorStream_ < < " RtApiDs : : callbackEvent : error ( " < < getErrorString ( result ) < < " ) locking buffer during playback ! " ; <nl> errorText_ = errorStream_ . str ( ) ; <nl> + MUTEX_UNLOCK ( & stream_ . mutex ) ; <nl> error ( RtAudioError : : SYSTEM_ERROR ) ; <nl> return ; <nl> } <nl> void RtApiDs : : callbackEvent ( ) <nl> if ( FAILED ( result ) ) { <nl> errorStream_ < < " RtApiDs : : callbackEvent : error ( " < < getErrorString ( result ) < < " ) unlocking buffer during playback ! " ; <nl> errorText_ = errorStream_ . str ( ) ; <nl> + MUTEX_UNLOCK ( & stream_ . mutex ) ; <nl> error ( RtAudioError : : SYSTEM_ERROR ) ; <nl> return ; <nl> } <nl> void RtApiDs : : callbackEvent ( ) <nl> if ( FAILED ( result ) ) { <nl> errorStream_ < < " RtApiDs : : callbackEvent : error ( " < < getErrorString ( result ) < < " ) getting current read position ! " ; <nl> errorText_ = errorStream_ . str ( ) ; <nl> + MUTEX_UNLOCK ( & stream_ . mutex ) ; <nl> error ( RtAudioError : : SYSTEM_ERROR ) ; <nl> return ; <nl> } <nl> void RtApiDs : : callbackEvent ( ) <nl> if ( FAILED ( result ) ) { <nl> errorStream_ < < " RtApiDs : : callbackEvent : error ( " < < getErrorString ( result ) < < " ) getting current read position ! " ; <nl> errorText_ = errorStream_ . str ( ) ; <nl> + MUTEX_UNLOCK ( & stream_ . mutex ) ; <nl> error ( RtAudioError : : SYSTEM_ERROR ) ; <nl> return ; <nl> } <nl> void RtApiDs : : callbackEvent ( ) <nl> if ( FAILED ( result ) ) { <nl> errorStream_ < < " RtApiDs : : callbackEvent : error ( " < < getErrorString ( result ) < < " ) locking capture buffer ! " ; <nl> errorText_ = errorStream_ . str ( ) ; <nl> + MUTEX_UNLOCK ( & stream_ . mutex ) ; <nl> error ( RtAudioError : : SYSTEM_ERROR ) ; <nl> return ; <nl> } <nl> void RtApiDs : : callbackEvent ( ) <nl> if ( FAILED ( result ) ) { <nl> errorStream_ < < " RtApiDs : : callbackEvent : error ( " < < getErrorString ( result ) < < " ) unlocking capture buffer ! " ; <nl> errorText_ = errorStream_ . str ( ) ; <nl> + MUTEX_UNLOCK ( & stream_ . mutex ) ; <nl> error ( RtAudioError : : SYSTEM_ERROR ) ; <nl> return ; <nl> } <nl> static unsigned __stdcall callbackHandler ( void * ptr ) <nl> return 0 ; <nl> } <nl> <nl> - # include " tchar . h " <nl> - <nl> - static std : : string convertTChar ( LPCTSTR name ) <nl> - { <nl> - # if defined ( UNICODE ) | | defined ( _UNICODE ) <nl> - int length = WideCharToMultiByte ( CP_UTF8 , 0 , name , - 1 , NULL , 0 , NULL , NULL ) ; <nl> - std : : string s ( length - 1 , ' \ 0 ' ) ; <nl> - WideCharToMultiByte ( CP_UTF8 , 0 , name , - 1 , & s [ 0 ] , length , NULL , NULL ) ; <nl> - # else <nl> - std : : string s ( name ) ; <nl> - # endif <nl> - <nl> - return s ; <nl> - } <nl> - <nl> static BOOL CALLBACK deviceQueryCallback ( LPGUID lpguid , <nl> LPCTSTR description , <nl> LPCTSTR / * module * / , <nl> static BOOL CALLBACK deviceQueryCallback ( LPGUID lpguid , <nl> } <nl> <nl> / / If good device , then save its name and guid . <nl> - std : : string name = convertTChar ( description ) ; <nl> + std : : string name = convertCharPointerToStdString ( description ) ; <nl> / / if ( name = = " Primary Sound Driver " | | name = = " Primary Sound Capture Driver " ) <nl> if ( lpguid = = NULL ) <nl> name = " Default Device " ; <nl> RtAudio : : DeviceInfo RtApiAlsa : : getDeviceInfo ( unsigned int device ) <nl> <nl> / / Count cards and devices <nl> card = - 1 ; <nl> + subdevice = - 1 ; <nl> snd_card_next ( & card ) ; <nl> while ( card > = 0 ) { <nl> sprintf ( name , " hw : % d " , card ) ; <nl> RtAudio : : DeviceInfo RtApiAlsa : : getDeviceInfo ( unsigned int device ) <nl> / / Test our discrete set of sample rate values . <nl> info . sampleRates . clear ( ) ; <nl> for ( unsigned int i = 0 ; i < MAX_SAMPLE_RATES ; i + + ) { <nl> - if ( snd_pcm_hw_params_test_rate ( phandle , params , SAMPLE_RATES [ i ] , 0 ) = = 0 ) <nl> + if ( snd_pcm_hw_params_test_rate ( phandle , params , SAMPLE_RATES [ i ] , 0 ) = = 0 ) { <nl> info . sampleRates . push_back ( SAMPLE_RATES [ i ] ) ; <nl> + <nl> + if ( ! info . preferredSampleRate | | ( SAMPLE_RATES [ i ] < = 48000 & & SAMPLE_RATES [ i ] > info . preferredSampleRate ) ) <nl> + info . preferredSampleRate = SAMPLE_RATES [ i ] ; <nl> + } <nl> } <nl> if ( info . sampleRates . size ( ) = = 0 ) { <nl> snd_pcm_close ( phandle ) ; <nl> void RtApiAlsa : : callbackEvent ( ) <nl> errorStream_ < < " RtApiAlsa : : callbackEvent : error preparing device after underrun , " < < snd_strerror ( result ) < < " . " ; <nl> errorText_ = errorStream_ . str ( ) ; <nl> } <nl> + else <nl> + errorText_ = " RtApiAlsa : : callbackEvent : audio write error , underrun . " ; <nl> } <nl> else { <nl> errorStream_ < < " RtApiAlsa : : callbackEvent : error , current state is " < < snd_pcm_state_name ( state ) < < " , " < < snd_strerror ( result ) < < " . " ; <nl> RtAudio : : DeviceInfo RtApiPulse : : getDeviceInfo ( unsigned int / * device * / ) <nl> for ( const unsigned int * sr = SUPPORTED_SAMPLERATES ; * sr ; + + sr ) <nl> info . sampleRates . push_back ( * sr ) ; <nl> <nl> + info . preferredSampleRate = 48000 ; <nl> info . nativeFormats = RTAUDIO_SINT16 | RTAUDIO_SINT32 | RTAUDIO_FLOAT32 ; <nl> <nl> return info ; <nl> bool RtApiPulse : : probeDeviceOpen ( unsigned int device , StreamMode mode , <nl> pah = static_cast < PulseAudioHandle * > ( stream_ . apiHandle ) ; <nl> <nl> int error ; <nl> - if ( ! options - > streamName . empty ( ) ) streamName = options - > streamName ; <nl> + if ( options & & ! options - > streamName . empty ( ) ) streamName = options - > streamName ; <nl> switch ( mode ) { <nl> case INPUT : <nl> pa_buffer_attr buffer_attr ; <nl> RtAudio : : DeviceInfo RtApiOss : : getDeviceInfo ( unsigned int device ) <nl> for ( unsigned int k = 0 ; k < MAX_SAMPLE_RATES ; k + + ) { <nl> if ( ainfo . rates [ i ] = = SAMPLE_RATES [ k ] ) { <nl> info . sampleRates . push_back ( SAMPLE_RATES [ k ] ) ; <nl> + <nl> + if ( ! info . preferredSampleRate | | ( SAMPLE_RATES [ k ] < = 48000 & & SAMPLE_RATES [ k ] > info . preferredSampleRate ) ) <nl> + info . preferredSampleRate = SAMPLE_RATES [ k ] ; <nl> + <nl> break ; <nl> } <nl> } <nl> RtAudio : : DeviceInfo RtApiOss : : getDeviceInfo ( unsigned int device ) <nl> else { <nl> / / Check min and max rate values ; <nl> for ( unsigned int k = 0 ; k < MAX_SAMPLE_RATES ; k + + ) { <nl> - if ( ainfo . min_rate < = ( int ) SAMPLE_RATES [ k ] & & ainfo . max_rate > = ( int ) SAMPLE_RATES [ k ] ) <nl> + if ( ainfo . min_rate < = ( int ) SAMPLE_RATES [ k ] & & ainfo . max_rate > = ( int ) SAMPLE_RATES [ k ] ) { <nl> info . sampleRates . push_back ( SAMPLE_RATES [ k ] ) ; <nl> + <nl> + if ( ! info . preferredSampleRate | | ( SAMPLE_RATES [ k ] < = 48000 & & SAMPLE_RATES [ k ] > info . preferredSampleRate ) ) <nl> + info . preferredSampleRate = SAMPLE_RATES [ k ] ; <nl> + } <nl> } <nl> } <nl> <nl> mmm a / drivers / rtaudio / RtAudio . h <nl> ppp b / drivers / rtaudio / RtAudio . h <nl> class RtAudio <nl> bool isDefaultOutput ; / * ! < true if this is the default output device . * / <nl> bool isDefaultInput ; / * ! < true if this is the default input device . * / <nl> std : : vector < unsigned int > sampleRates ; / * ! < Supported sample rates ( queried from list of standard rates ) . * / <nl> + unsigned int preferredSampleRate ; / * ! < Preferred sample rate , eg . for WASAPI the system sample rate . * / <nl> RtAudioFormat nativeFormats ; / * ! < Bit mask of supported data formats . * / <nl> <nl> / / Default constructor . <nl> DeviceInfo ( ) <nl> : probed ( false ) , outputChannels ( 0 ) , inputChannels ( 0 ) , duplexChannels ( 0 ) , <nl> - isDefaultOutput ( false ) , isDefaultInput ( false ) , nativeFormats ( 0 ) { } <nl> + isDefaultOutput ( false ) , isDefaultInput ( false ) , preferredSampleRate ( 0 ) , nativeFormats ( 0 ) { } <nl> } ; <nl> <nl> / / ! The structure for specifying input or ouput stream parameters . <nl>
Merge pull request from SuperUserNameMan / updated_rtaudio
godotengine/godot
deba45ebf781eaf12964d530336b72b2fd78f2a5
2015-05-07T23:03:00Z
mmm a / tensorflow / contrib / tensorrt / convert / convert_nodes . cc <nl> ppp b / tensorflow / contrib / tensorrt / convert / convert_nodes . cc <nl> string DebugString ( const nvinfer1 : : DimensionType type ) { <nl> } <nl> } <nl> <nl> + string DebugString ( const nvinfer1 : : DataType trt_dtype ) { <nl> + switch ( trt_dtype ) { <nl> + case nvinfer1 : : DataType : : kFLOAT : <nl> + return " kFLOAT " ; <nl> + case nvinfer1 : : DataType : : kHALF : <nl> + return " kHALF " ; <nl> + case nvinfer1 : : DataType : : kINT8 : <nl> + return " kINT8 " ; <nl> + case nvinfer1 : : DataType : : kINT32 : <nl> + return " kINT32 " ; <nl> + default : <nl> + return " Invalid TRT data type " ; <nl> + } <nl> + } <nl> + <nl> string DebugString ( const nvinfer1 : : Dims & dims ) { <nl> string out = StrCat ( " nvinfer1 : : Dims ( nbDims = " , dims . nbDims , " , d = " ) ; <nl> for ( int i = 0 ; i < dims . nbDims ; + + i ) { <nl> string DebugString ( const nvinfer1 : : Permutation & permutation , int len ) { <nl> <nl> string DebugString ( const nvinfer1 : : ITensor & tensor ) { <nl> return StrCat ( " nvinfer1 : : ITensor ( @ " , reinterpret_cast < uintptr_t > ( & tensor ) , <nl> - " , shape = " , DebugString ( tensor . getDimensions ( ) ) , " ) " ) ; <nl> + " , name = " , tensor . getName ( ) , <nl> + " , dtype = " , DebugString ( tensor . getType ( ) ) , <nl> + " , dims = " , DebugString ( tensor . getDimensions ( ) ) , " ) " ) ; <nl> } <nl> <nl> - / / Return whether or not the broadcast is feasible ; <nl> - bool TensorRTGetBroadcastShape ( const nvinfer1 : : Dims & operand_l , <nl> - const bool operand_l_is_tensor , <nl> - const nvinfer1 : : Dims & operand_r , <nl> - const bool operand_r_is_tensor , <nl> - nvinfer1 : : Dims * operand_l_new_shape , <nl> - nvinfer1 : : Dims * operand_r_new_shape ) { <nl> + Status Converter : : GetTrtBroadcastShape ( <nl> + const TRT_TensorOrWeights & operand_l , const TRT_TensorOrWeights & operand_r , <nl> + nvinfer1 : : Dims * operand_l_new_dims , <nl> + nvinfer1 : : Dims * operand_r_new_dims ) const { <nl> / / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> / / TensorRT Elementwise op supports broadcast but requires both tensor to be <nl> / / of Identical rank <nl> bool TensorRTGetBroadcastShape ( const nvinfer1 : : Dims & operand_l , <nl> / / - > T : 1 1 1 - 1 3 5 1 <nl> / / - > W : 1 1 1 1 3 5 1 <nl> / / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> - const int max_nb_dims = nvinfer1 : : Dims : : MAX_DIMS + 1 ; <nl> - const size_t element_size = sizeof ( operand_l . d [ 0 ] ) ; <nl> - <nl> - / / fill in dimensions <nl> - int l_s [ max_nb_dims ] ; <nl> - std : : fill ( l_s , l_s + max_nb_dims , 1 ) ; <nl> - int l_d = operand_l_is_tensor ? operand_l . nbDims + 1 : operand_l . nbDims ; <nl> - int r_s [ max_nb_dims ] ; <nl> - std : : fill ( r_s , r_s + max_nb_dims , 1 ) ; <nl> - int r_d = operand_r_is_tensor ? operand_r . nbDims + 1 : operand_r . nbDims ; <nl> - <nl> - int max_d = std : : max ( l_d , r_d ) ; <nl> - std : : memcpy ( l_s + max_d - operand_l . nbDims , operand_l . d , <nl> - operand_l . nbDims * element_size ) ; <nl> - std : : memcpy ( r_s + max_d - operand_r . nbDims , operand_r . d , <nl> - operand_r . nbDims * element_size ) ; <nl> - <nl> - / / set - 1 for batch dimension , since batch size is not supposed to be <nl> - / / broadcasted <nl> - if ( operand_l_is_tensor ) { <nl> - if ( max_d ! = l_d ) { / / if broadcast beyond batch dimension , fail <nl> - return false ; <nl> - } <nl> - l_s [ 0 ] = - 1 ; <nl> - } <nl> - if ( operand_r_is_tensor ) { <nl> - if ( max_d ! = r_d ) { / / if broadcast beyond batch dimension , fail <nl> - return false ; <nl> - } <nl> - r_s [ 0 ] = - 1 ; <nl> + if ( ! operand_l . is_tensor ( ) & & ! operand_r . is_tensor ( ) ) { <nl> + return errors : : InvalidArgument ( <nl> + " Broadcasting requires at least one of the operands be tensors " ) ; <nl> } <nl> <nl> - / / compare broadcast feasibility <nl> - for ( int i = max_d - 1 ; i > = 0 ; i - - ) { <nl> - if ( ( l_s [ i ] ! = r_s [ i ] ) & & ( l_s [ i ] ! = 1 ) & & ( r_s [ i ] ! = 1 ) ) { <nl> - return false ; <nl> + const int max_nb_dims = nvinfer1 : : Dims : : MAX_DIMS + 1 ; <nl> + auto compute_output_dims = <nl> + [ max_nb_dims ] ( const TRT_TensorOrWeights & input , int broadcast_num_dims , <nl> + int * output_dims_array , nvinfer1 : : Dims * output_dims ) { <nl> + const nvinfer1 : : Dims input_dims = input . GetTrtDims ( ) ; <nl> + std : : fill ( output_dims_array , output_dims_array + max_nb_dims , 1 ) ; <nl> + std : : copy ( input_dims . d , input_dims . d + input_dims . nbDims , <nl> + output_dims_array + broadcast_num_dims - input_dims . nbDims ) ; <nl> + if ( input . is_tensor ( ) ) { <nl> + const int true_input_dims = input_dims . nbDims + 1 ; <nl> + if ( true_input_dims < broadcast_num_dims ) { <nl> + return errors : : InvalidArgument ( <nl> + " Broadcasting beyond batch dimension is not supported " , <nl> + " ( tensor # dims " , true_input_dims , " vs broadcast # dims " , <nl> + broadcast_num_dims , " ) " ) ; <nl> + } <nl> + / / Set the batch dimension to - 1 , since batch size is not supposed to <nl> + / / be broadcasted . <nl> + output_dims_array [ 0 ] = - 1 ; <nl> + } <nl> + / / Copy to output dimensions ( stripping the batch dimension ) . <nl> + output_dims - > nbDims = broadcast_num_dims - 1 ; <nl> + std : : copy ( output_dims_array + 1 , output_dims_array + broadcast_num_dims , <nl> + output_dims - > d ) ; <nl> + return Status : : OK ( ) ; <nl> + } ; <nl> + <nl> + / / Compute the output dimensions . <nl> + const int broadcast_num_dims = <nl> + std : : max ( operand_l . GetTrtDims ( ) . nbDims + ( operand_l . is_tensor ( ) ? 1 : 0 ) , <nl> + operand_r . GetTrtDims ( ) . nbDims + ( operand_r . is_tensor ( ) ? 1 : 0 ) ) ; <nl> + int output_l [ max_nb_dims ] , output_r [ max_nb_dims ] ; <nl> + TF_RETURN_IF_ERROR ( compute_output_dims ( operand_l , broadcast_num_dims , <nl> + output_l , operand_l_new_dims ) ) ; <nl> + TF_RETURN_IF_ERROR ( compute_output_dims ( operand_r , broadcast_num_dims , <nl> + output_r , operand_r_new_dims ) ) ; <nl> + <nl> + / / Compare broadcast feasibility <nl> + for ( int i = 0 ; i < broadcast_num_dims ; + + i ) { <nl> + if ( ( output_l [ i ] ! = output_r [ i ] ) & & ( output_l [ i ] ! = 1 ) & & <nl> + ( output_r [ i ] ! = 1 ) ) { <nl> + return errors : : InvalidArgument ( <nl> + " Infeasible broadcast scheme ( " , " batch_dim : " , output_l [ 0 ] , " , " , <nl> + DebugString ( * operand_l_new_dims ) , " vs " , " batch_dim : " , output_r [ 0 ] , <nl> + " , " , DebugString ( * operand_r_new_dims ) , " ) " ) ; <nl> } <nl> } <nl> - <nl> - / / output new TensorRT Dimension ( stripping the batch dimension ) <nl> - operand_l_new_shape - > nbDims = max_d - 1 ; <nl> - std : : memcpy ( operand_l_new_shape - > d , l_s + 1 , ( max_d - 1 ) * element_size ) ; <nl> - operand_r_new_shape - > nbDims = max_d - 1 ; <nl> - std : : memcpy ( operand_r_new_shape - > d , r_s + 1 , ( max_d - 1 ) * element_size ) ; <nl> - <nl> - return true ; <nl> + return Status : : OK ( ) ; <nl> } <nl> <nl> inline bool DimsEqual ( const nvinfer1 : : Dims & dim_l , <nl> nvinfer1 : : Dims TRT_TensorOrWeights : : GetTrtDims ( ) const { <nl> string TRT_TensorOrWeights : : DebugString ( ) const { <nl> string output = " TRT_TensorOrWeights ( type = " ; <nl> if ( is_tensor ( ) ) { <nl> - StrAppend ( & output , " tensor @ " , reinterpret_cast < uintptr_t > ( tensor ( ) ) , <nl> - " , shape = " , convert : : DebugString ( tensor ( ) - > getDimensions ( ) ) , <nl> + StrAppend ( & output , " tensor = " , convert : : DebugString ( * tensor ( ) ) , <nl> " , batch_size = " , batch_size_ ) ; <nl> } else { <nl> StrAppend ( & output , " weights = " , weights_ . DebugString ( ) ) ; <nl> Status TrtNodeValidator : : ValidateNode ( <nl> Status status = ConvertToTensorOrWeights ( <nl> * pair . first , pair . second , graph_properties , & tensor_or_weights ) ; <nl> if ( ! status . ok ( ) ) { <nl> - return errors : : Internal ( " Failed to convert input with index " , i , <nl> - " to a TRT_TensorOrWeights " ) ; <nl> + return errors : : Internal ( <nl> + " Failed to convert input with index " , i , <nl> + " to a TRT_TensorOrWeights : " , status . error_message ( ) ) ; <nl> } <nl> inputs . push_back ( tensor_or_weights ) ; <nl> } <nl> Status Converter : : PrepareTensorForShape ( const TRT_TensorOrWeights & input , <nl> } <nl> if ( can_check_shapes & & <nl> TrtDimsNumElements ( input . GetTrtDims ( ) ) ! = TrtDimsNumElements ( dims ) ) { <nl> - return tensorflow : : errors : : InvalidArgument ( <nl> - " Reshape shapes are not compatible . " ) ; <nl> + return errors : : InvalidArgument ( " Reshape shapes are not compatible ( " , <nl> + DebugString ( input . GetTrtDims ( ) ) , " vs " , <nl> + DebugString ( dims ) , " ) " ) ; <nl> } <nl> <nl> if ( input . is_tensor ( ) ) { <nl> TRT_ShapedWeights ConvertFP32ToFP16 ( TrtWeightStore * store , <nl> } <nl> <nl> / / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> - / / Constant folding functions <nl> - / / TODO ( jie ) : once optimizer kicks in , we should have done constant folding <nl> - / / there . <nl> + / / Constant folding functions for weights . <nl> + / / TODO ( laigd ) : we should probably use eigen directly . <nl> / / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> struct LambdaFactory { <nl> - enum class OP_CATEGORY : int { RSQRT = 0 , NEG , ADD , MUL , SUB , RECIP } ; <nl> + enum class OP_CATEGORY : int { RSQRT = 0 , NEG , RECIP } ; <nl> OP_CATEGORY op ; <nl> <nl> template < typename T > <nl> struct LambdaFactory { <nl> case OP_CATEGORY : : RECIP : <nl> return [ ] ( T t ) - > T { return 1 . 0 / t ; } ; <nl> default : <nl> - VLOG ( 2 ) < < " Not supported op for unary : " < < static_cast < int > ( op ) ; <nl> + LOG ( ERROR ) < < " Not supported op for unary : " < < static_cast < int > ( op ) ; <nl> return nullptr ; <nl> } <nl> } <nl> std : : function < Eigen : : half ( Eigen : : half ) > LambdaFactory : : unary < Eigen : : half > ( ) { <nl> switch ( op ) { <nl> case OP_CATEGORY : : RSQRT : { <nl> VLOG ( 2 ) < < " RSQRT GETS DONE " ; <nl> - return [ ] ( Eigen : : half t ) - > Eigen : : half { <nl> + return [ ] ( Eigen : : half t ) { <nl> return Eigen : : half ( 1 . 0 / sqrt ( static_cast < float > ( t ) ) ) ; <nl> } ; <nl> } <nl> case OP_CATEGORY : : NEG : <nl> - return [ ] ( Eigen : : half t ) - > Eigen : : half { return - t ; } ; <nl> - / / TODO ( aaroey ) : can we support RECIP ? <nl> + return [ ] ( Eigen : : half t ) { return - t ; } ; <nl> + case OP_CATEGORY : : RECIP : <nl> + return [ ] ( Eigen : : half t ) { <nl> + return Eigen : : half ( 1 . 0 / static_cast < float > ( t ) ) ; <nl> + } ; <nl> default : <nl> - VLOG ( 2 ) < < " Not supported op for unary : " < < static_cast < int > ( op ) ; <nl> + LOG ( ERROR ) < < " Not supported op for unary : " < < static_cast < int > ( op ) ; <nl> return nullptr ; <nl> } <nl> } <nl> tensorflow : : Status UnaryCompute ( const TRT_ShapedWeights & iweights , <nl> return tensorflow : : Status : : OK ( ) ; <nl> } <nl> <nl> + / / If swapped_inputs is false , ' tensor ' is the left operand and ' weights ' is the <nl> + / / right operand . If swapped_inputs is true , those two are swapped . <nl> + / / <nl> / / TODO ( jie ) : broadcast is needed yet not implemented . <nl> - / / Only implemented channel wise for the time being <nl> - tensorflow : : Status BinaryTensorOpWeight ( OpConverterParams * params , <nl> - const nvinfer1 : : ITensor * tensor , <nl> - TRT_ShapedWeights weights , <nl> - bool swapped_inputs ) { <nl> + / / Only implemented channel wise for the time being . <nl> + Status BinaryTensorOpWeight ( OpConverterParams * params , <nl> + const nvinfer1 : : ITensor * tensor , <nl> + TRT_ShapedWeights weights , bool swapped_inputs ) { <nl> + static const std : : unordered_set < string > supported_ops = { " Sub " , " Add " , " Mul " , <nl> + " Div " , " RealDiv " } ; <nl> const auto & node_def = params - > node_def ; <nl> - / / tensor is the left operand while weights is the right operand ; <nl> - / / when swapped_inputs set to true , those two are swapped . <nl> - / / TODO ( aaroey ) : use a set . <nl> - if ( node_def . op ( ) ! = " Sub " & & node_def . op ( ) ! = " Add " & & <nl> - node_def . op ( ) ! = " Mul " & & node_def . op ( ) ! = " Div " & & <nl> - node_def . op ( ) ! = " RealDiv " ) { <nl> - return tensorflow : : errors : : Unimplemented ( <nl> - " op not supported : " + node_def . op ( ) + " , at : " + node_def . name ( ) ) ; <nl> + if ( ! supported_ops . count ( node_def . op ( ) ) ) { <nl> + return errors : : Unimplemented ( node_def . op ( ) , " is not supported , at " , <nl> + node_def . name ( ) ) ; <nl> } <nl> <nl> - / / Check type consistency <nl> - nvinfer1 : : DataType ttype ; <nl> - TF_RETURN_IF_ERROR ( ConvertDType ( weights . type_ , & ttype ) ) ; <nl> + / / Check type consistency . <nl> + nvinfer1 : : DataType trt_dtype ; <nl> + TF_RETURN_IF_ERROR ( ConvertDType ( weights . type_ , & trt_dtype ) ) ; <nl> <nl> - / / Check scale mode <nl> + / / Check scale mode . <nl> auto dims_w = weights . shape_ ; <nl> - auto dims_t = tensor - > getDimensions ( ) ; <nl> + const auto dims_t = tensor - > getDimensions ( ) ; <nl> <nl> / / TODO ( jie ) : addScale checks for input tensor dimension <nl> if ( dims_t . nbDims ! = 3 ) { <nl> - return tensorflow : : errors : : InvalidArgument ( <nl> - " addScale requires tensor with rank 3 , " + node_def . name ( ) ) ; <nl> + return errors : : InvalidArgument ( " addScale requires tensor with rank 3 , at " , <nl> + node_def . name ( ) ) ; <nl> } <nl> <nl> - / / default to element - wise <nl> + / / Default to element - wise <nl> auto scale_mode = nvinfer1 : : ScaleMode : : kELEMENTWISE ; <nl> <nl> / / TODO ( jie ) : maybe use a permutation instead to support more cases ; <nl> - bool permutation_flag = false ; <nl> + bool need_to_permute = false ; <nl> <nl> if ( weights . count ( ) = = 1 ) { <nl> - VLOG ( 2 ) < < " UNIFORM " ; <nl> scale_mode = nvinfer1 : : ScaleMode : : kUNIFORM ; <nl> } else { <nl> - / / no broadcasting on Batch dimension ; <nl> - VLOG ( 2 ) < < " WEIGHTS DIM : " < < dims_w . nbDims <nl> - < < " tensor DIM : " < < dims_t . nbDims ; <nl> + VLOG ( 2 ) < < " weights dims : " < < DebugString ( dims_w ) <nl> + < < " ; tensor dims : " < < DebugString ( dims_t ) ; <nl> + / / Make sure no broadcasting on batch dimension . <nl> if ( dims_w . nbDims = = dims_t . nbDims + 1 ) { <nl> if ( dims_w . d [ 0 ] = = 1 ) { <nl> for ( int i = 1 ; i < dims_w . nbDims ; i + + ) { <nl> tensorflow : : Status BinaryTensorOpWeight ( OpConverterParams * params , <nl> } <nl> dims_w . nbDims - - ; <nl> } else { <nl> - return tensorflow : : errors : : InvalidArgument ( <nl> - " Binary op cannot operate on batch , " + node_def . name ( ) ) ; <nl> + return errors : : InvalidArgument ( " Binary op cannot operate on batch , at " , <nl> + node_def . name ( ) ) ; <nl> } <nl> } <nl> <nl> if ( dims_w . nbDims = = dims_t . nbDims & & dims_w . d [ 0 ] = = dims_t . d [ 0 ] ) { <nl> scale_mode = nvinfer1 : : ScaleMode : : kELEMENTWISE ; <nl> - / / default is element ; <nl> + / / Default is element - wise <nl> for ( int i = 1 ; i < dims_w . nbDims ; i + + ) { <nl> if ( dims_w . d [ i ] ! = dims_t . d [ i ] ) { <nl> - / / if dimension does not match , switch back to channel ; <nl> - VLOG ( 2 ) < < " channel " ; <nl> + / / If dimension does not match , switch back to per - channel <nl> scale_mode = nvinfer1 : : ScaleMode : : kCHANNEL ; <nl> break ; <nl> } <nl> } <nl> - / / if channel as candidate , validate it <nl> + / / If the mode is per - channel , since channel dimension is assumed to be <nl> + / / the third to last dimension , we need to make sure all other dimensions <nl> + / / have size 1 . <nl> if ( scale_mode = = nvinfer1 : : ScaleMode : : kCHANNEL ) { <nl> for ( int i = 1 ; i < dims_w . nbDims ; i + + ) { <nl> if ( dims_w . d [ i ] ! = 1 ) <nl> - return tensorflow : : errors : : InvalidArgument ( <nl> - " Weight shape not compatible at , " + node_def . name ( ) ) ; <nl> + return errors : : InvalidArgument ( <nl> + " Weight dims not compatible for channel - wise broadcast at " , <nl> + node_def . name ( ) ) ; <nl> } <nl> - } else { <nl> - VLOG ( 2 ) < < " elementwise " ; <nl> } <nl> } else if ( dims_w . nbDims = = 1 & & <nl> dims_w . d [ 0 ] = = dims_t . d [ dims_t . nbDims - 1 ] ) { <nl> - / / channel wise and broadcast required ; <nl> - permutation_flag = true ; <nl> + / / Channel wise and broadcast required . We compare the last dimension of <nl> + / / the tensor shape because of tensorflow default broadcasting rules . <nl> + need_to_permute = true ; <nl> scale_mode = nvinfer1 : : ScaleMode : : kCHANNEL ; <nl> } else { <nl> - return tensorflow : : errors : : InvalidArgument ( <nl> - " Weight shape not compatible at , " + node_def . name ( ) ) ; <nl> + return errors : : InvalidArgument ( " Weight dims not compatible at " , <nl> + node_def . name ( ) ) ; <nl> } <nl> } <nl> + / / TODO ( laigd ) : we should add validation_only support in TransposeTensor ( ) and <nl> + / / PrepareTensorForShape ( ) . <nl> + if ( params - > validation_only ) return Status : : OK ( ) ; <nl> <nl> - / / transpose last dimension <nl> + / / Transpose last dimension . <nl> std : : vector < int > permutation ( dims_t . nbDims + 1 ) ; <nl> - if ( permutation_flag ) { <nl> - if ( scale_mode = = nvinfer1 : : ScaleMode : : kCHANNEL & & dims_t . nbDims > 1 ) { <nl> - / / we swap the last dimension into channel for trt . <nl> - / / because of tensorflow default broadcasting rules . <nl> - for ( int i = 0 ; i < static_cast < int > ( permutation . size ( ) ) ; i + + ) { <nl> - permutation [ i ] = i ; <nl> - } <nl> - permutation [ 1 ] = dims_t . nbDims ; <nl> - permutation [ dims_t . nbDims ] = 1 ; <nl> - TF_RETURN_IF_ERROR ( params - > converter - > TransposeTensor ( <nl> - const_cast < nvinfer1 : : ITensor * > ( tensor ) , permutation , & tensor ) ) ; <nl> - } else { <nl> - return tensorflow : : errors : : InvalidArgument ( <nl> - " Transpose cannot be applied , " + node_def . name ( ) ) ; <nl> - } <nl> + if ( need_to_permute ) { <nl> + / / We swap the last dimension into channel for trt , because of tensorflow <nl> + / / default broadcasting rules . <nl> + for ( int i = 0 ; i < static_cast < int > ( permutation . size ( ) ) ; i + + ) { <nl> + permutation [ i ] = i ; <nl> + } <nl> + permutation [ 1 ] = dims_t . nbDims ; <nl> + permutation [ dims_t . nbDims ] = 1 ; <nl> + TF_RETURN_IF_ERROR ( params - > converter - > TransposeTensor ( <nl> + const_cast < nvinfer1 : : ITensor * > ( tensor ) , permutation , & tensor ) ) ; <nl> } <nl> <nl> if ( params - > converter - > precision_mode ( ) = = FP16MODE ) { <nl> weights = ConvertFP32ToFP16 ( params - > weight_store , weights ) ; <nl> } <nl> <nl> - / / prepare weights <nl> + / / Prepare weights <nl> TRT_ShapedWeights shift_weights ( weights . type_ ) ; <nl> TRT_ShapedWeights scale_weights ( weights . type_ ) ; <nl> TRT_ShapedWeights power_weights ( weights . type_ ) ; <nl> <nl> - / / Maybe I should do a switch <nl> if ( node_def . op ( ) = = " Sub " ) { <nl> if ( swapped_inputs ) { <nl> shift_weights = weights ; <nl> tensorflow : : Status BinaryTensorOpWeight ( OpConverterParams * params , <nl> } else if ( node_def . op ( ) = = " Add " ) { <nl> shift_weights = weights ; <nl> } else { <nl> - return tensorflow : : errors : : Unimplemented ( " Binary op not supported : " + <nl> - node_def . op ( ) ) ; <nl> + / / This should not happen . <nl> + return errors : : Unimplemented ( " Binary op not supported at " , node_def . op ( ) ) ; <nl> } <nl> <nl> nvinfer1 : : IScaleLayer * layer = params - > converter - > network ( ) - > addScale ( <nl> tensorflow : : Status BinaryTensorOpWeight ( OpConverterParams * params , <nl> TFTRT_RETURN_ERROR_IF_NULLPTR ( layer , node_def . name ( ) ) ; <nl> <nl> const nvinfer1 : : ITensor * output_tensor = layer - > getOutput ( 0 ) ; <nl> - / / transpose back dimension <nl> - if ( permutation_flag ) { <nl> + / / Transpose back dimension <nl> + if ( need_to_permute ) { <nl> TF_RETURN_IF_ERROR ( params - > converter - > TransposeTensor ( <nl> const_cast < nvinfer1 : : ITensor * > ( output_tensor ) , permutation , <nl> & output_tensor ) ) ; <nl> tensorflow : : Status ConvertConv2DHelper ( OpConverterParams * params , <nl> params - > node_def . name ( ) ) ; <nl> } <nl> <nl> - tensorflow : : Status BinaryTensorOpTensor ( OpConverterParams * params , <nl> - const TRT_TensorOrWeights & operand_l , <nl> - const TRT_TensorOrWeights & operand_r ) { <nl> + Status BinaryTensorOpTensor ( OpConverterParams * params , <nl> + const TRT_TensorOrWeights & operand_l , <nl> + const TRT_TensorOrWeights & operand_r ) { <nl> const auto & node_def = params - > node_def ; <nl> static const std : : unordered_map < string , nvinfer1 : : ElementWiseOperation > ops { <nl> { " Add " , nvinfer1 : : ElementWiseOperation : : kSUM } , <nl> tensorflow : : Status BinaryTensorOpTensor ( OpConverterParams * params , <nl> { " Minimum " , nvinfer1 : : ElementWiseOperation : : kMIN } , <nl> { " Maximum " , nvinfer1 : : ElementWiseOperation : : kMAX } , <nl> } ; <nl> + auto op_pair = ops . find ( node_def . op ( ) ) ; <nl> + if ( op_pair = = ops . end ( ) ) { <nl> + return errors : : Unimplemented ( " Binary op " , node_def . op ( ) , <nl> + " not supported at : " , node_def . name ( ) ) ; <nl> + } <nl> <nl> - const nvinfer1 : : ITensor * tensor_l ; <nl> - const nvinfer1 : : ITensor * tensor_r ; <nl> - <nl> - nvinfer1 : : Dims dim_l ; <nl> - nvinfer1 : : Dims dim_r ; <nl> - <nl> - if ( ! TensorRTGetBroadcastShape ( operand_l . GetTrtDims ( ) , operand_l . is_tensor ( ) , <nl> - operand_r . GetTrtDims ( ) , operand_r . is_tensor ( ) , <nl> - & dim_l , & dim_r ) ) { <nl> - return tensorflow : : errors : : InvalidArgument ( <nl> - " Binary op broadcast scheme not supported by TensorRT op : " + <nl> - node_def . op ( ) + " , at : " + node_def . name ( ) ) ; <nl> + nvinfer1 : : Dims broadcasted_dims_l , broadcasted_dims_r ; <nl> + Status status = params - > converter - > GetTrtBroadcastShape ( <nl> + operand_l , operand_r , & broadcasted_dims_l , & broadcasted_dims_r ) ; <nl> + if ( ! status . ok ( ) ) { <nl> + return errors : : InvalidArgument ( <nl> + " Unsupported binary op broadcast scheme for op " , node_def . name ( ) , " : " , <nl> + status . error_message ( ) ) ; <nl> } <nl> + if ( params - > validation_only ) return Status : : OK ( ) ; <nl> <nl> - TF_RETURN_IF_ERROR ( <nl> - params - > converter - > PrepareTensorForShape ( operand_l , dim_l , & tensor_l ) ) ; <nl> - TF_RETURN_IF_ERROR ( <nl> - params - > converter - > PrepareTensorForShape ( operand_r , dim_r , & tensor_r ) ) ; <nl> + const nvinfer1 : : ITensor * tensor_l = nullptr ; <nl> + const nvinfer1 : : ITensor * tensor_r = nullptr ; <nl> + status = params - > converter - > PrepareTensorForShape ( <nl> + operand_l , broadcasted_dims_l , & tensor_l ) ; <nl> + if ( status . ok ( ) ) { <nl> + status = params - > converter - > PrepareTensorForShape ( <nl> + operand_r , broadcasted_dims_r , & tensor_r ) ; <nl> + } <nl> + if ( ! status . ok ( ) ) { <nl> + return errors : : Internal ( " Failed to convert binary op " , node_def . name ( ) , <nl> + " : " , status . error_message ( ) ) ; <nl> + } <nl> <nl> - / / get trt type & shape <nl> + / / Check type consistency . <nl> TFAttrs attrs ( node_def ) ; <nl> - / / maybe this part has to be moved into the block of rsqrt later <nl> nvinfer1 : : DataType dtype = attrs . get < nvinfer1 : : DataType > ( " T " ) ; <nl> + TFTRT_CHECK_EQ_TYPE ( tensor_l - > getType ( ) , dtype ) <nl> + < < DebugString ( tensor_l - > getType ( ) ) < < " vs " < < DebugString ( dtype ) ; <nl> + TFTRT_CHECK_EQ_TYPE ( tensor_r - > getType ( ) , dtype ) <nl> + < < DebugString ( tensor_r - > getType ( ) ) < < " vs " < < DebugString ( dtype ) ; <nl> <nl> - / / check type consistency <nl> - TFTRT_CHECK_EQ_TYPE ( tensor_l - > getType ( ) , dtype ) ; <nl> - TFTRT_CHECK_EQ_TYPE ( tensor_r - > getType ( ) , dtype ) ; <nl> - auto op_pair = ops . find ( node_def . op ( ) ) ; <nl> - if ( op_pair = = ops . end ( ) ) { <nl> - return tensorflow : : errors : : Unimplemented ( <nl> - " binary op : " , node_def . op ( ) , " not supported at : " , node_def . name ( ) ) ; <nl> - } <nl> - <nl> + / / Add ElementWise layer . <nl> nvinfer1 : : IElementWiseLayer * layer = <nl> params - > converter - > network ( ) - > addElementWise ( <nl> - / / TODO ( aaroey ) : will tensor_l / tensor_r get modified ? <nl> * const_cast < nvinfer1 : : ITensor * > ( tensor_l ) , <nl> * const_cast < nvinfer1 : : ITensor * > ( tensor_r ) , op_pair - > second ) ; <nl> TFTRT_RETURN_ERROR_IF_NULLPTR ( layer , node_def . name ( ) ) ; <nl> - <nl> nvinfer1 : : ITensor * output_tensor = layer - > getOutput ( 0 ) ; <nl> <nl> - / / pass the output <nl> + / / Pass the output <nl> params - > outputs - > push_back ( TRT_TensorOrWeights ( output_tensor ) ) ; <nl> return tensorflow : : Status : : OK ( ) ; <nl> } <nl> tensorflow : : Status ConvertBiasAdd ( OpConverterParams * params ) { <nl> } <nl> permutation . order [ 0 ] = channel_index ; <nl> permutation . order [ channel_index ] = 0 ; <nl> + VLOG ( 1 ) < < " ConvertBiasAdd permutation : " <nl> + < < DebugString ( permutation , original_dims . nbDims ) ; <nl> } <nl> - VLOG ( 1 ) < < " ConvertBiasAdd permutation : " <nl> - < < DebugString ( permutation , original_dims . nbDims ) ; <nl> <nl> / / TensorRT addScale requires input to be of rank 3 , we need to apply <nl> / / transpose as well as reshape . <nl> tensorflow : : Status ConvertIdentity ( OpConverterParams * params ) { <nl> return tensorflow : : Status : : OK ( ) ; <nl> } <nl> <nl> - tensorflow : : Status ConvertBinary ( OpConverterParams * params ) { <nl> + Status ConvertBinary ( OpConverterParams * params ) { <nl> const auto & inputs = params - > inputs ; <nl> const auto & node_def = params - > node_def ; <nl> if ( inputs . size ( ) ! = 2 ) { <nl> - return tensorflow : : errors : : FailedPrecondition ( <nl> - " Binary ops require two tensor input , at " , node_def . name ( ) ) ; <nl> + return errors : : InvalidArgument ( " Binary ops require two inputs , at " , <nl> + node_def . name ( ) ) ; <nl> } <nl> <nl> / / Constant folding should have been done by TensorFlow <nl> - <nl> if ( inputs . at ( 0 ) . is_weights ( ) & & inputs . at ( 1 ) . is_weights ( ) ) { <nl> - return tensorflow : : errors : : Unimplemented ( <nl> + return errors : : Unimplemented ( <nl> " Constant folding is falled back to TensorFlow , binary op received " <nl> " both input as constant at : " , <nl> node_def . name ( ) ) ; <nl> tensorflow : : Status ConvertBinary ( OpConverterParams * params ) { <nl> / / IScaleLayer are when the layer performs both a shift and a scale , which we <nl> / / don ' t do except for convolutions . <nl> / / <nl> - / / Try to convert into Scale layer first ( for better performance ) <nl> + / / Try to convert into Scale layer first ( for better performance ) . <nl> / / Since scale layer supports restricted broadcast policy and op types , we <nl> / / allow failure and try to handle it through Elementwise op <nl> - / / ( BinaryTensorOpTensor ) <nl> - Status status = tensorflow : : Status : : OK ( ) ; <nl> + / / ( BinaryTensorOpTensor ) . <nl> + Status status = Status : : OK ( ) ; <nl> if ( inputs . at ( 0 ) . is_tensor ( ) & & inputs . at ( 1 ) . is_weights ( ) ) { <nl> status = BinaryTensorOpWeight ( params , inputs . at ( 0 ) . tensor ( ) , <nl> inputs . at ( 1 ) . weights ( ) , false ) ; <nl> tensorflow : : Status ConvertBinary ( OpConverterParams * params ) { <nl> status = BinaryTensorOpWeight ( params , inputs . at ( 1 ) . tensor ( ) , <nl> inputs . at ( 0 ) . weights ( ) , true ) ; <nl> } <nl> + / / If both input are tensors , or one of them is weights but the conversion <nl> + / / above failed , try the conversion using BinaryTensorOpTensor . <nl> if ( ( inputs . at ( 0 ) . is_tensor ( ) & & inputs . at ( 1 ) . is_tensor ( ) ) | | ! status . ok ( ) ) { <nl> + if ( ! status . ok ( ) ) VLOG ( 1 ) < < status ; <nl> status = BinaryTensorOpTensor ( params , inputs . at ( 0 ) , inputs . at ( 1 ) ) ; <nl> } <nl> return status ; <nl> tensorflow : : Status ConvertTopK ( OpConverterParams * params ) { <nl> return tensorflow : : Status : : OK ( ) ; <nl> } <nl> <nl> - void TrtNodeValidator : : RegisterOpValidators ( ) { <nl> + static void RegisterValidatableOpConverters ( <nl> + std : : unordered_map < string , OpConverter > * registration ) { <nl> / / TODO ( laigd ) : support all op types . <nl> - op_validators_ [ " BiasAdd " ] = ConvertBiasAdd ; <nl> - op_validators_ [ " Const " ] = ConvertConst ; <nl> - op_validators_ [ " Transpose " ] = ConvertTranspose ; <nl> - op_validators_ [ " Reshape " ] = ConvertReshape ; <nl> - op_validators_ [ " MatMul " ] = ConvertMatMul ; <nl> + ( * registration ) [ " BiasAdd " ] = ConvertBiasAdd ; <nl> + ( * registration ) [ " Const " ] = ConvertConst ; <nl> + ( * registration ) [ " Transpose " ] = ConvertTranspose ; <nl> + ( * registration ) [ " Reshape " ] = ConvertReshape ; <nl> + ( * registration ) [ " MatMul " ] = ConvertMatMul ; <nl> + ( * registration ) [ " Relu6 " ] = ConvertRelu6 ; <nl> <nl> - op_validators_ [ " Relu6 " ] = ConvertRelu6 ; <nl> + for ( auto quantization_op_type : <nl> + { " QuantizeAndDequantizeV2 " , " QuantizeAndDequantizeV3 " , <nl> + " FakeQuantWithMinMaxVars " , " FakeQuantWithMinMaxArgs " } ) { <nl> + ( * registration ) [ quantization_op_type ] = ConvertQuantize ; <nl> + } <nl> + for ( auto binary_op_type : <nl> + { " Add " , " Mul " , " Sub " , " Div " , " RealDiv " , " Maximum " , " Minimum " } ) { <nl> + ( * registration ) [ binary_op_type ] = ConvertBinary ; <nl> + } <nl> + } <nl> <nl> - op_validators_ [ " QuantizeAndDequantizeV2 " ] = ConvertQuantize ; <nl> - op_validators_ [ " QuantizeAndDequantizeV3 " ] = ConvertQuantize ; <nl> - op_validators_ [ " FakeQuantWithMinMaxVars " ] = ConvertQuantize ; <nl> - op_validators_ [ " FakeQuantWithMinMaxArgs " ] = ConvertQuantize ; <nl> + void TrtNodeValidator : : RegisterOpValidators ( ) { <nl> + RegisterValidatableOpConverters ( & op_validators_ ) ; <nl> } <nl> <nl> void Converter : : RegisterOpConverters ( ) { <nl> - / / vgg_16 slim implementation <nl> + RegisterValidatableOpConverters ( & op_registry_ ) ; <nl> + <nl> op_registry_ [ " Conv2D " ] = ConvertConv2D ; <nl> op_registry_ [ " DepthwiseConv2dNative " ] = ConvertConv2DDepthwise ; <nl> op_registry_ [ " Relu " ] = ConvertActivation ; <nl> op_registry_ [ " MaxPool " ] = ConvertPool ; <nl> op_registry_ [ " AvgPool " ] = ConvertPool ; <nl> - op_registry_ [ " BiasAdd " ] = ConvertBiasAdd ; <nl> - op_registry_ [ " Const " ] = ConvertConst ; <nl> / / TODO ( ben , jie ) : this is a temp hack . <nl> op_registry_ [ " Identity " ] = ConvertIdentity ; / / Identity should be removed <nl> op_registry_ [ " Snapshot " ] = ConvertIdentity ; / / Snapshot should be removed <nl> <nl> - / / resnet_50_v1 slim implementation <nl> - op_registry_ [ " Add " ] = ConvertBinary ; <nl> - op_registry_ [ " Mul " ] = ConvertBinary ; <nl> - op_registry_ [ " Sub " ] = ConvertBinary ; <nl> op_registry_ [ " Pad " ] = ConvertPad ; <nl> <nl> op_registry_ [ " ConcatV2 " ] = ConvertConcat ; <nl> op_registry_ [ " FusedBatchNorm " ] = ConvertFusedBatchNorm ; <nl> op_registry_ [ " FusedBatchNormV2 " ] = ConvertFusedBatchNorm ; <nl> <nl> - op_registry_ [ " Div " ] = ConvertBinary ; <nl> - op_registry_ [ " RealDiv " ] = ConvertBinary ; <nl> - <nl> op_registry_ [ " Rsqrt " ] = ConvertUnary ; <nl> op_registry_ [ " Reciprocal " ] = ConvertUnary ; <nl> op_registry_ [ " Exp " ] = ConvertUnary ; <nl> void Converter : : RegisterOpConverters ( ) { <nl> op_registry_ [ " Abs " ] = ConvertUnary ; <nl> op_registry_ [ " Neg " ] = ConvertUnary ; <nl> <nl> - op_registry_ [ " Transpose " ] = ConvertTranspose ; <nl> - op_registry_ [ " Reshape " ] = ConvertReshape ; <nl> - <nl> op_registry_ [ " Sum " ] = ConvertReduce ; <nl> op_registry_ [ " Prod " ] = ConvertReduce ; <nl> op_registry_ [ " Max " ] = ConvertReduce ; <nl> op_registry_ [ " Min " ] = ConvertReduce ; <nl> op_registry_ [ " Mean " ] = ConvertReduce ; <nl> - op_registry_ [ " Maximum " ] = ConvertBinary ; <nl> - op_registry_ [ " Minimum " ] = ConvertBinary ; <nl> op_registry_ [ " Softmax " ] = ConvertSoftmax ; <nl> - op_registry_ [ " MatMul " ] = ConvertMatMul ; <nl> op_registry_ [ " BatchMatMul " ] = ConvertBatchMatMul ; <nl> op_registry_ [ " TopKV2 " ] = ConvertTopK ; <nl> op_registry_ [ " Relu6 " ] = ConvertRelu6 ; <nl> mmm a / tensorflow / contrib / tensorrt / convert / convert_nodes . h <nl> ppp b / tensorflow / contrib / tensorrt / convert / convert_nodes . h <nl> class Converter { <nl> const nvinfer1 : : Dims & dims , <nl> const nvinfer1 : : ITensor * * tensor ) ; <nl> <nl> + / / Return OK if the broadcast scheme is supported and compute the shapes after <nl> + / / broadcasting . <nl> + Status GetTrtBroadcastShape ( const TRT_TensorOrWeights & operand_l , <nl> + const TRT_TensorOrWeights & operand_r , <nl> + nvinfer1 : : Dims * operand_l_new_dims , <nl> + nvinfer1 : : Dims * operand_r_new_dims ) const ; <nl> + <nl> private : <nl> / / Verify the provided batch_size is consistent with batch_size_ and update it <nl> / / if necessary . <nl> mmm a / tensorflow / contrib / tensorrt / convert / convert_nodes_test . cc <nl> ppp b / tensorflow / contrib / tensorrt / convert / convert_nodes_test . cc <nl> namespace convert { <nl> <nl> using : : tensorflow : : strings : : StrCat ; <nl> using : : testing : : ElementsAre ; <nl> + using : : testing : : ElementsAreArray ; <nl> <nl> / / TODO ( laigd ) : put this into some test utils file . <nl> void ExpectStatus ( Status status , error : : Code code = error : : OK , <nl> nvinfer1 : : Dims GetTestDims ( const std : : vector < int > & d ) { <nl> return dims ; <nl> } <nl> <nl> + nvinfer1 : : DataType TfDataTypeToTrt ( DataType tf_dtype ) { <nl> + switch ( tf_dtype ) { <nl> + case DT_FLOAT : <nl> + return nvinfer1 : : DataType : : kFLOAT ; <nl> + case DT_HALF : <nl> + return nvinfer1 : : DataType : : kHALF ; <nl> + case DT_INT32 : <nl> + return nvinfer1 : : DataType : : kINT32 ; <nl> + default : <nl> + QCHECK ( false ) < < " Unexpected data type " < < DataTypeString ( tf_dtype ) ; <nl> + } <nl> + } <nl> + <nl> + DataType TrtDataTypeToTf ( nvinfer1 : : DataType trt_dtype ) { <nl> + switch ( trt_dtype ) { <nl> + case nvinfer1 : : DataType : : kFLOAT : <nl> + return DT_FLOAT ; <nl> + case nvinfer1 : : DataType : : kHALF : <nl> + return DT_HALF ; <nl> + case nvinfer1 : : DataType : : kINT32 : <nl> + return DT_INT32 ; <nl> + default : <nl> + QCHECK ( false ) < < " Unexpected data type " < < static_cast < int > ( trt_dtype ) ; <nl> + } <nl> + } <nl> + <nl> NodeDef MakeNodeDef ( const string & name , const string & op , <nl> const std : : vector < string > & inputs ) { <nl> NodeDef node_def ; <nl> bool TrtDimsEqualsArray ( const std : : vector < int > & lhs , <nl> return TrtDimsEquals ( GetTestDims ( lhs ) , rhs ) ; <nl> } <nl> <nl> + / / TODO ( laigd ) : define a parameterized matcher that can compare against the <nl> + / / vector . <nl> + void ExpectTrtDimsEqualsArray ( const std : : vector < int > & lhs , <nl> + const nvinfer1 : : Dims & rhs ) { <nl> + EXPECT_TRUE ( TrtDimsEqualsArray ( lhs , rhs ) ) <nl> + < < " expected : " < < DebugString ( GetTestDims ( lhs ) ) < < " \ n " <nl> + < < " actual : " < < DebugString ( rhs ) ; <nl> + } <nl> + <nl> bool TrtShapedWeightsEquals ( const TRT_ShapedWeights & lhs , <nl> const TRT_ShapedWeights & rhs ) { <nl> return TrtDimsEquals ( lhs . shape_ , rhs . shape_ ) & & lhs . type_ = = rhs . type_ & & <nl> template < typename T > <nl> void ValidateWeights ( const TRT_ShapedWeights & weights , <nl> const std : : vector < int > & expected_dims , <nl> const std : : vector < T > & expected_value ) { <nl> - EXPECT_TRUE ( TrtDimsEqualsArray ( expected_dims , weights . shape_ ) ) <nl> - < < weights . DebugString ( ) ; <nl> + ExpectTrtDimsEqualsArray ( expected_dims , weights . shape_ ) ; <nl> ASSERT_EQ ( expected_value . size ( ) , weights . count ( ) ) < < weights . DebugString ( ) ; <nl> const T * actual_values = static_cast < const T * > ( weights . GetValues ( ) ) ; <nl> for ( int i = 0 ; i < expected_value . size ( ) ; + + i ) { <nl> TEST ( TRT_TensorOrWeights_Test , Basic ) { <nl> EXPECT_EQ ( 1 , ptr - > batch_size ( ) ) ; <nl> } <nl> EXPECT_EQ ( & itensor , ptr - > tensor ( ) ) ; <nl> - EXPECT_TRUE ( TrtDimsEqualsArray ( { 1 } , ptr - > GetTrtDims ( ) ) ) <nl> - < < " - expected : " < < DebugString ( dims ) <nl> - < < " \ n vs \ n - actual : " < < DebugString ( ptr - > GetTrtDims ( ) ) ; <nl> + ExpectTrtDimsEqualsArray ( { 1 } , ptr - > GetTrtDims ( ) ) ; <nl> } <nl> } <nl> } <nl> TEST ( TRT_TensorOrWeights_Test , Basic ) { <nl> EXPECT_EQ ( false , ptr - > is_weights ( ) ) ; <nl> EXPECT_EQ ( 1 , ptr - > batch_size ( ) ) ; <nl> EXPECT_NE ( nullptr , ptr - > tensor ( ) ) ; <nl> - EXPECT_TRUE ( TrtDimsEqualsArray ( { 1 } , ptr - > GetTrtDims ( ) ) ) <nl> - < < " - expected : " < < DebugString ( dims ) <nl> - < < " \ n vs \ n - actual : " < < DebugString ( ptr - > GetTrtDims ( ) ) ; <nl> + ExpectTrtDimsEqualsArray ( { 1 } , ptr - > GetTrtDims ( ) ) ; <nl> } <nl> } <nl> / / Test constructor with TRT_ShapedWeights argument . <nl> TEST ( TRT_TensorOrWeights_Test , Basic ) { <nl> <nl> nvinfer1 : : Dims dims ; <nl> dims . nbDims = 0 ; <nl> - EXPECT_TRUE ( TrtDimsEqualsArray ( { } , ptr - > GetTrtDims ( ) ) ) <nl> - < < " - expected : " < < DebugString ( dims ) <nl> - < < " \ n vs \ n - actual : " < < DebugString ( ptr - > GetTrtDims ( ) ) ; <nl> + ExpectTrtDimsEqualsArray ( { } , ptr - > GetTrtDims ( ) ) ; <nl> } <nl> } <nl> } <nl> TEST_F ( ValidatorTest , ConvertToTensorOrWeights ) { <nl> EXPECT_EQ ( true , output . is_tensor ( ) ) ; <nl> EXPECT_EQ ( batch_size , output . batch_size ( ) ) ; <nl> EXPECT_NE ( nullptr , output . tensor ( ) ) ; <nl> - EXPECT_TRUE ( TrtDimsEqualsArray ( { non_batch_dim } , output . GetTrtDims ( ) ) ) <nl> - < < " - expected : { " < < non_batch_dim < < " } \ n vs \ n " <nl> - < < " - actual : " < < DebugString ( output . GetTrtDims ( ) ) ; <nl> + ExpectTrtDimsEqualsArray ( { non_batch_dim } , output . GetTrtDims ( ) ) ; <nl> } <nl> } <nl> <nl> TEST_F ( ConverterTest , AddAndGetInputs ) { <nl> EXPECT_EQ ( nvinfer1 : : DataType : : kFLOAT , inputs [ 0 ] . tensor ( ) - > getType ( ) ) ; <nl> EXPECT_EQ ( nvinfer1 : : DataType : : kINT32 , inputs [ 2 ] . tensor ( ) - > getType ( ) ) ; <nl> EXPECT_EQ ( nvinfer1 : : DataType : : kHALF , inputs [ 3 ] . tensor ( ) - > getType ( ) ) ; <nl> - EXPECT_TRUE ( TrtDimsEqualsArray ( { 1 } , inputs [ 0 ] . tensor ( ) - > getDimensions ( ) ) ) ; <nl> - EXPECT_TRUE ( TrtDimsEqualsArray ( { 2 , 3 } , inputs [ 2 ] . tensor ( ) - > getDimensions ( ) ) ) ; <nl> - EXPECT_TRUE ( TrtDimsEqualsArray ( { 5 , 3 } , inputs [ 3 ] . tensor ( ) - > getDimensions ( ) ) ) ; <nl> + ExpectTrtDimsEqualsArray ( { 1 } , inputs [ 0 ] . tensor ( ) - > getDimensions ( ) ) ; <nl> + ExpectTrtDimsEqualsArray ( { 2 , 3 } , inputs [ 2 ] . tensor ( ) - > getDimensions ( ) ) ; <nl> + ExpectTrtDimsEqualsArray ( { 5 , 3 } , inputs [ 3 ] . tensor ( ) - > getDimensions ( ) ) ; <nl> } <nl> <nl> TEST_F ( ConverterTest , RenameAndMarkOutputTensors ) { <nl> TEST_F ( ConverterTest , RenameAndMarkOutputTensors ) { <nl> { { " my_op " , " my_output " } , { " my_op : 1 " , " my_output_1 " } } ) ) ; <nl> EXPECT_EQ ( 2 , output_tensors . size ( ) ) ; <nl> for ( auto output_tensor : output_tensors ) { <nl> - EXPECT_TRUE ( TrtDimsEqualsArray ( { 2 , 1 } , output_tensor - > getDimensions ( ) ) ) ; <nl> + ExpectTrtDimsEqualsArray ( { 2 , 1 } , output_tensor - > getDimensions ( ) ) ; <nl> } <nl> EXPECT_EQ ( " my_output " , string ( output_tensors [ 0 ] - > getName ( ) ) ) ; <nl> EXPECT_EQ ( " my_output_1 " , string ( output_tensors [ 1 ] - > getName ( ) ) ) ; <nl> TEST_F ( ConverterTest , TransposeTensor ) { <nl> / / OK . <nl> TF_EXPECT_OK ( <nl> converter_ - > TransposeTensor ( input_tensor , { 0 , 3 , 1 , 2 } , & output_tensor ) ) ; <nl> - EXPECT_TRUE ( TrtDimsEqualsArray ( { 5 , 2 , 3 } , output_tensor - > getDimensions ( ) ) ) <nl> - < < DebugString ( * output_tensor ) ; <nl> + ExpectTrtDimsEqualsArray ( { 5 , 2 , 3 } , output_tensor - > getDimensions ( ) ) ; <nl> } <nl> <nl> TEST_F ( ConverterTest , PrepareTensorForShape_Tensor ) { <nl> TEST_F ( ConverterTest , PrepareTensorForShape_Tensor ) { <nl> / / Shape size doesn ' t match . <nl> ExpectStatus ( converter_ - > PrepareTensorForShape ( tw , GetTestDims ( { 2 , 3 , 6 } ) , <nl> & output_tensor ) , <nl> - error : : INVALID_ARGUMENT , " Reshape shapes are not compatible . " ) ; <nl> + error : : INVALID_ARGUMENT , " Reshape shapes are not compatible " ) ; <nl> <nl> / / TODO ( aaroey ) : we should check the case where uninferred dimensions are not <nl> / / an exact divisor of input dim ensions , e . g . for dims { - 1 , 7 } . <nl> TEST_F ( ConverterTest , PrepareTensorForShape_Tensor ) { <nl> / / Infer shape , ok . <nl> TF_EXPECT_OK ( converter_ - > PrepareTensorForShape ( tw , GetTestDims ( { - 1 , 2 } ) , <nl> & output_tensor ) ) ; <nl> - EXPECT_TRUE ( TrtDimsEqualsArray ( { 15 , 2 } , output_tensor - > getDimensions ( ) ) ) <nl> - < < DebugString ( * output_tensor ) ; <nl> + ExpectTrtDimsEqualsArray ( { 15 , 2 } , output_tensor - > getDimensions ( ) ) ; <nl> <nl> / / Regular shape . <nl> TF_EXPECT_OK ( converter_ - > PrepareTensorForShape ( tw , GetTestDims ( { 10 , 3 } ) , <nl> & output_tensor ) ) ; <nl> - EXPECT_TRUE ( TrtDimsEqualsArray ( { 10 , 3 } , output_tensor - > getDimensions ( ) ) ) <nl> - < < DebugString ( * output_tensor ) ; <nl> + ExpectTrtDimsEqualsArray ( { 10 , 3 } , output_tensor - > getDimensions ( ) ) ; <nl> } <nl> <nl> TEST_F ( ConverterTest , PrepareTensorForShape_Weights ) { <nl> TEST_F ( ConverterTest , PrepareTensorForShape_Weights ) { <nl> const nvinfer1 : : ITensor * output_tensor = nullptr ; <nl> TF_EXPECT_OK ( converter_ - > PrepareTensorForShape ( tw , GetTestDims ( { 10 , 3 } ) , <nl> & output_tensor ) ) ; <nl> - EXPECT_TRUE ( TrtDimsEqualsArray ( { 10 , 3 } , output_tensor - > getDimensions ( ) ) ) <nl> - < < DebugString ( * output_tensor ) ; <nl> + ExpectTrtDimsEqualsArray ( { 10 , 3 } , output_tensor - > getDimensions ( ) ) ; <nl> } <nl> <nl> TEST_F ( ConverterTest , MaybeUpdateBatchSize ) { <nl> TEST_F ( ConverterTest , PropagateQuantizationRanges ) { <nl> EXPECT_EQ ( ranges . count ( & not_infer ) , 0 ) ; <nl> } <nl> <nl> + TEST_F ( ConverterTest , GetTrtBroadcastShape ) { <nl> + const bool kIsTensor = true ; <nl> + const bool kIsNotTensor = false ; <nl> + auto symmetric_test = [ this ] ( const std : : vector < int > & operand_1_shape , <nl> + const std : : vector < int > & operand_2_shape , <nl> + const bool operand_1_is_tensor , <nl> + const bool operand_2_is_tensor , <nl> + const std : : vector < int > & expected_operand_1_shape , <nl> + const std : : vector < int > & expected_operand_2_shape , <nl> + error : : Code expected_code = error : : OK , <nl> + const char * expected_error_msg_substr = nullptr , <nl> + const int operand_1_batch_size = - 1 , <nl> + const int operand_2_batch_size = - 1 ) { <nl> + auto create_tensor_or_weights = [ ] ( const std : : vector < int > & shape , <nl> + bool is_tensor , int batch_size = - 1 ) { <nl> + if ( is_tensor ) { <nl> + return TRT_TensorOrWeights { nvinfer1 : : DataType : : kFLOAT , <nl> + GetTestDims ( shape ) , batch_size } ; <nl> + } <nl> + TRT_ShapedWeights weights ; <nl> + weights . shape_ = GetTestDims ( shape ) ; <nl> + return TRT_TensorOrWeights ( weights ) ; <nl> + } ; <nl> + <nl> + nvinfer1 : : Dims operand_1_new_dims , operand_2_new_dims ; <nl> + TRT_TensorOrWeights operand_1 = create_tensor_or_weights ( <nl> + operand_1_shape , operand_1_is_tensor , operand_1_batch_size ) ; <nl> + TRT_TensorOrWeights operand_2 = create_tensor_or_weights ( <nl> + operand_2_shape , operand_2_is_tensor , operand_2_batch_size ) ; <nl> + <nl> + / / operand_1 broadcast operand_2 <nl> + ExpectStatus ( <nl> + this - > converter_ - > GetTrtBroadcastShape ( <nl> + operand_1 , operand_2 , & operand_1_new_dims , & operand_2_new_dims ) , <nl> + expected_code , expected_error_msg_substr ) ; <nl> + if ( expected_code = = error : : OK ) { <nl> + ExpectTrtDimsEqualsArray ( expected_operand_1_shape , operand_1_new_dims ) ; <nl> + ExpectTrtDimsEqualsArray ( expected_operand_2_shape , operand_2_new_dims ) ; <nl> + } <nl> + / / operand_2 broadcast operand_1 <nl> + ExpectStatus ( <nl> + this - > converter_ - > GetTrtBroadcastShape ( <nl> + operand_2 , operand_1 , & operand_2_new_dims , & operand_1_new_dims ) , <nl> + expected_code , expected_error_msg_substr ) ; <nl> + if ( expected_code = = error : : OK ) { <nl> + ExpectTrtDimsEqualsArray ( expected_operand_1_shape , operand_1_new_dims ) ; <nl> + ExpectTrtDimsEqualsArray ( expected_operand_2_shape , operand_2_new_dims ) ; <nl> + } <nl> + } ; <nl> + <nl> + / / Both inputs are weights . <nl> + symmetric_test ( <nl> + { 1 } , { 1 } , kIsNotTensor , kIsNotTensor , { } , { } , error : : INVALID_ARGUMENT , <nl> + " Broadcasting requires at least one of the operands be tensors " ) ; <nl> + <nl> + / / One tensor and one weights . <nl> + symmetric_test ( { 1 , 1 , 1 } , { 2 } , kIsTensor , kIsNotTensor , { 1 , 1 , 1 } , { 1 , 1 , 2 } ) ; <nl> + symmetric_test ( { 1 , 1 , 2 } , { 2 } , kIsTensor , kIsNotTensor , { 1 , 1 , 2 } , { 1 , 1 , 2 } ) ; <nl> + symmetric_test ( { 1 , 3 , 2 } , { 1 } , kIsTensor , kIsNotTensor , { 1 , 3 , 2 } , { 1 , 1 , 1 } ) ; <nl> + symmetric_test ( { 1 , 1 , 1 } , { 2 , 3 } , kIsTensor , kIsNotTensor , { 1 , 1 , 1 } , <nl> + { 1 , 2 , 3 } ) ; <nl> + symmetric_test ( { 1 , 1 , 1 } , { 2 , 3 , 4 } , kIsTensor , kIsNotTensor , { 1 , 1 , 1 } , <nl> + { 2 , 3 , 4 } ) ; <nl> + symmetric_test ( { 1 , 1 , 1 } , { 1 , 2 , 3 , 4 } , kIsTensor , kIsNotTensor , { 1 , 1 , 1 } , <nl> + { 2 , 3 , 4 } ) ; <nl> + symmetric_test ( { 1 , 3 , 4 } , { 1 , 2 , 1 , 4 } , kIsTensor , kIsNotTensor , { 1 , 3 , 4 } , <nl> + { 2 , 1 , 4 } ) ; <nl> + symmetric_test ( { 1 , 1 , 1 } , { 2 , 1 , 1 , 1 } , kIsTensor , kIsNotTensor , { } , { } , <nl> + error : : INVALID_ARGUMENT , " Infeasible broadcast scheme " ) ; <nl> + symmetric_test ( { 1 , 1 , 1 } , { 2 , 1 , 1 , 1 } , kIsTensor , kIsNotTensor , { } , { } , <nl> + error : : INVALID_ARGUMENT , " Infeasible broadcast scheme " , <nl> + / * operand_1_batch_size = * / 2 ) ; <nl> + symmetric_test ( { 1 , 1 , 1 } , { 1 , 1 , 1 , 1 , 1 } , kIsTensor , kIsNotTensor , { } , { } , <nl> + error : : INVALID_ARGUMENT , <nl> + " Broadcasting beyond batch dimension is not supported " <nl> + " ( tensor # dims 4 vs broadcast # dims 5 ) " ) ; <nl> + <nl> + / / Both inputs are tensors . <nl> + symmetric_test ( { 1 , 1 , 1 } , { 1 , 1 } , kIsTensor , kIsTensor , { } , { } , <nl> + error : : INVALID_ARGUMENT , <nl> + " Broadcasting beyond batch dimension is not supported " <nl> + " ( tensor # dims 3 vs broadcast # dims 4 ) " ) ; <nl> + symmetric_test ( { 1 , 3 , 4 } , { 2 , 1 , 4 } , kIsTensor , kIsTensor , { 1 , 3 , 4 } , <nl> + { 2 , 1 , 4 } ) ; <nl> + symmetric_test ( { 1 , 1 , 1 } , { 1 , 1 , 1 , 1 } , kIsTensor , kIsTensor , { } , { } , <nl> + error : : INVALID_ARGUMENT , <nl> + " Broadcasting beyond batch dimension is not supported " <nl> + " ( tensor # dims 4 vs broadcast # dims 5 ) " ) ; <nl> + } <nl> + <nl> / / Class to test various op converters , using both a TrtNodeValidator and <nl> / / Converter . <nl> class OpConverterTest : public : : testing : : Test { <nl> class OpConverterTest : public : : testing : : Test { <nl> } <nl> <nl> / / TODO ( laigd ) : test fp16 and int8 support . <nl> - void BuildAndRun ( const char * input_name , const std : : vector < float > & input_data , <nl> - const char * output_name , std : : vector < float > * output_data ) { <nl> + template < typename T > <nl> + void BuildAndRun ( <nl> + const std : : vector < std : : pair < const char * , const std : : vector < T > > > & <nl> + input_data , <nl> + const char * output_name , std : : vector < T > * output_data ) { <nl> / / Mark the output tensor as TRT engine output . <nl> TF_EXPECT_OK ( converter_ - > RenameAndMarkOutputTensors ( <nl> { { string ( output_name ) , string ( output_name ) } } ) ) ; <nl> class OpConverterTest : public : : testing : : Test { <nl> CHECK_NOTNULL ( engine_ . get ( ) ) ; <nl> <nl> / / Execute the TRT engine . <nl> - const int input_size = input_data . size ( ) * sizeof ( float ) ; <nl> - const int output_size = output_data - > size ( ) * sizeof ( float ) ; <nl> - const int input_index = engine_ - > getBindingIndex ( input_name ) ; <nl> - const int output_index = engine_ - > getBindingIndex ( output_name ) ; <nl> + ASSERT_LE ( input_data . size ( ) + 1 , 3 ) ; <nl> + void * buffers [ 3 ] ; <nl> + for ( const auto name_and_data : input_data ) { <nl> + const int input_size = name_and_data . second . size ( ) * sizeof ( T ) ; <nl> + const int input_index = engine_ - > getBindingIndex ( name_and_data . first ) ; <nl> + ASSERT_EQ ( 0 , cudaMalloc ( & buffers [ input_index ] , input_size ) ) ; <nl> + ASSERT_EQ ( <nl> + 0 , cudaMemcpyAsync ( buffers [ input_index ] , name_and_data . second . data ( ) , <nl> + input_size , cudaMemcpyHostToDevice , stream_ ) ) ; <nl> + } <nl> <nl> - ASSERT_EQ ( engine_ - > getNbBindings ( ) , 2 ) ; <nl> - void * buffers [ 2 ] ; <nl> - ASSERT_EQ ( 0 , cudaMalloc ( & buffers [ input_index ] , input_size ) ) ; <nl> + const int output_size = output_data - > size ( ) * sizeof ( T ) ; <nl> + const int output_index = engine_ - > getBindingIndex ( output_name ) ; <nl> ASSERT_EQ ( 0 , cudaMalloc ( & buffers [ output_index ] , output_size ) ) ; <nl> - ASSERT_EQ ( 0 , cudaMemcpyAsync ( buffers [ input_index ] , input_data . data ( ) , <nl> - input_size , cudaMemcpyHostToDevice , stream_ ) ) ; <nl> + <nl> + ASSERT_EQ ( engine_ - > getNbBindings ( ) , input_data . size ( ) + 1 ) ; <nl> + <nl> TrtUniquePtrType < nvinfer1 : : IExecutionContext > execution_context ( <nl> engine_ - > createExecutionContext ( ) ) ; <nl> execution_context - > enqueue ( / * batchSize = * / 1 , buffers , stream_ , nullptr ) ; <nl> ASSERT_EQ ( 0 , cudaMemcpyAsync ( output_data - > data ( ) , buffers [ output_index ] , <nl> output_size , cudaMemcpyDeviceToHost , stream_ ) ) ; <nl> cudaStreamSynchronize ( stream_ ) ; <nl> - ASSERT_EQ ( 0 , cudaFree ( buffers [ input_index ] ) ) ; <nl> - ASSERT_EQ ( 0 , cudaFree ( buffers [ output_index ] ) ) ; <nl> + <nl> + for ( int i = 0 ; i < input_data . size ( ) + 1 ; + + i ) { <nl> + ASSERT_EQ ( 0 , cudaFree ( buffers [ i ] ) ) ; <nl> + } <nl> } <nl> <nl> bool HasStaticShape ( const nvinfer1 : : Dims & dims ) const { <nl> class OpConverterTest : public : : testing : : Test { <nl> void AddTestTensor ( <nl> const char * name , const std : : vector < int32 > & dims , int batch_size = 1 , <nl> nvinfer1 : : DataType trt_dtype = nvinfer1 : : DataType : : kFLOAT ) { <nl> - DataType tf_dtype = DT_FLOAT ; <nl> - switch ( trt_dtype ) { <nl> - case nvinfer1 : : DataType : : kFLOAT : <nl> - tf_dtype = DT_FLOAT ; <nl> - break ; <nl> - case nvinfer1 : : DataType : : kINT32 : <nl> - tf_dtype = DT_INT32 ; <nl> - break ; <nl> - default : <nl> - ASSERT_TRUE ( false ) < < " Unexpected data type " <nl> - < < static_cast < int > ( trt_dtype ) ; <nl> - } <nl> + DataType tf_dtype = TrtDataTypeToTf ( trt_dtype ) ; <nl> ops : : Placeholder : : Attrs attrs ; <nl> TF_EXPECT_OK ( TensorShapeUtils : : MakeShape ( dims , & attrs . shape_ ) ) ; <nl> attrs . shape_ . InsertDim ( 0 , batch_size ) ; <nl> TEST_F ( OpConverterTest , ConvertTranspose ) { <nl> Reset ( ) ; <nl> AddTestTensor ( " input " , { 1 , 2 , 3 } ) ; <nl> AddTestWeights < int32 > ( " weights " , { 4 } , { 0 , 3 , 1 , 2 } ) ; <nl> - RunConversion ( node_def ) ; <nl> + RunValidationAndConversion ( node_def ) ; <nl> TRT_TensorOrWeights output ; <nl> TF_EXPECT_OK ( GetTensorOrWeights ( " my_transpose " , & output ) ) ; <nl> EXPECT_TRUE ( output . is_tensor ( ) ) ; <nl> - EXPECT_TRUE ( TrtDimsEqualsArray ( { 3 , 1 , 2 } , output . tensor ( ) - > getDimensions ( ) ) ) <nl> - < < output . DebugString ( ) ; <nl> + ExpectTrtDimsEqualsArray ( { 3 , 1 , 2 } , output . tensor ( ) - > getDimensions ( ) ) ; <nl> <nl> std : : vector < float > output_data ( 6 ) ; <nl> - BuildAndRun ( " input " , { 1 , 2 , 3 , 4 , 5 , 6 } , " my_transpose " , & output_data ) ; <nl> + BuildAndRun < float > ( { { " input " , { 1 , 2 , 3 , 4 , 5 , 6 } } } , " my_transpose " , <nl> + & output_data ) ; <nl> EXPECT_THAT ( output_data , ElementsAre ( 1 , 4 , 2 , 5 , 3 , 6 ) ) ; <nl> } <nl> } <nl> TEST_F ( OpConverterTest , ConvertReshape ) { <nl> Reset ( ) ; <nl> AddTestTensor ( " input " , ok_params [ i ] . tensor_dims , ok_params [ i ] . batch_size ) ; <nl> AddTestWeights < int32 > ( " weights " , { 4 } , ok_params [ i ] . shape ) ; <nl> - RunConversion ( node_def ) ; <nl> + RunValidationAndConversion ( node_def ) ; <nl> TRT_TensorOrWeights output ; <nl> TF_EXPECT_OK ( GetTensorOrWeights ( " my_reshape " , & output ) ) ; <nl> EXPECT_TRUE ( output . is_tensor ( ) ) ; <nl> - EXPECT_TRUE ( TrtDimsEqualsArray ( { 1 , 3 , 2 } , output . tensor ( ) - > getDimensions ( ) ) ) <nl> - < < output . DebugString ( ) ; <nl> + ExpectTrtDimsEqualsArray ( { 1 , 3 , 2 } , output . tensor ( ) - > getDimensions ( ) ) ; <nl> <nl> std : : vector < float > output_data ( 6 ) ; <nl> - BuildAndRun ( " input " , { 1 , 2 , 3 , 4 , 5 , 6 } , " my_reshape " , & output_data ) ; <nl> + BuildAndRun < float > ( { { " input " , { 1 , 2 , 3 , 4 , 5 , 6 } } } , " my_reshape " , <nl> + & output_data ) ; <nl> EXPECT_THAT ( output_data , ElementsAre ( 1 , 2 , 3 , 4 , 5 , 6 ) ) ; <nl> } <nl> } <nl> TEST_F ( OpConverterTest , ConvertMatMul ) { <nl> get_matmul_nodedef ( DT_FLOAT , / * transpose_a = * / false , transpose_b ) ; <nl> AddTestTensor ( " input " , { 2 } , / * batch_size = * / 1 ) ; <nl> AddTestWeights < float > ( " weights " , { 2 , 2 } , { 0 , 1 , 2 , 3 } ) ; <nl> - RunConversion ( node_def ) ; <nl> + RunValidationAndConversion ( node_def ) ; <nl> TRT_TensorOrWeights output ; <nl> TF_EXPECT_OK ( GetTensorOrWeights ( " my_matmul " , & output ) ) ; <nl> EXPECT_TRUE ( output . is_tensor ( ) ) ; <nl> - EXPECT_TRUE ( TrtDimsEqualsArray ( { 2 } , output . tensor ( ) - > getDimensions ( ) ) ) <nl> - < < output . DebugString ( ) ; <nl> + ExpectTrtDimsEqualsArray ( { 2 } , output . tensor ( ) - > getDimensions ( ) ) ; <nl> <nl> std : : vector < float > output_data ( 2 ) ; <nl> - BuildAndRun ( " input " , { 0 , 1 } , " my_matmul " , & output_data ) ; <nl> + BuildAndRun < float > ( { { " input " , { 0 , 1 } } } , " my_matmul " , & output_data ) ; <nl> if ( transpose_b ) { <nl> EXPECT_THAT ( output_data , ElementsAre ( 1 , 3 ) ) ; <nl> } else { <nl> void TestConvertBiasAdd ( OpConverterTest * test ) { <nl> dims_array [ 0 ] = 2 ; <nl> dims_array [ trt_input_rank - 1 ] = 3 ; <nl> } <nl> - test - > AddTestTensor ( " input " , dims_array , / * batch_size = * / 1 ) ; <nl> + test - > AddTestTensor ( " input " , dims_array , / * batch_size = * / 1 , <nl> + TfDataTypeToTrt ( dtype ) ) ; <nl> <nl> / / Add bias weights . <nl> const int channel_size = ( data_format = = " NHWC " ? 3 : 2 ) ; <nl> std : : vector < CType > bias ( channel_size ) ; <nl> - std : : iota ( bias . begin ( ) , bias . end ( ) , 1 ) ; / / bias will be { 1 , 2 , 3 , . . . } <nl> + for ( int i = 0 ; i < channel_size ; + + i ) { <nl> + bias [ i ] = CType ( i + 1 ) ; / / bias will be { 1 , 2 , 3 , . . . } <nl> + } <nl> test - > AddTestWeights < CType > ( " weights " , { channel_size } , bias ) ; <nl> <nl> / / Run the conversion . <nl> void TestConvertBiasAdd ( OpConverterTest * test ) { <nl> TRT_TensorOrWeights output ; <nl> TF_EXPECT_OK ( test - > GetTensorOrWeights ( " my_biasadd " , & output ) ) ; <nl> EXPECT_TRUE ( output . is_tensor ( ) ) ; <nl> - EXPECT_TRUE ( <nl> - TrtDimsEqualsArray ( dims_array , output . tensor ( ) - > getDimensions ( ) ) ) <nl> - < < output . DebugString ( ) ; <nl> + ExpectTrtDimsEqualsArray ( dims_array , output . tensor ( ) - > getDimensions ( ) ) ; <nl> <nl> / / Build and run the engine . <nl> const int num_input = TrtDimsNumElements ( GetTestDims ( dims_array ) ) ; <nl> ASSERT_EQ ( trt_input_rank > 1 ? 6 : ( data_format = = " NHWC " ? 3 : 2 ) , <nl> num_input ) ; <nl> std : : vector < CType > output_data ( num_input ) ; <nl> - test - > BuildAndRun ( " input " , std : : vector < CType > ( num_input , CType ( 0 ) ) , <nl> - " my_biasadd " , & output_data ) ; <nl> + test - > BuildAndRun < CType > ( <nl> + { { " input " , std : : vector < CType > ( num_input , CType ( 0 ) ) } } , " my_biasadd " , <nl> + & output_data ) ; <nl> if ( trt_input_rank = = 1 ) { <nl> if ( data_format = = " NHWC " ) { <nl> - EXPECT_THAT ( output_data , ElementsAre ( 1 , 2 , 3 ) ) ; <nl> + EXPECT_THAT ( output_data , ElementsAre ( CType ( 1 ) , CType ( 2 ) , CType ( 3 ) ) ) ; <nl> } else { <nl> - EXPECT_THAT ( output_data , ElementsAre ( 1 , 2 ) ) ; <nl> + EXPECT_THAT ( output_data , ElementsAre ( CType ( 1 ) , CType ( 2 ) ) ) ; <nl> } <nl> } else { <nl> if ( data_format = = " NHWC " ) { <nl> - EXPECT_THAT ( output_data , ElementsAre ( 1 , 2 , 3 , 1 , 2 , 3 ) ) ; <nl> + EXPECT_THAT ( output_data , ElementsAre ( CType ( 1 ) , CType ( 2 ) , CType ( 3 ) , <nl> + CType ( 1 ) , CType ( 2 ) , CType ( 3 ) ) ) ; <nl> } else { <nl> - EXPECT_THAT ( output_data , ElementsAre ( 1 , 1 , 1 , 2 , 2 , 2 ) ) ; <nl> + EXPECT_THAT ( output_data , ElementsAre ( CType ( 1 ) , CType ( 1 ) , CType ( 1 ) , <nl> + CType ( 2 ) , CType ( 2 ) , CType ( 2 ) ) ) ; <nl> } <nl> } <nl> } <nl> TEST_F ( OpConverterTest , ConvertBiasAdd ) { <nl> " Input expects tensor and weights , at my_biasadd " ) ; <nl> } <nl> <nl> - / / OK . <nl> + / / OK . Note that kINT32 is not supported by IScaleLayer , so we don ' t test <nl> + / / DT_INT32 type here . <nl> TestConvertBiasAdd < DT_FLOAT > ( this ) ; <nl> - / / TODO ( laigd ) : uncomment this after cl / 220663893 is submitted . <nl> - / / TestConvertBiasAdd < DT_INT32 > ( this ) ; <nl> - / / TestConvertBiasAdd < DT_HALF > ( this ) ; <nl> + TestConvertBiasAdd < DT_HALF > ( this ) ; <nl> + } <nl> + <nl> + template < typename OpType > <nl> + NodeDef GetBinaryOpNodeDef ( const string & input_name_l , <nl> + const string & input_name_r , DataType dtype ) { <nl> + Scope s = Scope : : NewRootScope ( ) ; <nl> + auto input_l = ops : : Placeholder ( s . WithOpName ( input_name_l ) , dtype ) ; <nl> + auto input_r = ops : : Placeholder ( s . WithOpName ( input_name_r ) , dtype ) ; <nl> + auto op = OpType ( s . WithOpName ( " my_binary " ) , input_l , input_r ) ; <nl> + return op . operation . node ( ) - > def ( ) ; <nl> + } <nl> + <nl> + void CheckAddedLayers ( OpConverterTest * test , bool expect_scale_layer ) { <nl> + bool element_wise_layer_found = false ; <nl> + bool scale_layer_found = false ; <nl> + for ( int i = 0 ; i < test - > converter_ - > network ( ) - > getNbLayers ( ) ; i + + ) { <nl> + nvinfer1 : : ILayer * layer = test - > converter_ - > network ( ) - > getLayer ( i ) ; <nl> + if ( dynamic_cast < nvinfer1 : : IScaleLayer * > ( layer ) ) { <nl> + scale_layer_found = true ; <nl> + } else if ( dynamic_cast < nvinfer1 : : IElementWiseLayer * > ( layer ) ) { <nl> + element_wise_layer_found = true ; <nl> + } <nl> + } <nl> + EXPECT_EQ ( expect_scale_layer , scale_layer_found ) ; <nl> + EXPECT_NE ( expect_scale_layer , element_wise_layer_found ) ; <nl> + } <nl> + <nl> + template < typename OpType , DataType dtype > <nl> + void TestBinaryTensorOpWeightNoBroadcast ( OpConverterTest * test ) { <nl> + typedef typename EnumToDataType < dtype > : : Type CType ; <nl> + for ( auto swap_inputs : { false , true } ) { <nl> + test - > Reset ( ) ; <nl> + NodeDef node_def ; <nl> + if ( swap_inputs ) { <nl> + node_def = GetBinaryOpNodeDef < OpType > ( " weights " , " input " , dtype ) ; <nl> + } else { <nl> + node_def = GetBinaryOpNodeDef < OpType > ( " input " , " weights " , dtype ) ; <nl> + } <nl> + <nl> + const std : : vector < CType > operand1 { CType ( 3 ) , CType ( 7 . 5 ) } ; <nl> + const std : : vector < CType > operand2 { CType ( 2 ) , CType ( 3 ) } ; <nl> + <nl> + / / It requires the dims to be at least of rank 3 to apply an IScaleLayer . <nl> + test - > AddTestTensor ( " input " , / * dims = * / { 1 , 1 , 2 } , / * batch_size = * / 1 , <nl> + TfDataTypeToTrt ( dtype ) ) ; <nl> + test - > AddTestWeights < CType > ( " weights " , / * dims = * / { 1 , 1 , 2 } , <nl> + / * values = * / swap_inputs ? operand1 : operand2 ) ; <nl> + test - > RunValidationAndConversion ( node_def ) ; <nl> + <nl> + / / Make sure it does use BinaryTensorOpWeight , not BinaryTensorOpTensor . <nl> + CheckAddedLayers ( test , / * expect_scale_layer = * / true ) ; <nl> + <nl> + / / Check the dims of the output ITensor . <nl> + TRT_TensorOrWeights output ; <nl> + TF_EXPECT_OK ( test - > GetTensorOrWeights ( " my_binary " , & output ) ) ; <nl> + EXPECT_TRUE ( output . is_tensor ( ) ) ; <nl> + ExpectTrtDimsEqualsArray ( { 1 , 1 , 2 } , output . tensor ( ) - > getDimensions ( ) ) ; <nl> + <nl> + std : : vector < CType > output_data ( 2 ) ; <nl> + test - > BuildAndRun < CType > ( <nl> + { { " input " , <nl> + / * input_data = * / swap_inputs ? operand2 : operand1 } } , <nl> + " my_binary " , & output_data ) ; <nl> + if ( node_def . op ( ) = = " Add " ) { <nl> + EXPECT_THAT ( output_data , ElementsAre ( CType ( 5 ) , CType ( 10 . 5 ) ) ) ; <nl> + } else if ( node_def . op ( ) = = " Sub " ) { <nl> + EXPECT_THAT ( output_data , ElementsAre ( CType ( 1 ) , CType ( 4 . 5 ) ) ) ; <nl> + } else if ( node_def . op ( ) = = " Mul " ) { <nl> + EXPECT_THAT ( output_data , ElementsAre ( CType ( 6 ) , CType ( 22 . 5 ) ) ) ; <nl> + } else if ( node_def . op ( ) = = " Div " ) { <nl> + EXPECT_THAT ( output_data , ElementsAre ( CType ( 1 . 5 ) , CType ( 2 . 5 ) ) ) ; <nl> + } else if ( node_def . op ( ) = = " RealDiv " ) { <nl> + EXPECT_THAT ( output_data , ElementsAre ( CType ( 1 . 5 ) , CType ( 2 . 5 ) ) ) ; <nl> + } else { <nl> + ASSERT_TRUE ( false ) ; <nl> + } <nl> + } <nl> + } <nl> + <nl> + template < DataType dtype > <nl> + void TestBinaryTensorOpWeightWithChannelWiseBroadcast ( OpConverterTest * test ) { <nl> + typedef typename EnumToDataType < dtype > : : Type CType ; <nl> + const NodeDef node_def = <nl> + GetBinaryOpNodeDef < ops : : Add > ( " input " , " weights " , dtype ) ; <nl> + const std : : vector < CType > input { CType ( 1 ) , CType ( 2 ) , CType ( 3 ) , CType ( 4 ) } ; <nl> + const std : : vector < CType > weights { CType ( 10 ) , CType ( 20 ) } ; <nl> + / / There are two types of valid dim pairs which requires channel - wise <nl> + / / broadcasting : <nl> + / / - input dims ( X Y Z ) vs weights dims ( X 1 1 ) <nl> + / / - input dims ( X Y Z ) vs weights dims ( Z ) <nl> + / / Here X = Z = 2 and Y = 1 . <nl> + for ( auto weights_dims : std : : vector < std : : vector < int > > { { 2 , 1 , 1 } , { 2 } } ) { <nl> + test - > Reset ( ) ; <nl> + test - > AddTestTensor ( " input " , / * dims = * / { 2 , 1 , 2 } , / * batch_size = * / 1 , <nl> + TfDataTypeToTrt ( dtype ) ) ; <nl> + test - > AddTestWeights < CType > ( " weights " , weights_dims , weights ) ; <nl> + test - > RunValidationAndConversion ( node_def ) ; <nl> + <nl> + / / Make sure it does use BinaryTensorOpWeight , not BinaryTensorOpTensor . <nl> + CheckAddedLayers ( test , / * expect_scale_layer = * / true ) ; <nl> + <nl> + / / Check the dims of the output ITensor . <nl> + TRT_TensorOrWeights output ; <nl> + TF_EXPECT_OK ( test - > GetTensorOrWeights ( " my_binary " , & output ) ) ; <nl> + EXPECT_TRUE ( output . is_tensor ( ) ) ; <nl> + ExpectTrtDimsEqualsArray ( { 2 , 1 , 2 } , output . tensor ( ) - > getDimensions ( ) ) ; <nl> + <nl> + std : : vector < CType > output_data ( 4 ) ; <nl> + test - > BuildAndRun < CType > ( { { " input " , input } } , " my_binary " , & output_data ) ; <nl> + if ( weights_dims . size ( ) = = 1 ) { <nl> + EXPECT_THAT ( output_data , <nl> + ElementsAre ( CType ( 11 ) , CType ( 22 ) , CType ( 13 ) , CType ( 24 ) ) ) ; <nl> + } else { <nl> + EXPECT_THAT ( output_data , <nl> + ElementsAre ( CType ( 11 ) , CType ( 12 ) , CType ( 23 ) , CType ( 24 ) ) ) ; <nl> + } <nl> + } <nl> + } <nl> + <nl> + template < DataType dtype > <nl> + void TestBinaryTensorOpWeightWithUniformlyBroadcast ( OpConverterTest * test ) { <nl> + typedef typename EnumToDataType < dtype > : : Type CType ; <nl> + const NodeDef node_def = <nl> + GetBinaryOpNodeDef < ops : : Add > ( " input " , " weights " , dtype ) ; <nl> + const std : : vector < CType > input { CType ( 1 ) , CType ( 2 ) , CType ( 3 ) , CType ( 4 ) } ; <nl> + const std : : vector < CType > weights { CType ( 10 ) } ; <nl> + test - > Reset ( ) ; <nl> + test - > AddTestTensor ( " input " , / * dims = * / { 2 , 1 , 2 } , / * batch_size = * / 1 , <nl> + TfDataTypeToTrt ( dtype ) ) ; <nl> + test - > AddTestWeights < CType > ( " weights " , { 1 , 1 , 1 , 1 } , weights ) ; <nl> + test - > RunValidationAndConversion ( node_def ) ; <nl> + <nl> + / / Make sure it does use BinaryTensorOpWeight , not BinaryTensorOpTensor . <nl> + CheckAddedLayers ( test , / * expect_scale_layer = * / true ) ; <nl> + <nl> + / / Check the dims of the output ITensor . <nl> + TRT_TensorOrWeights output ; <nl> + TF_EXPECT_OK ( test - > GetTensorOrWeights ( " my_binary " , & output ) ) ; <nl> + EXPECT_TRUE ( output . is_tensor ( ) ) ; <nl> + ExpectTrtDimsEqualsArray ( { 2 , 1 , 2 } , output . tensor ( ) - > getDimensions ( ) ) ; <nl> + <nl> + std : : vector < CType > output_data ( 4 ) ; <nl> + test - > BuildAndRun < CType > ( { { " input " , input } } , " my_binary " , & output_data ) ; <nl> + EXPECT_THAT ( output_data , <nl> + ElementsAre ( CType ( 11 ) , CType ( 12 ) , CType ( 13 ) , CType ( 14 ) ) ) ; <nl> + } <nl> + <nl> + template < typename OpType > <nl> + void TestBinaryTensorOpWeightFallback ( OpConverterTest * test , <nl> + const std : : vector < int32 > & input_dims , <nl> + const std : : vector < int > & weights_dims , <nl> + error : : Code code = error : : OK , <nl> + const char * error_msg_substr = nullptr , <nl> + const int input_batch_size = 1 ) { <nl> + const DataType dtype = DT_FLOAT ; <nl> + typedef typename EnumToDataType < dtype > : : Type CType ; <nl> + const size_t num_inputs = TrtDimsNumElements ( GetTestDims ( input_dims ) ) ; <nl> + const size_t num_weights = TrtDimsNumElements ( GetTestDims ( weights_dims ) ) ; <nl> + <nl> + test - > Reset ( ) ; <nl> + const NodeDef node_def = <nl> + GetBinaryOpNodeDef < OpType > ( " input " , " weights " , dtype ) ; <nl> + test - > AddTestTensor ( " input " , / * dims = * / input_dims , input_batch_size , <nl> + TfDataTypeToTrt ( dtype ) ) ; <nl> + test - > AddTestWeights < CType > ( <nl> + " weights " , / * dims = * / weights_dims , <nl> + / * values = * / std : : vector < CType > ( num_weights , CType ( 1 ) ) ) ; <nl> + test - > RunValidationAndConversion ( node_def , code , error_msg_substr ) ; <nl> + if ( code ! = error : : OK ) return ; <nl> + <nl> + / / Make sure it does use BinaryTensorOpTensor , not BinaryTensorOpWeight . <nl> + CheckAddedLayers ( test , / * expect_scale_layer = * / false ) ; <nl> + <nl> + TRT_TensorOrWeights output ; <nl> + TF_EXPECT_OK ( test - > GetTensorOrWeights ( " my_binary " , & output ) ) ; <nl> + EXPECT_TRUE ( output . is_tensor ( ) ) ; <nl> + <nl> + / / Check the dims of the output ITensor . <nl> + std : : vector < int > expected_output_dims = input_dims ; <nl> + for ( int i = expected_output_dims . size ( ) - 1 , j = weights_dims . size ( ) - 1 ; <nl> + i > = 0 & & j > = 0 ; - - i , - - j ) { <nl> + if ( expected_output_dims [ i ] = = 1 ) { <nl> + expected_output_dims [ i ] = weights_dims [ j ] ; <nl> + } <nl> + } <nl> + ExpectTrtDimsEqualsArray ( expected_output_dims , <nl> + output . tensor ( ) - > getDimensions ( ) ) ; <nl> + <nl> + / / Check the result of running the engine . <nl> + const int expected_num_outputs = <nl> + TrtDimsNumElements ( GetTestDims ( expected_output_dims ) ) ; <nl> + std : : vector < CType > output_data ( expected_num_outputs ) ; <nl> + test - > BuildAndRun < CType > ( <nl> + { { " input " , <nl> + / * input_data = * / std : : vector < CType > ( num_inputs , CType ( 2 ) ) } } , <nl> + " my_binary " , & output_data ) ; <nl> + if ( node_def . op ( ) = = " Add " ) { <nl> + EXPECT_THAT ( output_data , ElementsAreArray ( std : : vector < CType > ( <nl> + expected_num_outputs , CType ( 3 ) ) ) ) ; <nl> + } else if ( node_def . op ( ) = = " Minimum " ) { <nl> + EXPECT_THAT ( output_data , ElementsAreArray ( std : : vector < CType > ( <nl> + expected_num_outputs , CType ( 1 ) ) ) ) ; <nl> + } else { <nl> + ASSERT_TRUE ( false ) ; <nl> + } <nl> + } <nl> + <nl> + template < typename OpType , DataType dtype > <nl> + void TestBinaryTensorOpTensor ( OpConverterTest * test ) { <nl> + typedef typename EnumToDataType < dtype > : : Type CType ; <nl> + test - > Reset ( ) ; <nl> + const NodeDef node_def = <nl> + GetBinaryOpNodeDef < OpType > ( " input1 " , " input2 " , dtype ) ; <nl> + test - > AddTestTensor ( " input1 " , / * dims = * / { 1 , 2 } , / * batch_size = * / 1 , <nl> + TfDataTypeToTrt ( dtype ) ) ; <nl> + test - > AddTestTensor ( " input2 " , / * dims = * / { 2 , 1 } , / * batch_size = * / 1 , <nl> + TfDataTypeToTrt ( dtype ) ) ; <nl> + test - > RunValidationAndConversion ( node_def ) ; <nl> + <nl> + / / Make sure it does use BinaryTensorOpTensor , not BinaryTensorOpWeight . <nl> + CheckAddedLayers ( test , / * expect_scale_layer = * / false ) ; <nl> + <nl> + / / Check output dims . <nl> + TRT_TensorOrWeights output ; <nl> + TF_EXPECT_OK ( test - > GetTensorOrWeights ( " my_binary " , & output ) ) ; <nl> + EXPECT_TRUE ( output . is_tensor ( ) ) ; <nl> + ExpectTrtDimsEqualsArray ( { 2 , 2 } , output . tensor ( ) - > getDimensions ( ) ) ; <nl> + <nl> + std : : vector < CType > output_data ( 4 ) ; <nl> + / / After broadcasting first input becomes { 3 , 6 , 3 , 6 } and second input <nl> + / / becomes { 2 , 3 , 2 , 3 } . <nl> + test - > BuildAndRun < CType > ( <nl> + { { " input1 " , { CType ( 3 ) , CType ( 6 ) } } , { " input2 " , { CType ( 2 ) , CType ( 3 ) } } } , <nl> + " my_binary " , & output_data ) ; <nl> + if ( node_def . op ( ) = = " Add " ) { <nl> + EXPECT_THAT ( output_data , <nl> + ElementsAre ( CType ( 5 ) , CType ( 8 ) , CType ( 6 ) , CType ( 9 ) ) ) ; <nl> + } else if ( node_def . op ( ) = = " Sub " ) { <nl> + EXPECT_THAT ( output_data , <nl> + ElementsAre ( CType ( 1 ) , CType ( 4 ) , CType ( 0 ) , CType ( 3 ) ) ) ; <nl> + } else if ( node_def . op ( ) = = " Mul " ) { <nl> + EXPECT_THAT ( output_data , <nl> + ElementsAre ( CType ( 6 ) , CType ( 12 ) , CType ( 9 ) , CType ( 18 ) ) ) ; <nl> + } else if ( node_def . op ( ) = = " Div " ) { <nl> + EXPECT_THAT ( output_data , <nl> + ElementsAre ( CType ( 1 . 5 ) , CType ( 3 ) , CType ( 1 ) , CType ( 2 ) ) ) ; <nl> + } else if ( node_def . op ( ) = = " RealDiv " ) { <nl> + EXPECT_THAT ( output_data , <nl> + ElementsAre ( CType ( 1 . 5 ) , CType ( 3 ) , CType ( 1 ) , CType ( 2 ) ) ) ; <nl> + } else if ( node_def . op ( ) = = " Minimum " ) { <nl> + EXPECT_THAT ( output_data , <nl> + ElementsAre ( CType ( 2 ) , CType ( 2 ) , CType ( 3 ) , CType ( 3 ) ) ) ; <nl> + } else if ( node_def . op ( ) = = " Maximum " ) { <nl> + EXPECT_THAT ( output_data , <nl> + ElementsAre ( CType ( 3 ) , CType ( 6 ) , CType ( 3 ) , CType ( 6 ) ) ) ; <nl> + } else { <nl> + ASSERT_TRUE ( false ) ; <nl> + } <nl> + } <nl> + <nl> + TEST_F ( OpConverterTest , ConvertBinary ) { <nl> + / / Input size doesn ' t match , should fail . <nl> + for ( size_t num_inputs = 0 ; num_inputs < 2 ; + + num_inputs ) { <nl> + Reset ( ) ; <nl> + NodeDef node_def = MakeNodeDef ( " my_add " , " Add " , { num_inputs , " input " } ) ; <nl> + AddTestTensor ( " input " , { 1 } , / * batch_size = * / 1 , nvinfer1 : : DataType : : kFLOAT ) ; <nl> + RunValidationAndConversion ( node_def , error : : INVALID_ARGUMENT , <nl> + " Binary ops require two inputs , at my_add " ) ; <nl> + } <nl> + { <nl> + / / Both inputs are weights . <nl> + Reset ( ) ; <nl> + NodeDef node_def = MakeNodeDef ( " my_add " , " Add " , { " weights1 " , " weights2 " } ) ; <nl> + AddTestWeights < float > ( " weights1 " , { 1 } , { 1 } ) ; <nl> + AddTestWeights < float > ( " weights2 " , { 1 } , { 1 } ) ; <nl> + RunValidationAndConversion ( <nl> + node_def , error : : UNIMPLEMENTED , <nl> + " Constant folding is falled back to TensorFlow , binary op received " <nl> + " both input as constant at : my_add " ) ; <nl> + } <nl> + <nl> + / / Test BinaryTensorOpWeight ( ) without broadcasting . <nl> + TestBinaryTensorOpWeightNoBroadcast < ops : : Add , DT_FLOAT > ( this ) ; <nl> + TestBinaryTensorOpWeightNoBroadcast < ops : : Sub , DT_FLOAT > ( this ) ; <nl> + TestBinaryTensorOpWeightNoBroadcast < ops : : Mul , DT_FLOAT > ( this ) ; <nl> + TestBinaryTensorOpWeightNoBroadcast < ops : : Div , DT_FLOAT > ( this ) ; <nl> + TestBinaryTensorOpWeightNoBroadcast < ops : : RealDiv , DT_FLOAT > ( this ) ; <nl> + # if 0 <nl> + / / TODO ( b / 119560144 ) : it doesn ' t support FP16 constants and the following test <nl> + / / will fail . <nl> + TestBinaryTensorOpWeightNoBroadcast < ops : : Add , DT_HALF > ( this ) ; <nl> + TestBinaryTensorOpWeightNoBroadcast < ops : : Sub , DT_HALF > ( this ) ; <nl> + TestBinaryTensorOpWeightNoBroadcast < ops : : Mul , DT_HALF > ( this ) ; <nl> + TestBinaryTensorOpWeightNoBroadcast < ops : : Div , DT_HALF > ( this ) ; <nl> + TestBinaryTensorOpWeightNoBroadcast < ops : : RealDiv , DT_HALF > ( this ) ; <nl> + # endif <nl> + <nl> + / / Test BinaryTensorOpWeight ( ) with channel - wise broadcasting . <nl> + TestBinaryTensorOpWeightWithChannelWiseBroadcast < DT_FLOAT > ( this ) ; <nl> + <nl> + / / Test BinaryTensorOpWeight ( ) with uniformly broadcasting . <nl> + TestBinaryTensorOpWeightWithUniformlyBroadcast < DT_FLOAT > ( this ) ; <nl> + <nl> + / / Test BinaryTensorOpWeight ( ) falling back to BinaryTensorOpTensor ( ) . <nl> + / / Unsupported op . <nl> + TestBinaryTensorOpWeightFallback < ops : : Minimum > ( this , { 1 , 1 , 1 } , { 1 } ) ; <nl> + / / Rank of input tensor dimension < 3 . <nl> + TestBinaryTensorOpWeightFallback < ops : : Add > ( this , { 1 , 1 } , { 1 } ) ; <nl> + / / Broadcast on batch dimension , should fail . <nl> + TestBinaryTensorOpWeightFallback < ops : : Add > ( <nl> + this , { 1 , 1 , 1 } , { 2 , 1 , 1 , 1 } , error : : INVALID_ARGUMENT , <nl> + " Unsupported binary op broadcast scheme for op my_binary " , <nl> + / * input_batch_size = * / 2 ) ; <nl> + / / Incompatible dims with per - channel mode . <nl> + TestBinaryTensorOpWeightFallback < ops : : Add > ( this , { 1 , 1 , 1 } , { 1 , 2 , 1 } ) ; <nl> + / / Incompatible dims . <nl> + TestBinaryTensorOpWeightFallback < ops : : Add > ( this , { 1 , 2 , 1 } , { 2 } ) ; <nl> + <nl> + / / Test BinaryTensorOpTensor ( ) with broadcasting . <nl> + TestBinaryTensorOpTensor < ops : : Add , DT_FLOAT > ( this ) ; <nl> + TestBinaryTensorOpTensor < ops : : Sub , DT_FLOAT > ( this ) ; <nl> + TestBinaryTensorOpTensor < ops : : Mul , DT_FLOAT > ( this ) ; <nl> + TestBinaryTensorOpTensor < ops : : Div , DT_FLOAT > ( this ) ; <nl> + TestBinaryTensorOpTensor < ops : : RealDiv , DT_FLOAT > ( this ) ; <nl> + TestBinaryTensorOpTensor < ops : : Minimum , DT_FLOAT > ( this ) ; <nl> + TestBinaryTensorOpTensor < ops : : Maximum , DT_FLOAT > ( this ) ; <nl> + <nl> + TestBinaryTensorOpTensor < ops : : Add , DT_HALF > ( this ) ; <nl> + TestBinaryTensorOpTensor < ops : : Sub , DT_HALF > ( this ) ; <nl> + TestBinaryTensorOpTensor < ops : : Mul , DT_HALF > ( this ) ; <nl> + TestBinaryTensorOpTensor < ops : : Div , DT_HALF > ( this ) ; <nl> + TestBinaryTensorOpTensor < ops : : RealDiv , DT_HALF > ( this ) ; <nl> + TestBinaryTensorOpTensor < ops : : Minimum , DT_HALF > ( this ) ; <nl> + TestBinaryTensorOpTensor < ops : : Maximum , DT_HALF > ( this ) ; <nl> } <nl> <nl> TEST_F ( OpConverterTest , ConvertQuantize ) { <nl> TEST_F ( OpConverterTest , ConvertRelu6 ) { <nl> EXPECT_EQ ( ranges [ output . tensor ( ) ] , 6 . 0f ) ; <nl> <nl> std : : vector < float > output_data ( 6 ) ; <nl> - BuildAndRun ( " input " , { - 100 , - 1 , 0 , 3 , 5 , 9 } , " my_relu6 " , & output_data ) ; <nl> + BuildAndRun < float > ( { { " input " , { - 100 , - 1 , 0 , 3 , 5 , 9 } } } , " my_relu6 " , <nl> + & output_data ) ; <nl> EXPECT_THAT ( output_data , ElementsAre ( 0 , 0 , 0 , 3 , 5 , 6 ) ) ; <nl> } <nl> } <nl> mmm a / tensorflow / contrib / tensorrt / test / base_test . py <nl> ppp b / tensorflow / contrib / tensorrt / test / base_test . py <nl> def GetParams ( self ) : <nl> strides = [ 1 , 2 , 2 , 1 ] , <nl> padding = " SAME " , <nl> name = " conv " ) <nl> - bias = constant_op . constant ( <nl> - [ 4 . , 1 . 5 , 2 . , 3 . , 5 . , 7 . ] , name = " bias " , dtype = dtype ) <nl> + bias = constant_op . constant ( [ 4 . , 1 . 5 , 2 . , 3 . , 5 . , 7 . ] , <nl> + name = " bias " , <nl> + dtype = dtype ) <nl> added = nn . bias_add ( conv , bias , name = " bias_add " ) <nl> relu = nn . relu ( added , " relu " ) <nl> identity = array_ops . identity ( relu , " identity " ) <nl> def GetParams ( self ) : <nl> <nl> def ExpectedEnginesToBuild ( self , run_params ) : <nl> " " " Return the expected engines to build . " " " <nl> - # TODO ( aaroey ) : LayoutOptimizer adds additional nodes to the graph which <nl> - # breaks the connection check , fix it . <nl> - # - my_trt_op_0 should have [ " weights " , " conv " , " bias " , " bias_add " , <nl> - # " relu " , " identity " , " max_pool " ] <nl> - return [ " my_trt_op_0 " ] <nl> + return { <nl> + " my_trt_op_0 " : [ <nl> + " weights " , " conv " , " bias " , " bias_add " , " relu " , " identity " , <nl> + " max_pool " <nl> + ] <nl> + } <nl> <nl> <nl> class SimpleMultiEnginesTest ( trt_test . TfTrtIntegrationTestBase ) : <nl> def GetParams ( self ) : <nl> g = ops . Graph ( ) <nl> with g . as_default ( ) : <nl> inp = array_ops . placeholder ( <nl> - dtype = dtype , shape = [ None ] + input_dims [ 1 : ] , name = input_name ) <nl> + dtype = dtype , shape = input_dims , name = input_name ) <nl> with g . device ( " / GPU : 0 " ) : <nl> conv_filter = constant_op . constant ( <nl> [ [ [ [ 1 . , 0 . 5 , 4 . , 6 . , 0 . 5 , 1 . ] , [ 1 . , 0 . 5 , 1 . , 1 . , 0 . 5 , 1 . ] ] ] ] , <nl> def GetParams ( self ) : <nl> padding = " SAME " , <nl> name = " conv " ) <nl> c1 = constant_op . constant ( <nl> - np . random . randn ( input_dims [ 0 ] , 12 , 12 , 6 ) , dtype = dtype , name = " c1 " ) <nl> + np . random . randn ( 12 , 12 , 6 ) , dtype = dtype , name = " c1 " ) <nl> p = math_ops . mul ( conv , c1 , name = " mul " ) <nl> c2 = constant_op . constant ( <nl> - np . random . randn ( input_dims [ 0 ] , 12 , 12 , 6 ) , dtype = dtype , name = " c2 " ) <nl> + np . random . randn ( 12 , 12 , 6 ) , dtype = dtype , name = " c2 " ) <nl> q = math_ops . div ( conv , c2 , name = " div " ) <nl> <nl> edge = self . trt_incompatible_op ( q , name = " incompatible " ) <nl> def GetParams ( self ) : <nl> <nl> def ExpectedEnginesToBuild ( self , run_params ) : <nl> " " " Return the expected engines to build . " " " <nl> - # TODO ( aaroey ) : LayoutOptimizer adds additional nodes to the graph which <nl> - # breaks the connection check , fix it . <nl> - # - my_trt_op_0 should have [ " mul " , " sub " , " div1 " , " mul1 " , " add1 " , <nl> - # " add " , " sub1 " ] ; <nl> - # - my_trt_op_1 should have [ " weights " , " conv " , " div " ] <nl> - return [ " my_trt_op_0 " , " my_trt_op_1 " ] <nl> + return { <nl> + " my_trt_op_0 " : [ <nl> + " add " , " add1 " , " c1 " , " div1 " , " mul " , " mul1 " , " sub " , " sub1 " <nl> + ] , <nl> + " my_trt_op_1 " : [ " c2 " , " conv " , " div " , " weights " ] <nl> + } <nl> <nl> - def ShouldRunTest ( self , run_params ) : <nl> - # TODO ( aaroey ) : LayoutOptimizer adds Transpose ( Const , Const ) to the graph <nl> - # which breaks the conversion . We should fix it as : <nl> - # - Detect the invalid NodeDef earlier before adding them to segment <nl> - # - Let it able to change the RewriterConfig when calling <nl> - # create_inference_graph ( ) . <nl> - # It will be good to add debugging feature for Grappler to print the graph <nl> - # after running each optimizer . <nl> - return False <nl> + def GetConversionParams ( self , run_params ) : <nl> + " " " Return a ConversionParams for test . " " " <nl> + return super ( <nl> + SimpleMultiEnginesTest , self <nl> + ) . GetConversionParams ( run_params ) . _replace ( <nl> + # Disable layout optimizer , since it ' ll add Transpose ( Const , Const ) to <nl> + # the graph and breaks the conversion check . <nl> + rewriter_config = trt_test . OptimizerDisabledRewriterConfig ( ) ) <nl> <nl> <nl> class PartiallyConvertedTestA ( trt_test . TfTrtIntegrationTestBase ) : <nl> mmm a / tensorflow / contrib / tensorrt / test / tf_trt_integration_test_base . py <nl> ppp b / tensorflow / contrib / tensorrt / test / tf_trt_integration_test_base . py <nl> class GraphState ( object ) : <nl> def OptimizerDisabledRewriterConfig ( ) : <nl> " " " Returns a RewriterConfig with all default Grappler optimizers disabled . " " " <nl> rewriter_config = rewriter_config_pb2 . RewriterConfig ( ) <nl> + <nl> + # Turn off all default Grappler optimizers . <nl> off = rewriter_config_pb2 . RewriterConfig . OFF <nl> rewriter_config . layout_optimizer = off <nl> rewriter_config . constant_folding = off <nl> def OptimizerDisabledRewriterConfig ( ) : <nl> rewriter_config_pb2 . RewriterConfig . NO_MEM_OPT ) <nl> rewriter_config . pin_to_host_optimization = off <nl> rewriter_config . auto_parallel . enable = False <nl> + <nl> + # Run only once for each enabled optimizer . <nl> + rewriter_config . meta_optimizer_iterations = ( <nl> + rewriter_config_pb2 . RewriterConfig . ONE ) <nl> return rewriter_config <nl> <nl> <nl>
Fix conversion for binary operations and add corresponding test . Main changes
tensorflow/tensorflow
0fee95f2a98f047f074d6c16c1841f0f94834fcf
2018-11-21T00:32:54Z
new file mode 100644 <nl> index 00000000000 . . 9d8cb7fea2e <nl> mmm / dev / null <nl> ppp b / hphp / test / slow / ext_string / 7157 . php <nl> <nl> + < ? php <nl> + $ chars = " \ xE4 " ; <nl> + setlocale ( LC_CTYPE , " de_DE " , " de " , " german " , " ge " , " de_DE . ISO8859 - 1 " , " ISO8859 - 1 " ) ; <nl> + echo strcasecmp ( $ chars , strtoupper ( $ chars ) ) . " \ n " ; <nl> + echo stripos ( $ chars , strtoupper ( $ chars ) ) . " \ n " ; <nl> + ? > <nl> new file mode 100644 <nl> index 00000000000 . . aa47d0d46d4 <nl> mmm / dev / null <nl> ppp b / hphp / test / slow / ext_string / 7157 . php . expect <nl> <nl> + 0 <nl> + 0 <nl> mmm a / hphp / util / bstring . h <nl> ppp b / hphp / util / bstring . h <nl> inline bool chrcaseeq ( char left , char right ) { <nl> char k = left ^ right ; <nl> if ( k = = 0 ) return true ; <nl> if ( k ! = 32 ) return false ; <nl> - k = left | right ; <nl> - return ( k > = ' a ' & & k < = ' z ' ) ; <nl> + return isalpha ( left ) ; <nl> } <nl> <nl> / / chrcasecmp performs a case insensitive comparison and returns < 0 if left <nl> / / is less than right , > 0 if left is greater than right , and 0 if the <nl> / / characters are equal <nl> inline int chrcasecmp ( char left , char right ) { <nl> - if ( left = = right ) return 0 ; <nl> + if ( chrcaseeq ( left , right ) ) return 0 ; <nl> if ( left > = ' A ' & & left < = ' Z ' ) left + = 32 ; <nl> if ( right > = ' A ' & & right < = ' Z ' ) right + = 32 ; <nl> return ( int ) ( unsigned char ) left - ( int ) ( unsigned char ) right ; <nl>
adding fix for proper case insensitive comparisons of single byte , no …
facebook/hhvm
927193099c04834811753503aa7dabc84481ceae
2016-07-01T18:50:13Z
mmm a / benchmark / single - source / unit - tests / ObjectiveCBridging . swift <nl> ppp b / benchmark / single - source / unit - tests / ObjectiveCBridging . swift <nl> public func conditionalCast < NS , T > ( _ ns : NS ) - > T ? { <nl> / / = = = String = = = / / <nl> <nl> func createNSString ( ) - > NSString { <nl> - return NSString ( cString : " NSString that does not fit in tagged pointer " , encoding : NSUTF8StringEncoding ) ! <nl> + return NSString ( cString : " NSString that does not fit in tagged pointer " , encoding : NSUTF8StringEncoding ) ! <nl> } <nl> <nl> @ inline ( never ) <nl> func testObjectiveCBridgeFromNSArrayAnyObjectToString ( ) { <nl> nativeString = nativeArray [ 0 ] <nl> } <nl> } <nl> - CheckResults ( nativeString ! = nil & & nativeString = = " NSString that does not fit in tagged pointer " , " Expected results did not match " ) <nl> + CheckResults ( nativeString ! = nil & & nativeString = = " NSString that does not fit in tagged pointer " , " Expected results did not match " ) <nl> } <nl> <nl> @ inline ( never ) <nl> func testObjectiveCBridgeFromNSSetAnyObjectForced ( ) { <nl> result = nativeSet . contains ( nsString ) <nl> } <nl> } <nl> - CheckResults ( result ! = nil & & result ! , " Expected results did not match " ) <nl> + CheckResults ( result ! = nil & & result ! , " Expected results did not match " ) <nl> } <nl> <nl> @ inline ( never ) <nl> func testObjectiveCBridgeFromNSSetAnyObjectToString ( ) { <nl> result = nativeSet . contains ( nativeString ) <nl> } <nl> } <nl> - CheckResults ( result ! = nil & & result ! , " Expected results did not match " ) <nl> + CheckResults ( result ! = nil & & result ! , " Expected results did not match " ) <nl> } <nl> <nl> @ inline ( never ) <nl> mmm a / stdlib / public / core / ArrayBuffer . swift <nl> ppp b / stdlib / public / core / ArrayBuffer . swift <nl> extension _ArrayBuffer { <nl> / / / Otherwise , returns ` nil ` . <nl> @ warn_unused_result <nl> public mutating func requestUniqueMutableBackingBuffer ( minimumCapacity : Int ) <nl> - - > NativeBuffer ? { <nl> + - > NativeBuffer ? { <nl> if _fastPath ( isUniquelyReferenced ( ) ) { <nl> let b = _native <nl> if _fastPath ( b . capacity > = minimumCapacity ) { <nl>
[ gardening ] " \ t " → " "
apple/swift
8fc1307037c5b8ecccb667b2552919beda3587d3
2016-04-17T19:12:32Z
mmm a / src / compiler / wasm - compiler . cc <nl> ppp b / src / compiler / wasm - compiler . cc <nl> WasmCodeWrapper WasmCompilationUnit : : FinishLiftoffCompilation ( <nl> WasmCodeWrapper ret ; <nl> if ( ! FLAG_wasm_jit_to_native ) { <nl> Handle < Code > code ; <nl> - code = isolate_ - > factory ( ) - > NewCode ( desc , Code : : WASM_FUNCTION , code ) ; <nl> + code = isolate_ - > factory ( ) - > NewCode ( <nl> + desc , Code : : WASM_FUNCTION , code , Builtins : : kNoBuiltinId , <nl> + MaybeHandle < HandlerTable > ( ) , MaybeHandle < ByteArray > ( ) , <nl> + MaybeHandle < DeoptimizationData > ( ) , kMovable , <nl> + 0 , / / stub_key <nl> + false , / / is_turbofanned <nl> + liftoff_ . asm_ . GetTotalFrameSlotCount ( ) , / / stack_slots <nl> + liftoff_ . safepoint_table_offset_ ) ; <nl> # ifdef ENABLE_DISASSEMBLER <nl> if ( FLAG_print_code | | FLAG_print_wasm_code ) { <nl> / / TODO ( wasm ) : Use proper log files , here and elsewhere . <nl> WasmCodeWrapper WasmCompilationUnit : : FinishLiftoffCompilation ( <nl> / / Consider lifting them both to FinishCompilation . <nl> return WasmCodeWrapper ( native_module_ - > AddCode ( <nl> desc , liftoff_ . asm_ . GetTotalFrameSlotCount ( ) , func_index_ , <nl> - liftoff_ . asm_ . GetSafepointTableOffset ( ) , protected_instructions_ , <nl> - true ) ) ; <nl> + liftoff_ . safepoint_table_offset_ , protected_instructions_ , true ) ) ; <nl> } <nl> } <nl> <nl> mmm a / src / compiler / wasm - compiler . h <nl> ppp b / src / compiler / wasm - compiler . h <nl> class WasmCompilationUnit final { <nl> <nl> struct LiftoffData { <nl> wasm : : LiftoffAssembler asm_ ; <nl> + int safepoint_table_offset_ ; <nl> explicit LiftoffData ( Isolate * isolate ) : asm_ ( isolate ) { } <nl> } ; <nl> struct TurbofanData { <nl> mmm a / src / objects . cc <nl> ppp b / src / objects . cc <nl> void Code : : Disassemble ( const char * name , std : : ostream & os ) { / / NOLINT <nl> { <nl> Isolate * isolate = GetIsolate ( ) ; <nl> int size = instruction_size ( ) ; <nl> - int safepoint_offset = is_turbofanned ( ) ? safepoint_table_offset ( ) : size ; <nl> + int safepoint_offset = <nl> + has_safepoint_info ( ) ? safepoint_table_offset ( ) : size ; <nl> int constant_pool_offset = FLAG_enable_embedded_constant_pool <nl> ? this - > constant_pool_offset ( ) <nl> : size ; <nl> void Code : : Disassemble ( const char * name , std : : ostream & os ) { / / NOLINT <nl> } <nl> os < < " \ n " ; <nl> <nl> - if ( is_turbofanned ( ) ) { <nl> + if ( has_safepoint_info ( ) ) { <nl> SafepointTable table ( this ) ; <nl> os < < " Safepoints ( size = " < < table . size ( ) < < " ) \ n " ; <nl> for ( unsigned i = 0 ; i < table . length ( ) ; i + + ) { <nl> mmm a / src / objects / code - inl . h <nl> ppp b / src / objects / code - inl . h <nl> Code : : Kind Code : : kind ( ) const { <nl> void Code : : initialize_flags ( Kind kind , bool has_unwinding_info , <nl> bool is_turbofanned , int stack_slots ) { <nl> CHECK ( 0 < = stack_slots & & stack_slots < StackSlotsField : : kMax ) ; <nl> - DCHECK_IMPLIES ( stack_slots ! = 0 , is_turbofanned ) ; <nl> static_assert ( Code : : NUMBER_OF_KINDS < = KindField : : kMax + 1 , " field overflow " ) ; <nl> uint32_t flags = HasUnwindingInfoField : : encode ( has_unwinding_info ) | <nl> KindField : : encode ( kind ) | <nl> IsTurbofannedField : : encode ( is_turbofanned ) | <nl> StackSlotsField : : encode ( stack_slots ) ; <nl> WRITE_UINT32_FIELD ( this , kFlagsOffset , flags ) ; <nl> + DCHECK_IMPLIES ( stack_slots ! = 0 , has_safepoint_info ( ) ) ; <nl> } <nl> <nl> inline bool Code : : is_interpreter_trampoline_builtin ( ) const { <nl> void Code : : set_builtin_index ( int index ) { <nl> <nl> bool Code : : is_builtin ( ) const { return builtin_index ( ) ! = - 1 ; } <nl> <nl> + bool Code : : has_safepoint_info ( ) const { <nl> + return is_turbofanned ( ) | | is_wasm_code ( ) ; <nl> + } <nl> + <nl> int Code : : stack_slots ( ) const { <nl> - DCHECK ( is_turbofanned ( ) ) ; <nl> + DCHECK ( has_safepoint_info ( ) ) ; <nl> return StackSlotsField : : decode ( READ_UINT32_FIELD ( this , kFlagsOffset ) ) ; <nl> } <nl> <nl> int Code : : safepoint_table_offset ( ) const { <nl> - DCHECK ( is_turbofanned ( ) ) ; <nl> + DCHECK ( has_safepoint_info ( ) ) ; <nl> return READ_INT32_FIELD ( this , kSafepointTableOffsetOffset ) ; <nl> } <nl> <nl> void Code : : set_safepoint_table_offset ( int offset ) { <nl> CHECK_LE ( 0 , offset ) ; <nl> - DCHECK ( is_turbofanned ( ) | | offset = = 0 ) ; / / Allow zero initialization . <nl> + DCHECK ( has_safepoint_info ( ) | | offset = = 0 ) ; / / Allow zero initialization . <nl> DCHECK ( IsAligned ( offset , static_cast < unsigned > ( kIntSize ) ) ) ; <nl> WRITE_INT32_FIELD ( this , kSafepointTableOffsetOffset , offset ) ; <nl> } <nl> mmm a / src / objects / code . h <nl> ppp b / src / objects / code . h <nl> class Code : public HeapObject { <nl> inline void set_builtin_index ( int id ) ; <nl> inline bool is_builtin ( ) const ; <nl> <nl> - / / [ stack_slots ] : For kind OPTIMIZED_FUNCTION , the number of stack slots <nl> + inline bool has_safepoint_info ( ) const ; <nl> + <nl> + / / [ stack_slots ] : If { has_safepoint_info ( ) } , the number of stack slots <nl> / / reserved in the code prologue . <nl> inline int stack_slots ( ) const ; <nl> <nl> - / / [ safepoint_table_start ] : For kind OPTIMIZED_FUNCTION , the offset in <nl> - / / the instruction stream where the safepoint table starts . <nl> + / / [ safepoint_table_offset ] : If { has_safepoint_info ( ) } , the offset in the <nl> + / / instruction stream where the safepoint table starts . <nl> inline int safepoint_table_offset ( ) const ; <nl> inline void set_safepoint_table_offset ( int offset ) ; <nl> <nl> mmm a / src / safepoint - table . cc <nl> ppp b / src / safepoint - table . cc <nl> SafepointTable : : SafepointTable ( Address instruction_start , <nl> <nl> SafepointTable : : SafepointTable ( Code * code ) <nl> : SafepointTable ( code - > instruction_start ( ) , code - > safepoint_table_offset ( ) , <nl> - code - > stack_slots ( ) , true ) { <nl> - DCHECK ( code - > is_turbofanned ( ) ) ; <nl> - } <nl> + code - > stack_slots ( ) , true ) { } <nl> <nl> unsigned SafepointTable : : find_return_pc ( unsigned pc_offset ) { <nl> for ( unsigned i = 0 ; i < length ( ) ; i + + ) { <nl> mmm a / src / wasm / baseline / liftoff - assembler . cc <nl> ppp b / src / wasm / baseline / liftoff - assembler . cc <nl> void LiftoffAssembler : : set_num_locals ( uint32_t num_locals ) { <nl> } <nl> <nl> uint32_t LiftoffAssembler : : GetTotalFrameSlotCount ( ) const { <nl> - return kPointerSize * ( num_locals ( ) + kMaxValueStackHeight ) ; <nl> + return num_locals ( ) + kMaxValueStackHeight ; <nl> } <nl> <nl> # undef __ <nl> mmm a / src / wasm / baseline / liftoff - assembler . h <nl> ppp b / src / wasm / baseline / liftoff - assembler . h <nl> class LiftoffAssembler : public TurboAssembler { <nl> void set_num_locals ( uint32_t num_locals ) ; <nl> <nl> uint32_t GetTotalFrameSlotCount ( ) const ; <nl> - size_t GetSafepointTableOffset ( ) const { return 0 ; } <nl> <nl> ValueType local_type ( uint32_t index ) { <nl> DCHECK_GT ( num_locals_ , index ) ; <nl> mmm a / src / wasm / baseline / liftoff - compiler . cc <nl> ppp b / src / wasm / baseline / liftoff - compiler . cc <nl> class LiftoffCompiler { <nl> using Decoder = WasmFullDecoder < validate , LiftoffCompiler > ; <nl> <nl> LiftoffCompiler ( LiftoffAssembler * liftoff_asm , <nl> - compiler : : CallDescriptor * call_desc , <nl> - const compiler : : ModuleEnv * env ) <nl> - : asm_ ( liftoff_asm ) , call_desc_ ( call_desc ) , env_ ( env ) { } <nl> + compiler : : CallDescriptor * call_desc , compiler : : ModuleEnv * env ) <nl> + : asm_ ( liftoff_asm ) , <nl> + call_desc_ ( call_desc ) , <nl> + env_ ( env ) , <nl> + compilation_zone_ ( liftoff_asm - > isolate ( ) - > allocator ( ) , <nl> + " liftoff compilation " ) , <nl> + safepoint_table_builder_ ( & compilation_zone_ ) { } <nl> <nl> bool ok ( ) const { return ok_ ; } <nl> <nl> class LiftoffCompiler { <nl> BindUnboundLabels ( decoder ) ; <nl> } <nl> <nl> + int GetSafepointTableOffset ( ) const { <nl> + return safepoint_table_builder_ . GetCodeOffset ( ) ; <nl> + } <nl> + <nl> void BindUnboundLabels ( Decoder * decoder ) { <nl> # ifdef DEBUG <nl> / / Bind all labels now , otherwise their destructor will fire a DCHECK error <nl> class LiftoffCompiler { <nl> CheckStackSizeLimit ( decoder ) ; <nl> } <nl> <nl> - void FinishFunction ( Decoder * decoder ) { } <nl> + void FinishFunction ( Decoder * decoder ) { <nl> + safepoint_table_builder_ . Emit ( asm_ , __ GetTotalFrameSlotCount ( ) ) ; <nl> + } <nl> <nl> void OnFirstError ( Decoder * decoder ) { <nl> ok_ = false ; <nl> class LiftoffCompiler { <nl> } <nl> <nl> private : <nl> - LiftoffAssembler * asm_ ; <nl> - compiler : : CallDescriptor * call_desc_ ; <nl> - const compiler : : ModuleEnv * env_ ; <nl> + LiftoffAssembler * const asm_ ; <nl> + compiler : : CallDescriptor * const call_desc_ ; <nl> + compiler : : ModuleEnv * const env_ ; <nl> bool ok_ = true ; <nl> + / / Zone used to store information during compilation . The result will be <nl> + / / stored independently , such that this zone can die together with the <nl> + / / LiftoffCompiler after compilation . <nl> + Zone compilation_zone_ ; <nl> + SafepointTableBuilder safepoint_table_builder_ ; <nl> } ; <nl> <nl> } / / namespace <nl> bool compiler : : WasmCompilationUnit : : ExecuteLiftoffCompilation ( ) { <nl> / / Record the memory cost this unit places on the system until <nl> / / it is finalized . <nl> memory_cost_ = liftoff_ . asm_ . pc_offset ( ) ; <nl> + liftoff_ . safepoint_table_offset_ = <nl> + decoder . interface ( ) . GetSafepointTableOffset ( ) ; <nl> isolate_ - > counters ( ) - > liftoff_compiled_functions ( ) - > Increment ( ) ; <nl> return true ; <nl> } <nl> mmm a / src / wasm / wasm - code - manager . cc <nl> ppp b / src / wasm / wasm - code - manager . cc <nl> WasmCode * NativeModule : : AddAnonymousCode ( Handle < Code > code , <nl> static_cast < size_t > ( code - > instruction_size ( ) ) } , <nl> std : : move ( reloc_info ) , static_cast < size_t > ( code - > relocation_size ( ) ) , <nl> Nothing < uint32_t > ( ) , kind , code - > constant_pool_offset ( ) , <nl> - ( code - > is_turbofanned ( ) ? code - > stack_slots ( ) : 0 ) , <nl> - ( code - > is_turbofanned ( ) ? code - > safepoint_table_offset ( ) : 0 ) , { } ) ; <nl> + ( code - > has_safepoint_info ( ) ? code - > stack_slots ( ) : 0 ) , <nl> + ( code - > has_safepoint_info ( ) ? code - > safepoint_table_offset ( ) : 0 ) , { } ) ; <nl> if ( ret = = nullptr ) return nullptr ; <nl> intptr_t delta = ret - > instructions ( ) . start ( ) - code - > instruction_start ( ) ; <nl> int mask = RelocInfo : : kApplyMask | RelocInfo : : kCodeTargetMask | <nl>
[ Liftoff ] Store safepoint info
v8/v8
060f868edf1736a9c6b51d40c7a763e9b9f6aa15
2017-12-08T08:53:08Z
mmm a / docs / tutorial / solver . md <nl> ppp b / docs / tutorial / solver . md <nl> What distinguishes the method from SGD is the weight setting $ $ W $ $ on which we <nl> The * * RMSprop * * ( ` type : " RMSProp " ` ) , suggested by Tieleman in a Coursera course lecture , is a gradient - based optimization method ( like SGD ) . The update formulas are <nl> <nl> $ $ <nl> - ( v_t ) _i = <nl> - \ begin { cases } <nl> - ( v_ { t - 1 } ) _i + \ delta , & ( \ nabla L ( W_t ) ) _i ( \ nabla L ( W_ { t - 1 } ) ) _i > 0 \ \ <nl> - ( v_ { t - 1 } ) _i \ cdot ( 1 - \ delta ) , & \ text { else } <nl> - \ end { cases } <nl> + \ operatorname { MS } ( ( W_t ) _i ) = \ delta \ operatorname { MS } ( ( W_ { t - 1 } ) _i ) + ( 1 - \ delta ) ( \ nabla L ( W_t ) ) _i ^ 2 \ \ <nl> + ( W_ { t + 1 } ) _i = ( W_ { t } ) _i - \ alpha \ frac { ( \ nabla L ( W_t ) ) _i } { \ sqrt { \ operatorname { MS } ( ( W_t ) _i ) } } <nl> $ $ <nl> <nl> - $ $ <nl> - ( W_ { t + 1 } ) _i = ( W_t ) _i - \ alpha ( v_t ) _i , <nl> - $ $ <nl> - <nl> - If the gradient updates results in oscillations the gradient is reduced by times $ $ 1 - \ delta $ $ . Otherwise it will be increased by $ $ \ delta $ $ . The default value of $ $ \ delta $ $ ( ` rms_decay ` ) is set to $ $ \ delta = 0 . 02 $ $ . <nl> + The default value of $ $ \ delta $ $ ( ` rms_decay ` ) is set to $ $ \ delta = 0 . 99 $ $ . <nl> <nl> [ 1 ] T . Tieleman , and G . Hinton . <nl> [ RMSProp : Divide the gradient by a running average of its recent magnitude ] ( http : / / www . cs . toronto . edu / ~ tijmen / csc321 / slides / lecture_slides_lec6 . pdf ) . <nl>
corrected rmsprop documentation
BVLC/caffe
80f60dae071fca4457d7a439960385a4579f489d
2016-06-28T20:59:36Z