diff
stringlengths 41
2.03M
| msg
stringlengths 1
1.5k
⌀ | repo
stringlengths 5
40
| sha
stringlengths 40
40
| time
stringlengths 20
20
|
---|---|---|---|---|
mmm a / docs / en / operations / server - configuration - parameters / settings . md <nl> ppp b / docs / en / operations / server - configuration - parameters / settings . md <nl> The cache is shared for the server and memory is allocated as needed . The cache <nl> ` ` ` xml <nl> < mark_cache_size > 5368709120 < / mark_cache_size > <nl> ` ` ` <nl> - <nl> # # max \ _server \ _memory \ _usage { # max_server_memory_usage } <nl> <nl> Limits total RAM usage by the ClickHouse server . You can specify it only for the default profile . <nl> Default value : ` 0 ` . <nl> <nl> * * Additional Info * * <nl> <nl> - On hosts with low RAM and swap , you possibly need setting ` max_server_memory_usage_to_ram_ratio > 1 ` . <nl> + The default ` max_server_memory_usage ` value is calculated as ` memory_amount * max_server_memory_usage_to_ram_ratio ` . <nl> <nl> * * See also * * <nl> <nl> - [ max \ _memory \ _usage ] ( . . / . . / operations / settings / query - complexity . md # settings_max_memory_usage ) <nl> + - [ max_server_memory_usage_to_ram_ratio ] ( # max_server_memory_usage_to_ram_ratio ) <nl> + <nl> + # # max_server_memory_usage_to_ram_ratio { # max_server_memory_usage_to_ram_ratio } <nl> + <nl> + Defines the fraction of total physical RAM amount , available to the Clickhouse server . If the server tries to utilize more , the memory is cut down to the appropriate amount . <nl> + <nl> + Possible values : <nl> + <nl> + - Positive double . <nl> + - 0 — The Clickhouse server can use all available RAM . <nl> + <nl> + Default value : ` 0 ` . <nl> + <nl> + * * Usage * * <nl> + <nl> + On hosts with low RAM and swap , you possibly need setting ` max_server_memory_usage_to_ram_ratio ` larger than 1 . <nl> + <nl> + * * Example * * <nl> + <nl> + ` ` ` xml <nl> + < max_server_memory_usage_to_ram_ratio > 0 . 9 < / max_server_memory_usage_to_ram_ratio > <nl> + ` ` ` <nl> + <nl> + * * See Also * * <nl> + <nl> + - [ max_server_memory_usage ] ( # max_server_memory_usage ) <nl> <nl> # # max \ _concurrent \ _queries { # max - concurrent - queries } <nl> <nl> mmm a / docs / ru / operations / server - configuration - parameters / settings . md <nl> ppp b / docs / ru / operations / server - configuration - parameters / settings . md <nl> ClickHouse проверит условия ` min_part_size ` и ` min_part_size_rat <nl> <nl> * * Дополнительная информация * * <nl> <nl> - На серверах с небольшим объёмом RAM и файла подкачки может потребоваться настройка ` max_server_memory_usage_to_ram_ratio > 1 ` . <nl> + Значение по умолчанию для ` max_server_memory_usage ` рассчитывается как ` memory_amount * max_server_memory_usage_to_ram_ratio ` . <nl> <nl> * * См . также * * <nl> <nl> - [ max_memory_usage ] ( . . / settings / query - complexity . md # settings_max_memory_usage ) <nl> <nl> + # # max_server_memory_usage_to_ram_ratio { # max_server_memory_usage_to_ram_ratio } <nl> + <nl> + Определяет долю оперативной памяти , доступную для использования сервером Clickhouse . Если сервер попытается использовать больше , предоставляемый ему объём памяти будет ограничен до расчётного значения . <nl> + <nl> + Возможные значения : <nl> + <nl> + - Положительное число с плавающей запятой . <nl> + - 0 — сервер Clickhouse может использовать всю оперативную память . <nl> + <nl> + Значение по умолчанию : ` 0 ` . <nl> + <nl> + * * Использование * * <nl> + <nl> + На серверах с небольшим объёмом оперативной памяти и файла подкачки может потребоваться установить настройку ` max_server_memory_usage_to_ram_ratio ` в значение , большее 1 . <nl> + <nl> + * * Пример * * <nl> + <nl> + ` ` ` xml <nl> + < max_server_memory_usage_to_ram_ratio > 0 . 9 < / max_server_memory_usage_to_ram_ratio > <nl> + ` ` ` <nl> + <nl> + * * См . также * * <nl> + <nl> + - [ max_server_memory_usage ] ( # max_server_memory_usage ) <nl> + <nl> # # max \ _connections { # max - connections } <nl> <nl> Максимальное количество входящих соединений . <nl>
|
Merge pull request from BayoNet / docs / CLICKHOUSEDOCS - 680 - max - server - memory - usage - to - ram
|
ClickHouse/ClickHouse
|
dad8d85b7d0a014e617ffc66cc0f138e365556e8
|
2020-07-20T08:21:13Z
|
mmm a / src / mongo / db / query / query_planner . cpp <nl> ppp b / src / mongo / db / query / query_planner . cpp <nl> static bool is2DIndex ( const BSONObj & pattern ) { <nl> string optionString ( size_t options ) { <nl> mongoutils : : str : : stream ss ; <nl> <nl> - / / These options are all currently mutually exclusive . <nl> if ( QueryPlannerParams : : DEFAULT = = options ) { <nl> ss < < " DEFAULT " ; <nl> } <nl> - if ( options & QueryPlannerParams : : NO_TABLE_SCAN ) { <nl> - ss < < " NO_TABLE_SCAN " ; <nl> - } <nl> - if ( options & QueryPlannerParams : : INCLUDE_COLLSCAN ) { <nl> - ss < < " INCLUDE_COLLSCAN " ; <nl> - } <nl> - if ( options & QueryPlannerParams : : INCLUDE_SHARD_FILTER ) { <nl> - ss < < " INCLUDE_SHARD_FILTER " ; <nl> - } <nl> - if ( options & QueryPlannerParams : : NO_BLOCKING_SORT ) { <nl> - ss < < " NO_BLOCKING_SORT " ; <nl> - } <nl> - if ( options & QueryPlannerParams : : INDEX_INTERSECTION ) { <nl> - ss < < " INDEX_INTERSECTION " ; <nl> - } <nl> - if ( options & QueryPlannerParams : : KEEP_MUTATIONS ) { <nl> - ss < < " KEEP_MUTATIONS " ; <nl> - } <nl> - if ( options & QueryPlannerParams : : IS_COUNT ) { <nl> - ss < < " IS_COUNT " ; <nl> - } <nl> - if ( options & QueryPlannerParams : : SPLIT_LIMITED_SORT ) { <nl> - ss < < " SPLIT_LIMITED_SORT " ; <nl> - } <nl> - if ( options & QueryPlannerParams : : CANNOT_TRIM_IXISECT ) { <nl> - ss < < " CANNOT_TRIM_IXISECT " ; <nl> - } <nl> - if ( options & QueryPlannerParams : : SNAPSHOT_USE_ID ) { <nl> - ss < < " SNAPSHOT_USE_ID " ; <nl> - } <nl> - if ( options & QueryPlannerParams : : NO_UNCOVERED_PROJECTIONS ) { <nl> - ss < < " NO_UNCOVERED_PROJECTIONS " ; <nl> - } <nl> - if ( options & QueryPlannerParams : : GENERATE_COVERED_IXSCANS ) { <nl> - ss < < " GENERATE_COVERED_IXSCANS " ; <nl> - } <nl> - if ( options & QueryPlannerParams : : TRACK_LATEST_OPLOG_TS ) { <nl> - ss < < " TRACK_LATEST_OPLOG_TS " ; <nl> + while ( options ) { <nl> + / / The expression ( x & ( x - 1 ) ) yields x with the lowest bit cleared . Then the exclusive - or <nl> + / / of the result with the original yields the lowest bit by itself . <nl> + size_t new_options = options & ( options - 1 ) ; <nl> + QueryPlannerParams : : Options opt = QueryPlannerParams : : Options ( new_options ^ options ) ; <nl> + options = new_options ; <nl> + switch ( opt ) { <nl> + case QueryPlannerParams : : NO_TABLE_SCAN : <nl> + ss < < " NO_TABLE_SCAN " ; <nl> + break ; <nl> + case QueryPlannerParams : : INCLUDE_COLLSCAN : <nl> + ss < < " INCLUDE_COLLSCAN " ; <nl> + break ; <nl> + case QueryPlannerParams : : INCLUDE_SHARD_FILTER : <nl> + ss < < " INCLUDE_SHARD_FILTER " ; <nl> + break ; <nl> + case QueryPlannerParams : : NO_BLOCKING_SORT : <nl> + ss < < " NO_BLOCKING_SORT " ; <nl> + break ; <nl> + case QueryPlannerParams : : INDEX_INTERSECTION : <nl> + ss < < " INDEX_INTERSECTION " ; <nl> + break ; <nl> + case QueryPlannerParams : : KEEP_MUTATIONS : <nl> + ss < < " KEEP_MUTATIONS " ; <nl> + break ; <nl> + case QueryPlannerParams : : IS_COUNT : <nl> + ss < < " IS_COUNT " ; <nl> + break ; <nl> + case QueryPlannerParams : : SPLIT_LIMITED_SORT : <nl> + ss < < " SPLIT_LIMITED_SORT " ; <nl> + break ; <nl> + case QueryPlannerParams : : CANNOT_TRIM_IXISECT : <nl> + ss < < " CANNOT_TRIM_IXISECT " ; <nl> + break ; <nl> + case QueryPlannerParams : : SNAPSHOT_USE_ID : <nl> + ss < < " SNAPSHOT_USE_ID " ; <nl> + break ; <nl> + case QueryPlannerParams : : NO_UNCOVERED_PROJECTIONS : <nl> + ss < < " NO_UNCOVERED_PROJECTIONS " ; <nl> + break ; <nl> + case QueryPlannerParams : : GENERATE_COVERED_IXSCANS : <nl> + ss < < " GENERATE_COVERED_IXSCANS " ; <nl> + break ; <nl> + case QueryPlannerParams : : TRACK_LATEST_OPLOG_TS : <nl> + ss < < " TRACK_LATEST_OPLOG_TS " ; <nl> + case QueryPlannerParams : : DEFAULT : <nl> + MONGO_UNREACHABLE ; <nl> + break ; <nl> + } <nl> } <nl> <nl> return ss ; <nl>
|
SERVER - 31154 Make planner options stringizer check completeness at compile time .
|
mongodb/mongo
|
d1c2d57cd919bcead99fe4b37a821b7e3e4a9def
|
2017-09-19T16:01:35Z
|
mmm a / dbms / src / Functions / FunctionsHashing . h <nl> ppp b / dbms / src / Functions / FunctionsHashing . h <nl> struct JavaHashUTF16LEImpl <nl> <nl> UInt32 h = 0 ; <nl> for ( size_t i = 0 ; i < size ; i + = 2 ) <nl> - h = 31 * h + static_cast < UInt32 > ( ( data [ i ] & 0xFF ) < < HI_BYTE_SHIFT | ( data [ i + 1 ] & 0xFF ) < < LO_BYTE_SHIFT ) ; <nl> + h = 31 * h + static_cast < UInt32 > ( ( data [ i ] & 0xFF ) < < HI_BYTE_SHIFT | ( data [ i + 1 ] & 0xFF ) < < LO_BYTE_SHIFT ) ; <nl> <nl> return static_cast < Int32 > ( h ) ; <nl> } <nl>
|
Update FunctionsHashing . h
|
ClickHouse/ClickHouse
|
a120fba929ddf80922ca088d80dbd12e3aac205b
|
2019-11-06T11:20:31Z
|
mmm a / example / rnn / char_lstm . ipynb <nl> ppp b / example / rnn / char_lstm . ipynb <nl> <nl> " This example aims to show how to use lstm to build a char level language model , and generate text from it . \ n " , <nl> " We use a tiny shakespeare text for demo purpose . \ n " , <nl> " \ n " , <nl> - " Data can be found at [ https : / / github . com / dmlc / web - data / tree / master / mxnet / tinyshakespeare ] ( https : / / github . com / dmlc / web - data / tree / master / mxnet / tinyshakespeare ) . " <nl> + " Data can be found at [ https : / / github . com / dmlc / web - data / tree / master / mxnet / tinyshakespeare ] ( https : / / github . com / dmlc / web - data / tree / master / mxnet / tinyshakespeare ) . " , <nl> + " \ n " , <nl> + " If running for the first time , download the data by running the following commands : cd example / rnn ; . / get_ptb_data . sh " <nl> ] <nl> } , <nl> { <nl> <nl> " num_embed = 256 \ n " , <nl> " num_lstm_layer = 2 \ n " , <nl> " num_round = 21 \ n " , <nl> - " learning_rate = 1 \ n " , <nl> + " learning_rate = 0 . 01 \ n " , <nl> " wd = 0 . 00001 \ n " , <nl> - " momentum = 0 . 0 \ n " , <nl> " clip_gradient = 1 \ n " , <nl> " update_period = 1 \ n " <nl> ] <nl> <nl> } <nl> ] , <nl> " source " : [ <nl> - " X , dic , lookup_table = make_batch ( \ " . / input . txt \ " , batch_size = batch_size , seq_lenth = seq_len ) \ n " , <nl> + " X , dic , lookup_table = make_batch ( \ " . / data / input . txt \ " , batch_size = batch_size , seq_lenth = seq_len ) \ n " , <nl> " vocab = len ( dic ) " <nl> ] <nl> } , <nl> <nl> " update_period = update_period , \ n " , <nl> " learning_rate = learning_rate , \ n " , <nl> " wd = wd , \ n " , <nl> - " momentum = momentum , \ n " , <nl> " clip_gradient = clip_gradient ) " <nl> ] <nl> } , <nl> old mode 100644 <nl> new mode 100755 <nl> index 2b517f4ebc4 . . 1ec009aa2f9 <nl> mmm a / example / rnn / get_ptb_data . sh <nl> ppp b / example / rnn / get_ptb_data . sh <nl> <nl> - # ! / bin / env bash <nl> + # ! / usr / bin / env bash <nl> <nl> RNN_DIR = $ ( cd ` dirname $ 0 ` ; pwd ) <nl> DATA_DIR = " $ { RNN_DIR } / data / " <nl> if [ [ ! - d " $ { DATA_DIR } " ] ] ; then <nl> mkdir - p $ { DATA_DIR } <nl> fi <nl> <nl> - wget - P $ { DATA_DIR } https : / / raw . githubusercontent . com / dmlc / web - data / master / mxnet / ptb / ptb . train . txt ; <nl> + wget - P $ { DATA_DIR } https : / / raw . githubusercontent . com / dmlc / web - data / master / mxnet / ptb / ptb . train . txt ; <nl> wget - P $ { DATA_DIR } https : / / raw . githubusercontent . com / dmlc / web - data / master / mxnet / ptb / ptb . valid . txt ; <nl> wget - P $ { DATA_DIR } https : / / raw . githubusercontent . com / dmlc / web - data / master / mxnet / ptb / ptb . test . txt ; <nl> + wget - P $ { DATA_DIR } https : / / raw . githubusercontent . com / dmlc / web - data / master / mxnet / tinyshakespeare / input . txt ; <nl>
|
Fix issue
|
apache/incubator-mxnet
|
aa82d39f961a35eb8230ccd59653024e450f9d56
|
2015-12-30T21:21:32Z
|
mmm a / atom / browser / web_view / web_view_manager . cc <nl> ppp b / atom / browser / web_view / web_view_manager . cc <nl> void WebViewManager : : AddGuest ( int guest_instance_id , <nl> <nl> void WebViewManager : : RemoveGuest ( int guest_instance_id ) { <nl> auto web_contents = web_contents_map_ [ guest_instance_id ] . web_contents ; <nl> - content : : BrowserThread : : PostTask ( <nl> - content : : BrowserThread : : IO , FROM_HERE , <nl> - base : : Bind ( <nl> - & WebViewRendererState : : RemoveGuest , <nl> - base : : Unretained ( WebViewRendererState : : GetInstance ( ) ) , <nl> - web_contents - > GetRenderProcessHost ( ) - > GetID ( ) ) ) ; <nl> + <nl> + if ( web_contents ) { <nl> + content : : BrowserThread : : PostTask ( <nl> + content : : BrowserThread : : IO , FROM_HERE , <nl> + base : : Bind ( <nl> + & WebViewRendererState : : RemoveGuest , <nl> + base : : Unretained ( WebViewRendererState : : GetInstance ( ) ) , <nl> + web_contents - > GetRenderProcessHost ( ) - > GetID ( ) ) ) ; <nl> + } <nl> + <nl> web_contents_map_ . erase ( guest_instance_id ) ; <nl> <nl> / / Remove the record of element in embedder too . <nl>
|
Fix nullref crash in RemoveGuest
|
electron/electron
|
310509213007c4ae6b2341cb114a133367e41747
|
2014-12-15T14:10:39Z
|
mmm a / hphp / compiler / parser / hphp . tab . cpp <nl> ppp b / hphp / compiler / parser / hphp . tab . cpp <nl> static const yytype_uint16 yyrline [ ] = <nl> 2521 , 2523 , 2525 , 2529 , 2530 , 2532 , 2533 , 2539 , 2540 , 2542 , <nl> 2544 , 2546 , 2548 , 2551 , 2552 , 2553 , 2557 , 2558 , 2559 , 2560 , <nl> 2561 , 2562 , 2563 , 2564 , 2565 , 2569 , 2570 , 2574 , 2582 , 2584 , <nl> - 2588 , 2591 , 2597 , 2598 , 2604 , 2605 , 2612 , 2615 , 2619 , 2622 , <nl> - 2627 , 2628 , 2629 , 2630 , 2634 , 2635 , 2639 , 2641 , 2642 , 2644 , <nl> - 2648 , 2654 , 2656 , 2660 , 2663 , 2666 , 2674 , 2677 , 2680 , 2681 , <nl> - 2684 , 2687 , 2688 , 2691 , 2695 , 2699 , 2705 , 2713 , 2714 <nl> + 2588 , 2592 , 2599 , 2600 , 2606 , 2607 , 2614 , 2617 , 2621 , 2624 , <nl> + 2629 , 2630 , 2631 , 2632 , 2636 , 2637 , 2641 , 2643 , 2644 , 2646 , <nl> + 2650 , 2656 , 2658 , 2662 , 2665 , 2668 , 2676 , 2679 , 2682 , 2683 , <nl> + 2686 , 2689 , 2690 , 2693 , 2697 , 2701 , 2707 , 2715 , 2716 <nl> } ; <nl> # endif <nl> <nl> YYLTYPE yylloc ; <nl> <nl> / * Line 1806 of yacc . c * / <nl> # line 2589 " hphp . y " <nl> - { _p - > onTypedef ( ( yyval ) , ( yyvsp [ ( 2 ) - ( 5 ) ] ) , ( yyvsp [ ( 4 ) - ( 5 ) ] ) ) ; <nl> + { ( yyvsp [ ( 2 ) - ( 5 ) ] ) . setText ( _p - > nsDecl ( ( yyvsp [ ( 2 ) - ( 5 ) ] ) . text ( ) ) ) ; <nl> + _p - > onTypedef ( ( yyval ) , ( yyvsp [ ( 2 ) - ( 5 ) ] ) , ( yyvsp [ ( 4 ) - ( 5 ) ] ) ) ; <nl> _p - > popTypeScope ( ) ; } <nl> break ; <nl> <nl> case 781 : <nl> <nl> / * Line 1806 of yacc . c * / <nl> - # line 2592 " hphp . y " <nl> - { _p - > onTypedef ( ( yyval ) , ( yyvsp [ ( 2 ) - ( 6 ) ] ) , ( yyvsp [ ( 5 ) - ( 6 ) ] ) ) ; <nl> + # line 2593 " hphp . y " <nl> + { ( yyvsp [ ( 2 ) - ( 6 ) ] ) . setText ( _p - > nsDecl ( ( yyvsp [ ( 2 ) - ( 6 ) ] ) . text ( ) ) ) ; <nl> + _p - > onTypedef ( ( yyval ) , ( yyvsp [ ( 2 ) - ( 6 ) ] ) , ( yyvsp [ ( 5 ) - ( 6 ) ] ) ) ; <nl> _p - > popTypeScope ( ) ; } <nl> break ; <nl> <nl> case 782 : <nl> <nl> / * Line 1806 of yacc . c * / <nl> - # line 2597 " hphp . y " <nl> + # line 2599 " hphp . y " <nl> { ( yyval ) = ( yyvsp [ ( 1 ) - ( 1 ) ] ) ; } <nl> break ; <nl> <nl> case 783 : <nl> <nl> / * Line 1806 of yacc . c * / <nl> - # line 2598 " hphp . y " <nl> + # line 2600 " hphp . y " <nl> { only_in_hh_syntax ( _p ) ; ( yyval ) = ( yyvsp [ ( 2 ) - ( 2 ) ] ) ; } <nl> break ; <nl> <nl> case 784 : <nl> <nl> / * Line 1806 of yacc . c * / <nl> - # line 2604 " hphp . y " <nl> + # line 2606 " hphp . y " <nl> { _p - > pushTypeScope ( ) ; ( yyval ) = ( yyvsp [ ( 1 ) - ( 1 ) ] ) ; } <nl> break ; <nl> <nl> case 785 : <nl> <nl> / * Line 1806 of yacc . c * / <nl> - # line 2608 " hphp . y " <nl> + # line 2610 " hphp . y " <nl> { _p - > pushTypeScope ( ) ; ( yyval ) = ( yyvsp [ ( 1 ) - ( 4 ) ] ) ; } <nl> break ; <nl> <nl> case 786 : <nl> <nl> / * Line 1806 of yacc . c * / <nl> - # line 2614 " hphp . y " <nl> + # line 2616 " hphp . y " <nl> { ( yyval ) = ( yyvsp [ ( 2 ) - ( 3 ) ] ) ; } <nl> break ; <nl> <nl> case 787 : <nl> <nl> / * Line 1806 of yacc . c * / <nl> - # line 2615 " hphp . y " <nl> + # line 2617 " hphp . y " <nl> { ( yyval ) . reset ( ) ; } <nl> break ; <nl> <nl> case 788 : <nl> <nl> / * Line 1806 of yacc . c * / <nl> - # line 2619 " hphp . y " <nl> + # line 2621 " hphp . y " <nl> { Token t ; t . reset ( ) ; <nl> _p - > onTypeList ( ( yyvsp [ ( 1 ) - ( 1 ) ] ) , t ) ; <nl> ( yyval ) = ( yyvsp [ ( 1 ) - ( 1 ) ] ) ; } <nl> YYLTYPE yylloc ; <nl> case 789 : <nl> <nl> / * Line 1806 of yacc . c * / <nl> - # line 2622 " hphp . y " <nl> + # line 2624 " hphp . y " <nl> { _p - > onTypeList ( ( yyvsp [ ( 1 ) - ( 3 ) ] ) , ( yyvsp [ ( 3 ) - ( 3 ) ] ) ) ; <nl> ( yyval ) = ( yyvsp [ ( 1 ) - ( 3 ) ] ) ; } <nl> break ; <nl> YYLTYPE yylloc ; <nl> case 790 : <nl> <nl> / * Line 1806 of yacc . c * / <nl> - # line 2627 " hphp . y " <nl> + # line 2629 " hphp . y " <nl> { ( yyval ) = ( yyvsp [ ( 1 ) - ( 3 ) ] ) ; } <nl> break ; <nl> <nl> case 791 : <nl> <nl> / * Line 1806 of yacc . c * / <nl> - # line 2628 " hphp . y " <nl> + # line 2630 " hphp . y " <nl> { ( yyval ) = ( yyvsp [ ( 1 ) - ( 1 ) ] ) ; } <nl> break ; <nl> <nl> case 792 : <nl> <nl> / * Line 1806 of yacc . c * / <nl> - # line 2629 " hphp . y " <nl> + # line 2631 " hphp . y " <nl> { ( yyval ) . reset ( ) ; } <nl> break ; <nl> <nl> case 793 : <nl> <nl> / * Line 1806 of yacc . c * / <nl> - # line 2630 " hphp . y " <nl> + # line 2632 " hphp . y " <nl> { ( yyval ) . reset ( ) ; } <nl> break ; <nl> <nl> case 794 : <nl> <nl> / * Line 1806 of yacc . c * / <nl> - # line 2634 " hphp . y " <nl> + # line 2636 " hphp . y " <nl> { ( yyval ) . reset ( ) ; } <nl> break ; <nl> <nl> case 795 : <nl> <nl> / * Line 1806 of yacc . c * / <nl> - # line 2635 " hphp . y " <nl> + # line 2637 " hphp . y " <nl> { only_in_hh_syntax ( _p ) ; ( yyval ) = ( yyvsp [ ( 2 ) - ( 2 ) ] ) ; } <nl> break ; <nl> <nl> case 796 : <nl> <nl> / * Line 1806 of yacc . c * / <nl> - # line 2640 " hphp . y " <nl> + # line 2642 " hphp . y " <nl> { _p - > addTypeVar ( ( yyvsp [ ( 3 ) - ( 3 ) ] ) . text ( ) ) ; } <nl> break ; <nl> <nl> case 797 : <nl> <nl> / * Line 1806 of yacc . c * / <nl> - # line 2641 " hphp . y " <nl> + # line 2643 " hphp . y " <nl> { _p - > addTypeVar ( ( yyvsp [ ( 1 ) - ( 1 ) ] ) . text ( ) ) ; } <nl> break ; <nl> <nl> case 798 : <nl> <nl> / * Line 1806 of yacc . c * / <nl> - # line 2643 " hphp . y " <nl> + # line 2645 " hphp . y " <nl> { _p - > addTypeVar ( ( yyvsp [ ( 3 ) - ( 5 ) ] ) . text ( ) ) ; } <nl> break ; <nl> <nl> case 799 : <nl> <nl> / * Line 1806 of yacc . c * / <nl> - # line 2644 " hphp . y " <nl> + # line 2646 " hphp . y " <nl> { _p - > addTypeVar ( ( yyvsp [ ( 1 ) - ( 3 ) ] ) . text ( ) ) ; } <nl> break ; <nl> <nl> case 800 : <nl> <nl> / * Line 1806 of yacc . c * / <nl> - # line 2650 " hphp . y " <nl> + # line 2652 " hphp . y " <nl> { validate_shape_keyname ( ( yyvsp [ ( 1 ) - ( 3 ) ] ) , _p ) ; } <nl> break ; <nl> <nl> case 803 : <nl> <nl> / * Line 1806 of yacc . c * / <nl> - # line 2661 " hphp . y " <nl> + # line 2663 " hphp . y " <nl> { ( yyval ) = ( yyvsp [ ( 1 ) - ( 2 ) ] ) ; } <nl> break ; <nl> <nl> case 804 : <nl> <nl> / * Line 1806 of yacc . c * / <nl> - # line 2663 " hphp . y " <nl> + # line 2665 " hphp . y " <nl> { } <nl> break ; <nl> <nl> case 805 : <nl> <nl> / * Line 1806 of yacc . c * / <nl> - # line 2667 " hphp . y " <nl> + # line 2669 " hphp . y " <nl> { ( yyval ) . setText ( " array " ) ; } <nl> break ; <nl> <nl> case 806 : <nl> <nl> / * Line 1806 of yacc . c * / <nl> - # line 2674 " hphp . y " <nl> + # line 2676 " hphp . y " <nl> { only_in_hh_syntax ( _p ) ; <nl> _p - > onTypeSpecialization ( ( yyvsp [ ( 2 ) - ( 2 ) ] ) , ' ? ' ) ; <nl> ( yyval ) = ( yyvsp [ ( 2 ) - ( 2 ) ] ) ; } <nl> YYLTYPE yylloc ; <nl> case 807 : <nl> <nl> / * Line 1806 of yacc . c * / <nl> - # line 2677 " hphp . y " <nl> + # line 2679 " hphp . y " <nl> { only_in_hh_syntax ( _p ) ; <nl> _p - > onTypeSpecialization ( ( yyvsp [ ( 2 ) - ( 2 ) ] ) , ' @ ' ) ; <nl> ( yyval ) = ( yyvsp [ ( 2 ) - ( 2 ) ] ) ; } <nl> YYLTYPE yylloc ; <nl> case 808 : <nl> <nl> / * Line 1806 of yacc . c * / <nl> - # line 2680 " hphp . y " <nl> + # line 2682 " hphp . y " <nl> { ( yyval ) = ( yyvsp [ ( 1 ) - ( 1 ) ] ) ; } <nl> break ; <nl> <nl> case 809 : <nl> <nl> / * Line 1806 of yacc . c * / <nl> - # line 2681 " hphp . y " <nl> + # line 2683 " hphp . y " <nl> { Token t ; t . reset ( ) ; <nl> ( yyvsp [ ( 1 ) - ( 1 ) ] ) . setText ( " array " ) ; <nl> _p - > onTypeAnnotation ( ( yyval ) , ( yyvsp [ ( 1 ) - ( 1 ) ] ) , t ) ; } <nl> YYLTYPE yylloc ; <nl> case 810 : <nl> <nl> / * Line 1806 of yacc . c * / <nl> - # line 2684 " hphp . y " <nl> + # line 2686 " hphp . y " <nl> { Token t ; t . reset ( ) ; <nl> ( yyvsp [ ( 1 ) - ( 1 ) ] ) . setText ( " callable " ) ; <nl> _p - > onTypeAnnotation ( ( yyval ) , ( yyvsp [ ( 1 ) - ( 1 ) ] ) , t ) ; } <nl> YYLTYPE yylloc ; <nl> case 811 : <nl> <nl> / * Line 1806 of yacc . c * / <nl> - # line 2687 " hphp . y " <nl> + # line 2689 " hphp . y " <nl> { ( yyval ) = ( yyvsp [ ( 1 ) - ( 1 ) ] ) ; } <nl> break ; <nl> <nl> case 812 : <nl> <nl> / * Line 1806 of yacc . c * / <nl> - # line 2689 " hphp . y " <nl> + # line 2691 " hphp . y " <nl> { ( yyvsp [ ( 1 ) - ( 4 ) ] ) . setText ( " array " ) ; <nl> _p - > onTypeAnnotation ( ( yyval ) , ( yyvsp [ ( 1 ) - ( 4 ) ] ) , ( yyvsp [ ( 3 ) - ( 4 ) ] ) ) ; } <nl> break ; <nl> YYLTYPE yylloc ; <nl> case 813 : <nl> <nl> / * Line 1806 of yacc . c * / <nl> - # line 2692 " hphp . y " <nl> + # line 2694 " hphp . y " <nl> { _p - > onTypeList ( ( yyvsp [ ( 3 ) - ( 6 ) ] ) , ( yyvsp [ ( 5 ) - ( 6 ) ] ) ) ; <nl> ( yyvsp [ ( 1 ) - ( 6 ) ] ) . setText ( " array " ) ; <nl> _p - > onTypeAnnotation ( ( yyval ) , ( yyvsp [ ( 1 ) - ( 6 ) ] ) , ( yyvsp [ ( 3 ) - ( 6 ) ] ) ) ; } <nl> YYLTYPE yylloc ; <nl> case 814 : <nl> <nl> / * Line 1806 of yacc . c * / <nl> - # line 2695 " hphp . y " <nl> + # line 2697 " hphp . y " <nl> { ( yyvsp [ ( 1 ) - ( 1 ) ] ) . xhpLabel ( ) ; <nl> Token t ; t . reset ( ) ; <nl> _p - > onTypeAnnotation ( ( yyval ) , ( yyvsp [ ( 1 ) - ( 1 ) ] ) , t ) ; <nl> YYLTYPE yylloc ; <nl> case 815 : <nl> <nl> / * Line 1806 of yacc . c * / <nl> - # line 2701 " hphp . y " <nl> + # line 2703 " hphp . y " <nl> { only_in_hh_syntax ( _p ) ; <nl> _p - > onTypeList ( ( yyvsp [ ( 7 ) - ( 8 ) ] ) , ( yyvsp [ ( 4 ) - ( 8 ) ] ) ) ; <nl> _p - > onTypeAnnotation ( ( yyval ) , ( yyvsp [ ( 2 ) - ( 8 ) ] ) , ( yyvsp [ ( 7 ) - ( 8 ) ] ) ) ; <nl> YYLTYPE yylloc ; <nl> case 816 : <nl> <nl> / * Line 1806 of yacc . c * / <nl> - # line 2705 " hphp . y " <nl> + # line 2707 " hphp . y " <nl> { only_in_hh_syntax ( _p ) ; <nl> _p - > onTypeList ( ( yyvsp [ ( 2 ) - ( 5 ) ] ) , ( yyvsp [ ( 4 ) - ( 5 ) ] ) ) ; <nl> Token t ; t . reset ( ) ; t . setText ( " array " ) ; <nl> YYLTYPE yylloc ; <nl> case 817 : <nl> <nl> / * Line 1806 of yacc . c * / <nl> - # line 2713 " hphp . y " <nl> + # line 2715 " hphp . y " <nl> { ( yyval ) = ( yyvsp [ ( 1 ) - ( 1 ) ] ) ; } <nl> break ; <nl> <nl> case 818 : <nl> <nl> / * Line 1806 of yacc . c * / <nl> - # line 2714 " hphp . y " <nl> + # line 2716 " hphp . y " <nl> { ( yyval ) . reset ( ) ; } <nl> break ; <nl> <nl> <nl> <nl> / * Line 1806 of yacc . c * / <nl> - # line 12250 " hphp . tab . cpp " <nl> + # line 12252 " hphp . tab . cpp " <nl> default : break ; <nl> } <nl> / * User semantic actions sometimes alter yychar , and that requires <nl> YYLTYPE yylloc ; <nl> <nl> <nl> / * Line 2067 of yacc . c * / <nl> - # line 2717 " hphp . y " <nl> + # line 2719 " hphp . y " <nl> <nl> bool Parser : : parseImpl ( ) { <nl> return yyparse ( this ) = = 0 ; <nl> mmm a / hphp / parser / hphp . y <nl> ppp b / hphp / parser / hphp . y <nl> hh_opt_constraint : <nl> <nl> hh_type_alias_statement : <nl> T_TYPE hh_name_with_typevar <nl> - ' = ' hh_type ' ; ' { _p - > onTypedef ( $ $ , $ 2 , $ 4 ) ; <nl> + ' = ' hh_type ' ; ' { $ 2 . setText ( _p - > nsDecl ( $ 2 . text ( ) ) ) ; <nl> + _p - > onTypedef ( $ $ , $ 2 , $ 4 ) ; <nl> _p - > popTypeScope ( ) ; } <nl> | T_NEWTYPE hh_name_with_typevar <nl> - hh_opt_constraint ' = ' hh_type ' ; ' { _p - > onTypedef ( $ $ , $ 2 , $ 5 ) ; <nl> + hh_opt_constraint ' = ' hh_type ' ; ' { $ 2 . setText ( _p - > nsDecl ( $ 2 . text ( ) ) ) ; <nl> + _p - > onTypedef ( $ $ , $ 2 , $ 5 ) ; <nl> _p - > popTypeScope ( ) ; } <nl> ; <nl> <nl> new file mode 100644 <nl> index 00000000000 . . 97c08a762c4 <nl> mmm / dev / null <nl> ppp b / hphp / test / slow / hack_mode / typedef_namespace . php <nl> <nl> + < ? hh <nl> + <nl> + namespace test ; <nl> + <nl> + use Map ; <nl> + <nl> + type HandlerFunction = ( function ( array , ? \ string , Map < \ string , \ mixed > ) : mixed ) ; <nl> + <nl> + function t ( HandlerFunction $ f ) { <nl> + $ f ( [ ] , " " , Map { } ) ; <nl> + } <nl> + t ( function ( $ a , $ b , $ c ) { <nl> + echo " Ok " ; <nl> + } ) ; <nl> new file mode 100644 <nl> index 00000000000 . . 7326d960397 <nl> mmm / dev / null <nl> ppp b / hphp / test / slow / hack_mode / typedef_namespace . php . expect <nl> @ @ - 0 , 0 + 1 @ @ <nl> + Ok <nl>
|
Fix namespace typedefs
|
facebook/hhvm
|
faaaa3b646989147f27b2b5e30e7bdddc84ded75
|
2014-01-10T23:22:07Z
|
mmm a / tensorflow / python / autograph / core / converter . py <nl> ppp b / tensorflow / python / autograph / core / converter . py <nl> def to_ast ( self , ctx , internal_convert_user_code = None ) : <nl> ast . Node <nl> " " " <nl> template = " " " <nl> - constructor_name ( <nl> + ag__ . ConversionOptions ( <nl> recursive = recursive_val , <nl> verbose = verbose_val , <nl> strip_decorators = strip_decorators_val , <nl> def list_of_names ( values ) : <nl> <nl> def list_of_features ( values ) : <nl> return parser . parse_expression ( ' ( { } ) ' . format ( ' , ' . join ( <nl> - ' ag__ . Feature . { } ' . format ( v ) <nl> - for v in Feature . __members__ <nl> + ' ag__ . { } ' . format ( v ) <nl> + for v in Feature . __members__ . values ( ) <nl> if v in values ) ) ) <nl> <nl> - if internal_convert_user_code is not None : <nl> + if internal_convert_user_code is None : <nl> internal_convert_user_code = self . internal_convert_user_code <nl> <nl> expr_ast = templates . replace ( <nl> template , <nl> - constructor_name = parser . parse_expression ( <nl> - as_qualified_name ( ConversionOptions ) ) , <nl> recursive_val = parser . parse_expression ( str ( self . recursive ) ) , <nl> verbose_val = parser . parse_expression ( str ( int ( self . verbose ) ) ) , <nl> strip_decorators_val = list_of_names ( self . _strip_decorators ) , <nl> class ProgramContext ( object ) : <nl> required_imports : str , containing an import statement on each line . These <nl> are all the imports necessary for the compiled code to run , in addition to <nl> the closures of each entity , which are attached dynamically . <nl> + partial_types : Tuple [ Type ] , deprecated . <nl> + conversion_order : Tuple [ Any ] , deprecated . <nl> + additional_symbols : Dict [ str , Any ] , a map of new symbols that have been <nl> + created under this context , and need to be added to the namespace of the <nl> + generated code . <nl> " " " <nl> <nl> def __init__ ( <nl> mmm a / tensorflow / python / autograph / core / converter_test . py <nl> ppp b / tensorflow / python / autograph / core / converter_test . py <nl> <nl> from tensorflow . python . autograph . core import converter <nl> from tensorflow . python . autograph . core import converter_testing <nl> from tensorflow . python . autograph . pyct import anno <nl> + from tensorflow . python . autograph . pyct import compiler <nl> from tensorflow . python . autograph . pyct import parser <nl> + from tensorflow . python . autograph . pyct import templates <nl> + from tensorflow . python . autograph . pyct import transformer <nl> from tensorflow . python . platform import test <nl> <nl> <nl> class TestConverter ( converter . Base ) : <nl> pass <nl> <nl> <nl> - class ConversionOptionsTest ( test . TestCase ) : <nl> + class ConversionOptionsTest ( converter_testing . TestCase ) : <nl> + <nl> + def test_to_ast ( self ) : <nl> + opts = converter . ConversionOptions ( ) <nl> + <nl> + namer = converter_testing . FakeNamer ( ) <nl> + program_ctx = converter . ProgramContext ( <nl> + options = opts , <nl> + partial_types = None , <nl> + autograph_module = None , <nl> + uncompiled_modules = ( ) ) <nl> + entity_info = transformer . EntityInfo ( <nl> + source_code = ' ' , <nl> + source_file = ' < fragment > ' , <nl> + namespace = { } , <nl> + arg_values = None , <nl> + arg_types = { } , <nl> + owner_type = None ) <nl> + ctx = converter . EntityContext ( namer , entity_info , program_ctx ) <nl> + opts_ast = opts . to_ast ( ctx ) <nl> + <nl> + template = ' ' ' <nl> + def test_fn ( ) : <nl> + return opts_ast <nl> + ' ' ' <nl> + opts_packed = templates . replace ( template , opts_ast = opts_ast ) <nl> + <nl> + reparsed , _ = compiler . ast_to_object ( opts_packed ) <nl> + reparsed . __dict__ [ ' ag__ ' ] = self . make_fake_mod ( <nl> + ' fake_ag ' , converter . ConversionOptions , converter . Feature ) <nl> + <nl> + reparsed_opts = reparsed . test_fn ( ) <nl> + <nl> + self . assertEqual ( opts . recursive , reparsed_opts . recursive ) <nl> + self . assertEqual ( opts . verbose , reparsed_opts . verbose ) <nl> + self . assertEqual ( opts . force_conversion , reparsed_opts . force_conversion ) <nl> + self . assertEqual ( <nl> + opts . internal_convert_user_code , <nl> + reparsed_opts . internal_convert_user_code ) <nl> + self . assertEqual ( opts . optional_features , reparsed_opts . optional_features ) <nl> <nl> def test_should_strip_weakrefs ( self ) : <nl> def test_fn ( ) : <nl> mmm a / tensorflow / python / autograph / core / converter_testing . py <nl> ppp b / tensorflow / python / autograph / core / converter_testing . py <nl> <nl> from tensorflow . python . platform import test <nl> <nl> <nl> + RESULT_OF_MOCK_CONVERTED_CALL = 7 <nl> + <nl> + <nl> def imported_decorator ( f ) : <nl> return lambda a : f ( a ) + 1 <nl> <nl> class FakeNamer ( object ) : <nl> <nl> def __init__ ( self ) : <nl> self . i = 0 <nl> + self . partial_types = ( ) <nl> <nl> def new_symbol ( self , name_root , used ) : <nl> while True : <nl> def compiled ( self , node , namespace , * symbols ) : <nl> self . dynamic_calls = [ ] <nl> def converted_call ( * args ) : <nl> " " " Mock version of api . converted_call . " " " <nl> - self . dynamic_calls . append ( args ) <nl> - return 7 <nl> + self . dynamic_calls . append ( args [ 3 : ] ) # args only ; see api . converted_call <nl> + return RESULT_OF_MOCK_CONVERTED_CALL <nl> <nl> try : <nl> result , source = compiler . ast_to_object ( node , include_source_map = True ) <nl> def converted_call ( * args ) : <nl> converter . ConversionOptions ) <nl> fake_ag . __dict__ . update ( operators . __dict__ ) <nl> fake_ag . __dict__ . update ( special_functions . __dict__ ) <nl> - fake_ag . __dict__ [ ' utils ' ] = utils <nl> - fake_ag . __dict__ [ ' rewrite_graph_construction_error ' ] = ( <nl> + fake_ag . ConversionOptions = converter . ConversionOptions <nl> + fake_ag . Feature = converter . Feature <nl> + fake_ag . utils = utils <nl> + fake_ag . rewrite_graph_construction_error = ( <nl> errors . rewrite_graph_construction_error ) <nl> - fake_ag . __dict__ [ ' function_scope ' ] = function_wrapping . function_scope <nl> - result . __dict__ [ ' ag__ ' ] = fake_ag <nl> + fake_ag . function_scope = function_wrapping . function_scope <nl> + result . ag__ = fake_ag <nl> for k , v in namespace . items ( ) : <nl> result . __dict__ [ k ] = v <nl> yield result <nl> mmm a / tensorflow / python / autograph / impl / conversion . py <nl> ppp b / tensorflow / python / autograph / impl / conversion . py <nl> <nl> from tensorflow . python . autograph . pyct import qual_names <nl> from tensorflow . python . autograph . pyct import templates <nl> from tensorflow . python . autograph . pyct import transformer <nl> - from tensorflow . python . platform import tf_logging as logging <nl> + from tensorflow . python . autograph . utils import ag_logging as logging <nl> from tensorflow . python . util import tf_inspect <nl> <nl> <nl> def is_whitelisted_for_graph ( o ) : <nl> else : <nl> m = tf_inspect . getmodule ( o ) <nl> if not hasattr ( m , ' __name__ ' ) : <nl> - logging . vlog ( 1 , ' % s is NOT whitelisted for graph : unknown module name ' , o ) <nl> + # Note : typically it ' s builtins that fall in this category . Builtins will <nl> + # be handled by specific code that follows this screening layer . <nl> + logging . log ( 2 , ' % s is NOT whitelisted : unknown module name ' , o ) <nl> return False <nl> <nl> for prefix , in config . DEFAULT_UNCOMPILED_MODULES : <nl> if m . __name__ . startswith ( prefix ) : <nl> - logging . vlog ( 1 , ' % s is whitelisted : name starts with " % s " ' , o , prefix ) <nl> + logging . log ( 2 , ' % s is whitelisted : name starts with " % s " ' , o , prefix ) <nl> return True <nl> <nl> - if hasattr ( o , ' autograph_info__ ' ) : <nl> + if hasattr ( o , ' autograph_info__ ' ) or hasattr ( o , ' __ag_compiled ' ) : <nl> + logging . log ( 2 , ' % s is whitelisted : already converted ' , o ) <nl> return True <nl> <nl> if ( not inspect_utils . isweakrefself ( o ) and not tf_inspect . isclass ( o ) and <nl> hasattr ( o , ' __call__ ' ) and hasattr ( o , ' __class__ ' ) ) : <nl> # Callable objects : whitelisted if their __call__ method is . <nl> - retval = is_whitelisted_for_graph ( o . __call__ ) <nl> - logging . vlog ( 1 , ' % s is whitelisted : object __call__ whitelisted ' , o ) <nl> - return retval <nl> + call_whitelisted = is_whitelisted_for_graph ( o . __call__ ) <nl> + if call_whitelisted : <nl> + logging . log ( 2 , ' % s is whitelisted : object __call__ whitelisted ' , o ) <nl> + return call_whitelisted <nl> <nl> if tf_inspect . ismethod ( o ) : <nl> # Methods of whitelisted classes are also whitelisted , even if they are <nl> def is_whitelisted_for_graph ( o ) : <nl> if owner_class is not None : <nl> owner_class = inspect_utils . getdefiningclass ( o , owner_class ) <nl> if is_whitelisted_for_graph ( owner_class ) : <nl> - logging . vlog ( 1 , ' % s is whitelisted : owner is whitelisted % s ' , o , <nl> - owner_class ) <nl> + logging . log ( 2 , ' % s is whitelisted : owner is whitelisted % s ' , o , <nl> + owner_class ) <nl> return True <nl> <nl> if inspect_utils . isnamedtuple ( o ) : <nl> def is_whitelisted_for_graph ( o ) : <nl> # because they don ' t expose source code . But we assume they are safe for <nl> # graph mode since they are just containers . <nl> if tf_inspect . isclass ( o ) and len ( o . __bases__ ) > 1 : <nl> - logging . log_first_n ( <nl> - logging . level_warning ( ) , <nl> + logging . warn_first_n ( <nl> ' Entity { } looks like a namedtuple subclass . If it has any custom ' <nl> ' methods , they will not be converted by AutoGraph . ' . format ( o ) , 1 ) <nl> - logging . vlog ( 1 , ' % s is whitelisted : named tuple ' , o ) <nl> + logging . log ( 2 , ' % s is whitelisted : named tuple ' , o ) <nl> return True <nl> <nl> - logging . vlog ( 1 , ' % s is NOT whitelisted for graph ' , o ) <nl> + logging . log ( 2 , ' % s is NOT whitelisted ' , o ) <nl> return False <nl> <nl> <nl> def entity_to_graph ( o , program_ctx , arg_values , arg_types ) : <nl> Raises : <nl> ValueError : if the entity type is not supported . <nl> " " " <nl> - logging . vlog ( logging . DEBUG , ' Converting % s ' , o ) <nl> + logging . log ( 1 , ' Converting % s ' , o ) <nl> <nl> if tf_inspect . isclass ( o ) : <nl> node , name , ns = class_to_graph ( o , program_ctx ) <nl> def entity_to_graph ( o , program_ctx , arg_values , arg_types ) : <nl> <nl> program_ctx . add_to_cache ( o , node ) <nl> <nl> - if logging . get_verbosity ( ) < = logging . DEBUG : <nl> - logging . vlog ( logging . DEBUG , ' Compiled output of % s : \ n \ n % s \ n ' , o , <nl> - compiler . ast_to_source ( node ) ) <nl> + if logging . has_verbosity ( 2 ) : <nl> + logging . log ( 2 , ' Compiled output of % s : \ n \ n % s \ n ' , o , <nl> + compiler . ast_to_source ( node ) ) <nl> <nl> if program_ctx . options . recursive : <nl> while True : <nl> def _add_self_references ( namespace , autograph_module ) : <nl> # internal modules . <nl> ag_internal = imp . new_module ( ' autograph ' ) <nl> ag_internal . __dict__ . update ( autograph_module . __dict__ ) <nl> + ag_internal . ConversionOptions = converter . ConversionOptions <nl> + ag_internal . Feature = converter . Feature <nl> ag_internal . utils = utils <nl> ag_internal . function_scope = function_wrapping . function_scope <nl> ag_internal . rewrite_graph_construction_error = ( <nl>
|
Use static names in ConversionOptions . to_ast , because they are stable and well - known . Properly recognize cases when conversion is applied to a function that already has autograph decorators . Make it a bit more obvious that converted_call is mocked in the tests that do it . Add even more logging .
|
tensorflow/tensorflow
|
c8a2c9eacd27d4334bd52e48a4a22cb507700942
|
2019-01-24T23:42:44Z
|
mmm a / include / external / clara . hpp <nl> ppp b / include / external / clara . hpp <nl> namespace detail { <nl> <nl> protected : <nl> ResultBase ( Type type ) : m_type ( type ) { } <nl> + virtual ~ ResultBase ( ) = default ; <nl> <nl> virtual void enforceOk ( ) const = 0 ; <nl> <nl> namespace detail { <nl> <nl> class ParserBase { <nl> public : <nl> + virtual ~ ParserBase ( ) = default ; <nl> virtual auto validate ( ) const - > Result { return Result : : ok ( ) ; } <nl> <nl> virtual auto parse ( std : : string const & exeName , TokenStream const & tokens ) const - > InternalParseResult = 0 ; <nl> mmm a / third_party / clara . hpp <nl> ppp b / third_party / clara . hpp <nl> namespace detail { <nl> <nl> protected : <nl> ResultBase ( Type type ) : m_type ( type ) { } <nl> + virtual ~ ResultBase ( ) = default ; <nl> <nl> virtual void enforceOk ( ) const = 0 ; <nl> <nl> namespace detail { <nl> <nl> class ParserBase { <nl> public : <nl> + virtual ~ ParserBase ( ) = default ; <nl> virtual auto validate ( ) const - > Result { return Result : : ok ( ) ; } <nl> <nl> virtual auto parse ( std : : string const & exeName , TokenStream const & tokens ) const - > InternalParseResult = 0 ; <nl>
|
added version of Clara that has virtual destructors
|
catchorg/Catch2
|
d81c1eb00699e469d13b998c222a929d121cb0d1
|
2017-06-20T21:35:35Z
|
mmm a / doc / guide . md <nl> ppp b / doc / guide . md <nl> Because the different nature of the two types of models , different strategy will <nl> nodes ( selected using a ring replication strategy ) . The checkpoint is only saved in the memory without touching the disk which makes rabit programs more efficient . <nl> User is encouraged to use ` ` ` global_model ` ` ` only when is sufficient for better efficiency . <nl> <nl> - To enable a model class to be checked pointed , user can implement a [ serialization interface ] ( . . / include / rabit_serialization . h ) . The serialization interface already <nl> + To enable a model class to be checked pointed , user can implement a [ serialization interface ] ( https : / / github . com / dmlc / rabit / blob / master / include / rabit_serialization . h ) . The serialization interface already <nl> provide serialization functions of STL vector and string . For python API , user can checkpoint any python object that can be pickled . <nl> <nl> There is a special Checkpoint function called [ LazyCheckpoint ] ( http : / / homes . cs . washington . edu / ~ tqchen / rabit / doc / namespacerabit . html # a99f74c357afa5fba2c80cc0363e4e459 ) , <nl> improve the efficiency of the program . <nl> Compile Programs with Rabit <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> Rabit is a portable library , to use it , you only need to include the rabit header file . <nl> - * You will need to add the path to [ . . / include ] ( . . / include ) to the header search path of the compiler <nl> + * You will need to add the path to [ . . / include ] ( https : / / github . com / dmlc / rabit / blob / master / include ) to the header search path of the compiler <nl> - Solution 1 : add ` ` ` - I / path / to / rabit / include ` ` ` to the compiler flag in gcc or clang <nl> - Solution 2 : add the path to the environment variable CPLUS_INCLUDE_PATH <nl> - * You will need to add the path to [ . . / lib ] ( . . / lib ) to the library search path of the compiler <nl> + * You will need to add the path to [ . . / lib ] ( https : / / github . com / dmlc / rabit / blob / master / lib ) to the library search path of the compiler <nl> - Solution 1 : add ` ` ` - L / path / to / rabit / lib ` ` ` to the linker flag <nl> - Solution 2 : add the path to environment variable LIBRARY_PATH AND LD_LIBRARY_PATH <nl> * Link against lib / rabit . a <nl>
|
final change
|
dmlc/xgboost
|
aefc05cb91a1c475889c87330ac14b81edad8a19
|
2015-07-27T04:09:58Z
|
mmm a / stdlib / runtime / Heap . cpp <nl> ppp b / stdlib / runtime / Heap . cpp <nl> void _swift_refillThreadAllocCache ( AllocIndex idx , uintptr_t flags ) { <nl> <nl> void * SwiftZone : : slowAlloc_optimized ( size_t size , size_t alignMask , <nl> uintptr_t flags ) { <nl> + / / llvm : : RoundUpToAlignment ( size , alignMask + 1 ) generates terrible code <nl> + size = ( size + alignMask ) & ~ alignMask ; <nl> AllocIndex idx = sizeToIndex ( size ) ; <nl> if ( idx = = badAllocIndex ) { <nl> / / large allocations <nl> void * SwiftZone : : slowAlloc_systemMalloc ( size_t size , size_t alignMask , <nl> void SwiftZone : : slowDealloc_optimized ( void * ptr , size_t bytes , <nl> size_t alignMask ) { <nl> assert ( bytes ! = 0 ) ; <nl> - AllocIndex idx = sizeToIndex ( bytes ) ; <nl> + auto size = ( bytes + alignMask ) & ~ alignMask ; <nl> + AllocIndex idx = sizeToIndex ( size ) ; <nl> if ( idx = = badAllocIndex ) { <nl> swiftZone . writeLock ( ) ; <nl> auto it2 = swiftZone . hugeAllocations . find ( ptr ) ; <nl> mmm a / stdlib / runtime / HeapObject . cpp <nl> ppp b / stdlib / runtime / HeapObject . cpp <nl> static HeapObject * <nl> _swift_allocObject_ ( HeapMetadata const * metadata , size_t requiredSize , <nl> size_t requiredAlignmentMask ) { <nl> assert ( isAlignmentMask ( requiredAlignmentMask ) ) ; <nl> - / / llvm : : RoundUpToAlignment ( size , mask + 1 ) generates terrible code <nl> - auto size = ( requiredSize + requiredAlignmentMask ) & ~ requiredAlignmentMask ; <nl> auto object = reinterpret_cast < HeapObject * > ( <nl> - swift_slowAlloc ( size , requiredAlignmentMask , 0 ) ) ; <nl> + swift_slowAlloc ( requiredSize , requiredAlignmentMask , 0 ) ) ; <nl> object - > metadata = metadata ; <nl> object - > refCount = RC_INTERVAL ; <nl> object - > weakRefCount = WRC_INTERVAL ; <nl> new file mode 100644 <nl> index 000000000000 . . e6b091a7c439 <nl> mmm / dev / null <nl> ppp b / test / stdlib / alloc_rounding . swift <nl> <nl> + / / RUN : % target - run - simple - swift | FileCheck % s <nl> + <nl> + struct Buffer32 { <nl> + var x0 : UInt64 = 0 <nl> + var x1 : UInt64 = 0 <nl> + var x2 : UInt64 = 0 <nl> + var x3 : UInt64 = 0 <nl> + } <nl> + <nl> + func foo ( ) - > UInt64 { <nl> + var buffer = Buffer32 ( ) <nl> + var v0 : UInt64 = 1 <nl> + var v1 : UInt64 = 2 <nl> + var b : Bool = true <nl> + return withUnsafePointer ( & buffer ) { bufferPtr in <nl> + bufferPtr . memory . x0 = 5 <nl> + bufferPtr . memory . x1 = v0 <nl> + bufferPtr . memory . x2 = v1 <nl> + bufferPtr . memory . x3 = b ? v0 : v1 <nl> + return bufferPtr . memory . x3 <nl> + } <nl> + } <nl> + <nl> + / / CHECK : 1 <nl> + println ( foo ( ) ) <nl>
|
Allocator : round the size of an allocation up to the alignment on all allocation and deallocation paths .
|
apple/swift
|
37d69a42071b6ce44f595a5de6b180aeda4bfdee
|
2014-07-03T02:11:50Z
|
mmm a / src / mongo / bson / bsonmisc . h <nl> ppp b / src / mongo / bson / bsonmisc . h <nl> namespace mongo { <nl> BSON ( " a " < < GT < < 23 . 4 < < NE < < 30 < < " b " < < 2 ) produces the object <nl> { a : { \ $ gt : 23 . 4 , \ $ ne : 30 } , b : 2 } . <nl> * / <nl> - # define BSON ( x ) ( ( mongo : : BSONObjBuilder ( 64 ) < < x ) . obj ( ) ) <nl> + # define BSON ( x ) ( ( : : mongo : : BSONObjBuilder ( 64 ) < < x ) . obj ( ) ) <nl> <nl> / * * Use BSON_ARRAY macro like BSON macro , but without keys <nl> <nl> BSONArray arr = BSON_ARRAY ( " hello " < < 1 < < BSON ( " foo " < < BSON_ARRAY ( " bar " < < " baz " < < " qux " ) ) ) ; <nl> <nl> * / <nl> - # define BSON_ARRAY ( x ) ( ( mongo : : BSONArrayBuilder ( ) < < x ) . arr ( ) ) <nl> + # define BSON_ARRAY ( x ) ( ( : : mongo : : BSONArrayBuilder ( ) < < x ) . arr ( ) ) <nl> <nl> / * Utility class to auto assign object IDs . <nl> Example : <nl> mmm a / src / mongo / client / dbclientinterface . h <nl> ppp b / src / mongo / client / dbclientinterface . h <nl> namespace mongo { <nl> / * * Typically one uses the QUERY ( . . . ) macro to construct a Query object . <nl> Example : QUERY ( " age " < < 33 < < " school " < < " UCLA " ) <nl> * / <nl> - # define QUERY ( x ) mongo : : Query ( BSON ( x ) ) <nl> + # define QUERY ( x ) : : mongo : : Query ( BSON ( x ) ) <nl> <nl> / / Useful utilities for namespaces <nl> / * * @ return the database name portion of an ns string * / <nl> mmm a / src / mongo / util / allocator . h <nl> ppp b / src / mongo / util / allocator . h <nl> namespace mongo { <nl> return x ; <nl> } <nl> <nl> - # define MONGO_malloc mongo : : ourmalloc <nl> - # define MONGO_realloc mongo : : ourrealloc <nl> + # define MONGO_malloc : : mongo : : ourmalloc <nl> + # define MONGO_realloc : : mongo : : ourrealloc <nl> <nl> / / this redefines ' malloc ' to ' MONGO_malloc ' , etc <nl> # include " mongo / client / redef_macros . h " <nl> mmm a / src / mongo / util / assert_util . h <nl> ppp b / src / mongo / util / assert_util . h <nl> namespace mongo { <nl> <nl> <nl> / * " user assert " . if asserts , user did something wrong , not our code * / <nl> - # define MONGO_uassert ( msgid , msg , expr ) ( void ) ( MONGO_likely ( ! ! ( expr ) ) | | ( mongo : : uasserted ( msgid , msg ) , 0 ) ) <nl> + # define MONGO_uassert ( msgid , msg , expr ) ( void ) ( MONGO_likely ( ! ! ( expr ) ) | | ( : : mongo : : uasserted ( msgid , msg ) , 0 ) ) <nl> <nl> inline void uassertStatusOK ( const Status & status ) { <nl> if ( MONGO_unlikely ( ! status . isOK ( ) ) ) { <nl> namespace mongo { <nl> } <nl> <nl> / * warning only - keeps going * / <nl> - # define MONGO_wassert ( _Expression ) ( void ) ( MONGO_likely ( ! ! ( _Expression ) ) | | ( mongo : : wasserted ( # _Expression , __FILE__ , __LINE__ ) , 0 ) ) <nl> + # define MONGO_wassert ( _Expression ) ( void ) ( MONGO_likely ( ! ! ( _Expression ) ) | | ( : : mongo : : wasserted ( # _Expression , __FILE__ , __LINE__ ) , 0 ) ) <nl> <nl> / * display a message , no context , and throw assertionexception <nl> <nl> easy way to throw an exception and log something without our stack trace <nl> display happening . <nl> * / <nl> - # define MONGO_massert ( msgid , msg , expr ) ( void ) ( MONGO_likely ( ! ! ( expr ) ) | | ( mongo : : msgasserted ( msgid , msg ) , 0 ) ) <nl> + # define MONGO_massert ( msgid , msg , expr ) ( void ) ( MONGO_likely ( ! ! ( expr ) ) | | ( : : mongo : : msgasserted ( msgid , msg ) , 0 ) ) <nl> / * same as massert except no msgid * / <nl> - # define MONGO_verify ( _Expression ) ( void ) ( MONGO_likely ( ! ! ( _Expression ) ) | | ( mongo : : verifyFailed ( # _Expression , __FILE__ , __LINE__ ) , 0 ) ) <nl> + # define MONGO_verify ( _Expression ) ( void ) ( MONGO_likely ( ! ! ( _Expression ) ) | | ( : : mongo : : verifyFailed ( # _Expression , __FILE__ , __LINE__ ) , 0 ) ) <nl> <nl> / * dassert is ' debug assert ' - - might want to turn off for production as these <nl> could be slow . <nl>
|
SERVER - 6219 : Use : : mongo in macros
|
mongodb/mongo
|
eb22c8e590a60dde9adde997f34cddcea9d166f8
|
2013-09-13T14:50:07Z
|
mmm a / README . md <nl> ppp b / README . md <nl> Cream Sandwich ) . <nl> The [ Java demo ] ( https : / / libphonenumber . appspot . com / ) is updated with a slight <nl> delay after the GitHub release . <nl> <nl> - Last demo update : v8 . 9 . 12 . <nl> + Last demo update : v8 . 9 . 13 . <nl> <nl> If this number is lower than the [ latest release ' s version <nl> number ] ( https : / / github . com / googlei18n / libphonenumber / releases ) , we are between <nl>
|
Update README . md ( )
|
google/libphonenumber
|
a967434364745293dc050580a9e8072ee54fd1c2
|
2018-09-07T01:16:27Z
|
mmm a / test / functional / feature_config_args . py <nl> ppp b / test / functional / feature_config_args . py <nl> <nl> " " " Test various command line arguments and configuration file parameters . " " " <nl> <nl> import os <nl> + import re <nl> <nl> from test_framework . test_framework import BitcoinTestFramework <nl> from test_framework . util import get_datadir_path <nl> def run_test ( self ) : <nl> <nl> # Check that using - datadir argument on non - existent directory fails <nl> self . nodes [ 0 ] . datadir = new_data_dir <nl> - self . assert_start_raises_init_error ( 0 , [ ' - datadir = ' + new_data_dir ] , ' Error : Specified data directory " ' + new_data_dir + ' " does not exist . ' ) <nl> + self . nodes [ 0 ] . assert_start_raises_init_error ( [ ' - datadir = ' + new_data_dir ] , ' Error : Specified data directory " ' + re . escape ( new_data_dir ) + ' " does not exist . ' ) <nl> <nl> # Check that using non - existent datadir in conf file fails <nl> conf_file = os . path . join ( default_data_dir , " bitcoin . conf " ) <nl> with open ( conf_file , ' a ' , encoding = ' utf8 ' ) as f : <nl> f . write ( " datadir = " + new_data_dir + " \ n " ) <nl> - self . assert_start_raises_init_error ( 0 , [ ' - conf = ' + conf_file ] , ' Error reading configuration file : specified data directory " ' + new_data_dir + ' " does not exist . ' ) <nl> + self . nodes [ 0 ] . assert_start_raises_init_error ( [ ' - conf = ' + conf_file ] , ' Error reading configuration file : specified data directory " ' + re . escape ( new_data_dir ) + ' " does not exist . ' ) <nl> <nl> # Create the directory and ensure the config file now works <nl> os . mkdir ( new_data_dir ) <nl> mmm a / test / functional / feature_logging . py <nl> ppp b / test / functional / feature_logging . py <nl> def run_test ( self ) : <nl> invdir = os . path . join ( self . nodes [ 0 ] . datadir , " regtest " , " foo " ) <nl> invalidname = os . path . join ( " foo " , " foo . log " ) <nl> self . stop_node ( 0 ) <nl> - self . assert_start_raises_init_error ( 0 , [ " - debuglogfile = % s " % ( invalidname ) ] , <nl> - " Error : Could not open debug log file " ) <nl> + exp_stderr = " Error : Could not open debug log file \ S + $ " <nl> + self . nodes [ 0 ] . assert_start_raises_init_error ( [ " - debuglogfile = % s " % ( invalidname ) ] , exp_stderr ) <nl> assert not os . path . isfile ( os . path . join ( invdir , " foo . log " ) ) <nl> <nl> # check that invalid log ( relative ) works after path exists <nl> def run_test ( self ) : <nl> self . stop_node ( 0 ) <nl> invdir = os . path . join ( self . options . tmpdir , " foo " ) <nl> invalidname = os . path . join ( invdir , " foo . log " ) <nl> - self . assert_start_raises_init_error ( 0 , [ " - debuglogfile = % s " % invalidname ] , <nl> - " Error : Could not open debug log file " ) <nl> + self . nodes [ 0 ] . assert_start_raises_init_error ( [ " - debuglogfile = % s " % invalidname ] , exp_stderr ) <nl> assert not os . path . isfile ( os . path . join ( invdir , " foo . log " ) ) <nl> <nl> # check that invalid log ( absolute ) works after path exists <nl> mmm a / test / functional / feature_uacomment . py <nl> ppp b / test / functional / feature_uacomment . py <nl> <nl> # file COPYING or http : / / www . opensource . org / licenses / mit - license . php . <nl> " " " Test the - uacomment option . " " " <nl> <nl> + import re <nl> + <nl> from test_framework . test_framework import BitcoinTestFramework <nl> from test_framework . util import assert_equal <nl> <nl> + <nl> class UacommentTest ( BitcoinTestFramework ) : <nl> def set_test_params ( self ) : <nl> self . num_nodes = 1 <nl> def run_test ( self ) : <nl> <nl> self . log . info ( " test - uacomment max length " ) <nl> self . stop_node ( 0 ) <nl> - expected = " exceeds maximum length ( 256 ) . Reduce the number or size of uacomments . " <nl> - self . assert_start_raises_init_error ( 0 , [ " - uacomment = " + ' a ' * 256 ] , expected ) <nl> + expected = " Error : Total length of network version string \ ( [ 0 - 9 ] + \ ) exceeds maximum length \ ( 256 \ ) . Reduce the number or size of uacomments . " <nl> + self . nodes [ 0 ] . assert_start_raises_init_error ( [ " - uacomment = " + ' a ' * 256 ] , expected ) <nl> <nl> self . log . info ( " test - uacomment unsafe characters " ) <nl> for unsafe_char in [ ' / ' , ' : ' , ' ( ' , ' ) ' ] : <nl> - expected = " User Agent comment ( " + unsafe_char + " ) contains unsafe characters " <nl> - self . assert_start_raises_init_error ( 0 , [ " - uacomment = " + unsafe_char ] , expected ) <nl> + expected = " Error : User Agent comment \ ( " + re . escape ( unsafe_char ) + " \ ) contains unsafe characters . " <nl> + self . nodes [ 0 ] . assert_start_raises_init_error ( [ " - uacomment = " + unsafe_char ] , expected ) <nl> + <nl> <nl> if __name__ = = ' __main__ ' : <nl> UacommentTest ( ) . main ( ) <nl> mmm a / test / functional / test_framework / test_framework . py <nl> ppp b / test / functional / test_framework / test_framework . py <nl> def restart_node ( self , i , extra_args = None ) : <nl> self . stop_node ( i ) <nl> self . start_node ( i , extra_args ) <nl> <nl> - def assert_start_raises_init_error ( self , i , extra_args = None , expected_msg = None , * args , * * kwargs ) : <nl> - with tempfile . SpooledTemporaryFile ( max_size = 2 * * 16 ) as log_stderr : <nl> - try : <nl> - self . start_node ( i , extra_args , stderr = log_stderr , * args , * * kwargs ) <nl> - self . stop_node ( i ) <nl> - except Exception as e : <nl> - assert ' bitcoind exited ' in str ( e ) # node must have shutdown <nl> - self . nodes [ i ] . running = False <nl> - self . nodes [ i ] . process = None <nl> - if expected_msg is not None : <nl> - log_stderr . seek ( 0 ) <nl> - stderr = log_stderr . read ( ) . decode ( ' utf - 8 ' ) <nl> - if expected_msg not in stderr : <nl> - raise AssertionError ( " Expected error \ " " + expected_msg + " \ " not found in : \ n " + stderr ) <nl> - else : <nl> - if expected_msg is None : <nl> - assert_msg = " bitcoind should have exited with an error " <nl> - else : <nl> - assert_msg = " bitcoind should have exited with expected error " + expected_msg <nl> - raise AssertionError ( assert_msg ) <nl> - <nl> def wait_for_node_exit ( self , i , timeout ) : <nl> self . nodes [ i ] . process . wait ( timeout ) <nl> <nl> mmm a / test / functional / test_framework / test_node . py <nl> ppp b / test / functional / test_framework / test_node . py <nl> <nl> import os <nl> import re <nl> import subprocess <nl> + import tempfile <nl> import time <nl> <nl> from . authproxy import JSONRPCException <nl> def is_node_stopped ( self ) : <nl> def wait_until_stopped ( self , timeout = BITCOIND_PROC_WAIT_TIMEOUT ) : <nl> wait_until ( self . is_node_stopped , timeout = timeout ) <nl> <nl> + def assert_start_raises_init_error ( self , extra_args = None , expected_msg = None , partial_match = False , * args , * * kwargs ) : <nl> + " " " Attempt to start the node and expect it to raise an error . <nl> + <nl> + extra_args : extra arguments to pass through to bitcoind <nl> + expected_msg : regex that stderr should match when bitcoind fails <nl> + <nl> + Will throw if bitcoind starts without an error . <nl> + Will throw if an expected_msg is provided and it does not match bitcoind ' s stdout . " " " <nl> + with tempfile . SpooledTemporaryFile ( max_size = 2 * * 16 ) as log_stderr : <nl> + try : <nl> + self . start ( extra_args , stderr = log_stderr , * args , * * kwargs ) <nl> + self . wait_for_rpc_connection ( ) <nl> + self . stop_node ( ) <nl> + self . wait_util_stopped ( ) <nl> + except Exception as e : <nl> + assert ' bitcoind exited ' in str ( e ) # node must have shutdown <nl> + self . running = False <nl> + self . process = None <nl> + # Check stderr for expected message <nl> + if expected_msg is not None : <nl> + log_stderr . seek ( 0 ) <nl> + stderr = log_stderr . read ( ) . decode ( ' utf - 8 ' ) . strip ( ) <nl> + if partial_match : <nl> + if re . search ( expected_msg , stderr , flags = re . MULTILINE ) is None : <nl> + raise AssertionError ( ' Expected message " { } " does not partially match stderr : \ n " { } " ' . format ( expected_msg , stderr ) ) <nl> + else : <nl> + if re . fullmatch ( expected_msg , stderr ) is None : <nl> + raise AssertionError ( ' Expected message " { } " does not fully match stderr : \ n " { } " ' . format ( expected_msg , stderr ) ) <nl> + else : <nl> + if expected_msg is None : <nl> + assert_msg = " bitcoind should have exited with an error " <nl> + else : <nl> + assert_msg = " bitcoind should have exited with expected error " + expected_msg <nl> + raise AssertionError ( assert_msg ) <nl> + <nl> def node_encrypt_wallet ( self , passphrase ) : <nl> " " " " Encrypts the wallet . <nl> <nl> mmm a / test / functional / wallet_hd . py <nl> ppp b / test / functional / wallet_hd . py <nl> def run_test ( self ) : <nl> <nl> # Make sure can ' t switch off usehd after wallet creation <nl> self . stop_node ( 1 ) <nl> - self . assert_start_raises_init_error ( 1 , [ ' - usehd = 0 ' ] , ' already existing HD wallet ' ) <nl> + self . nodes [ 1 ] . assert_start_raises_init_error ( [ ' - usehd = 0 ' ] , " Error : Error loading : You can ' t disable HD on an already existing HD wallet " ) <nl> self . start_node ( 1 ) <nl> connect_nodes_bi ( self . nodes , 0 , 1 ) <nl> <nl> mmm a / test / functional / wallet_multiwallet . py <nl> ppp b / test / functional / wallet_multiwallet . py <nl> <nl> Verify that a bitcoind node can load multiple wallet files <nl> " " " <nl> import os <nl> + import re <nl> import shutil <nl> <nl> from test_framework . test_framework import BitcoinTestFramework <nl> def run_test ( self ) : <nl> assert_equal ( os . path . isfile ( wallet_dir ( wallet_name ) ) , True ) <nl> <nl> # should not initialize if wallet path can ' t be created <nl> - self . assert_start_raises_init_error ( 0 , [ ' - wallet = wallet . dat / bad ' ] , ' Not a directory ' ) <nl> + exp_stderr = " boost : : filesystem : : create_directory : ( The system cannot find the path specified | Not a directory ) : " <nl> + self . nodes [ 0 ] . assert_start_raises_init_error ( [ ' - wallet = wallet . dat / bad ' ] , exp_stderr , partial_match = True ) <nl> <nl> - self . assert_start_raises_init_error ( 0 , [ ' - walletdir = wallets ' ] , ' Error : Specified - walletdir " wallets " does not exist ' ) <nl> - self . assert_start_raises_init_error ( 0 , [ ' - walletdir = wallets ' ] , ' Error : Specified - walletdir " wallets " is a relative path ' , cwd = data_dir ( ) ) <nl> - self . assert_start_raises_init_error ( 0 , [ ' - walletdir = debug . log ' ] , ' Error : Specified - walletdir " debug . log " is not a directory ' , cwd = data_dir ( ) ) <nl> + self . nodes [ 0 ] . assert_start_raises_init_error ( [ ' - walletdir = wallets ' ] , ' Error : Specified - walletdir " wallets " does not exist ' ) <nl> + self . nodes [ 0 ] . assert_start_raises_init_error ( [ ' - walletdir = wallets ' ] , ' Error : Specified - walletdir " wallets " is a relative path ' , cwd = data_dir ( ) ) <nl> + self . nodes [ 0 ] . assert_start_raises_init_error ( [ ' - walletdir = debug . log ' ] , ' Error : Specified - walletdir " debug . log " is not a directory ' , cwd = data_dir ( ) ) <nl> <nl> # should not initialize if there are duplicate wallets <nl> - self . assert_start_raises_init_error ( 0 , [ ' - wallet = w1 ' , ' - wallet = w1 ' ] , ' Error loading wallet w1 . Duplicate - wallet filename specified . ' ) <nl> + self . nodes [ 0 ] . assert_start_raises_init_error ( [ ' - wallet = w1 ' , ' - wallet = w1 ' ] , ' Error : Error loading wallet w1 . Duplicate - wallet filename specified . ' ) <nl> <nl> # should not initialize if one wallet is a copy of another <nl> shutil . copyfile ( wallet_dir ( ' w8 ' ) , wallet_dir ( ' w8_copy ' ) ) <nl> - self . assert_start_raises_init_error ( 0 , [ ' - wallet = w8 ' , ' - wallet = w8_copy ' ] , ' duplicates fileid ' ) <nl> + exp_stderr = " CDB : Can ' t open database w8_copy \ ( duplicates fileid \ w + from w8 \ ) " <nl> + self . nodes [ 0 ] . assert_start_raises_init_error ( [ ' - wallet = w8 ' , ' - wallet = w8_copy ' ] , exp_stderr , partial_match = True ) <nl> <nl> # should not initialize if wallet file is a symlink <nl> os . symlink ( ' w8 ' , wallet_dir ( ' w8_symlink ' ) ) <nl> - self . assert_start_raises_init_error ( 0 , [ ' - wallet = w8_symlink ' ] , ' Invalid - wallet path ' ) <nl> + self . nodes [ 0 ] . assert_start_raises_init_error ( [ ' - wallet = w8_symlink ' ] , ' Error : Invalid - wallet path \ ' w8_symlink \ ' \ . . * ' ) <nl> <nl> # should not initialize if the specified walletdir does not exist <nl> - self . assert_start_raises_init_error ( 0 , [ ' - walletdir = bad ' ] , ' Error : Specified - walletdir " bad " does not exist ' ) <nl> + self . nodes [ 0 ] . assert_start_raises_init_error ( [ ' - walletdir = bad ' ] , ' Error : Specified - walletdir " bad " does not exist ' ) <nl> # should not initialize if the specified walletdir is not a directory <nl> not_a_dir = wallet_dir ( ' notadir ' ) <nl> open ( not_a_dir , ' a ' ) . close ( ) <nl> - self . assert_start_raises_init_error ( 0 , [ ' - walletdir = ' + not_a_dir ] , ' Error : Specified - walletdir " ' + not_a_dir + ' " is not a directory ' ) <nl> + self . nodes [ 0 ] . assert_start_raises_init_error ( [ ' - walletdir = ' + not_a_dir ] , ' Error : Specified - walletdir " ' + re . escape ( not_a_dir ) + ' " is not a directory ' ) <nl> <nl> # if wallets / doesn ' t exist , datadir should be the default wallet dir <nl> wallet_dir2 = data_dir ( ' walletdir ' ) <nl> def run_test ( self ) : <nl> <nl> competing_wallet_dir = os . path . join ( self . options . tmpdir , ' competing_walletdir ' ) <nl> os . mkdir ( competing_wallet_dir ) <nl> - self . restart_node ( 0 , [ ' - walletdir = ' + competing_wallet_dir ] ) <nl> - self . assert_start_raises_init_error ( 1 , [ ' - walletdir = ' + competing_wallet_dir ] , ' Error initializing wallet database environment ' ) <nl> + self . restart_node ( 0 , [ ' - walletdir = ' + competing_wallet_dir ] ) <nl> + exp_stderr = " Error : Error initializing wallet database environment \ " \ S + competing_walletdir \ " ! " <nl> + self . nodes [ 1 ] . assert_start_raises_init_error ( [ ' - walletdir = ' + competing_wallet_dir ] , exp_stderr , partial_match = True ) <nl> <nl> self . restart_node ( 0 , extra_args ) <nl> <nl>
|
Merge : [ Tests ] Require exact match in assert_start_raises_init_eror ( jnewbery )
|
bitcoin/bitcoin
|
185d48473e439743d68ede0208738f3a3e48bbce
|
2018-03-22T09:31:44Z
|
mmm a / tensorflow / contrib / lite / schema / BUILD <nl> ppp b / tensorflow / contrib / lite / schema / BUILD <nl> <nl> - package ( <nl> - default_hdrs_check = " loose " , <nl> - default_visibility = [ <nl> - " / / visibility : public " , <nl> - ] , <nl> - ) <nl> + package ( default_visibility = [ <nl> + " / / visibility : public " , <nl> + ] ) <nl> <nl> licenses ( [ " notice " ] ) # Apache 2 . 0 <nl> <nl> mmm a / tensorflow / contrib / session_bundle / BUILD <nl> ppp b / tensorflow / contrib / session_bundle / BUILD <nl> <nl> # TensorFlow Serving session bundle . <nl> <nl> package ( <nl> - default_hdrs_check = " loose " , <nl> default_visibility = [ " / / visibility : public " ] , <nl> ) <nl> <nl> mmm a / tensorflow / core / BUILD <nl> ppp b / tensorflow / core / BUILD <nl> <nl> # / / tensorflow / tensorflow . bzl ) will include the necessary symbols in binary <nl> # build targets . <nl> <nl> - package ( <nl> - default_hdrs_check = " loose " , <nl> - default_visibility = [ <nl> - " / / tensorflow : internal " , <nl> - " / / tensorflow_models : __subpackages__ " , <nl> - ] , <nl> - ) <nl> + package ( default_visibility = [ <nl> + " / / tensorflow : internal " , <nl> + " / / tensorflow_models : __subpackages__ " , <nl> + ] ) <nl> <nl> licenses ( [ " notice " ] ) # Apache 2 . 0 <nl> <nl>
|
tfdbg : add reference to the TensorBoard Debugger Plugin in README . md
|
tensorflow/tensorflow
|
97a6780105c39429930a0307cb2a3bcad19cf642
|
2018-03-13T15:16:15Z
|
mmm a / src / main . cpp <nl> ppp b / src / main . cpp <nl> namespace { <nl> uint256 hash ; <nl> CBlockIndex * pindex ; / / ! Optional . <nl> int64_t nTime ; / / ! Time of " getdata " request in microseconds . <nl> - int nValidatedQueuedBefore ; / / ! Number of blocks queued with validated headers ( globally ) at the time this one is requested . <nl> bool fValidatedHeaders ; / / ! Whether this block has validated headers at the time of request . <nl> + int64_t nTimeDisconnect ; / / ! The timeout for this block request ( for disconnecting a slow peer ) <nl> } ; <nl> map < uint256 , pair < NodeId , list < QueuedBlock > : : iterator > > mapBlocksInFlight ; <nl> <nl> struct CNodeState { <nl> int64_t nStallingSince ; <nl> list < QueuedBlock > vBlocksInFlight ; <nl> int nBlocksInFlight ; <nl> + int nBlocksInFlightValidHeaders ; <nl> / / ! Whether we consider this a preferred download peer . <nl> bool fPreferredDownload ; <nl> <nl> struct CNodeState { <nl> fSyncStarted = false ; <nl> nStallingSince = 0 ; <nl> nBlocksInFlight = 0 ; <nl> + nBlocksInFlightValidHeaders = 0 ; <nl> fPreferredDownload = false ; <nl> } <nl> } ; <nl> void UpdatePreferredDownload ( CNode * node , CNodeState * state ) <nl> nPreferredDownload + = state - > fPreferredDownload ; <nl> } <nl> <nl> + / / Returns time at which to timeout block request ( nTime in microseconds ) <nl> + int64_t GetBlockTimeout ( int64_t nTime , int nValidatedQueuedBefore ) <nl> + { <nl> + return nTime + 500000 * Params ( ) . GetConsensus ( ) . nPowTargetSpacing * ( 4 + nValidatedQueuedBefore ) ; <nl> + } <nl> + <nl> void InitializeNode ( NodeId nodeid , const CNode * pnode ) { <nl> LOCK ( cs_main ) ; <nl> CNodeState & state = mapNodeState . insert ( std : : make_pair ( nodeid , CNodeState ( ) ) ) . first - > second ; <nl> void MarkBlockAsReceived ( const uint256 & hash ) { <nl> if ( itInFlight ! = mapBlocksInFlight . end ( ) ) { <nl> CNodeState * state = State ( itInFlight - > second . first ) ; <nl> nQueuedValidatedHeaders - = itInFlight - > second . second - > fValidatedHeaders ; <nl> + state - > nBlocksInFlightValidHeaders - = itInFlight - > second . second - > fValidatedHeaders ; <nl> state - > vBlocksInFlight . erase ( itInFlight - > second . second ) ; <nl> state - > nBlocksInFlight - - ; <nl> state - > nStallingSince = 0 ; <nl> void MarkBlockAsInFlight ( NodeId nodeid , const uint256 & hash , CBlockIndex * pindex <nl> / / Make sure it ' s not listed somewhere already . <nl> MarkBlockAsReceived ( hash ) ; <nl> <nl> - QueuedBlock newentry = { hash , pindex , GetTimeMicros ( ) , nQueuedValidatedHeaders , pindex ! = NULL } ; <nl> + int64_t nNow = GetTimeMicros ( ) ; <nl> + QueuedBlock newentry = { hash , pindex , nNow , pindex ! = NULL , GetBlockTimeout ( nNow , nQueuedValidatedHeaders ) } ; <nl> nQueuedValidatedHeaders + = newentry . fValidatedHeaders ; <nl> list < QueuedBlock > : : iterator it = state - > vBlocksInFlight . insert ( state - > vBlocksInFlight . end ( ) , newentry ) ; <nl> state - > nBlocksInFlight + + ; <nl> + state - > nBlocksInFlightValidHeaders + = newentry . fValidatedHeaders ; <nl> mapBlocksInFlight [ hash ] = std : : make_pair ( nodeid , it ) ; <nl> } <nl> <nl> bool SendMessages ( CNode * pto , bool fSendTrickle ) <nl> / / timeout . We compensate for in - flight blocks to prevent killing off peers due to our own downstream link <nl> / / being saturated . We only count validated in - flight blocks so peers can ' t advertize nonexisting block hashes <nl> / / to unreasonably increase our timeout . <nl> - if ( ! pto - > fDisconnect & & state . vBlocksInFlight . size ( ) > 0 & & state . vBlocksInFlight . front ( ) . nTime < nNow - 500000 * consensusParams . nPowTargetSpacing * ( 4 + state . vBlocksInFlight . front ( ) . nValidatedQueuedBefore ) ) { <nl> - LogPrintf ( " Timeout downloading block % s from peer = % d , disconnecting \ n " , state . vBlocksInFlight . front ( ) . hash . ToString ( ) , pto - > id ) ; <nl> - pto - > fDisconnect = true ; <nl> + / / We also compare the block download timeout originally calculated against the time at which we ' d disconnect <nl> + / / if we assumed the block were being requested now ( ignoring blocks we ' ve requested from this peer , since we ' re <nl> + / / only looking at this peer ' s oldest request ) . This way a large queue in the past doesn ' t result in a <nl> + / / permanently large window for this block to be delivered ( ie if the number of blocks in flight is decreasing <nl> + / / more quickly than once every 5 minutes , then we ' ll shorten the download window for this block ) . <nl> + if ( ! pto - > fDisconnect & & state . vBlocksInFlight . size ( ) > 0 ) { <nl> + QueuedBlock & queuedBlock = state . vBlocksInFlight . front ( ) ; <nl> + int64_t nTimeoutIfRequestedNow = GetBlockTimeout ( nNow , nQueuedValidatedHeaders - state . nBlocksInFlightValidHeaders ) ; <nl> + if ( queuedBlock . nTimeDisconnect > nTimeoutIfRequestedNow ) { <nl> + LogPrint ( " net " , " Reducing block download timeout for peer = % d block = % s , orig = % d new = % d \ n " , pto - > id , queuedBlock . hash . ToString ( ) , queuedBlock . nTimeDisconnect , nTimeoutIfRequestedNow ) ; <nl> + queuedBlock . nTimeDisconnect = nTimeoutIfRequestedNow ; <nl> + } <nl> + if ( queuedBlock . nTimeDisconnect < nNow ) { <nl> + LogPrintf ( " Timeout downloading block % s from peer = % d , disconnecting \ n " , queuedBlock . hash . ToString ( ) , pto - > id ) ; <nl> + pto - > fDisconnect = true ; <nl> + } <nl> } <nl> <nl> / / <nl>
|
Reduce download timeouts as blocks arrive
|
bitcoin/bitcoin
|
8ba7f842e5a00e43167e53b456c6d8732b8861c5
|
2015-04-15T13:28:00Z
|
mmm a / tools / internal_ci / linux / grpc_e2e_performance_singlevm . sh <nl> ppp b / tools / internal_ci / linux / grpc_e2e_performance_singlevm . sh <nl> source tools / internal_ci / helper_scripts / prepare_build_linux_perf_multilang_rc <nl> <nl> # " smoketest " scenarios on a single VM ( = no remote VM for running qps_workers ) <nl> tools / run_tests / run_performance_tests . py \ <nl> - - l c + + csharp ruby java python go php7 php7_protobuf_c node node_purejs \ <nl> + - l c + + csharp ruby java python go php7 php7_protobuf_c node \ <nl> - - netperf \ <nl> - - category smoketest \ <nl> - u kbuilder \ <nl> mmm a / tools / internal_ci / linux / grpc_full_performance_master . sh <nl> ppp b / tools / internal_ci / linux / grpc_full_performance_master . sh <nl> source tools / internal_ci / helper_scripts / prepare_build_linux_perf_multilang_rc <nl> <nl> # run 8core client vs 8core server <nl> tools / run_tests / run_performance_tests . py \ <nl> - - l c + + csharp ruby java python go php7 php7_protobuf_c node node_purejs \ <nl> + - l c + + csharp ruby java python go php7 php7_protobuf_c node \ <nl> - - netperf \ <nl> - - category scalable \ <nl> - - remote_worker_host grpc - kokoro - performance - server - 8core grpc - kokoro - performance - client - 8core grpc - kokoro - performance - client2 - 8core \ <nl>
|
Merge pull request from jtattermusch / disable_purejs_benchmark
|
grpc/grpc
|
9887feed4669524609db0ecbe99bff74afd6bea4
|
2018-10-29T18:28:03Z
|
mmm a / src / mongo / db / ftdc / ftdc_test . cpp <nl> ppp b / src / mongo / db / ftdc / ftdc_test . cpp <nl> MONGO_INITIALIZER_WITH_PREREQUISITES ( FTDCTestInit , <nl> ( " ThreadNameInitializer " ) ) ( InitializerContext * context ) { <nl> setGlobalServiceContext ( stdx : : make_unique < ServiceContextNoop > ( ) ) ; <nl> <nl> - getGlobalServiceContext ( ) - > setClockSource ( stdx : : make_unique < FTDCClockSourceMock > ( ) ) ; <nl> + getGlobalServiceContext ( ) - > setPreciseClockSource ( stdx : : make_unique < FTDCClockSourceMock > ( ) ) ; <nl> <nl> Client : : initThreadIfNotAlready ( " UnitTest " ) ; <nl> <nl>
|
SERVER - 23243 Extract time - keeping from Listener
|
mongodb/mongo
|
af5080d9478a9340ec4f54ae7f9e8e881cbc275e
|
2016-04-07T06:08:49Z
|
mmm a / configure . py <nl> ppp b / configure . py <nl> def main ( ) : <nl> config_info_line ( ' nohdfs ' , ' Disable HDFS support . ' ) <nl> config_info_line ( ' noignite ' , ' Disable Apacha Ignite support . ' ) <nl> config_info_line ( ' nokafka ' , ' Disable Apache Kafka support . ' ) <nl> + config_info_line ( ' nonccl ' , ' Disable NVIDIA NCCL support . ' ) <nl> <nl> <nl> if __name__ = = ' __main__ ' : <nl> mmm a / tensorflow / BUILD <nl> ppp b / tensorflow / BUILD <nl> config_setting ( <nl> visibility = [ " / / visibility : public " ] , <nl> ) <nl> <nl> + config_setting ( <nl> + name = " no_nccl_support " , <nl> + define_values = { " no_nccl_support " : " true " } , <nl> + visibility = [ " / / visibility : public " ] , <nl> + ) <nl> + <nl> # Crosses between platforms and file system libraries not supported on those <nl> # platforms due to limitations in nested select ( ) statements . <nl> config_setting ( <nl> mmm a / tensorflow / core / BUILD <nl> ppp b / tensorflow / core / BUILD <nl> cc_library ( <nl> name = " all_kernels_statically_linked " , <nl> visibility = [ " / / visibility : private " ] , <nl> deps = [ <nl> - " / / tensorflow / core / kernels : array " , <nl> - " / / tensorflow / core / kernels : audio " , <nl> - " / / tensorflow / core / kernels : batch_kernels " , <nl> - " / / tensorflow / core / kernels : bincount_op " , <nl> - " / / tensorflow / core / kernels : boosted_trees_ops " , <nl> - " / / tensorflow / core / kernels : candidate_sampler_ops " , <nl> - " / / tensorflow / core / kernels : checkpoint_ops " , <nl> - " / / tensorflow / core / kernels : collective_ops " , <nl> - " / / tensorflow / core / kernels : control_flow_ops " , <nl> - " / / tensorflow / core / kernels : ctc_ops " , <nl> - " / / tensorflow / core / kernels : cudnn_rnn_kernels " , <nl> - " / / tensorflow / core / kernels : data_flow " , <nl> - " / / tensorflow / core / kernels : dataset_ops " , <nl> - " / / tensorflow / core / kernels : decode_proto_op " , <nl> - " / / tensorflow / core / kernels : encode_proto_op " , <nl> - " / / tensorflow / core / kernels : fake_quant_ops " , <nl> - " / / tensorflow / core / kernels : function_ops " , <nl> - " / / tensorflow / core / kernels : functional_ops " , <nl> - " / / tensorflow / core / kernels : grappler " , <nl> - " / / tensorflow / core / kernels : histogram_op " , <nl> - " / / tensorflow / core / kernels : image " , <nl> - " / / tensorflow / core / kernels : io " , <nl> - " / / tensorflow / core / kernels : linalg " , <nl> - " / / tensorflow / core / kernels : list_kernels " , <nl> - " / / tensorflow / core / kernels : lookup " , <nl> - " / / tensorflow / core / kernels : logging " , <nl> - " / / tensorflow / core / kernels : manip " , <nl> - " / / tensorflow / core / kernels : math " , <nl> - " / / tensorflow / core / kernels : multinomial_op " , <nl> - " / / tensorflow / core / kernels : nn " , <nl> - " / / tensorflow / core / kernels : parameterized_truncated_normal_op " , <nl> - " / / tensorflow / core / kernels : parsing " , <nl> - " / / tensorflow / core / kernels : partitioned_function_ops " , <nl> - " / / tensorflow / core / kernels : ragged_ops " , <nl> - " / / tensorflow / core / kernels : random_ops " , <nl> - " / / tensorflow / core / kernels : random_poisson_op " , <nl> - " / / tensorflow / core / kernels : remote_fused_graph_ops " , <nl> - " / / tensorflow / core / kernels : required " , <nl> - " / / tensorflow / core / kernels : resource_variable_ops " , <nl> - " / / tensorflow / core / kernels : rpc_op " , <nl> - " / / tensorflow / core / kernels : scoped_allocator_ops " , <nl> - " / / tensorflow / core / kernels : sdca_ops " , <nl> - " / / tensorflow / core / kernels : searchsorted_op " , <nl> - " / / tensorflow / core / kernels : set_kernels " , <nl> - " / / tensorflow / core / kernels : sparse " , <nl> - " / / tensorflow / core / kernels : state " , <nl> - " / / tensorflow / core / kernels : stateless_random_ops " , <nl> - " / / tensorflow / core / kernels : string " , <nl> - " / / tensorflow / core / kernels : summary_kernels " , <nl> - " / / tensorflow / core / kernels : training_ops " , <nl> - " / / tensorflow / core / kernels : word2vec_kernels " , <nl> - ] + tf_additional_cloud_kernel_deps ( ) + if_not_tx2_llvm_or_windows_cuda ( [ <nl> - " / / tensorflow / core / kernels : nccl_kernels " , <nl> - ] ) + if_not_windows ( [ <nl> + " / / tensorflow / core / kernels : array " , <nl> + " / / tensorflow / core / kernels : audio " , <nl> + " / / tensorflow / core / kernels : batch_kernels " , <nl> + " / / tensorflow / core / kernels : bincount_op " , <nl> + " / / tensorflow / core / kernels : boosted_trees_ops " , <nl> + " / / tensorflow / core / kernels : candidate_sampler_ops " , <nl> + " / / tensorflow / core / kernels : checkpoint_ops " , <nl> + " / / tensorflow / core / kernels : collective_ops " , <nl> + " / / tensorflow / core / kernels : control_flow_ops " , <nl> + " / / tensorflow / core / kernels : ctc_ops " , <nl> + " / / tensorflow / core / kernels : cudnn_rnn_kernels " , <nl> + " / / tensorflow / core / kernels : data_flow " , <nl> + " / / tensorflow / core / kernels : dataset_ops " , <nl> + " / / tensorflow / core / kernels : decode_proto_op " , <nl> + " / / tensorflow / core / kernels : encode_proto_op " , <nl> + " / / tensorflow / core / kernels : fake_quant_ops " , <nl> + " / / tensorflow / core / kernels : function_ops " , <nl> + " / / tensorflow / core / kernels : functional_ops " , <nl> + " / / tensorflow / core / kernels : grappler " , <nl> + " / / tensorflow / core / kernels : histogram_op " , <nl> + " / / tensorflow / core / kernels : image " , <nl> + " / / tensorflow / core / kernels : io " , <nl> + " / / tensorflow / core / kernels : linalg " , <nl> + " / / tensorflow / core / kernels : list_kernels " , <nl> + " / / tensorflow / core / kernels : lookup " , <nl> + " / / tensorflow / core / kernels : logging " , <nl> + " / / tensorflow / core / kernels : manip " , <nl> + " / / tensorflow / core / kernels : math " , <nl> + " / / tensorflow / core / kernels : multinomial_op " , <nl> + " / / tensorflow / core / kernels : nn " , <nl> + " / / tensorflow / core / kernels : parameterized_truncated_normal_op " , <nl> + " / / tensorflow / core / kernels : parsing " , <nl> + " / / tensorflow / core / kernels : partitioned_function_ops " , <nl> + " / / tensorflow / core / kernels : ragged_ops " , <nl> + " / / tensorflow / core / kernels : random_ops " , <nl> + " / / tensorflow / core / kernels : random_poisson_op " , <nl> + " / / tensorflow / core / kernels : remote_fused_graph_ops " , <nl> + " / / tensorflow / core / kernels : required " , <nl> + " / / tensorflow / core / kernels : resource_variable_ops " , <nl> + " / / tensorflow / core / kernels : rpc_op " , <nl> + " / / tensorflow / core / kernels : scoped_allocator_ops " , <nl> + " / / tensorflow / core / kernels : sdca_ops " , <nl> + " / / tensorflow / core / kernels : searchsorted_op " , <nl> + " / / tensorflow / core / kernels : set_kernels " , <nl> + " / / tensorflow / core / kernels : sparse " , <nl> + " / / tensorflow / core / kernels : state " , <nl> + " / / tensorflow / core / kernels : stateless_random_ops " , <nl> + " / / tensorflow / core / kernels : string " , <nl> + " / / tensorflow / core / kernels : summary_kernels " , <nl> + " / / tensorflow / core / kernels : training_ops " , <nl> + " / / tensorflow / core / kernels : word2vec_kernels " , <nl> + ] + tf_additional_cloud_kernel_deps ( ) + <nl> + select ( { <nl> + " / / tensorflow : no_nccl_support " : [ ] , <nl> + " / / tensorflow : with_cuda_support_windows_override " : [ ] , <nl> + " / / conditions : default " : [ " / / tensorflow / core / kernels : nccl_kernels " ] , <nl> + } ) + if_not_windows ( [ <nl> " / / tensorflow / core / kernels : fact_op " , <nl> " / / tensorflow / core / kernels : array_not_windows " , <nl> " / / tensorflow / core / kernels : math_not_windows " , <nl> mmm a / tensorflow / python / BUILD <nl> ppp b / tensorflow / python / BUILD <nl> cuda_py_test ( <nl> " no_oss " , <nl> " noguitar " , <nl> " notap " , <nl> + " no_nccl " <nl> ] , <nl> ) <nl> <nl> mmm a / tools / bazel . rc <nl> ppp b / tools / bazel . rc <nl> build : nogcp - - define = no_gcp_support = true <nl> build : nohdfs - - define = no_hdfs_support = true <nl> build : nokafka - - define = no_kafka_support = true <nl> build : noignite - - define = no_ignite_support = true <nl> + build : nonccl - - define = no_nccl_support = true <nl> + test : nonccl - - define = no_nccl_support = true - - test_tag_filters = - no_nccl <nl> <nl> build - - define = use_fast_cpp_protos = true <nl> build - - define = allow_oversize_protos = true <nl>
|
Add option to disable nccl
|
tensorflow/tensorflow
|
b51ad2408b5050ee497a3af602d4bbd950f89973
|
2018-11-16T22:16:23Z
|
mmm a / include / swift / AST / Types . h <nl> ppp b / include / swift / AST / Types . h <nl> class alignas ( 8 ) TypeBase { <nl> return getAnyOptionalObjectType ( ignored ) ; <nl> } <nl> <nl> + / / / Return the type T after looking through all of the optional or <nl> + / / / implicitly - unwrapped optional types . <nl> + Type lookThroughAllAnyOptionalTypes ( ) ; <nl> + <nl> / / / Whether this is the AnyObject type . <nl> bool isAnyObject ( ) ; <nl> <nl> mmm a / lib / AST / Type . cpp <nl> ppp b / lib / AST / Type . cpp <nl> CanType CanType : : getAnyOptionalObjectTypeImpl ( CanType type ) { <nl> return CanType ( ) ; <nl> } <nl> <nl> + Type TypeBase : : lookThroughAllAnyOptionalTypes ( ) { <nl> + Type type ( this ) ; <nl> + while ( auto objType = type - > getAnyOptionalObjectType ( ) ) <nl> + type = objType ; <nl> + <nl> + return type ; <nl> + } <nl> + <nl> bool TypeBase : : isAnyObject ( ) { <nl> if ( auto proto = getAs < ProtocolType > ( ) ) <nl> return proto - > getDecl ( ) - > isSpecificProtocol ( KnownProtocolKind : : AnyObject ) ; <nl> mmm a / lib / Sema / CSApply . cpp <nl> ppp b / lib / Sema / CSApply . cpp <nl> namespace { <nl> break ; <nl> } <nl> <nl> - / / Allow for casts from AnyObject to a bridged type . <nl> - if ( tc . getDynamicBridgedThroughObjCClass ( cs . DC , fromType , toType ) ) { <nl> - sub = tc . coerceToRValue ( expr - > getSubExpr ( ) ) ; <nl> - if ( ! sub ) <nl> - return nullptr ; <nl> - <nl> - auto OSTLoc = TypeLoc : : withoutLoc ( toType / * optType * / ) ; <nl> - <nl> - auto wrappedExpr <nl> - = new ( tc . Context ) ConditionalCheckedCastExpr ( sub , <nl> - sub - > getLoc ( ) , <nl> - OSTLoc ) ; <nl> - return visitConditionalCheckedCastExpr ( wrappedExpr ) ; <nl> + / / Allow for bridging of a value type through a class type . <nl> + auto fromValueType = fromType - > lookThroughAllAnyOptionalTypes ( ) ; <nl> + if ( auto classType = tc . getDynamicBridgedThroughObjCClass ( cs . DC , <nl> + fromValueType , <nl> + toType ) ) { <nl> + / / The actual check is against the class type through which we ' re <nl> + / / bridging . <nl> + expr - > getCastTypeLoc ( ) . setType ( classType , / * validated = * / true ) ; <nl> + <nl> + / / FIXME : We actually need to perform a checked cast , then call <nl> + / / bridgeFromObjectiveC to try to perform the bridge , then check whether <nl> + / / that optional has a value . <nl> } <nl> <nl> / / SIL - generation magically turns this into a Bool ; make sure it can . <nl> namespace { <nl> arrayConversion - > setType ( toType ) ; <nl> return arrayConversion ; <nl> } <nl> - <nl> - / / Allow for casts from AnyObject to a briged type . <nl> - if ( auto bridgedType = tc . getDynamicBridgedThroughObjCClass ( cs . DC , <nl> - fromType , <nl> + <nl> + / / The type to which the result of the optional should be coerced . <nl> + Type coercedResultType ; <nl> + <nl> + / / Local function to finish the result , performing a final coercion if <nl> + / / needed . <nl> + auto finishResult = [ & ] ( Expr * expr ) - > Expr * { <nl> + / / If there is no final coercion to perform , we ' re done . <nl> + if ( ! coercedResultType ) <nl> + return expr ; <nl> + <nl> + bool failed = tc . convertToType ( expr , coercedResultType , cs . DC ) ; <nl> + assert ( ! failed & & " Not convertible ? " ) ; <nl> + return expr ; <nl> + } ; <nl> + <nl> + / / Allow for casts from AnyObject to a bridged type . <nl> + auto fromValueType = fromType - > lookThroughAllAnyOptionalTypes ( ) ; <nl> + Type finalResultType = simplifyType ( expr - > getType ( ) ) ; <nl> + if ( auto bridgedType = tc . getDynamicBridgedThroughObjCClass ( cs . DC , <nl> + fromValueType , <nl> toType ) ) { <nl> - sub - > setType ( bridgedType ) ; <nl> - <nl> - sub = tc . coerceToRValue ( expr - > getSubExpr ( ) ) ; <nl> - if ( ! sub ) <nl> - return nullptr ; <nl> - expr - > setSubExpr ( sub ) ; <nl> - expr - > getCastTypeLoc ( ) . setType ( bridgedType , true ) ; <nl> - expr - > setType ( tc . getOptionalType ( expr - > getLoc ( ) , bridgedType ) ) ; <nl> - <nl> - auto optType = tc . getOptionalType ( expr - > getLoc ( ) , toType ) ; <nl> - auto OSTLoc = TypeLoc : : withoutLoc ( optType ) ; <nl> - <nl> - auto wrappedExpr <nl> - = new ( tc . Context ) ConditionalCheckedCastExpr ( expr , <nl> - expr - > getLoc ( ) , <nl> - OSTLoc ) ; <nl> - <nl> - / / The original expression now represents the wrapped conversion . <nl> - expr - > setImplicit ( ) ; <nl> - return visitConditionalCheckedCastExpr ( wrappedExpr ) ; <nl> + / / FIXME : multiple levels of optionality . <nl> + coercedResultType = finalResultType ; <nl> + finalResultType = tc . getOptionalType ( expr - > getLoc ( ) , bridgedType ) ; <nl> } <nl> - <nl> - Type finalResultType = simplifyType ( expr - > getType ( ) ) ; <nl> - <nl> + <nl> / / Handle optional operands or optional results . <nl> <nl> / / FIXME : some of this work needs to be delayed until runtime to <nl> namespace { <nl> srcType = plumbOptionals ( srcType , srcOptionals ) ; <nl> if ( srcOptionals . empty ( ) ) { <nl> expr - > setType ( finalResultType ) ; <nl> - return expr ; <nl> + return finishResult ( expr ) ; <nl> } <nl> <nl> SmallVector < Type , 4 > destOptionals ; <nl> namespace { <nl> finalResultType ) ; <nl> } <nl> <nl> - return result ; <nl> + return finishResult ( result ) ; <nl> } <nl> <nl> Expr * visitCoerceExpr ( CoerceExpr * expr ) { <nl> mmm a / lib / Sema / CSSimplify . cpp <nl> ppp b / lib / Sema / CSSimplify . cpp <nl> static CheckedCastKind getCheckedCastKind ( ConstraintSystem * cs , <nl> Type toType ) { <nl> / / Peel off optionals metatypes from the types , because we might cast through <nl> / / them . <nl> - while ( auto toValueType = toType - > getAnyOptionalObjectType ( ) ) { <nl> - toType = toValueType ; <nl> - } <nl> - <nl> - while ( auto fromValueType = fromType - > getAnyOptionalObjectType ( ) ) { <nl> - fromType = fromValueType ; <nl> - } <nl> - <nl> + toType = toType - > lookThroughAllAnyOptionalTypes ( ) ; <nl> + fromType = fromType - > lookThroughAllAnyOptionalTypes ( ) ; <nl> + <nl> / / Peel off metatypes , since if we can cast two types , we can cast their <nl> / / metatypes . <nl> while ( auto toMetatype = toType - > getAs < MetatypeType > ( ) ) { <nl> ConstraintSystem : : simplifyCheckedCastConstraint ( <nl> } <nl> return SolutionKind : : Solved ; <nl> <nl> - case CheckedCastKind : : ExistentialToConcrete : <nl> + case CheckedCastKind : : ExistentialToConcrete : { <nl> + / / Peel off optionals metatypes from the types , because we might cast through <nl> + / / them . <nl> + auto toValueType = toType - > lookThroughAllAnyOptionalTypes ( ) ; <nl> + auto fromValueType = fromType - > lookThroughAllAnyOptionalTypes ( ) ; <nl> + <nl> + / / This existential - to - concrete cast might bridge through an Objective - C <nl> + / / class type . <nl> + if ( auto classType = TC . getDynamicBridgedThroughObjCClass ( DC , fromValueType , <nl> + toValueType ) ) { <nl> + / / The class we ' re bridging through must be a subtype of the type we ' re <nl> + / / coming from . <nl> + addConstraint ( ConstraintKind : : Subtype , classType , fromValueType , <nl> + getConstraintLocator ( locator ) ) ; <nl> + return SolutionKind : : Solved ; <nl> + } <nl> + <nl> addConstraint ( ConstraintKind : : Subtype , toType , fromType , <nl> getConstraintLocator ( locator ) ) ; <nl> return SolutionKind : : Solved ; <nl> + } <nl> <nl> case CheckedCastKind : : Coercion : <nl> case CheckedCastKind : : Unresolved : <nl> mmm a / test / Interpreter / SDK / objc_cast . swift <nl> ppp b / test / Interpreter / SDK / objc_cast . swift <nl> var s : String = auo ! <nl> var auoo : AnyObject ? = " s " <nl> auoo ! as String <nl> <nl> + / / Test bridged casts . <nl> + / / CHECK : Downcast to hello <nl> + obj = NSString ( string : " hello " ) <nl> + if let str = obj as String { <nl> + println ( " Downcast to \ ( str ) " ) <nl> + } else { <nl> + println ( " Not a string ? " ) <nl> + } <nl> + <nl> + / / CHECK - NEXT : Downcast to Swift <nl> + var objOpt : AnyObject ? = NSString ( string : " Swift " ) <nl> + if let str = objOpt as String { <nl> + println ( " Downcast to \ ( str ) " ) <nl> + } else { <nl> + println ( " Not a string ? " ) <nl> + } <nl> + <nl> + / / CHECK - NEXT : Downcast to world <nl> + var objImplicitOpt : AnyObject ! = NSString ( string : " world " ) <nl> + if let str = objImplicitOpt as String { <nl> + println ( " Downcast to \ ( str ) " ) <nl> + } else { <nl> + println ( " Not a string ? " ) <nl> + } <nl> + <nl> + <nl> + / / CHECK - NEXT : Downcast correctly failed due to nil <nl> + objOpt = nil <nl> + if let str = objOpt as String { <nl> + println ( " Downcast should not succeed for nil " ) <nl> + } else { <nl> + println ( " Downcast correctly failed due to nil " ) <nl> + } <nl> + <nl> + # if false <nl> + / / < rdar : / / problem / 16953860 > Implicitly unwrapped optionals in casts are being forced rather than bound <nl> + / / FIXME - NEXT : Downcast correctly failed due to nil <nl> + objImplicitOpt = nil <nl> + if let str = objImplicitOpt as String { <nl> + println ( " Downcast should not succeed for nil " ) <nl> + } else { <nl> + println ( " Downcast correctly failed due to nil " ) <nl> + } <nl> + # endif <nl> + <nl> println ( " ok " ) / / CHECK : ok <nl> mmm a / test / Interpreter / SDK / objc_nsstring_bridge . swift <nl> ppp b / test / Interpreter / SDK / objc_nsstring_bridge . swift <nl> var s6 : NSString = " foo " <nl> var ao : AnyObject = s6 . copy ( ) <nl> var s7 = ( ao as NSString ) ! <nl> var s8 = ao as String <nl> + <nl> + <nl> + / / CHECK - NEXT : done <nl> + println ( " done " ) <nl>
|
Support downcasting from AnyObject to a bridged value type .
|
apple/swift
|
e7ad745be03839043b409e59ed4c6ec6280c5998
|
2014-05-18T20:30:39Z
|
mmm a / BUILD . gn <nl> ppp b / BUILD . gn <nl> v8_source_set ( " v8_base_without_compiler " ) { <nl> " src / execution / messages . h " , <nl> " src / execution / microtask - queue . cc " , <nl> " src / execution / microtask - queue . h " , <nl> + " src / execution / off - thread - isolate - inl . h " , <nl> " src / execution / off - thread - isolate . cc " , <nl> " src / execution / off - thread - isolate . h " , <nl> " src / execution / pointer - authentication . h " , <nl> mmm a / src / common / globals . h <nl> ppp b / src / common / globals . h <nl> class NewSpace ; <nl> class NewLargeObjectSpace ; <nl> class NumberDictionary ; <nl> class Object ; <nl> + class OffThreadIsolate ; <nl> class OldLargeObjectSpace ; <nl> template < HeapObjectReferenceType kRefType , typename StorageType > <nl> class TaggedImpl ; <nl> mmm a / src / common / ptr - compr - inl . h <nl> ppp b / src / common / ptr - compr - inl . h <nl> <nl> # include " include / v8 - internal . h " <nl> # include " src / common / ptr - compr . h " <nl> # include " src / execution / isolate . h " <nl> + # include " src / execution / off - thread - isolate - inl . h " <nl> <nl> namespace v8 { <nl> namespace internal { <nl> V8_INLINE Address GetIsolateRoot ( const Isolate * isolate ) { <nl> return isolate_root ; <nl> } <nl> <nl> + V8_INLINE Address GetIsolateRoot ( const OffThreadIsolate * isolate ) { <nl> + Address isolate_root = isolate - > isolate_root ( ) ; <nl> + # ifdef V8_COMPRESS_POINTERS <nl> + isolate_root = reinterpret_cast < Address > ( V8_ASSUME_ALIGNED ( <nl> + reinterpret_cast < void * > ( isolate_root ) , kPtrComprIsolateRootAlignment ) ) ; <nl> + # endif <nl> + return isolate_root ; <nl> + } <nl> + <nl> / / Decompresses smi value . <nl> V8_INLINE Address DecompressTaggedSigned ( Tagged_t raw_value ) { <nl> / / For runtime code the upper 32 - bits of the Smi value do not matter . <nl> new file mode 100644 <nl> index 00000000000 . . 13dfebd47f5 <nl> mmm / dev / null <nl> ppp b / src / execution / off - thread - isolate - inl . h <nl> <nl> + / / Copyright 2020 the V8 project authors . All rights reserved . <nl> + / / Use of this source code is governed by a BSD - style license that can be <nl> + / / found in the LICENSE file . <nl> + <nl> + # ifndef V8_EXECUTION_OFF_THREAD_ISOLATE_INL_H_ <nl> + # define V8_EXECUTION_OFF_THREAD_ISOLATE_INL_H_ <nl> + <nl> + # include " src / execution / isolate . h " <nl> + # include " src / execution / off - thread - isolate . h " <nl> + # include " src / roots / roots - inl . h " <nl> + <nl> + namespace v8 { <nl> + namespace internal { <nl> + <nl> + Address OffThreadIsolate : : isolate_root ( ) const { <nl> + return isolate_ - > isolate_root ( ) ; <nl> + } <nl> + <nl> + } / / namespace internal <nl> + } / / namespace v8 <nl> + <nl> + # endif / / V8_EXECUTION_OFF_THREAD_ISOLATE_INL_H_ <nl> mmm a / src / execution / off - thread - isolate . h <nl> ppp b / src / execution / off - thread - isolate . h <nl> <nl> # ifndef V8_EXECUTION_OFF_THREAD_ISOLATE_H_ <nl> # define V8_EXECUTION_OFF_THREAD_ISOLATE_H_ <nl> <nl> - # include " src / base / logging . h " <nl> + # include " src / base / macros . h " <nl> # include " src / execution / thread - id . h " <nl> # include " src / handles / handles . h " <nl> # include " src / handles / maybe - handles . h " <nl> class V8_EXPORT_PRIVATE OffThreadIsolate final <nl> <nl> OffThreadHeap * heap ( ) { return & heap_ ; } <nl> <nl> + inline Address isolate_root ( ) const ; <nl> + <nl> v8 : : internal : : OffThreadFactory * factory ( ) { <nl> / / Upcast to the privately inherited base - class using c - style casts to avoid <nl> / / undefined behavior ( as static_cast cannot cast across private bases ) . <nl> mmm a / src / objects / maybe - object - inl . h <nl> ppp b / src / objects / maybe - object - inl . h <nl> <nl> # ifndef V8_OBJECTS_MAYBE_OBJECT_INL_H_ <nl> # define V8_OBJECTS_MAYBE_OBJECT_INL_H_ <nl> <nl> + # include " src / common / ptr - compr - inl . h " <nl> # include " src / objects / maybe - object . h " <nl> - <nl> - # ifdef V8_COMPRESS_POINTERS <nl> - # include " src / execution / isolate . h " <nl> - # endif <nl> # include " src / objects / smi - inl . h " <nl> # include " src / objects / tagged - impl - inl . h " <nl> <nl> HeapObjectReference HeapObjectReference : : Weak ( Object object ) { <nl> } <nl> <nl> / / static <nl> - HeapObjectReference HeapObjectReference : : ClearedValue ( Isolate * isolate ) { <nl> + HeapObjectReference HeapObjectReference : : ClearedValue ( const Isolate * isolate ) { <nl> / / Construct cleared weak ref value . <nl> + # ifdef V8_COMPRESS_POINTERS <nl> + / / This is necessary to make pointer decompression computation also <nl> + / / suitable for cleared weak references . <nl> + Address raw_value = <nl> + DecompressTaggedPointer ( isolate , kClearedWeakHeapObjectLower32 ) ; <nl> + # else <nl> Address raw_value = kClearedWeakHeapObjectLower32 ; <nl> + # endif <nl> + / / The rest of the code will check only the lower 32 - bits . <nl> + DCHECK_EQ ( kClearedWeakHeapObjectLower32 , static_cast < uint32_t > ( raw_value ) ) ; <nl> + return HeapObjectReference ( raw_value ) ; <nl> + } <nl> + <nl> + / / static <nl> + HeapObjectReference HeapObjectReference : : ClearedValue ( <nl> + const OffThreadIsolate * isolate ) { <nl> + / / Construct cleared weak ref value . <nl> # ifdef V8_COMPRESS_POINTERS <nl> / / This is necessary to make pointer decompression computation also <nl> / / suitable for cleared weak references . <nl> - Address isolate_root = isolate - > isolate_root ( ) ; <nl> - raw_value | = isolate_root ; <nl> - DCHECK_EQ ( raw_value & ( ~ static_cast < Address > ( kClearedWeakHeapObjectLower32 ) ) , <nl> - isolate_root ) ; <nl> + Address raw_value = <nl> + DecompressTaggedPointer ( isolate , kClearedWeakHeapObjectLower32 ) ; <nl> + # else <nl> + Address raw_value = kClearedWeakHeapObjectLower32 ; <nl> # endif <nl> / / The rest of the code will check only the lower 32 - bits . <nl> DCHECK_EQ ( kClearedWeakHeapObjectLower32 , static_cast < uint32_t > ( raw_value ) ) ; <nl> mmm a / src / objects / maybe - object . h <nl> ppp b / src / objects / maybe - object . h <nl> class HeapObjectReference : public MaybeObject { <nl> <nl> V8_INLINE static HeapObjectReference Weak ( Object object ) ; <nl> <nl> - V8_INLINE static HeapObjectReference ClearedValue ( Isolate * isolate ) ; <nl> + V8_INLINE static HeapObjectReference ClearedValue ( const Isolate * isolate ) ; <nl> + <nl> + V8_INLINE static HeapObjectReference ClearedValue ( <nl> + const OffThreadIsolate * isolate ) ; <nl> <nl> template < typename THeapObjectSlot > <nl> V8_INLINE static void Update ( THeapObjectSlot slot , HeapObject value ) ; <nl>
|
[ offthread ] Allow cleared references allocation off - thread
|
v8/v8
|
4f7b00c7dd47f76d1c6117eda1fab484cf20798f
|
2020-05-06T12:19:06Z
|
mmm a / include / rapidjson / reader . h <nl> ppp b / include / rapidjson / reader . h <nl> RAPIDJSON_DIAG_OFF ( effc + + ) <nl> # define RAPIDJSON_PARSE_ERROR ( parseErrorCode , offset ) \ <nl> RAPIDJSON_MULTILINEMACRO_BEGIN \ <nl> RAPIDJSON_PARSE_ERROR_NORETURN ( parseErrorCode , offset ) ; \ <nl> - RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID ; \ <nl> + return RAPIDJSON_NOTHING ; \ <nl> RAPIDJSON_MULTILINEMACRO_END <nl> # endif <nl> <nl>
|
Fix warnings when compiling with clang and - Wimplicit - fallthrough
|
Tencent/rapidjson
|
013b71b92fdc835b53a61c739d6d57bd6c5627be
|
2015-05-31T18:35:55Z
|
mmm a / src / io / config . cpp <nl> ppp b / src / io / config . cpp <nl> void OverallConfig : : CheckParamConflict ( ) { <nl> } else if ( gbdt_config - > tree_learner_type = = TreeLearnerType : : kDataParallelTreeLearner ) { <nl> is_parallel_find_bin = true ; <nl> if ( gbdt_config - > tree_config . histogram_pool_size > = 0 ) { <nl> - Log : : Error ( " Auto set histogram_pool_size to non - limit , to reduce communication cost " ) ; <nl> - / / To reduce communication cost , not limit pool size when using data parallel <nl> + Log : : Error ( " Histogram LRU queue was enabled ( histogram_pool_size = % f ) . Will disable this for reducing communication cost . " <nl> + , tree_config . histogram_pool_size ) ; <nl> + / / Change pool size to - 1 ( not limit ) when using data parallel for reducing communication cost <nl> gbdt_config - > tree_config . histogram_pool_size = - 1 ; <nl> } <nl> <nl>
|
alert output and comment
|
microsoft/LightGBM
|
31c3a89eb18762ef26e9616e4d515cdeb626f97f
|
2016-10-23T08:14:48Z
|
deleted file mode 100644 <nl> index 0286c2a70c . . 0000000000 <nl> mmm a / change / react - native - windows - 6336eb07 - 86e6 - 461a - a24c - 79311b382c98 . json <nl> ppp / dev / null <nl> <nl> - { <nl> - " type " : " prerelease " , <nl> - " comment " : " Use lessthrow_await_adapter for WebSocketJSExecutor : : ConnectAsync " , <nl> - " packageName " : " react - native - windows " , <nl> - " email " : " julio . rocha @ microsoft . com " , <nl> - " dependentChangeType " : " patch " <nl> - } <nl> deleted file mode 100644 <nl> index a71a080ed4 . . 0000000000 <nl> mmm a / change / react - native - windows - ad5982b9 - fb47 - 405a - 9abd - 6ee2b6d23e72 . json <nl> ppp / dev / null <nl> <nl> - { <nl> - " type " : " prerelease " , <nl> - " comment " : " Update Nuget publish to not overwrite the created anycpu version " , <nl> - " packageName " : " react - native - windows " , <nl> - " email " : " dannyvv @ microsoft . com " , <nl> - " dependentChangeType " : " patch " <nl> - } <nl> mmm a / packages / @ react - native - windows / tester / package . json <nl> ppp b / packages / @ react - native - windows / tester / package . json <nl> <nl> } , <nl> " peerDependencies " : { <nl> " react - native " : " 0 . 0 . 0 - 77f7658e4 " , <nl> - " react - native - windows " : " ^ 0 . 0 . 0 - canary . 212 " <nl> + " react - native - windows " : " ^ 0 . 0 . 0 - canary . 213 " <nl> } , <nl> " devDependencies " : { <nl> " @ rnw - scripts / eslint - config " : " 0 . 1 . 4 " , <nl> <nl> " just - scripts " : " ^ 0 . 44 . 7 " , <nl> " react - native " : " 0 . 0 . 0 - 77f7658e4 " , <nl> " react - native - platform - override " : " ^ 0 . 4 . 1 " , <nl> - " react - native - windows " : " ^ 0 . 0 . 0 - canary . 212 " , <nl> + " react - native - windows " : " ^ 0 . 0 . 0 - canary . 213 " , <nl> " typescript " : " ^ 3 . 8 . 3 " <nl> } <nl> } <nl> mmm a / packages / E2ETest / package . json <nl> ppp b / packages / E2ETest / package . json <nl> <nl> " prompt - sync " : " ^ 4 . 2 . 0 " , <nl> " react " : " 16 . 13 . 1 " , <nl> " react - native " : " 0 . 0 . 0 - 77f7658e4 " , <nl> - " react - native - windows " : " 0 . 0 . 0 - canary . 212 " <nl> + " react - native - windows " : " 0 . 0 . 0 - canary . 213 " <nl> } , <nl> " devDependencies " : { <nl> " @ babel / core " : " ^ 7 . 8 . 4 " , <nl> mmm a / packages / IntegrationTest / package . json <nl> ppp b / packages / IntegrationTest / package . json <nl> <nl> " chai " : " ^ 4 . 2 . 0 " , <nl> " react " : " 16 . 13 . 1 " , <nl> " react - native " : " 0 . 0 . 0 - 77f7658e4 " , <nl> - " react - native - windows " : " ^ 0 . 0 . 0 - canary . 212 " <nl> + " react - native - windows " : " ^ 0 . 0 . 0 - canary . 213 " <nl> } , <nl> " devDependencies " : { <nl> " @ babel / core " : " ^ 7 . 8 . 4 " , <nl> mmm a / packages / microsoft - reactnative - sampleapps / package . json <nl> ppp b / packages / microsoft - reactnative - sampleapps / package . json <nl> <nl> " dependencies " : { <nl> " react " : " 16 . 13 . 1 " , <nl> " react - native " : " 0 . 0 . 0 - 77f7658e4 " , <nl> - " react - native - windows " : " 0 . 0 . 0 - canary . 212 " <nl> + " react - native - windows " : " 0 . 0 . 0 - canary . 213 " <nl> } , <nl> " devDependencies " : { <nl> " @ babel / core " : " ^ 7 . 8 . 4 " , <nl> mmm a / packages / playground / package . json <nl> ppp b / packages / playground / package . json <nl> <nl> " @ react - native - windows / tester " : " 0 . 0 . 1 " , <nl> " react " : " 16 . 13 . 1 " , <nl> " react - native " : " 0 . 0 . 0 - 77f7658e4 " , <nl> - " react - native - windows " : " 0 . 0 . 0 - canary . 212 " <nl> + " react - native - windows " : " 0 . 0 . 0 - canary . 213 " <nl> } , <nl> " devDependencies " : { <nl> " @ babel / core " : " ^ 7 . 8 . 4 " , <nl> mmm a / vnext / CHANGELOG . json <nl> ppp b / vnext / CHANGELOG . json <nl> <nl> { <nl> " name " : " react - native - windows " , <nl> " entries " : [ <nl> + { <nl> + " date " : " Thu , 19 Nov 2020 17 : 13 : 10 GMT " , <nl> + " tag " : " react - native - windows_v0 . 0 . 0 - canary . 213 " , <nl> + " version " : " 0 . 0 . 0 - canary . 213 " , <nl> + " comments " : { <nl> + " prerelease " : [ <nl> + { <nl> + " comment " : " Update Nuget publish to not overwrite the created anycpu version " , <nl> + " author " : " dannyvv @ microsoft . com " , <nl> + " commit " : " 44b3782cfc475e79e1f2d950adac72d45a143391 " , <nl> + " package " : " react - native - windows " <nl> + } , <nl> + { <nl> + " comment " : " Use lessthrow_await_adapter for WebSocketJSExecutor : : ConnectAsync " , <nl> + " author " : " julio . rocha @ microsoft . com " , <nl> + " commit " : " a6e254b5b085588b8478e9926a38adfb400943de " , <nl> + " package " : " react - native - windows " <nl> + } <nl> + ] <nl> + } <nl> + } , <nl> { <nl> " date " : " Thu , 19 Nov 2020 05 : 06 : 10 GMT " , <nl> " tag " : " react - native - windows_v0 . 0 . 0 - canary . 212 " , <nl> mmm a / vnext / CHANGELOG . md <nl> ppp b / vnext / CHANGELOG . md <nl> <nl> # Change Log - react - native - windows <nl> <nl> - This log was last generated on Thu , 19 Nov 2020 05 : 06 : 10 GMT and should not be manually modified . <nl> + This log was last generated on Thu , 19 Nov 2020 17 : 13 : 10 GMT and should not be manually modified . <nl> <nl> < ! - - Start content - - > <nl> <nl> + # # 0 . 0 . 0 - canary . 213 <nl> + <nl> + Thu , 19 Nov 2020 17 : 13 : 10 GMT <nl> + <nl> + # # # Changes <nl> + <nl> + - Update Nuget publish to not overwrite the created anycpu version ( dannyvv @ microsoft . com ) <nl> + - Use lessthrow_await_adapter for WebSocketJSExecutor : : ConnectAsync ( julio . rocha @ microsoft . com ) <nl> + <nl> # # 0 . 0 . 0 - canary . 212 <nl> <nl> Thu , 19 Nov 2020 05 : 06 : 10 GMT <nl> mmm a / vnext / package . json <nl> ppp b / vnext / package . json <nl> <nl> { <nl> " name " : " react - native - windows " , <nl> - " version " : " 0 . 0 . 0 - canary . 212 " , <nl> + " version " : " 0 . 0 . 0 - canary . 213 " , <nl> " license " : " MIT " , <nl> " repository " : { <nl> " type " : " git " , <nl>
|
applying package updates * * * NO_CI * * *
|
microsoft/react-native-windows
|
0cb98f4d8aae7434b5be41970e69d11ae9b980b2
|
2020-11-19T17:13:10Z
|
mmm a / src / mongo / db / pipeline / sharded_agg_helpers . cpp <nl> ppp b / src / mongo / db / pipeline / sharded_agg_helpers . cpp <nl> boost : : optional < ShardedExchangePolicy > walkPipelineBackwardsTrackingShardKey ( <nl> / / We also compute consumer indices for every chunk . From the example above ( 3 chunks ) we may <nl> / / get the vector [ 0 , 1 , 2 ] ; i . e . the first chunk goes to the consumer 0 and so on . Note that <nl> / / the consumer id may be repeated if the consumer hosts more than 1 chunk . <nl> - boundaries . emplace_back ( translateBoundary ( ( * chunkManager . chunks ( ) . begin ( ) ) . getMin ( ) ) ) ; <nl> - for ( auto & & chunk : chunkManager . chunks ( ) ) { <nl> + chunkManager . forEachChunk ( [ & ] ( const auto & chunk ) { <nl> + if ( boundaries . empty ( ) ) <nl> + boundaries . emplace_back ( translateBoundary ( chunk . getMin ( ) ) ) ; <nl> + <nl> boundaries . emplace_back ( translateBoundary ( chunk . getMax ( ) ) ) ; <nl> if ( shardToConsumer . find ( chunk . getShardId ( ) ) = = shardToConsumer . end ( ) ) { <nl> shardToConsumer . emplace ( chunk . getShardId ( ) , numConsumers + + ) ; <nl> consumerShards . emplace_back ( chunk . getShardId ( ) ) ; <nl> } <nl> consumerIds . emplace_back ( shardToConsumer [ chunk . getShardId ( ) ] ) ; <nl> - } <nl> + <nl> + return true ; <nl> + } ) ; <nl> + <nl> exchangeSpec . setPolicy ( ExchangePolicyEnum : : kKeyRange ) ; <nl> exchangeSpec . setKey ( newShardKey . toBSON ( ) ) ; <nl> exchangeSpec . setBoundaries ( std : : move ( boundaries ) ) ; <nl> mmm a / src / mongo / db / s / balancer / balancer_chunk_selection_policy_impl . cpp <nl> ppp b / src / mongo / db / s / balancer / balancer_chunk_selection_policy_impl . cpp <nl> StatusWith < DistributionStatus > createCollectionDistributionStatus ( <nl> shardToChunksMap [ stat . shardId ] ; <nl> } <nl> <nl> - for ( const auto & chunkEntry : chunkMgr - > chunks ( ) ) { <nl> + chunkMgr - > forEachChunk ( [ & ] ( const auto & chunkEntry ) { <nl> ChunkType chunk ; <nl> chunk . setNS ( chunkMgr - > getns ( ) ) ; <nl> chunk . setMin ( chunkEntry . getMin ( ) ) ; <nl> StatusWith < DistributionStatus > createCollectionDistributionStatus ( <nl> chunk . setVersion ( chunkEntry . getLastmod ( ) ) ; <nl> <nl> shardToChunksMap [ chunkEntry . getShardId ( ) ] . push_back ( chunk ) ; <nl> - } <nl> + <nl> + return true ; <nl> + } ) ; <nl> <nl> const auto swCollectionTags = <nl> Grid : : get ( opCtx ) - > catalogClient ( ) - > getTagsForCollection ( opCtx , chunkMgr - > getns ( ) ) ; <nl> mmm a / src / mongo / db / s / collection_metadata . cpp <nl> ppp b / src / mongo / db / s / collection_metadata . cpp <nl> RangeMap CollectionMetadata : : getChunks ( ) const { <nl> <nl> RangeMap chunksMap ( SimpleBSONObjComparator : : kInstance . makeBSONObjIndexedMap < BSONObj > ( ) ) ; <nl> <nl> - for ( const auto & chunk : _cm - > chunks ( ) ) { <nl> - if ( chunk . getShardId ( ) ! = _thisShardId ) <nl> - continue ; <nl> + _cm - > forEachChunk ( [ this , & chunksMap ] ( const auto & chunk ) { <nl> + if ( chunk . getShardId ( ) = = _thisShardId ) <nl> + chunksMap . emplace_hint ( chunksMap . end ( ) , chunk . getMin ( ) , chunk . getMax ( ) ) ; <nl> <nl> - chunksMap . emplace_hint ( chunksMap . end ( ) , chunk . getMin ( ) , chunk . getMax ( ) ) ; <nl> - } <nl> + return true ; <nl> + } ) ; <nl> <nl> return chunksMap ; <nl> } <nl> RangeMap CollectionMetadata : : getChunks ( ) const { <nl> bool CollectionMetadata : : getNextChunk ( const BSONObj & lookupKey , ChunkType * chunk ) const { <nl> invariant ( isSharded ( ) ) ; <nl> <nl> - auto foundIt = _cm - > getNextChunkOnShard ( lookupKey , _thisShardId ) ; <nl> - if ( foundIt . begin ( ) = = foundIt . end ( ) ) <nl> + auto nextChunk = _cm - > getNextChunkOnShard ( lookupKey , _thisShardId ) ; <nl> + if ( ! nextChunk ) <nl> return false ; <nl> <nl> - const auto & nextChunk = * foundIt . begin ( ) ; <nl> - chunk - > setMin ( nextChunk . getMin ( ) ) ; <nl> - chunk - > setMax ( nextChunk . getMax ( ) ) ; <nl> + chunk - > setMin ( nextChunk - > getMin ( ) ) ; <nl> + chunk - > setMax ( nextChunk - > getMax ( ) ) ; <nl> + <nl> return true ; <nl> } <nl> <nl> void CollectionMetadata : : toBSONChunks ( BSONArrayBuilder * builder ) const { <nl> if ( ! isSharded ( ) ) <nl> return ; <nl> <nl> - for ( const auto & chunk : _cm - > chunks ( ) ) { <nl> + _cm - > forEachChunk ( [ this , & builder ] ( const auto & chunk ) { <nl> if ( chunk . getShardId ( ) = = _thisShardId ) { <nl> BSONArrayBuilder chunkBB ( builder - > subarrayStart ( ) ) ; <nl> chunkBB . append ( chunk . getMin ( ) ) ; <nl> chunkBB . append ( chunk . getMax ( ) ) ; <nl> chunkBB . done ( ) ; <nl> } <nl> - } <nl> + <nl> + return true ; <nl> + } ) ; <nl> } <nl> <nl> } / / namespace mongo <nl> mmm a / src / mongo / s / SConscript <nl> ppp b / src / mongo / s / SConscript <nl> env . CppUnitTest ( <nl> ' catalog / type_tags_test . cpp ' , <nl> ' chunk_manager_index_bounds_test . cpp ' , <nl> ' chunk_manager_query_test . cpp ' , <nl> + ' chunk_map_test . cpp ' , <nl> ' chunk_test . cpp ' , <nl> ' chunk_version_test . cpp ' , <nl> ' chunk_writes_tracker_test . cpp ' , <nl> mmm a / src / mongo / s / chunk_manager . cpp <nl> ppp b / src / mongo / s / chunk_manager . cpp <nl> std : : string extractKeyStringInternal ( const BSONObj & shardKeyValue , Ordering orde <nl> <nl> } / / namespace <nl> <nl> + ShardVersionMap ChunkMap : : constructShardVersionMap ( const OID & epoch ) const { <nl> + ShardVersionMap shardVersions ; <nl> + ChunkInfoMap : : const_iterator current = _chunkMap . cbegin ( ) ; <nl> + <nl> + boost : : optional < BSONObj > firstMin = boost : : none ; <nl> + boost : : optional < BSONObj > lastMax = boost : : none ; <nl> + <nl> + while ( current ! = _chunkMap . cend ( ) ) { <nl> + const auto & firstChunkInRange = current - > second ; <nl> + const auto & currentRangeShardId = firstChunkInRange - > getShardIdAt ( boost : : none ) ; <nl> + <nl> + / / Tracks the max shard version for the shard on which the current range will reside <nl> + auto shardVersionIt = shardVersions . find ( currentRangeShardId ) ; <nl> + if ( shardVersionIt = = shardVersions . end ( ) ) { <nl> + shardVersionIt = shardVersions . emplace ( currentRangeShardId , epoch ) . first ; <nl> + } <nl> + <nl> + auto & maxShardVersion = shardVersionIt - > second . shardVersion ; <nl> + <nl> + current = <nl> + std : : find_if ( current , <nl> + _chunkMap . cend ( ) , <nl> + [ & currentRangeShardId , <nl> + & maxShardVersion ] ( const ChunkInfoMap : : value_type & chunkMapEntry ) { <nl> + const auto & currentChunk = chunkMapEntry . second ; <nl> + <nl> + if ( currentChunk - > getShardIdAt ( boost : : none ) ! = currentRangeShardId ) <nl> + return true ; <nl> + <nl> + if ( currentChunk - > getLastmod ( ) > maxShardVersion ) <nl> + maxShardVersion = currentChunk - > getLastmod ( ) ; <nl> + <nl> + return false ; <nl> + } ) ; <nl> + <nl> + const auto rangeLast = std : : prev ( current ) ; <nl> + <nl> + const auto & rangeMin = firstChunkInRange - > getMin ( ) ; <nl> + const auto & rangeMax = rangeLast - > second - > getMax ( ) ; <nl> + <nl> + / / Check the continuity of the chunks map <nl> + if ( lastMax & & ! SimpleBSONObjComparator : : kInstance . evaluate ( * lastMax = = rangeMin ) ) { <nl> + if ( SimpleBSONObjComparator : : kInstance . evaluate ( * lastMax < rangeMin ) ) <nl> + uasserted ( ErrorCodes : : ConflictingOperationInProgress , <nl> + str : : stream ( ) <nl> + < < " Gap exists in the routing table between chunks " <nl> + < < _chunkMap <nl> + . at ( extractKeyStringInternal ( * lastMax , _shardKeyOrdering ) ) <nl> + - > getRange ( ) <nl> + . toString ( ) <nl> + < < " and " < < rangeLast - > second - > getRange ( ) . toString ( ) ) ; <nl> + else <nl> + uasserted ( ErrorCodes : : ConflictingOperationInProgress , <nl> + str : : stream ( ) <nl> + < < " Overlap exists in the routing table between chunks " <nl> + < < _chunkMap <nl> + . at ( extractKeyStringInternal ( * lastMax , _shardKeyOrdering ) ) <nl> + - > getRange ( ) <nl> + . toString ( ) <nl> + < < " and " < < rangeLast - > second - > getRange ( ) . toString ( ) ) ; <nl> + } <nl> + <nl> + if ( ! firstMin ) <nl> + firstMin = rangeMin ; <nl> + <nl> + lastMax = rangeMax ; <nl> + <nl> + / / If a shard has chunks it must have a shard version , otherwise we have an invalid chunk <nl> + / / somewhere , which should have been caught at chunk load time <nl> + invariant ( maxShardVersion . isSet ( ) ) ; <nl> + } <nl> + <nl> + if ( ! _chunkMap . empty ( ) ) { <nl> + invariant ( ! shardVersions . empty ( ) ) ; <nl> + invariant ( firstMin . is_initialized ( ) ) ; <nl> + invariant ( lastMax . is_initialized ( ) ) ; <nl> + <nl> + checkAllElementsAreOfType ( MinKey , firstMin . get ( ) ) ; <nl> + checkAllElementsAreOfType ( MaxKey , lastMax . get ( ) ) ; <nl> + } <nl> + <nl> + return shardVersions ; <nl> + } <nl> + <nl> + void ChunkMap : : addChunk ( const ChunkType & chunk ) { <nl> + const auto chunkMinKeyString = extractKeyStringInternal ( chunk . getMin ( ) , _shardKeyOrdering ) ; <nl> + const auto chunkMaxKeyString = extractKeyStringInternal ( chunk . getMax ( ) , _shardKeyOrdering ) ; <nl> + <nl> + / / Returns the first chunk with a max key that is > min - implies that the chunk overlaps <nl> + / / min <nl> + const auto low = _chunkMap . upper_bound ( chunkMinKeyString ) ; <nl> + <nl> + / / Returns the first chunk with a max key that is > max - implies that the next chunk cannot <nl> + / / not overlap max <nl> + const auto high = _chunkMap . upper_bound ( chunkMaxKeyString ) ; <nl> + <nl> + / / If we are in the middle of splitting a chunk , for the first few <nl> + / / chunks inserted , low = = high , because both lookups will point to the <nl> + / / same chunk ( the one being split ) . If we ' re inserting the last chunk <nl> + / / for the current chunk being split , low will point to the chunk that <nl> + / / we ' re splitting , and high will point to the next chunk past the one <nl> + / / we ' re splitting ( which could be chunkMap . end ( ) ) . In this case , <nl> + / / std : : distance ( low , high ) = = 1 . Lastly , this does not apply during <nl> + / / the creation of the original routing table , in which case the map is <nl> + / / empty and the first chunk that is inserted will find that low = = <nl> + / / high , but low = = chunkMap . end ( ) , and we aren ' t doing a split in that <nl> + / / case . <nl> + auto foundSingleChunk = <nl> + ( ( low = = high | | std : : distance ( low , high ) = = 1 ) & & low ! = _chunkMap . end ( ) ) ; <nl> + <nl> + auto newChunk = std : : make_shared < ChunkInfo > ( chunk ) ; <nl> + if ( foundSingleChunk ) { <nl> + auto chunkBeingReplacedBySplit = low - > second ; <nl> + auto bytesInReplacedChunk = <nl> + chunkBeingReplacedBySplit - > getWritesTracker ( ) - > getBytesWritten ( ) ; <nl> + newChunk - > getWritesTracker ( ) - > addBytesWritten ( bytesInReplacedChunk ) ; <nl> + } <nl> + <nl> + / / Erase all chunks from the map , which overlap the chunk we got from the persistent store <nl> + _chunkMap . erase ( low , high ) ; <nl> + <nl> + / / Insert only the chunk itself <nl> + _chunkMap . insert ( std : : make_pair ( chunkMaxKeyString , newChunk ) ) ; <nl> + } <nl> + <nl> + std : : shared_ptr < ChunkInfo > ChunkMap : : findIntersectingChunk ( const BSONObj & shardKey ) const { <nl> + const auto it = _findIntersectingChunk ( shardKey ) ; <nl> + <nl> + if ( it ! = _chunkMap . end ( ) ) <nl> + return it - > second ; <nl> + <nl> + return std : : shared_ptr < ChunkInfo > ( ) ; <nl> + } <nl> + <nl> + ChunkMap : : ChunkInfoMap : : const_iterator ChunkMap : : _findIntersectingChunk ( <nl> + const BSONObj & shardKey ) const { <nl> + return _chunkMap . upper_bound ( extractKeyStringInternal ( shardKey , _shardKeyOrdering ) ) ; <nl> + } <nl> + <nl> + std : : pair < ChunkMap : : ChunkInfoMap : : const_iterator , ChunkMap : : ChunkInfoMap : : const_iterator > <nl> + ChunkMap : : _overlappingBounds ( const BSONObj & min , const BSONObj & max , bool isMaxInclusive ) const { <nl> + const auto itMin = _chunkMap . upper_bound ( extractKeyStringInternal ( min , _shardKeyOrdering ) ) ; <nl> + const auto itMax = [ & ] ( ) { <nl> + auto it = isMaxInclusive <nl> + ? _chunkMap . upper_bound ( extractKeyStringInternal ( max , _shardKeyOrdering ) ) <nl> + : _chunkMap . lower_bound ( extractKeyStringInternal ( max , _shardKeyOrdering ) ) ; <nl> + return it = = _chunkMap . end ( ) ? it : + + it ; <nl> + } ( ) ; <nl> + <nl> + return { itMin , itMax } ; <nl> + } <nl> + <nl> ShardVersionTargetingInfo : : ShardVersionTargetingInfo ( const OID & epoch ) <nl> : shardVersion ( 0 , 0 , epoch ) { } <nl> <nl> RoutingTableHistory : : RoutingTableHistory ( NamespaceString nss , <nl> KeyPattern shardKeyPattern , <nl> std : : unique_ptr < CollatorInterface > defaultCollator , <nl> bool unique , <nl> - ChunkInfoMap chunkMap , <nl> + ChunkMap chunkMap , <nl> ChunkVersion collectionVersion ) <nl> : _sequenceNumber ( nextCMSequenceNumber . addAndFetch ( 1 ) ) , <nl> _nss ( std : : move ( nss ) ) , <nl> _uuid ( uuid ) , <nl> _shardKeyPattern ( shardKeyPattern ) , <nl> - _shardKeyOrdering ( Ordering : : make ( _shardKeyPattern . toBSON ( ) ) ) , <nl> _defaultCollator ( std : : move ( defaultCollator ) ) , <nl> _unique ( unique ) , <nl> _chunkMap ( std : : move ( chunkMap ) ) , <nl> _collectionVersion ( collectionVersion ) , <nl> - _shardVersions ( _constructShardVersionMap ( ) ) { } <nl> + _shardVersions ( _chunkMap . constructShardVersionMap ( collectionVersion . epoch ( ) ) ) { } <nl> <nl> void RoutingTableHistory : : setShardStale ( const ShardId & shardId ) { <nl> if ( gEnableFinerGrainedCatalogCacheRefresh ) { <nl> Chunk ChunkManager : : findIntersectingChunk ( const BSONObj & shardKey , const BSONObj <nl> } <nl> } <nl> <nl> - const auto it = _rt - > getChunkMap ( ) . upper_bound ( _rt - > _extractKeyString ( shardKey ) ) ; <nl> + auto chunkInfo = _rt - > findIntersectingChunk ( shardKey ) ; <nl> + <nl> uassert ( ErrorCodes : : ShardKeyNotFound , <nl> str : : stream ( ) < < " Cannot target single shard using key " < < shardKey <nl> < < " for namespace " < < getns ( ) , <nl> - it ! = _rt - > getChunkMap ( ) . end ( ) & & it - > second - > containsKey ( shardKey ) ) ; <nl> + chunkInfo & & chunkInfo - > containsKey ( shardKey ) ) ; <nl> <nl> - return Chunk ( * ( it - > second ) , _clusterTime ) ; <nl> + return Chunk ( * chunkInfo , _clusterTime ) ; <nl> } <nl> <nl> bool ChunkManager : : keyBelongsToShard ( const BSONObj & shardKey , const ShardId & shardId ) const { <nl> if ( shardKey . isEmpty ( ) ) <nl> return false ; <nl> <nl> - const auto it = _rt - > getChunkMap ( ) . upper_bound ( _rt - > _extractKeyString ( shardKey ) ) ; <nl> - if ( it = = _rt - > getChunkMap ( ) . end ( ) ) <nl> + auto chunkInfo = _rt - > findIntersectingChunk ( shardKey ) ; <nl> + if ( ! chunkInfo ) <nl> return false ; <nl> <nl> - invariant ( it - > second - > containsKey ( shardKey ) ) ; <nl> + invariant ( chunkInfo - > containsKey ( shardKey ) ) ; <nl> <nl> - return it - > second - > getShardIdAt ( _clusterTime ) = = shardId ; <nl> + return chunkInfo - > getShardIdAt ( _clusterTime ) = = shardId ; <nl> } <nl> <nl> void ChunkManager : : getShardIdsForQuery ( OperationContext * opCtx , <nl> void ChunkManager : : getShardIdsForQuery ( OperationContext * opCtx , <nl> / / For now , we satisfy that assumption by adding a shard with no matches rather than returning <nl> / / an empty set of shards . <nl> if ( shardIds - > empty ( ) ) { <nl> - shardIds - > insert ( _rt - > getChunkMap ( ) . begin ( ) - > second - > getShardIdAt ( _clusterTime ) ) ; <nl> + _rt - > forEachChunk ( [ & ] ( const std : : shared_ptr < ChunkInfo > & chunkInfo ) { <nl> + shardIds - > insert ( chunkInfo - > getShardIdAt ( _clusterTime ) ) ; <nl> + return false ; <nl> + } ) ; <nl> } <nl> } <nl> <nl> void ChunkManager : : getShardIdsForRange ( const BSONObj & min , <nl> return ; <nl> } <nl> <nl> - const auto bounds = _rt - > overlappingRanges ( min , max , true ) ; <nl> - for ( auto it = bounds . first ; it ! = bounds . second ; + + it ) { <nl> - shardIds - > insert ( it - > second - > getShardIdAt ( _clusterTime ) ) ; <nl> + _rt - > forEachOverlappingChunk ( min , max , true , [ & ] ( auto & chunkInfo ) { <nl> + shardIds - > insert ( chunkInfo - > getShardIdAt ( _clusterTime ) ) ; <nl> <nl> / / No need to iterate through the rest of the ranges , because we already know we need to use <nl> / / all shards . However , this optimization does not apply when we are reading from a snapshot <nl> void ChunkManager : : getShardIdsForRange ( const BSONObj & min , <nl> / / refresh . Therefore , it is possible for _shardVersions to have fewer entries if a shard <nl> / / no longer owns chunks when it used to at _clusterTime . <nl> if ( ! _clusterTime & & shardIds - > size ( ) = = _rt - > _shardVersions . size ( ) ) { <nl> - break ; <nl> + return false ; <nl> } <nl> - } <nl> + <nl> + return true ; <nl> + } ) ; <nl> } <nl> <nl> bool ChunkManager : : rangeOverlapsShard ( const ChunkRange & range , const ShardId & shardId ) const { <nl> - const auto bounds = _rt - > overlappingRanges ( range . getMin ( ) , range . getMax ( ) , false ) ; <nl> - const auto it = std : : find_if ( bounds . first , bounds . second , [ this , & shardId ] ( const auto & scr ) { <nl> - return scr . second - > getShardIdAt ( _clusterTime ) = = shardId ; <nl> + bool overlapFound = false ; <nl> + <nl> + _rt - > forEachOverlappingChunk ( range . getMin ( ) , range . getMax ( ) , false , [ & ] ( auto & chunkInfo ) { <nl> + if ( chunkInfo - > getShardIdAt ( _clusterTime ) = = shardId ) { <nl> + overlapFound = true ; <nl> + return false ; <nl> + } <nl> + <nl> + return true ; <nl> } ) ; <nl> <nl> - return it ! = bounds . second ; <nl> + return overlapFound ; <nl> } <nl> <nl> - ChunkManager : : ConstRangeOfChunks ChunkManager : : getNextChunkOnShard ( const BSONObj & shardKey , <nl> - const ShardId & shardId ) const { <nl> - for ( auto it = _rt - > getChunkMap ( ) . upper_bound ( _rt - > _extractKeyString ( shardKey ) ) ; <nl> - it ! = _rt - > getChunkMap ( ) . end ( ) ; <nl> - + + it ) { <nl> - const auto & chunk = it - > second ; <nl> - if ( chunk - > getShardIdAt ( _clusterTime ) = = shardId ) { <nl> - const auto begin = it ; <nl> - const auto end = + + it ; <nl> - return { ConstChunkIterator ( begin , _clusterTime ) , ConstChunkIterator ( end , _clusterTime ) } ; <nl> - } <nl> - } <nl> + boost : : optional < Chunk > ChunkManager : : getNextChunkOnShard ( const BSONObj & shardKey , <nl> + const ShardId & shardId ) const { <nl> + boost : : optional < Chunk > chunk ; <nl> + <nl> + _rt - > forEachChunk ( <nl> + [ & ] ( auto & chunkInfo ) { <nl> + if ( chunkInfo - > getShardIdAt ( _clusterTime ) = = shardId ) { <nl> + chunk . emplace ( * chunkInfo , _clusterTime ) ; <nl> + return false ; <nl> + } <nl> + return true ; <nl> + } , <nl> + shardKey ) ; <nl> <nl> - return { ConstChunkIterator ( ) , ConstChunkIterator ( ) } ; <nl> + return chunk ; <nl> } <nl> <nl> ShardId ChunkManager : : getMinKeyShardIdWithSimpleCollation ( ) const { <nl> int RoutingTableHistory : : getNShardsOwningChunks ( ) const { <nl> return _shardVersions . size ( ) ; <nl> } <nl> <nl> - std : : pair < ChunkInfoMap : : const_iterator , ChunkInfoMap : : const_iterator > <nl> - RoutingTableHistory : : overlappingRanges ( const BSONObj & min , <nl> - const BSONObj & max , <nl> - bool isMaxInclusive ) const { <nl> - if ( kDebugBuild ) { <nl> - auto keyPattern = _shardKeyPattern . getKeyPattern ( ) ; <nl> - bool minHasFullShardKey = <nl> - _extractKeyString ( keyPattern . extendRangeBound ( min , false / * makeUpperInclusive * / ) ) = = <nl> - _extractKeyString ( min ) ; <nl> - bool maxHasFullShardKey = <nl> - _extractKeyString ( keyPattern . extendRangeBound ( max , false / * makeUpperInclusive * / ) ) = = <nl> - _extractKeyString ( max ) ; <nl> - invariant ( minHasFullShardKey ) ; <nl> - invariant ( maxHasFullShardKey ) ; <nl> - } <nl> - <nl> - const auto itMin = _chunkMap . upper_bound ( _extractKeyString ( min ) ) ; <nl> - const auto itMax = [ & ] ( ) { <nl> - auto it = isMaxInclusive ? _chunkMap . upper_bound ( _extractKeyString ( max ) ) <nl> - : _chunkMap . lower_bound ( _extractKeyString ( max ) ) ; <nl> - return it = = _chunkMap . end ( ) ? it : + + it ; <nl> - } ( ) ; <nl> - <nl> - return { itMin , itMax } ; <nl> - } <nl> - <nl> IndexBounds ChunkManager : : getIndexBoundsForQuery ( const BSONObj & key , <nl> const CanonicalQuery & canonicalQuery ) { <nl> / / $ text is not allowed in planning since we don ' t have text index on mongos . <nl> std : : string RoutingTableHistory : : toString ( ) const { <nl> sb < < " RoutingTableHistory : " < < _nss . ns ( ) < < " key : " < < _shardKeyPattern . toString ( ) < < ' \ n ' ; <nl> <nl> sb < < " Chunks : \ n " ; <nl> - for ( const auto & chunk : _chunkMap ) { <nl> - sb < < " \ t " < < chunk . second - > toString ( ) < < ' \ n ' ; <nl> - } <nl> + _chunkMap . forEach ( [ & sb ] ( const auto & chunk ) { <nl> + sb < < " \ t " < < chunk - > toString ( ) < < ' \ n ' ; <nl> + return true ; <nl> + } ) ; <nl> <nl> sb < < " Shard versions : \ n " ; <nl> for ( const auto & entry : _shardVersions ) { <nl> std : : string RoutingTableHistory : : toString ( ) const { <nl> return sb . str ( ) ; <nl> } <nl> <nl> - ShardVersionMap RoutingTableHistory : : _constructShardVersionMap ( ) const { <nl> - const OID & epoch = _collectionVersion . epoch ( ) ; <nl> - <nl> - ShardVersionMap shardVersions ; <nl> - ChunkInfoMap : : const_iterator current = _chunkMap . cbegin ( ) ; <nl> - <nl> - boost : : optional < BSONObj > firstMin = boost : : none ; <nl> - boost : : optional < BSONObj > lastMax = boost : : none ; <nl> - <nl> - while ( current ! = _chunkMap . cend ( ) ) { <nl> - const auto & firstChunkInRange = current - > second ; <nl> - const auto & currentRangeShardId = firstChunkInRange - > getShardIdAt ( boost : : none ) ; <nl> - <nl> - / / Tracks the max shard version for the shard on which the current range will reside <nl> - auto shardVersionIt = shardVersions . find ( currentRangeShardId ) ; <nl> - if ( shardVersionIt = = shardVersions . end ( ) ) { <nl> - shardVersionIt = shardVersions . emplace ( currentRangeShardId , epoch ) . first ; <nl> - } <nl> - <nl> - auto & maxShardVersion = shardVersionIt - > second . shardVersion ; <nl> - <nl> - current = <nl> - std : : find_if ( current , <nl> - _chunkMap . cend ( ) , <nl> - [ & currentRangeShardId , <nl> - & maxShardVersion ] ( const ChunkInfoMap : : value_type & chunkMapEntry ) { <nl> - const auto & currentChunk = chunkMapEntry . second ; <nl> - <nl> - if ( currentChunk - > getShardIdAt ( boost : : none ) ! = currentRangeShardId ) <nl> - return true ; <nl> - <nl> - if ( currentChunk - > getLastmod ( ) > maxShardVersion ) <nl> - maxShardVersion = currentChunk - > getLastmod ( ) ; <nl> - <nl> - return false ; <nl> - } ) ; <nl> - <nl> - const auto rangeLast = std : : prev ( current ) ; <nl> - <nl> - const auto & rangeMin = firstChunkInRange - > getMin ( ) ; <nl> - const auto & rangeMax = rangeLast - > second - > getMax ( ) ; <nl> - <nl> - / / Check the continuity of the chunks map <nl> - if ( lastMax & & ! SimpleBSONObjComparator : : kInstance . evaluate ( * lastMax = = rangeMin ) ) { <nl> - if ( SimpleBSONObjComparator : : kInstance . evaluate ( * lastMax < rangeMin ) ) <nl> - uasserted ( ErrorCodes : : ConflictingOperationInProgress , <nl> - str : : stream ( ) <nl> - < < " Gap exists in the routing table between chunks " <nl> - < < _chunkMap . at ( _extractKeyString ( * lastMax ) ) - > getRange ( ) . toString ( ) <nl> - < < " and " < < rangeLast - > second - > getRange ( ) . toString ( ) ) ; <nl> - else <nl> - uasserted ( ErrorCodes : : ConflictingOperationInProgress , <nl> - str : : stream ( ) <nl> - < < " Overlap exists in the routing table between chunks " <nl> - < < _chunkMap . at ( _extractKeyString ( * lastMax ) ) - > getRange ( ) . toString ( ) <nl> - < < " and " < < rangeLast - > second - > getRange ( ) . toString ( ) ) ; <nl> - } <nl> - <nl> - if ( ! firstMin ) <nl> - firstMin = rangeMin ; <nl> - <nl> - lastMax = rangeMax ; <nl> - <nl> - / / If a shard has chunks it must have a shard version , otherwise we have an invalid chunk <nl> - / / somewhere , which should have been caught at chunk load time <nl> - invariant ( maxShardVersion . isSet ( ) ) ; <nl> - } <nl> - <nl> - if ( ! _chunkMap . empty ( ) ) { <nl> - invariant ( ! shardVersions . empty ( ) ) ; <nl> - invariant ( firstMin . is_initialized ( ) ) ; <nl> - invariant ( lastMax . is_initialized ( ) ) ; <nl> - <nl> - checkAllElementsAreOfType ( MinKey , firstMin . get ( ) ) ; <nl> - checkAllElementsAreOfType ( MaxKey , lastMax . get ( ) ) ; <nl> - } <nl> - <nl> - return shardVersions ; <nl> - } <nl> - <nl> - std : : string RoutingTableHistory : : _extractKeyString ( const BSONObj & shardKeyValue ) const { <nl> - return extractKeyStringInternal ( shardKeyValue , _shardKeyOrdering ) ; <nl> - } <nl> - <nl> std : : shared_ptr < RoutingTableHistory > RoutingTableHistory : : makeNew ( <nl> NamespaceString nss , <nl> boost : : optional < UUID > uuid , <nl> std : : shared_ptr < RoutingTableHistory > RoutingTableHistory : : makeNew ( <nl> bool unique , <nl> OID epoch , <nl> const std : : vector < ChunkType > & chunks ) { <nl> + auto ordering = Ordering : : make ( shardKeyPattern . toBSON ( ) ) ; <nl> return RoutingTableHistory ( std : : move ( nss ) , <nl> std : : move ( uuid ) , <nl> std : : move ( shardKeyPattern ) , <nl> std : : move ( defaultCollator ) , <nl> std : : move ( unique ) , <nl> - { } , <nl> + { std : : move ( ordering ) } , <nl> { 0 , 0 , epoch } ) <nl> . makeUpdated ( chunks ) ; <nl> } <nl> std : : shared_ptr < RoutingTableHistory > RoutingTableHistory : : makeUpdated ( <nl> < < chunkVersion . epoch ( ) , <nl> collectionVersion . epoch ( ) = = chunkVersion . epoch ( ) ) ; <nl> <nl> - / / Chunks must always come in incrementally sorted order <nl> + / / Chunks must always come in increasing sorted order <nl> invariant ( chunkVersion > = collectionVersion ) ; <nl> collectionVersion = chunkVersion ; <nl> <nl> - const auto chunkMinKeyString = _extractKeyString ( chunk . getMin ( ) ) ; <nl> - const auto chunkMaxKeyString = _extractKeyString ( chunk . getMax ( ) ) ; <nl> - <nl> - / / Returns the first chunk with a max key that is > min - implies that the chunk overlaps <nl> - / / min <nl> - const auto low = chunkMap . upper_bound ( chunkMinKeyString ) ; <nl> - <nl> - / / Returns the first chunk with a max key that is > max - implies that the next chunk cannot <nl> - / / not overlap max <nl> - const auto high = chunkMap . upper_bound ( chunkMaxKeyString ) ; <nl> - <nl> - / / If we are in the middle of splitting a chunk , for the first few <nl> - / / chunks inserted , low = = high , because both lookups will point to the <nl> - / / same chunk ( the one being split ) . If we ' re inserting the last chunk <nl> - / / for the current chunk being split , low will point to the chunk that <nl> - / / we ' re splitting , and high will point to the next chunk past the one <nl> - / / we ' re splitting ( which could be chunkMap . end ( ) ) . In this case , <nl> - / / std : : distance ( low , high ) = = 1 . Lastly , this does not apply during <nl> - / / the creation of the original routing table , in which case the map is <nl> - / / empty and the first chunk that is inserted will find that low = = <nl> - / / high , but low = = chunkMap . end ( ) , and we aren ' t doing a split in that <nl> - / / case . <nl> - auto foundSingleChunk = <nl> - ( ( low = = high | | std : : distance ( low , high ) = = 1 ) & & low ! = chunkMap . end ( ) ) ; <nl> - <nl> - auto newChunk = std : : make_shared < ChunkInfo > ( chunk ) ; <nl> - if ( foundSingleChunk ) { <nl> - auto chunkBeingReplacedBySplit = low - > second ; <nl> - auto bytesInReplacedChunk = <nl> - chunkBeingReplacedBySplit - > getWritesTracker ( ) - > getBytesWritten ( ) ; <nl> - newChunk - > getWritesTracker ( ) - > addBytesWritten ( bytesInReplacedChunk ) ; <nl> - } <nl> - <nl> - / / Erase all chunks from the map , which overlap the chunk we got from the persistent store <nl> - chunkMap . erase ( low , high ) ; <nl> - <nl> - / / Insert only the chunk itself <nl> - chunkMap . insert ( std : : make_pair ( chunkMaxKeyString , newChunk ) ) ; <nl> + chunkMap . addChunk ( chunk ) ; <nl> } <nl> <nl> / / If at least one diff was applied , the metadata is correct , but it might not have changed so <nl> mmm a / src / mongo / s / chunk_manager . h <nl> ppp b / src / mongo / s / chunk_manager . h <nl> struct QuerySolutionNode ; <nl> class OperationContext ; <nl> class ChunkManager ; <nl> <nl> - / / Ordered map from the max for each chunk to an entry describing the chunk <nl> - using ChunkInfoMap = std : : map < std : : string , std : : shared_ptr < ChunkInfo > > ; <nl> - <nl> struct ShardVersionTargetingInfo { <nl> / / Indicates whether the shard is stale and thus needs a catalog cache refresh . Is false by <nl> / / default . <nl> struct ShardVersionTargetingInfo { <nl> / / shard is currently marked as needing a catalog cache refresh ( stale ) . <nl> using ShardVersionMap = std : : map < ShardId , ShardVersionTargetingInfo > ; <nl> <nl> + / / This class serves as a Facade around how the mapping of ranges to chunks is represented . It also <nl> + / / provides a simpler , high - level interface for domain specific operations without exposing the <nl> + / / underlying implementation . <nl> + class ChunkMap { <nl> + / / Ordered map from the max for each chunk to an entry describing the chunk <nl> + using ChunkInfoMap = std : : map < std : : string , std : : shared_ptr < ChunkInfo > > ; <nl> + <nl> + public : <nl> + ChunkMap ( Ordering ordering ) : _shardKeyOrdering ( std : : move ( ordering ) ) { } <nl> + <nl> + size_t size ( ) const { <nl> + return _chunkMap . size ( ) ; <nl> + } <nl> + <nl> + template < typename Callable > <nl> + void forEach ( Callable & & handler , const BSONObj & shardKey = BSONObj ( ) ) const { <nl> + auto it = shardKey . isEmpty ( ) ? _chunkMap . begin ( ) : _findIntersectingChunk ( shardKey ) ; <nl> + <nl> + for ( ; it ! = _chunkMap . end ( ) ; + + it ) { <nl> + if ( ! handler ( it - > second ) ) <nl> + break ; <nl> + } <nl> + } <nl> + <nl> + template < typename Callable > <nl> + void forEachOverlappingChunk ( const BSONObj & min , <nl> + const BSONObj & max , <nl> + bool isMaxInclusive , <nl> + Callable & & handler ) const { <nl> + const auto bounds = _overlappingBounds ( min , max , isMaxInclusive ) ; <nl> + <nl> + for ( auto it = bounds . first ; it ! = bounds . second ; + + it ) { <nl> + if ( ! handler ( it - > second ) ) <nl> + break ; <nl> + } <nl> + } <nl> + <nl> + ShardVersionMap constructShardVersionMap ( const OID & epoch ) const ; <nl> + void addChunk ( const ChunkType & chunk ) ; <nl> + std : : shared_ptr < ChunkInfo > findIntersectingChunk ( const BSONObj & shardKey ) const ; <nl> + <nl> + private : <nl> + ChunkInfoMap : : const_iterator _findIntersectingChunk ( const BSONObj & shardKey ) const ; <nl> + std : : pair < ChunkInfoMap : : const_iterator , ChunkInfoMap : : const_iterator > _overlappingBounds ( <nl> + const BSONObj & min , const BSONObj & max , bool isMaxInclusive ) const ; <nl> + <nl> + ChunkInfoMap _chunkMap ; <nl> + const Ordering _shardKeyOrdering ; <nl> + } ; <nl> + <nl> / * * <nl> * In - memory representation of the routing table for a single sharded collection at various points <nl> * in time . <nl> class RoutingTableHistory : public std : : enable_shared_from_this < RoutingTableHist <nl> * / <nl> ChunkVersion getVersionForLogging ( const ShardId & shardId ) const ; <nl> <nl> - const ChunkInfoMap & getChunkMap ( ) const { <nl> - return _chunkMap ; <nl> + size_t numChunks ( ) const { <nl> + return _chunkMap . size ( ) ; <nl> + } <nl> + <nl> + template < typename Callable > <nl> + void forEachChunk ( Callable & & handler , const BSONObj & shardKey = BSONObj ( ) ) const { <nl> + _chunkMap . forEach ( std : : forward < Callable > ( handler ) , shardKey ) ; <nl> + } <nl> + <nl> + template < typename Callable > <nl> + void forEachOverlappingChunk ( const BSONObj & min , <nl> + const BSONObj & max , <nl> + bool isMaxInclusive , <nl> + Callable & & handler ) const { <nl> + _chunkMap . forEachOverlappingChunk ( <nl> + min , max , isMaxInclusive , std : : forward < Callable > ( handler ) ) ; <nl> + } <nl> + <nl> + std : : shared_ptr < ChunkInfo > findIntersectingChunk ( const BSONObj & shardKey ) const { <nl> + return _chunkMap . findIntersectingChunk ( shardKey ) ; <nl> } <nl> <nl> / * * <nl> class RoutingTableHistory : public std : : enable_shared_from_this < RoutingTableHist <nl> return _uuid ; <nl> } <nl> <nl> - std : : pair < ChunkInfoMap : : const_iterator , ChunkInfoMap : : const_iterator > overlappingRanges ( <nl> - const BSONObj & min , const BSONObj & max , bool isMaxInclusive ) const ; <nl> - <nl> - <nl> private : <nl> RoutingTableHistory ( NamespaceString nss , <nl> boost : : optional < UUID > uuid , <nl> KeyPattern shardKeyPattern , <nl> std : : unique_ptr < CollatorInterface > defaultCollator , <nl> bool unique , <nl> - ChunkInfoMap chunkMap , <nl> + ChunkMap chunkMap , <nl> ChunkVersion collectionVersion ) ; <nl> <nl> / * * <nl> class RoutingTableHistory : public std : : enable_shared_from_this < RoutingTableHist <nl> <nl> ChunkVersion _getVersion ( const ShardId & shardName , bool throwOnStaleShard ) const ; <nl> <nl> - std : : string _extractKeyString ( const BSONObj & shardKeyValue ) const ; <nl> - <nl> / / The shard versioning mechanism hinges on keeping track of the number of times we reload <nl> / / ChunkManagers . <nl> const unsigned long long _sequenceNumber ; <nl> class RoutingTableHistory : public std : : enable_shared_from_this < RoutingTableHist <nl> / / The key pattern used to shard the collection <nl> const ShardKeyPattern _shardKeyPattern ; <nl> <nl> - const Ordering _shardKeyOrdering ; <nl> - <nl> / / Default collation to use for routing data queries for this collection <nl> const std : : unique_ptr < CollatorInterface > _defaultCollator ; <nl> <nl> class RoutingTableHistory : public std : : enable_shared_from_this < RoutingTableHist <nl> <nl> / / Map from the max for each chunk to an entry describing the chunk . The union of all chunks ' <nl> / / ranges must cover the complete space from [ MinKey , MaxKey ) . <nl> - const ChunkInfoMap _chunkMap ; <nl> + ChunkMap _chunkMap ; <nl> <nl> / / Max version across all chunks <nl> const ChunkVersion _collectionVersion ; <nl> <nl> / / The representation of shard versions and staleness indicators for this namespace . If a <nl> / / shard does not exist , it will not have an entry in the map . <nl> + / / Note : this declaration must not be moved before _chunkMap since it is initialized by using <nl> + / / the _chunkMap instance . <nl> ShardVersionMap _shardVersions ; <nl> <nl> friend class ChunkManager ; <nl> class ChunkManager : public std : : enable_shared_from_this < ChunkManager > { <nl> ChunkManager & operator = ( const ChunkManager & ) = delete ; <nl> <nl> public : <nl> - class ConstChunkIterator { <nl> - public : <nl> - ConstChunkIterator ( ) = default ; <nl> - explicit ConstChunkIterator ( ChunkInfoMap : : const_iterator iter , <nl> - boost : : optional < Timestamp > clusterTime ) <nl> - : _iter { std : : move ( iter ) } , _clusterTime { std : : move ( clusterTime ) } { } <nl> - <nl> - ConstChunkIterator & operator + + ( ) { <nl> - + + _iter ; <nl> - return * this ; <nl> - } <nl> - ConstChunkIterator operator + + ( int ) { <nl> - return ConstChunkIterator { _iter + + , _clusterTime } ; <nl> - } <nl> - bool operator = = ( const ConstChunkIterator & other ) const { <nl> - return _iter = = other . _iter ; <nl> - } <nl> - bool operator ! = ( const ConstChunkIterator & other ) const { <nl> - return ! ( * this = = other ) ; <nl> - } <nl> - const Chunk operator * ( ) const { <nl> - return Chunk { * _iter - > second , _clusterTime } ; <nl> - } <nl> - <nl> - private : <nl> - ChunkInfoMap : : const_iterator _iter ; <nl> - boost : : optional < Timestamp > _clusterTime ; <nl> - } ; <nl> - <nl> - class ConstRangeOfChunks { <nl> - public : <nl> - ConstRangeOfChunks ( ConstChunkIterator begin , ConstChunkIterator end ) <nl> - : _begin { std : : move ( begin ) } , _end { std : : move ( end ) } { } <nl> - <nl> - ConstChunkIterator begin ( ) const { <nl> - return _begin ; <nl> - } <nl> - ConstChunkIterator end ( ) const { <nl> - return _end ; <nl> - } <nl> - <nl> - private : <nl> - ConstChunkIterator _begin ; <nl> - ConstChunkIterator _end ; <nl> - } ; <nl> - <nl> ChunkManager ( std : : shared_ptr < RoutingTableHistory > rt , boost : : optional < Timestamp > clusterTime ) <nl> : _rt ( std : : move ( rt ) ) , _clusterTime ( std : : move ( clusterTime ) ) { } <nl> <nl> class ChunkManager : public std : : enable_shared_from_this < ChunkManager > { <nl> return _rt - > getVersionForLogging ( shardId ) ; <nl> } <nl> <nl> - ConstRangeOfChunks chunks ( ) const { <nl> - return { ConstChunkIterator { _rt - > getChunkMap ( ) . cbegin ( ) , _clusterTime } , <nl> - ConstChunkIterator { _rt - > getChunkMap ( ) . cend ( ) , _clusterTime } } ; <nl> + template < typename Callable > <nl> + void forEachChunk ( Callable & & handler ) const { <nl> + _rt - > forEachChunk ( <nl> + [ this , handler = std : : forward < Callable > ( handler ) ] ( const auto & chunkInfo ) mutable { <nl> + if ( ! handler ( Chunk { * chunkInfo , _clusterTime } ) ) <nl> + return false ; <nl> + <nl> + return true ; <nl> + } ) ; <nl> } <nl> <nl> int numChunks ( ) const { <nl> - return _rt - > getChunkMap ( ) . size ( ) ; <nl> + return _rt - > numChunks ( ) ; <nl> } <nl> <nl> / * * <nl> class ChunkManager : public std : : enable_shared_from_this < ChunkManager > { <nl> <nl> / * * <nl> * Given a shardKey , returns the first chunk which is owned by shardId and overlaps or sorts <nl> - * after that shardKey . The returned iterator range always contains one or zero entries . If zero <nl> - * entries are returned , this means no such chunk exists . <nl> + * after that shardKey . If the return value is empty , this means no such chunk exists . <nl> * / <nl> - ConstRangeOfChunks getNextChunkOnShard ( const BSONObj & shardKey , const ShardId & shardId ) const ; <nl> + boost : : optional < Chunk > getNextChunkOnShard ( const BSONObj & shardKey , <nl> + const ShardId & shardId ) const ; <nl> <nl> / * * <nl> * Given a shard key ( or a prefix ) that has been extracted from a document , returns the chunk <nl> new file mode 100644 <nl> index 000000000000 . . a27fc59e8890 <nl> mmm / dev / null <nl> ppp b / src / mongo / s / chunk_map_test . cpp <nl> <nl> + / * * <nl> + * Copyright ( C ) 2019 - present MongoDB , Inc . <nl> + * <nl> + * This program is free software : you can redistribute it and / or modify <nl> + * it under the terms of the Server Side Public License , version 1 , <nl> + * as published by MongoDB , Inc . <nl> + * <nl> + * This program is distributed in the hope that it will be useful , <nl> + * but WITHOUT ANY WARRANTY ; without even the implied warranty of <nl> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the <nl> + * Server Side Public License for more details . <nl> + * <nl> + * You should have received a copy of the Server Side Public License <nl> + * along with this program . If not , see <nl> + * < http : / / www . mongodb . com / licensing / server - side - public - license > . <nl> + * <nl> + * As a special exception , the copyright holders give permission to link the <nl> + * code of portions of this program with the OpenSSL library under certain <nl> + * conditions as described in each individual source file and distribute <nl> + * linked combinations including the program with the OpenSSL library . You <nl> + * must comply with the Server Side Public License in all respects for <nl> + * all of the code used other than as permitted herein . If you modify file ( s ) <nl> + * with this exception , you may extend this exception to your version of the <nl> + * file ( s ) , but you are not obligated to do so . If you do not wish to do so , <nl> + * delete this exception statement from your version . If you delete this <nl> + * exception statement from all source files in the program , then also delete <nl> + * it in the license file . <nl> + * / <nl> + <nl> + # include " mongo / platform / basic . h " <nl> + <nl> + # include " mongo / s / chunk_manager . h " <nl> + # include " mongo / unittest / unittest . h " <nl> + <nl> + namespace mongo { <nl> + <nl> + namespace { <nl> + <nl> + const NamespaceString kNss ( " TestDB " , " TestColl " ) ; <nl> + const ShardId kThisShard ( " testShard " ) ; <nl> + <nl> + class ChunkMapTest : public unittest : : Test { <nl> + public : <nl> + const KeyPattern & getShardKeyPattern ( ) const { <nl> + return _shardKeyPattern ; <nl> + } <nl> + <nl> + private : <nl> + KeyPattern _shardKeyPattern { BSON ( " a " < < 1 ) } ; <nl> + } ; <nl> + <nl> + } / / namespace <nl> + <nl> + TEST_F ( ChunkMapTest , TestAddChunk ) { <nl> + ChunkMap chunkMap ( Ordering : : make ( getShardKeyPattern ( ) . toBSON ( ) ) ) ; <nl> + <nl> + const OID epoch = OID : : gen ( ) ; <nl> + ChunkVersion version { 1 , 0 , epoch } ; <nl> + <nl> + auto chunk = <nl> + ChunkType { kNss , <nl> + ChunkRange { getShardKeyPattern ( ) . globalMin ( ) , getShardKeyPattern ( ) . globalMax ( ) } , <nl> + version , <nl> + kThisShard } ; <nl> + <nl> + chunkMap . addChunk ( chunk ) ; <nl> + <nl> + ASSERT_EQ ( chunkMap . size ( ) , 1 ) ; <nl> + } <nl> + <nl> + TEST_F ( ChunkMapTest , TestEnumerateAllChunks ) { <nl> + ChunkMap chunkMap ( Ordering : : make ( getShardKeyPattern ( ) . toBSON ( ) ) ) ; <nl> + <nl> + const OID epoch = OID : : gen ( ) ; <nl> + ChunkVersion version { 1 , 0 , epoch } ; <nl> + <nl> + chunkMap . addChunk ( ChunkType { <nl> + kNss , ChunkRange { getShardKeyPattern ( ) . globalMin ( ) , BSON ( " a " < < 0 ) } , version , kThisShard } ) ; <nl> + <nl> + chunkMap . addChunk ( <nl> + ChunkType { kNss , ChunkRange { BSON ( " a " < < 0 ) , BSON ( " a " < < 100 ) } , version , kThisShard } ) ; <nl> + <nl> + chunkMap . addChunk ( ChunkType { <nl> + kNss , ChunkRange { BSON ( " a " < < 100 ) , getShardKeyPattern ( ) . globalMax ( ) } , version , kThisShard } ) ; <nl> + <nl> + int count = 0 ; <nl> + auto lastMax = getShardKeyPattern ( ) . globalMin ( ) ; <nl> + <nl> + chunkMap . forEach ( [ & ] ( const auto & chunkInfo ) { <nl> + ASSERT ( SimpleBSONObjComparator : : kInstance . evaluate ( chunkInfo - > getMax ( ) > lastMax ) ) ; <nl> + lastMax = chunkInfo - > getMax ( ) ; <nl> + count + + ; <nl> + <nl> + return true ; <nl> + } ) ; <nl> + <nl> + ASSERT_EQ ( count , chunkMap . size ( ) ) ; <nl> + } <nl> + <nl> + TEST_F ( ChunkMapTest , TestIntersectingChunk ) { <nl> + ChunkMap chunkMap ( Ordering : : make ( getShardKeyPattern ( ) . toBSON ( ) ) ) ; <nl> + <nl> + const OID epoch = OID : : gen ( ) ; <nl> + ChunkVersion version { 1 , 0 , epoch } ; <nl> + <nl> + chunkMap . addChunk ( ChunkType { <nl> + kNss , ChunkRange { getShardKeyPattern ( ) . globalMin ( ) , BSON ( " a " < < 0 ) } , version , kThisShard } ) ; <nl> + <nl> + chunkMap . addChunk ( <nl> + ChunkType { kNss , ChunkRange { BSON ( " a " < < 0 ) , BSON ( " a " < < 100 ) } , version , kThisShard } ) ; <nl> + <nl> + chunkMap . addChunk ( ChunkType { <nl> + kNss , ChunkRange { BSON ( " a " < < 100 ) , getShardKeyPattern ( ) . globalMax ( ) } , version , kThisShard } ) ; <nl> + <nl> + auto intersectingChunk = chunkMap . findIntersectingChunk ( BSON ( " a " < < 50 ) ) ; <nl> + <nl> + ASSERT ( intersectingChunk ) ; <nl> + ASSERT ( <nl> + SimpleBSONObjComparator : : kInstance . evaluate ( intersectingChunk - > getMin ( ) = = BSON ( " a " < < 0 ) ) ) ; <nl> + ASSERT ( SimpleBSONObjComparator : : kInstance . evaluate ( intersectingChunk - > getMax ( ) = = <nl> + BSON ( " a " < < 100 ) ) ) ; <nl> + } <nl> + <nl> + TEST_F ( ChunkMapTest , TestEnumerateOverlappingChunks ) { <nl> + ChunkMap chunkMap ( Ordering : : make ( getShardKeyPattern ( ) . toBSON ( ) ) ) ; <nl> + <nl> + const OID epoch = OID : : gen ( ) ; <nl> + ChunkVersion version { 1 , 0 , epoch } ; <nl> + <nl> + chunkMap . addChunk ( ChunkType { <nl> + kNss , ChunkRange { getShardKeyPattern ( ) . globalMin ( ) , BSON ( " a " < < 0 ) } , version , kThisShard } ) ; <nl> + <nl> + chunkMap . addChunk ( <nl> + ChunkType { kNss , ChunkRange { BSON ( " a " < < 0 ) , BSON ( " a " < < 100 ) } , version , kThisShard } ) ; <nl> + <nl> + chunkMap . addChunk ( ChunkType { <nl> + kNss , ChunkRange { BSON ( " a " < < 100 ) , getShardKeyPattern ( ) . globalMax ( ) } , version , kThisShard } ) ; <nl> + <nl> + auto min = BSON ( " a " < < - 50 ) ; <nl> + auto max = BSON ( " a " < < 150 ) ; <nl> + <nl> + int count = 0 ; <nl> + chunkMap . forEachOverlappingChunk ( min , max , true , [ & ] ( const auto & chunk ) { <nl> + count + + ; <nl> + return true ; <nl> + } ) ; <nl> + <nl> + ASSERT_EQ ( count , 3 ) ; <nl> + } <nl> + <nl> + } / / namespace mongo <nl> \ No newline at end of file <nl> mmm a / src / mongo / s / commands / cluster_get_shard_version_cmd . cpp <nl> ppp b / src / mongo / s / commands / cluster_get_shard_version_cmd . cpp <nl> class GetShardVersion : public BasicCommand { <nl> " Routing info requested by getShardVersion : { routingInfo } " , <nl> " Routing info requested by getShardVersion " , <nl> " routingInfo " _attr = redact ( cm - > toString ( ) ) ) ; <nl> - for ( const auto & chunk : cm - > chunks ( ) ) { <nl> + <nl> + cm - > forEachChunk ( [ & ] ( const auto & chunk ) { <nl> if ( ! exceedsSizeLimit ) { <nl> BSONArrayBuilder chunkBB ( chunksArrBuilder . subarrayStart ( ) ) ; <nl> chunkBB . append ( chunk . getMin ( ) ) ; <nl> class GetShardVersion : public BasicCommand { <nl> exceedsSizeLimit = true ; <nl> } <nl> } <nl> - } <nl> + <nl> + return true ; <nl> + } ) ; <nl> <nl> if ( ! exceedsSizeLimit ) { <nl> result . append ( " chunks " , chunksArrBuilder . arr ( ) ) ; <nl> mmm a / src / mongo / s / routing_table_history_test . cpp <nl> ppp b / src / mongo / s / routing_table_history_test . cpp <nl> std : : shared_ptr < RoutingTableHistory > splitChunk ( <nl> std : : set < ChunkInfo * > getChunksInRange ( std : : shared_ptr < RoutingTableHistory > rt , <nl> const BSONObj & min , <nl> const BSONObj & max ) { <nl> - auto chunksFromSplitIter = rt - > overlappingRanges ( min , max , false ) ; <nl> - <nl> std : : set < ChunkInfo * > chunksFromSplit ; <nl> - std : : transform ( chunksFromSplitIter . first , <nl> - chunksFromSplitIter . second , <nl> - std : : inserter ( chunksFromSplit , chunksFromSplit . begin ( ) ) , <nl> - [ ] ( const std : : pair < std : : string , std : : shared_ptr < ChunkInfo > > & pair ) { <nl> - return pair . second . get ( ) ; <nl> - } ) ; <nl> + <nl> + rt - > forEachOverlappingChunk ( min , max , false , [ & ] ( auto & chunk ) { <nl> + chunksFromSplit . insert ( chunk . get ( ) ) ; <nl> + return true ; <nl> + } ) ; <nl> + <nl> return chunksFromSplit ; <nl> } <nl> <nl> std : : set < ChunkInfo * > getChunksInRange ( std : : shared_ptr < RoutingTableHistory > rt , <nl> std : : shared_ptr < ChunkInfo > getChunkToSplit ( std : : shared_ptr < RoutingTableHistory > rt , <nl> const BSONObj & min , <nl> const BSONObj & max ) { <nl> - auto chunkToSplitIter = rt - > overlappingRanges ( min , max , false ) ; <nl> - invariant ( std : : distance ( chunkToSplitIter . first , chunkToSplitIter . second ) < = 1 ) ; <nl> - invariant ( chunkToSplitIter . first ! = rt - > getChunkMap ( ) . end ( ) ) ; <nl> + std : : shared_ptr < ChunkInfo > firstOverlappingChunk ; <nl> + <nl> + rt - > forEachOverlappingChunk ( min , max , false , [ & ] ( auto & chunkInfo ) { <nl> + firstOverlappingChunk = chunkInfo ; <nl> + return false ; / / only need first chunk <nl> + } ) ; <nl> + <nl> + invariant ( firstOverlappingChunk ) ; <nl> <nl> - return ( * chunkToSplitIter . first ) . second ; <nl> + return firstOverlappingChunk ; <nl> } <nl> <nl> / * * <nl> void assertCorrectBytesWritten ( std : : shared_ptr < RoutingTableHistory > rt , <nl> auto chunksFromSplit = getChunksInRange ( rt , minSplitBoundary , maxSplitBoundary ) ; <nl> ASSERT_EQ ( chunksFromSplit . size ( ) , expectedNumChunksFromSplit ) ; <nl> <nl> - for ( auto kv : rt - > getChunkMap ( ) ) { <nl> - auto chunkInfo = kv . second ; <nl> + rt - > forEachChunk ( [ & ] ( const auto & chunkInfo ) { <nl> auto writesTracker = chunkInfo - > getWritesTracker ( ) ; <nl> auto bytesWritten = writesTracker - > getBytesWritten ( ) ; <nl> if ( chunksFromSplit . count ( chunkInfo . get ( ) ) > 0 ) { <nl> void assertCorrectBytesWritten ( std : : shared_ptr < RoutingTableHistory > rt , <nl> } else { <nl> ASSERT_EQ ( bytesWritten , expectedBytesInChunksNotSplit ) ; <nl> } <nl> - } <nl> + <nl> + return true ; <nl> + } ) ; <nl> } <nl> <nl> / * * <nl> class RoutingTableHistoryTest : public unittest : : Test { <nl> _rt = RoutingTableHistory : : makeNew ( <nl> kNss , UUID : : gen ( ) , _shardKeyPattern , nullptr , false , epoch , { initChunk } ) ; <nl> <nl> - ASSERT_EQ ( _rt - > getChunkMap ( ) . size ( ) , 1ull ) ; <nl> + ASSERT_EQ ( _rt - > numChunks ( ) , 1ull ) ; <nl> / / Should only be one <nl> - for ( auto kv : _rt - > getChunkMap ( ) ) { <nl> - auto chunkInfo = kv . second ; <nl> + _rt - > forEachChunk ( [ & ] ( const auto & chunkInfo ) { <nl> auto writesTracker = chunkInfo - > getWritesTracker ( ) ; <nl> writesTracker - > addBytesWritten ( _bytesInOriginalChunk ) ; <nl> - } <nl> + return true ; <nl> + } ) ; <nl> } <nl> <nl> virtual const KeyPattern & getShardKeyPattern ( ) const { <nl> class RoutingTableHistoryTestThreeInitialChunks : public RoutingTableHistoryTest <nl> getShardKeyPattern ( ) . globalMax ( ) } ; <nl> _rt = splitChunk ( RoutingTableHistoryTest : : getInitialRoutingTable ( ) , <nl> _initialChunkBoundaryPoints ) ; <nl> - ASSERT_EQ ( _rt - > getChunkMap ( ) . size ( ) , 3ull ) ; <nl> + ASSERT_EQ ( _rt - > numChunks ( ) , 3ull ) ; <nl> } <nl> <nl> const std : : shared_ptr < RoutingTableHistory > & getInitialRoutingTable ( ) const { <nl> TEST_F ( RoutingTableHistoryTest , SplittingOnlyChunkCopiesBytesWrittenToAllSubchun <nl> <nl> auto rt = splitChunk ( getInitialRoutingTable ( ) , newChunkBoundaryPoints ) ; <nl> <nl> - ASSERT_EQ ( rt - > getChunkMap ( ) . size ( ) , 3ull ) ; <nl> - for ( auto kv : rt - > getChunkMap ( ) ) { <nl> - auto chunkInfo = kv . second ; <nl> + ASSERT_EQ ( rt - > numChunks ( ) , 3ull ) ; <nl> + <nl> + rt - > forEachChunk ( [ & ] ( const auto & chunkInfo ) { <nl> auto writesTracker = chunkInfo - > getWritesTracker ( ) ; <nl> auto bytesWritten = writesTracker - > getBytesWritten ( ) ; <nl> ASSERT_EQ ( bytesWritten , getBytesInOriginalChunk ( ) ) ; <nl> - } <nl> + return true ; <nl> + } ) ; <nl> } <nl> <nl> TEST_F ( RoutingTableHistoryTestThreeInitialChunks , <nl> TEST_F ( RoutingTableHistoryTestThreeInitialChunks , <nl> auto expectedNumChunksFromSplit = 2 ; <nl> auto expectedBytesInChunksFromSplit = getBytesInOriginalChunk ( ) + bytesToWrite ; <nl> auto expectedBytesInChunksNotSplit = getBytesInOriginalChunk ( ) ; <nl> - ASSERT_EQ ( rt - > getChunkMap ( ) . size ( ) , 4ull ) ; <nl> + ASSERT_EQ ( rt - > numChunks ( ) , 4ull ) ; <nl> assertCorrectBytesWritten ( rt , <nl> minKey , <nl> maxKey , <nl> TEST_F ( RoutingTableHistoryTestThreeInitialChunks , <nl> auto expectedNumChunksFromSplit = 3 ; <nl> auto expectedBytesInChunksFromSplit = getBytesInOriginalChunk ( ) + bytesToWrite ; <nl> auto expectedBytesInChunksNotSplit = getBytesInOriginalChunk ( ) ; <nl> - ASSERT_EQ ( rt - > getChunkMap ( ) . size ( ) , 5ull ) ; <nl> + ASSERT_EQ ( rt - > numChunks ( ) , 5ull ) ; <nl> assertCorrectBytesWritten ( rt , <nl> minKey , <nl> maxKey , <nl> TEST_F ( RoutingTableHistoryTestThreeInitialChunks , <nl> auto expectedNumChunksFromSplit = 2 ; <nl> auto expectedBytesInChunksFromSplit = getBytesInOriginalChunk ( ) + bytesToWrite ; <nl> auto expectedBytesInChunksNotSplit = getBytesInOriginalChunk ( ) ; <nl> - ASSERT_EQ ( rt - > getChunkMap ( ) . size ( ) , 4ull ) ; <nl> + ASSERT_EQ ( rt - > numChunks ( ) , 4ull ) ; <nl> assertCorrectBytesWritten ( rt , <nl> minKey , <nl> maxKey , <nl>
|
SERVER - 47674 Create Facade wrapper for ChunkInfoMap
|
mongodb/mongo
|
b3ecf8bc6b2c787d672be1c31187f3f2b2d673cd
|
2020-04-27T12:56:45Z
|
deleted file mode 100644 <nl> index a500ce9fe27e . . 000000000000 <nl> mmm a / system / settings / freebsd . xml <nl> ppp / dev / null <nl> <nl> - < ? xml version = " 1 . 0 " encoding = " utf - 8 " ? > <nl> - < settings version = " 1 " > <nl> - < section id = " player " > <nl> - < category id = " videoplayer " > <nl> - < group id = " 3 " > <nl> - < setting id = " videoplayer . usevdpau " type = " boolean " label = " 13425 " help = " 36155 " > <nl> - < requirement > HAVE_LIBVDPAU < / requirement > <nl> - < visible > false < / visible > <nl> - < level > 2 < / level > <nl> - < default > true < / default > <nl> - < control type = " toggle " / > <nl> - < / setting > <nl> - < setting id = " videoplayer . usevdpaumixer " type = " boolean " label = " 13437 " help = " 36421 " > <nl> - < requirement > HAVE_LIBVDPAU < / requirement > <nl> - < visible > false < / visible > <nl> - < level > 2 < / level > <nl> - < default > true < / default > <nl> - < dependencies > <nl> - < dependency type = " enable " > <nl> - < condition setting = " videoplayer . usevdpau " operator = " is " > true < / condition > < ! - - USE VDPAU - - > <nl> - < / dependency > <nl> - < / dependencies > <nl> - < control type = " toggle " / > <nl> - < / setting > <nl> - < setting id = " videoplayer . usevdpaumpeg2 " type = " boolean " parent = " videoplayer . usevdpau " label = " 13441 " help = " 13442 " > <nl> - < requirement > HAVE_LIBVDPAU < / requirement > <nl> - < visible > false < / visible > <nl> - < level > 3 < / level > <nl> - < default > true < / default > <nl> - < dependencies > <nl> - < dependency type = " enable " > <nl> - < condition setting = " videoplayer . usevdpau " operator = " is " > true < / condition > < ! - - USE VDPAU - - > <nl> - < / dependency > <nl> - < / dependencies > <nl> - < control type = " toggle " / > <nl> - < / setting > <nl> - < setting id = " videoplayer . usevdpaumpeg4 " type = " boolean " parent = " videoplayer . usevdpau " label = " 13443 " help = " 13444 " > <nl> - < requirement > HAVE_LIBVDPAU < / requirement > <nl> - < visible > false < / visible > <nl> - < level > 3 < / level > <nl> - < default > false < / default > <nl> - < dependencies > <nl> - < dependency type = " enable " > <nl> - < condition setting = " videoplayer . usevdpau " operator = " is " > true < / condition > < ! - - USE VDPAU - - > <nl> - < / dependency > <nl> - < / dependencies > <nl> - < control type = " toggle " / > <nl> - < / setting > <nl> - < setting id = " videoplayer . usevdpauvc1 " type = " boolean " parent = " videoplayer . usevdpau " label = " 13445 " help = " 13446 " > <nl> - < requirement > HAVE_LIBVDPAU < / requirement > <nl> - < visible > false < / visible > <nl> - < level > 3 < / level > <nl> - < default > true < / default > <nl> - < dependencies > <nl> - < dependency type = " enable " > <nl> - < condition setting = " videoplayer . usevdpau " operator = " is " > true < / condition > < ! - - USE VDPAU - - > <nl> - < / dependency > <nl> - < / dependencies > <nl> - < control type = " toggle " / > <nl> - < / setting > <nl> - < setting id = " videoplayer . usevaapi " type = " boolean " label = " 13426 " help = " 36156 " > <nl> - < requirement > HAVE_LIBVA < / requirement > <nl> - < visible > false < / visible > <nl> - < level > 2 < / level > <nl> - < default > true < / default > <nl> - < control type = " toggle " / > <nl> - < / setting > <nl> - < setting id = " videoplayer . usevaapimpeg2 " type = " boolean " parent = " videoplayer . usevaapi " label = " 13447 " help = " 13448 " > <nl> - < requirement > HAVE_LIBVA < / requirement > <nl> - < visible > false < / visible > <nl> - < dependencies > <nl> - < dependency type = " enable " > <nl> - < condition setting = " videoplayer . usevaapi " operator = " is " > true < / condition > <nl> - < / dependency > <nl> - < / dependencies > <nl> - < level > 3 < / level > <nl> - < default > true < / default > <nl> - < control type = " toggle " / > <nl> - < / setting > <nl> - < setting id = " videoplayer . usevaapimpeg4 " type = " boolean " parent = " videoplayer . usevaapi " label = " 13449 " help = " 13450 " > <nl> - < requirement > HAVE_LIBVA < / requirement > <nl> - < visible > false < / visible > <nl> - < dependencies > <nl> - < dependency type = " enable " > <nl> - < condition setting = " videoplayer . usevaapi " operator = " is " > true < / condition > <nl> - < / dependency > <nl> - < / dependencies > <nl> - < level > 3 < / level > <nl> - < default > true < / default > <nl> - < control type = " toggle " / > <nl> - < / setting > <nl> - < setting id = " videoplayer . usevaapivc1 " type = " boolean " parent = " videoplayer . usevaapi " label = " 13451 " help = " 13452 " > <nl> - < requirement > HAVE_LIBVA < / requirement > <nl> - < visible > false < / visible > <nl> - < dependencies > <nl> - < dependency type = " enable " > <nl> - < condition setting = " videoplayer . usevaapi " operator = " is " > true < / condition > <nl> - < / dependency > <nl> - < / dependencies > <nl> - < level > 3 < / level > <nl> - < default > true < / default > <nl> - < control type = " toggle " / > <nl> - < / setting > <nl> - < setting id = " videoplayer . usevaapivp8 " type = " boolean " parent = " videoplayer . usevaapi " label = " 13453 " help = " 13454 " > <nl> - < requirement > HAVE_LIBVA < / requirement > <nl> - < visible > false < / visible > <nl> - < dependencies > <nl> - < dependency type = " enable " > <nl> - < condition setting = " videoplayer . usevaapi " operator = " is " > true < / condition > <nl> - < / dependency > <nl> - < / dependencies > <nl> - < level > 3 < / level > <nl> - < default > true < / default > <nl> - < control type = " toggle " / > <nl> - < / setting > <nl> - < setting id = " videoplayer . usevaapivp9 " type = " boolean " parent = " videoplayer . usevaapi " label = " 13455 " help = " 13456 " > <nl> - < requirement > HAVE_LIBVA < / requirement > <nl> - < visible > false < / visible > <nl> - < dependencies > <nl> - < dependency type = " enable " > <nl> - < condition setting = " videoplayer . usevaapi " operator = " is " > true < / condition > <nl> - < / dependency > <nl> - < / dependencies > <nl> - < level > 3 < / level > <nl> - < default > true < / default > <nl> - < control type = " toggle " / > <nl> - < / setting > <nl> - < setting id = " videoplayer . usevaapihevc " type = " boolean " parent = " videoplayer . usevaapi " label = " 13460 " help = " 13461 " > <nl> - < requirement > HAVE_LIBVA < / requirement > <nl> - < visible > false < / visible > <nl> - < dependencies > <nl> - < dependency type = " enable " > <nl> - < condition setting = " videoplayer . usevaapi " operator = " is " > true < / condition > <nl> - < / dependency > <nl> - < / dependencies > <nl> - < level > 3 < / level > <nl> - < default > true < / default > <nl> - < control type = " toggle " / > <nl> - < / setting > <nl> - < setting id = " videoplayer . prefervaapirender " type = " boolean " parent = " videoplayer . usevaapi " label = " 13457 " help = " 36433 " > <nl> - < requirement > HAVE_LIBVA < / requirement > <nl> - < visible > false < / visible > <nl> - < dependencies > <nl> - < dependency type = " enable " > <nl> - < condition setting = " videoplayer . usevaapi " operator = " is " > true < / condition > <nl> - < / dependency > <nl> - < / dependencies > <nl> - < level > 3 < / level > <nl> - < default > true < / default > <nl> - < control type = " toggle " / > <nl> - < / setting > <nl> - < / group > <nl> - < / category > <nl> - < / section > <nl> - < section id = " system " > <nl> - < category id = " display " > <nl> - < group id = " 1 " > <nl> - < setting id = " videoscreen . fakefullscreen " > <nl> - < visible > false < / visible > <nl> - < / setting > <nl> - < / group > <nl> - < / category > <nl> - < / section > <nl> - < / settings > <nl> new file mode 120000 <nl> index 000000000000 . . fde0ce778e28 <nl> mmm / dev / null <nl> ppp b / system / settings / freebsd . xml <nl> @ @ - 0 , 0 + 1 @ @ <nl> + linux . xml <nl> \ No newline at end of file <nl>
|
Merge pull request from lrusak / freebsd - settings
|
xbmc/xbmc
|
1579b0f69bc23c01e3f813d0fe96a2ec1656dc83
|
2020-11-26T00:32:20Z
|
mmm a / Marlin / src / module / temperature . cpp <nl> ppp b / Marlin / src / module / temperature . cpp <nl> uint8_t Temperature : : soft_pwm_amount [ HOTENDS ] , <nl> <nl> # if HAS_PID_HEATING <nl> <nl> - void Temperature : : PID_autotune ( float temp , int hotend , int ncycles , bool set_result / * = false * / ) { <nl> + void Temperature : : PID_autotune ( const float temp , const int8_t hotend , const int8_t ncycles , const bool set_result / * = false * / ) { <nl> float input = 0 . 0 ; <nl> int cycles = 0 ; <nl> bool heating = true ; <nl> uint8_t Temperature : : soft_pwm_amount [ HOTENDS ] , <nl> long t_high = 0 , t_low = 0 ; <nl> <nl> long bias , d ; <nl> - float Ku , Tu ; <nl> - float workKp = 0 , workKi = 0 , workKd = 0 ; <nl> - float max = 0 , min = 10000 ; <nl> + float Ku , Tu , <nl> + workKp = 0 , workKi = 0 , workKd = 0 , <nl> + max = 0 , min = 10000 ; <nl> + <nl> + # if WATCH_THE_BED | | WATCH_HOTENDS <nl> + const float watch_temp_target = temp - <nl> + # if ENABLED ( THERMAL_PROTECTION_BED ) & & ENABLED ( PIDTEMPBED ) & & ENABLED ( THERMAL_PROTECTION_HOTENDS ) & & ENABLED ( PIDTEMP ) <nl> + ( hotend < 0 ? ( WATCH_BED_TEMP_INCREASE + TEMP_BED_HYSTERESIS + 1 ) : ( WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1 ) ) <nl> + # elif ENABLED ( THERMAL_PROTECTION_BED ) & & ENABLED ( PIDTEMPBED ) <nl> + ( WATCH_BED_TEMP_INCREASE + TEMP_BED_HYSTERESIS + 1 ) <nl> + # else <nl> + ( WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1 ) <nl> + # endif <nl> + ; <nl> + const int8_t watch_temp_period = <nl> + # if ENABLED ( THERMAL_PROTECTION_BED ) & & ENABLED ( PIDTEMPBED ) & & ENABLED ( THERMAL_PROTECTION_HOTENDS ) & & ENABLED ( PIDTEMP ) <nl> + hotend < 0 ? temp - THERMAL_PROTECTION_BED_PERIOD : THERMAL_PROTECTION_PERIOD <nl> + # elif ENABLED ( THERMAL_PROTECTION_BED ) & & ENABLED ( PIDTEMPBED ) <nl> + THERMAL_PROTECTION_BED_PERIOD <nl> + # else <nl> + THERMAL_PROTECTION_PERIOD <nl> + # endif <nl> + ; <nl> + const int8_t hysteresis = <nl> + # if ENABLED ( THERMAL_PROTECTION_BED ) & & ENABLED ( PIDTEMPBED ) & & ENABLED ( THERMAL_PROTECTION_HOTENDS ) & & ENABLED ( PIDTEMP ) <nl> + hotend < 0 ? TEMP_BED_HYSTERESIS : TEMP_HYSTERESIS <nl> + # elif ENABLED ( THERMAL_PROTECTION_BED ) & & ENABLED ( PIDTEMPBED ) <nl> + TEMP_BED_HYSTERESIS <nl> + # else <nl> + TEMP_HYSTERESIS <nl> + # endif <nl> + ; <nl> + millis_t temp_change_ms = next_temp_ms + watch_temp_period * 1000UL ; <nl> + float next_watch_temp = 0 . 0 ; <nl> + bool heated = false ; <nl> + # endif <nl> <nl> # if HAS_AUTO_FAN <nl> next_auto_fan_check_ms = next_temp_ms + 2500UL ; <nl> # endif <nl> <nl> - if ( hotend > = <nl> - # if ENABLED ( PIDTEMP ) <nl> - HOTENDS <nl> - # else <nl> - 0 <nl> - # endif <nl> - | | hotend < <nl> - # if ENABLED ( PIDTEMPBED ) <nl> - - 1 <nl> - # else <nl> - 0 <nl> - # endif <nl> - ) { <nl> + # if ENABLED ( PIDTEMP ) <nl> + # define _TOP_HOTEND HOTENDS - 1 <nl> + # else <nl> + # define _TOP_HOTEND - 1 <nl> + # endif <nl> + # if ENABLED ( PIDTEMPBED ) <nl> + # define _BOT_HOTEND - 1 <nl> + # else <nl> + # define _BOT_HOTEND 0 <nl> + # endif <nl> + <nl> + if ( ! WITHIN ( hotend , _BOT_HOTEND , _TOP_HOTEND ) ) { <nl> SERIAL_ECHOLN ( MSG_PID_BAD_EXTRUDER_NUM ) ; <nl> return ; <nl> } <nl> uint8_t Temperature : : soft_pwm_amount [ HOTENDS ] , <nl> ; <nl> bias + = ( d * ( t_high - t_low ) ) / ( t_low + t_high ) ; <nl> bias = constrain ( bias , 20 , max_pow - 20 ) ; <nl> - d = ( bias > max_pow / 2 ) ? max_pow - 1 - bias : bias ; <nl> + d = ( bias > max_pow > > 1 ) ? max_pow - 1 - bias : bias ; <nl> <nl> SERIAL_PROTOCOLPAIR ( MSG_BIAS , bias ) ; <nl> SERIAL_PROTOCOLPAIR ( MSG_D , d ) ; <nl> uint8_t Temperature : : soft_pwm_amount [ HOTENDS ] , <nl> # endif <nl> <nl> next_temp_ms = ms + 2000UL ; <nl> + <nl> + # if WATCH_THE_BED | | WATCH_HOTENDS <nl> + if ( ! heated & & input > next_watch_temp ) { <nl> + if ( input > watch_temp_target ) heated = true ; <nl> + next_watch_temp = input + hysteresis ; <nl> + temp_change_ms = ms + watch_temp_period * 1000UL ; <nl> + } <nl> + else if ( ( ! heated & & ELAPSED ( ms , temp_change_ms ) ) | | ( heated & & input < temp - MAX_OVERSHOOT_PID_AUTOTUNE ) ) <nl> + _temp_error ( hotend , PSTR ( MSG_T_THERMAL_RUNAWAY ) , PSTR ( MSG_THERMAL_RUNAWAY ) ) ; <nl> + # endif <nl> } / / every 2 seconds <nl> / / Timeout after 20 minutes since the last undershoot / overshoot cycle <nl> if ( ( ( ms - t1 ) + ( ms - t2 ) ) > ( 20L * 60L * 1000L ) ) { <nl> mmm a / Marlin / src / module / temperature . h <nl> ppp b / Marlin / src / module / temperature . h <nl> class Temperature { <nl> * Perform auto - tuning for hotend or bed in response to M303 <nl> * / <nl> # if HAS_PID_HEATING <nl> - static void PID_autotune ( float temp , int hotend , int ncycles , bool set_result = false ) ; <nl> + static void PID_autotune ( const float temp , const int8_t hotend , const int8_t ncycles , const bool set_result = false ) ; <nl> # endif <nl> <nl> / * * <nl>
|
Merge pull request from thinkyhead / bf2_protect_M303
|
MarlinFirmware/Marlin
|
f3deb37bdf4f5045b6a58e72eef39f23dfcede9e
|
2017-11-03T09:42:14Z
|
mmm a / tools / run_tests / run_interop_tests . py <nl> ppp b / tools / run_tests / run_interop_tests . py <nl> def cloud_to_prod_env ( self ) : <nl> return { } <nl> <nl> def server_cmd ( self , args ) : <nl> - return [ ' bins / opt / interop_server ' , ' - - use_tls = true ' ] + args <nl> + return [ ' bins / opt / interop_server ' ] + args <nl> <nl> def global_env ( self ) : <nl> return { } <nl> def cloud_to_prod_env ( self ) : <nl> return { } <nl> <nl> def server_cmd ( self , args ) : <nl> - return [ ' mono ' , ' Grpc . IntegrationTesting . Server . exe ' , ' - - use_tls = true ' ] + args <nl> + return [ ' mono ' , ' Grpc . IntegrationTesting . Server . exe ' ] + args <nl> <nl> def global_env ( self ) : <nl> return { } <nl> def cloud_to_prod_env ( self ) : <nl> return { } <nl> <nl> def server_cmd ( self , args ) : <nl> - return [ ' dotnet ' , ' exec ' , ' Grpc . IntegrationTesting . Server . dll ' , ' - - use_tls = true ' ] + args <nl> + return [ ' dotnet ' , ' exec ' , ' Grpc . IntegrationTesting . Server . dll ' ] + args <nl> <nl> def global_env ( self ) : <nl> return { } <nl> def cloud_to_prod_env ( self ) : <nl> return { } <nl> <nl> def server_cmd ( self , args ) : <nl> - return [ ' . / run - test - server . sh ' , ' - - use_tls = true ' ] + args <nl> + return [ ' . / run - test - server . sh ' ] + args <nl> <nl> def global_env ( self ) : <nl> return { } <nl> def cloud_to_prod_env ( self ) : <nl> return { } <nl> <nl> def server_cmd ( self , args ) : <nl> - return [ ' go ' , ' run ' , ' server . go ' , ' - - use_tls = true ' ] + args <nl> + return [ ' go ' , ' run ' , ' server . go ' ] + args <nl> <nl> def global_env ( self ) : <nl> return { } <nl> def cloud_to_prod_env ( self ) : <nl> <nl> def server_cmd ( self , args ) : <nl> return [ ' tools / run_tests / interop / with_nvm . sh ' , <nl> - ' node ' , ' src / node / interop / interop_server . js ' , <nl> - ' - - use_tls = true ' ] + args <nl> + ' node ' , ' src / node / interop / interop_server . js ' ] + args <nl> <nl> def global_env ( self ) : <nl> return { } <nl> def cloud_to_prod_env ( self ) : <nl> <nl> def server_cmd ( self , args ) : <nl> return [ ' tools / run_tests / interop / with_rvm . sh ' , <nl> - ' ruby ' , ' src / ruby / pb / test / server . rb ' , ' - - use_tls = true ' ] + args <nl> + ' ruby ' , ' src / ruby / pb / test / server . rb ' ] + args <nl> <nl> def global_env ( self ) : <nl> return { } <nl> def server_cmd ( self , args ) : <nl> ' src / python / grpcio_tests / setup . py ' , <nl> ' run_interop ' , <nl> ' - - server ' , <nl> - ' - - args = " { } " ' . format ( ' ' . join ( args ) + ' - - use_tls = true ' ) <nl> + ' - - args = " { } " ' . format ( ' ' . join ( args ) ) <nl> ] <nl> <nl> def global_env ( self ) : <nl> def cloud_to_prod_jobspec ( language , test_case , server_host_name , <nl> <nl> <nl> def cloud_to_cloud_jobspec ( language , test_case , server_name , server_host , <nl> - server_port , docker_image = None ) : <nl> + server_port , docker_image = None , insecure = False ) : <nl> " " " Creates jobspec for cloud - to - cloud interop test " " " <nl> interop_only_options = [ <nl> ' - - server_host_override = foo . test . google . fr ' , <nl> - ' - - use_tls = true ' , <nl> + ' - - use_tls = % s ' % ( ' false ' if insecure else ' true ' ) , <nl> ' - - use_test_ca = true ' , <nl> ] <nl> common_options = [ <nl> def cloud_to_cloud_jobspec ( language , test_case , server_name , server_host , <nl> return test_job <nl> <nl> <nl> - def server_jobspec ( language , docker_image ) : <nl> + def server_jobspec ( language , docker_image , insecure = False ) : <nl> " " " Create jobspec for running a server " " " <nl> container_name = dockerjob . random_name ( ' interop_server_ % s ' % language . safename ) <nl> cmdline = bash_cmdline ( <nl> - language . server_cmd ( [ ' - - port = % s ' % _DEFAULT_SERVER_PORT ] ) ) <nl> + language . server_cmd ( [ ' - - port = % s ' % _DEFAULT_SERVER_PORT , <nl> + ' - - use_tls = % s ' % ( ' false ' if insecure else ' true ' ) ] ) ) <nl> environ = language . global_env ( ) <nl> if language . safename = = ' http2 ' : <nl> # we are running the http2 interop server . Open next N ports beginning <nl> def aggregate_http2_results ( stdout ) : <nl> action = ' store_const ' , <nl> const = True , <nl> help = ' Enable HTTP / 2 server edge case testing . ( Good client , bad server ) ' ) <nl> + argp . add_argument ( ' - - insecure ' , <nl> + default = False , <nl> + action = ' store_const ' , <nl> + const = True , <nl> + help = ' Whether to use secure channel . ' ) <nl> <nl> args = argp . parse_args ( ) <nl> <nl> def aggregate_http2_results ( stdout ) : <nl> try : <nl> for s in servers : <nl> lang = str ( s ) <nl> - spec = server_jobspec ( _LANGUAGES [ lang ] , docker_images . get ( lang ) ) <nl> + spec = server_jobspec ( _LANGUAGES [ lang ] , docker_images . get ( lang ) , <nl> + args . insecure ) <nl> job = dockerjob . DockerJob ( spec ) <nl> server_jobs [ lang ] = job <nl> server_addresses [ lang ] = ( ' localhost ' , job . mapped_port ( _DEFAULT_SERVER_PORT ) ) <nl> def aggregate_http2_results ( stdout ) : <nl> <nl> jobs = [ ] <nl> if args . cloud_to_prod : <nl> + if args . insecure : <nl> + print ( ' TLS is always enabled for cloud_to_prod scenarios . ' ) <nl> for server_host_name in args . prod_servers : <nl> for language in languages : <nl> for test_case in _TEST_CASES : <nl> def aggregate_http2_results ( stdout ) : <nl> jobs . append ( test_job ) <nl> <nl> if args . cloud_to_prod_auth : <nl> + if args . insecure : <nl> + print ( ' TLS is always enabled for cloud_to_prod scenarios . ' ) <nl> for server_host_name in args . prod_servers : <nl> for language in languages : <nl> for test_case in _AUTH_TEST_CASES : <nl> def aggregate_http2_results ( stdout ) : <nl> server_name , <nl> server_host , <nl> server_port , <nl> - docker_image = docker_images . get ( str ( language ) ) ) <nl> + docker_image = docker_images . get ( str ( language ) ) , <nl> + insecure = args . insecure ) <nl> jobs . append ( test_job ) <nl> <nl> if args . http2_interop : <nl> def aggregate_http2_results ( stdout ) : <nl> server_name , <nl> server_host , <nl> server_port , <nl> - docker_image = docker_images . get ( str ( http2Interop ) ) ) <nl> + docker_image = docker_images . get ( str ( http2Interop ) ) , <nl> + insecure = args . insecure ) <nl> jobs . append ( test_job ) <nl> <nl> if args . http2_badserver_interop : <nl>
|
Merge pull request from adelez / insecure_tests2
|
grpc/grpc
|
f8b268fb2574ed966b95e549b0a573c13ba7dc92
|
2017-01-18T18:11:37Z
|
mmm a / src / main . cpp <nl> ppp b / src / main . cpp <nl> void static InvalidBlockFound ( CBlockIndex * pindex , const CValidationState & state <nl> } <nl> } <nl> <nl> - void UpdateTime ( CBlockHeader & block , const CBlockIndex * pindexPrev ) <nl> - { <nl> - block . nTime = max ( pindexPrev - > GetMedianTimePast ( ) + 1 , GetAdjustedTime ( ) ) ; <nl> - <nl> - / / Updating time can change work required on testnet : <nl> - if ( Params ( ) . AllowMinDifficultyBlocks ( ) ) <nl> - block . nBits = GetNextWorkRequired ( pindexPrev , & block ) ; <nl> - } <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> void UpdateCoins ( const CTransaction & tx , CValidationState & state , CCoinsViewCache & inputs , CTxUndo & txundo , int nHeight ) <nl> { <nl> bool ret ; <nl> bool LoadExternalBlockFile ( FILE * fileIn , CDiskBlockPos * dbp ) <nl> return nLoaded > 0 ; <nl> } <nl> <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> - <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> / / <nl> / / CAlert <nl> mmm a / src / main . h <nl> ppp b / src / main . h <nl> bool GetTransaction ( const uint256 & hash , CTransaction & tx , uint256 & hashBlock , b <nl> bool ActivateBestChain ( CValidationState & state ) ; <nl> int64_t GetBlockValue ( int nHeight , int64_t nFees ) ; <nl> <nl> - void UpdateTime ( CBlockHeader & block , const CBlockIndex * pindexPrev ) ; <nl> - <nl> / * * Create a new block index entry for a given block hash * / <nl> CBlockIndex * InsertBlockIndex ( uint256 hash ) ; <nl> / * * Verify a signature * / <nl> mmm a / src / miner . cpp <nl> ppp b / src / miner . cpp <nl> CBlockTemplate * CreateNewBlock ( const CScript & scriptPubKeyIn ) <nl> <nl> / / Fill in header <nl> pblock - > hashPrevBlock = pindexPrev - > GetBlockHash ( ) ; <nl> - UpdateTime ( * pblock , pindexPrev ) ; <nl> + UpdateTime ( pblock , pindexPrev ) ; <nl> pblock - > nBits = GetNextWorkRequired ( pindexPrev , pblock ) ; <nl> pblock - > nNonce = 0 ; <nl> pblocktemplate - > vTxSigOps [ 0 ] = GetLegacySigOpCount ( pblock - > vtx [ 0 ] ) ; <nl> void static BitcoinMiner ( CWallet * pwallet ) <nl> break ; <nl> <nl> / / Update nTime every few seconds <nl> - UpdateTime ( * pblock , pindexPrev ) ; <nl> + UpdateTime ( pblock , pindexPrev ) ; <nl> if ( Params ( ) . AllowMinDifficultyBlocks ( ) ) <nl> { <nl> / / Changing pblock - > nTime can change work required on testnet : <nl> mmm a / src / pow . cpp <nl> ppp b / src / pow . cpp <nl> <nl> # include " chainparams . h " <nl> # include " core . h " <nl> # include " main . h " <nl> + # include " timedata . h " <nl> # include " uint256 . h " <nl> <nl> unsigned int GetNextWorkRequired ( const CBlockIndex * pindexLast , const CBlockHeader * pblock ) <nl> unsigned int ComputeMinWork ( unsigned int nBase , int64_t nTime ) <nl> bnResult = bnLimit ; <nl> return bnResult . GetCompact ( ) ; <nl> } <nl> + <nl> + void UpdateTime ( CBlockHeader * pblock , const CBlockIndex * pindexPrev ) <nl> + { <nl> + pblock - > nTime = std : : max ( pindexPrev - > GetMedianTimePast ( ) + 1 , GetAdjustedTime ( ) ) ; <nl> + <nl> + / / Updating time can change work required on testnet : <nl> + if ( Params ( ) . AllowMinDifficultyBlocks ( ) ) <nl> + pblock - > nBits = GetNextWorkRequired ( pindexPrev , pblock ) ; <nl> + } <nl> mmm a / src / pow . h <nl> ppp b / src / pow . h <nl> bool CheckProofOfWork ( uint256 hash , unsigned int nBits ) ; <nl> / * * Calculate the minimum amount of work a received block needs , without knowing its direct parent * / <nl> unsigned int ComputeMinWork ( unsigned int nBase , int64_t nTime ) ; <nl> <nl> + void UpdateTime ( CBlockHeader * block , const CBlockIndex * pindexPrev ) ; <nl> + <nl> # endif <nl> mmm a / src / rpcmining . cpp <nl> ppp b / src / rpcmining . cpp <nl> Value getblocktemplate ( const Array & params , bool fHelp ) <nl> CBlock * pblock = & pblocktemplate - > block ; / / pointer for convenience <nl> <nl> / / Update nTime <nl> - UpdateTime ( * pblock , pindexPrev ) ; <nl> + UpdateTime ( pblock , pindexPrev ) ; <nl> pblock - > nNonce = 0 ; <nl> <nl> Array transactions ; <nl>
|
Move UpdateTime to pow
|
bitcoin/bitcoin
|
c2c02f3fa99385f5a5be722fda6f71522c93bdaa
|
2014-08-23T11:21:50Z
|
mmm a / cocos / physics3d / CCPhysics3DComponent . cpp <nl> ppp b / cocos / physics3d / CCPhysics3DComponent . cpp <nl> void Physics3DComponent : : preSimulate ( ) <nl> { <nl> if ( ( ( int ) _syncFlag & ( int ) Physics3DComponent : : PhysicsSyncFlag : : NODE_TO_PHYSICS ) & & _physics3DObj & & _owner ) <nl> { <nl> - syncToNode ( ) ; <nl> + syncNodeToPhysics ( ) ; <nl> } <nl> } <nl> <nl> void Physics3DComponent : : postSimulate ( ) <nl> { <nl> if ( ( ( int ) _syncFlag & ( int ) Physics3DComponent : : PhysicsSyncFlag : : PHYSICS_TO_NODE ) & & _physics3DObj & & _owner ) <nl> { <nl> - syncToPhysics ( ) ; <nl> + syncPhysicsToNode ( ) ; <nl> } <nl> } <nl> <nl> void Physics3DComponent : : setSyncFlag ( PhysicsSyncFlag syncFlag ) <nl> _syncFlag = syncFlag ; <nl> } <nl> <nl> - void Physics3DComponent : : syncToPhysics ( ) <nl> + void Physics3DComponent : : syncPhysicsToNode ( ) <nl> { <nl> if ( _physics3DObj - > getObjType ( ) = = Physics3DObject : : PhysicsObjType : : RIGID_BODY ) <nl> { <nl> void Physics3DComponent : : syncToPhysics ( ) <nl> } <nl> } <nl> <nl> - void Physics3DComponent : : syncToNode ( ) <nl> + void Physics3DComponent : : syncNodeToPhysics ( ) <nl> { <nl> if ( _physics3DObj - > getObjType ( ) = = Physics3DObject : : PhysicsObjType : : RIGID_BODY ) <nl> { <nl> mmm a / cocos / physics3d / CCPhysics3DComponent . h <nl> ppp b / cocos / physics3d / CCPhysics3DComponent . h <nl> class CC_DLL Physics3DComponent : public cocos2d : : Component <nl> void setSyncFlag ( PhysicsSyncFlag syncFlag ) ; <nl> <nl> / * * <nl> - * align node and physics according to physics object <nl> + * synchronize node transformation to physics <nl> * / <nl> - void syncToPhysics ( ) ; <nl> + void syncNodeToPhysics ( ) ; <nl> <nl> / * * <nl> - * align node and physics according to node <nl> + * synchronize physics transformation to node <nl> * / <nl> - void syncToNode ( ) ; <nl> + void syncPhysicsToNode ( ) ; <nl> <nl> CC_CONSTRUCTOR_ACCESS : <nl> Physics3DComponent ( ) ; <nl> mmm a / cocos / physics3d / CCPhysicsSprite3D . cpp <nl> ppp b / cocos / physics3d / CCPhysicsSprite3D . cpp <nl> void PhysicsSprite3D : : setSyncFlag ( Physics3DComponent : : PhysicsSyncFlag syncFlag ) <nl> _physicsComponent - > setSyncFlag ( syncFlag ) ; <nl> } <nl> <nl> - void PhysicsSprite3D : : syncToPhysics ( ) <nl> + void PhysicsSprite3D : : syncNodeToPhysics ( ) <nl> { <nl> if ( _physicsComponent ) <nl> - _physicsComponent - > syncToPhysics ( ) ; <nl> + _physicsComponent - > syncNodeToPhysics ( ) ; <nl> } <nl> <nl> - void PhysicsSprite3D : : syncToNode ( ) <nl> + void PhysicsSprite3D : : syncPhysicsToNode ( ) <nl> { <nl> if ( _physicsComponent ) <nl> - _physicsComponent - > syncToNode ( ) ; <nl> + _physicsComponent - > syncPhysicsToNode ( ) ; <nl> } <nl> <nl> PhysicsSprite3D : : PhysicsSprite3D ( ) <nl> mmm a / cocos / physics3d / CCPhysicsSprite3D . h <nl> ppp b / cocos / physics3d / CCPhysicsSprite3D . h <nl> class CC_DLL PhysicsSprite3D : public cocos2d : : Sprite3D <nl> / * * Set synchronization flag , see Physics3DComponent . * / <nl> void setSyncFlag ( Physics3DComponent : : PhysicsSyncFlag syncFlag ) ; <nl> <nl> - / * * Physics synchronize rendering . * / <nl> - void syncToPhysics ( ) ; <nl> + / * * synchronize node transformation to physics . * / <nl> + void syncNodeToPhysics ( ) ; <nl> <nl> - / * * Rendering synchronize physics . * / <nl> - void syncToNode ( ) ; <nl> + / * * synchronize physics transformation to node . * / <nl> + void syncPhysicsToNode ( ) ; <nl> <nl> CC_CONSTRUCTOR_ACCESS : <nl> PhysicsSprite3D ( ) ; <nl> mmm a / tests / cpp - tests / Classes / Physics3DTest / Physics3DTest . cpp <nl> ppp b / tests / cpp - tests / Classes / Physics3DTest / Physics3DTest . cpp <nl> void Physics3DTestDemo : : shootBox ( const cocos2d : : Vec3 & des ) <nl> this - > addChild ( sprite ) ; <nl> sprite - > setPosition3D ( _camera - > getPosition3D ( ) ) ; <nl> sprite - > setScale ( 0 . 5f ) ; <nl> - sprite - > syncToNode ( ) ; <nl> + sprite - > syncNodeToPhysics ( ) ; <nl> <nl> / / optimize , only sync node to physics <nl> sprite - > setSyncFlag ( Physics3DComponent : : PhysicsSyncFlag : : PHYSICS_TO_NODE ) ; / / sync node to physics <nl> bool BasicPhysics3DDemo : : init ( ) <nl> floor - > setScaleZ ( 60 ) ; <nl> this - > addChild ( floor ) ; <nl> floor - > setCameraMask ( ( unsigned short ) CameraFlag : : USER1 ) ; <nl> - floor - > syncToNode ( ) ; <nl> + floor - > syncNodeToPhysics ( ) ; <nl> / / static object sync is not needed <nl> floor - > setSyncFlag ( Physics3DComponent : : PhysicsSyncFlag : : NONE ) ; <nl> <nl> bool BasicPhysics3DDemo : : init ( ) <nl> auto sprite = PhysicsSprite3D : : create ( " Sprite3DTest / box . c3t " , & rbDes ) ; <nl> sprite - > setTexture ( " Images / CyanSquare . png " ) ; <nl> sprite - > setPosition3D ( Vec3 ( x , y , z ) ) ; <nl> - sprite - > syncToNode ( ) ; <nl> + sprite - > syncNodeToPhysics ( ) ; <nl> sprite - > setSyncFlag ( Physics3DComponent : : PhysicsSyncFlag : : PHYSICS_TO_NODE ) ; <nl> sprite - > setCameraMask ( ( unsigned short ) CameraFlag : : USER1 ) ; <nl> sprite - > setScale ( 0 . 8f ) ; <nl> bool Physics3DKinematicDemo : : init ( ) <nl> floor - > setPosition3D ( Vec3 ( 0 . f , - 1 . f , 0 . f ) ) ; <nl> this - > addChild ( floor ) ; <nl> floor - > setCameraMask ( ( unsigned short ) CameraFlag : : USER1 ) ; <nl> - floor - > syncToNode ( ) ; <nl> + floor - > syncNodeToPhysics ( ) ; <nl> / / static object sync is not needed <nl> floor - > setSyncFlag ( Physics3DComponent : : PhysicsSyncFlag : : NONE ) ; <nl> <nl> bool Physics3DKinematicDemo : : init ( ) <nl> sprite - > setScale ( 1 . 0f / sprite - > getContentSize ( ) . width ) ; <nl> this - > addChild ( sprite ) ; <nl> sprite - > setPosition3D ( Vec3 ( x , y , z ) ) ; <nl> - sprite - > syncToNode ( ) ; <nl> + sprite - > syncNodeToPhysics ( ) ; <nl> <nl> sprite - > setSyncFlag ( Physics3DComponent : : PhysicsSyncFlag : : PHYSICS_TO_NODE ) ; <nl> } <nl> bool Physics3DConstraintDemo : : init ( ) <nl> sprite - > setScale ( 0 . 4f ) ; <nl> sprite - > setPosition3D ( Vec3 ( - 20 . f , 5 . f , 0 . f ) ) ; <nl> / / sync node position to physics <nl> - component - > syncToNode ( ) ; <nl> + component - > syncNodeToPhysics ( ) ; <nl> / / physics controlled , we will not set position for it , so we can skip sync node position to physics <nl> component - > setSyncFlag ( Physics3DComponent : : PhysicsSyncFlag : : PHYSICS_TO_NODE ) ; <nl> <nl> bool Physics3DConstraintDemo : : init ( ) <nl> sprite - > addComponent ( component ) ; <nl> sprite - > setCameraMask ( ( unsigned short ) CameraFlag : : USER1 ) ; <nl> this - > addChild ( sprite ) ; <nl> - component - > syncToNode ( ) ; <nl> + component - > syncNodeToPhysics ( ) ; <nl> rigidBody - > setAngularVelocity ( Vec3 ( 0 , 3 , 0 ) ) ; <nl> constraint = Physics3DHingeConstraint : : create ( rigidBody , Vec3 ( 4 . f , 4 . f , 0 . 5f ) , Vec3 ( 0 . f , 1 . f , 0 . f ) ) ; <nl> physicsScene - > getPhysics3DWorld ( ) - > addPhysics3DConstraint ( constraint ) ; <nl> bool Physics3DConstraintDemo : : init ( ) <nl> sprite - > addComponent ( component ) ; <nl> sprite - > setCameraMask ( ( unsigned short ) CameraFlag : : USER1 ) ; <nl> this - > addChild ( sprite ) ; <nl> - component - > syncToNode ( ) ; <nl> + component - > syncNodeToPhysics ( ) ; <nl> rigidBody - > setLinearVelocity ( Vec3 ( 0 , 3 , 0 ) ) ; <nl> <nl> rbDes . mass = 0 . 0f ; <nl> bool Physics3DConstraintDemo : : init ( ) <nl> sprite - > addComponent ( component ) ; <nl> sprite - > setCameraMask ( ( unsigned short ) CameraFlag : : USER1 ) ; <nl> this - > addChild ( sprite ) ; <nl> - component - > syncToNode ( ) ; <nl> + component - > syncNodeToPhysics ( ) ; <nl> <nl> Mat4 frameInA , frameInB ; <nl> Mat4 : : createRotationZ ( CC_DEGREES_TO_RADIANS ( 90 ) , & frameInA ) ; <nl> bool Physics3DConstraintDemo : : init ( ) <nl> sprite - > addComponent ( component ) ; <nl> sprite - > setCameraMask ( ( unsigned short ) CameraFlag : : USER1 ) ; <nl> this - > addChild ( sprite ) ; <nl> - component - > syncToNode ( ) ; <nl> + component - > syncNodeToPhysics ( ) ; <nl> <nl> Mat4 : : createRotationZ ( CC_DEGREES_TO_RADIANS ( 90 ) , & frameInA ) ; <nl> frameInA . m [ 12 ] = 0 . f ; <nl> bool Physics3DConstraintDemo : : init ( ) <nl> sprite - > addComponent ( component ) ; <nl> sprite - > setCameraMask ( ( unsigned short ) CameraFlag : : USER1 ) ; <nl> this - > addChild ( sprite ) ; <nl> - component - > syncToNode ( ) ; <nl> + component - > syncNodeToPhysics ( ) ; <nl> frameInA . setIdentity ( ) ; <nl> constraint = Physics3D6DofConstraint : : create ( rigidBody , frameInA , false ) ; <nl> physicsScene - > getPhysics3DWorld ( ) - > addPhysics3DConstraint ( constraint ) ; <nl> bool Physics3DTerrainDemo : : init ( ) <nl> auto component = Physics3DComponent : : create ( rigidBody ) ; <nl> terrain - > addComponent ( component ) ; <nl> this - > addChild ( terrain ) ; <nl> - component - > syncToNode ( ) ; <nl> + component - > syncNodeToPhysics ( ) ; <nl> component - > setSyncFlag ( Physics3DComponent : : PhysicsSyncFlag : : NONE ) ; <nl> <nl> <nl> bool Physics3DTerrainDemo : : init ( ) <nl> sprite - > setScale ( 1 . 0f / sprite - > getContentSize ( ) . width ) ; <nl> sprite - > setPosition3D ( Vec3 ( x , y , z ) ) ; <nl> this - > addChild ( sprite ) ; <nl> - sprite - > syncToNode ( ) ; <nl> + sprite - > syncNodeToPhysics ( ) ; <nl> sprite - > setSyncFlag ( Physics3DComponent : : PhysicsSyncFlag : : PHYSICS_TO_NODE ) ; <nl> } <nl> } <nl>
|
Merge pull request from super626 / fixphysics3d
|
cocos2d/cocos2d-x
|
399ecfcb9f5c49b06667f829104a52da883e9675
|
2015-06-05T08:02:45Z
|
mmm a / xbmc / pvr / timers / PVRTimers . cpp <nl> ppp b / xbmc / pvr / timers / PVRTimers . cpp <nl> bool CPVRTimers : : UpdateEntries ( const CPVRTimers & timers ) <nl> UpdateEpgEvent ( newTimer ) ; <nl> <nl> VecTimerInfoTag * addEntry = NULL ; <nl> - MapTags : : iterator itr = m_tags . find ( newTimer - > StartAsUTC ( ) ) ; <nl> + MapTags : : iterator itr = m_tags . find ( newTimer - > m_bStartAnyTime ? CDateTime ( ) : newTimer - > StartAsUTC ( ) ) ; <nl> if ( itr = = m_tags . end ( ) ) <nl> { <nl> addEntry = new VecTimerInfoTag ; <nl> - m_tags . insert ( std : : make_pair ( newTimer - > StartAsUTC ( ) , addEntry ) ) ; <nl> + m_tags . insert ( std : : make_pair ( newTimer - > m_bStartAnyTime ? CDateTime ( ) : newTimer - > StartAsUTC ( ) , addEntry ) ) ; <nl> } <nl> else <nl> { <nl> bool CPVRTimers : : UpdateEntries ( const CPVRTimers & timers ) <nl> bChanged = true ; <nl> bAddedOrDeleted = true ; <nl> } <nl> - else if ( timer - > StartAsUTC ( ) ! = it - > first ) <nl> + else if ( ( timer - > m_bStartAnyTime & & it - > first ! = CDateTime ( ) ) | | <nl> + ( ! timer - > m_bStartAnyTime & & timer - > StartAsUTC ( ) ! = it - > first ) ) <nl> { <nl> / * timer start has changed * / <nl> CLog : : Log ( LOGDEBUG , " PVRTimers - % s - changed start time timer % d on client % d " , <nl> bool CPVRTimers : : UpdateEntries ( const CPVRTimers & timers ) <nl> for ( VecTimerInfoTag : : const_iterator timerIt = timersToMove . begin ( ) ; timerIt ! = timersToMove . end ( ) ; + + timerIt ) <nl> { <nl> VecTimerInfoTag * addEntry = NULL ; <nl> - MapTags : : const_iterator itr = m_tags . find ( ( * timerIt ) - > StartAsUTC ( ) ) ; <nl> + MapTags : : const_iterator itr = m_tags . find ( ( * timerIt ) - > m_bStartAnyTime ? CDateTime ( ) : ( * timerIt ) - > StartAsUTC ( ) ) ; <nl> if ( itr = = m_tags . end ( ) ) <nl> { <nl> addEntry = new VecTimerInfoTag ; <nl> - m_tags . insert ( std : : make_pair ( ( * timerIt ) - > StartAsUTC ( ) , addEntry ) ) ; <nl> + m_tags . insert ( std : : make_pair ( ( * timerIt ) - > m_bStartAnyTime ? CDateTime ( ) : ( * timerIt ) - > StartAsUTC ( ) , addEntry ) ) ; <nl> } <nl> else <nl> { <nl> bool CPVRTimers : : UpdateFromClient ( const CPVRTimerInfoTagPtr & timer ) <nl> { <nl> tag = CPVRTimerInfoTagPtr ( new CPVRTimerInfoTag ( ) ) ; <nl> VecTimerInfoTag * addEntry = NULL ; <nl> - MapTags : : iterator itr = m_tags . find ( timer - > StartAsUTC ( ) ) ; <nl> + MapTags : : iterator itr = m_tags . find ( timer - > m_bStartAnyTime ? CDateTime ( ) : timer - > StartAsUTC ( ) ) ; <nl> if ( itr = = m_tags . end ( ) ) <nl> { <nl> addEntry = new VecTimerInfoTag ; <nl> - m_tags . insert ( std : : make_pair ( timer - > StartAsUTC ( ) , addEntry ) ) ; <nl> + m_tags . insert ( std : : make_pair ( timer - > m_bStartAnyTime ? CDateTime ( ) : timer - > StartAsUTC ( ) , addEntry ) ) ; <nl> } <nl> else <nl> { <nl>
|
Merge pull request from ksooo / fix - pvr - window - flicker
|
xbmc/xbmc
|
01d7be4434b22aa8c8ebe88658351aeb24058c3c
|
2015-11-29T13:20:43Z
|
mmm a / include / swift / AST / GenericEnvironment . h <nl> ppp b / include / swift / AST / GenericEnvironment . h <nl> class alignas ( 1 < < DeclAlignInBits ) GenericEnvironment final <nl> / / / generic parameter types by their sugared form . <nl> Type getSugaredType ( Type type ) const ; <nl> <nl> - / / / Derive a contextual type substitution map from a substitution array . <nl> - / / / This is just like GenericSignature : : getSubstitutionMap ( ) , except <nl> - / / / with contextual types instead of interface types . <nl> - SubstitutionMap <nl> - getSubstitutionMap ( SubstitutionList subs ) const ; <nl> - <nl> / / / Build a contextual type substitution map from a type substitution function <nl> / / / and conformance lookup function . <nl> SubstitutionMap <nl> mmm a / include / swift / AST / SubstitutionMap . h <nl> ppp b / include / swift / AST / SubstitutionMap . h <nl> namespace swift { <nl> class GenericSignature ; <nl> class GenericEnvironment ; <nl> class SubstitutableType ; <nl> + typedef CanTypeWrapper < GenericTypeParamType > CanGenericTypeParamType ; <nl> <nl> template < class Type > class CanTypeWrapper ; <nl> typedef CanTypeWrapper < SubstitutableType > CanSubstitutableType ; <nl> class SubstitutionMap { <nl> GenericSignature * genericSig ; <nl> <nl> / / FIXME : Switch to a more efficient representation . <nl> - llvm : : DenseMap < SubstitutableType * , Type > subMap ; <nl> + llvm : : DenseMap < GenericTypeParamType * , Type > subMap ; <nl> llvm : : DenseMap < TypeBase * , SmallVector < ProtocolConformanceRef , 1 > > <nl> conformanceMap ; <nl> <nl> class SubstitutionMap { <nl> / / instead , use GenericSignature : : getSubstitutionMap ( ) or <nl> / / GenericEnvironment : : getSubstitutionMap ( ) . <nl> <nl> - void addSubstitution ( CanSubstitutableType type , Type replacement ) ; <nl> + void addSubstitution ( CanGenericTypeParamType type , Type replacement ) ; <nl> void addConformance ( CanType type , ProtocolConformanceRef conformance ) ; <nl> } ; <nl> <nl> mmm a / include / swift / SIL / TypeSubstCloner . h <nl> ppp b / include / swift / SIL / TypeSubstCloner . h <nl> class TypeSubstCloner : public SILClonerWithScopes < ImplClass > { <nl> } <nl> <nl> void computeSubsMap ( ) { <nl> - if ( auto * env = Original . getGenericEnvironment ( ) ) { <nl> - SubsMap = env - > getSubstitutionMap ( ApplySubs ) ; <nl> + if ( auto genericSig = Original . getLoweredFunctionType ( ) <nl> + - > getGenericSignature ( ) ) { <nl> + SubsMap = genericSig - > getSubstitutionMap ( ApplySubs ) ; <nl> } <nl> } <nl> <nl> mmm a / lib / AST / GenericEnvironment . cpp <nl> ppp b / lib / AST / GenericEnvironment . cpp <nl> GenericEnvironment : : getForwardingSubstitutions ( ) const { <nl> return getGenericSignature ( ) - > getASTContext ( ) . AllocateCopy ( result ) ; <nl> } <nl> <nl> - SubstitutionMap GenericEnvironment : : <nl> - getSubstitutionMap ( SubstitutionList subs ) const { <nl> - SubstitutionMap result ( const_cast < GenericEnvironment * > ( this ) ) ; <nl> - <nl> - getGenericSignature ( ) - > enumeratePairedRequirements ( <nl> - [ & ] ( Type depTy , ArrayRef < Requirement > reqts ) - > bool { <nl> - / / Map the interface type to a context type . <nl> - auto contextTy = depTy . subst ( QueryInterfaceTypeSubstitutions ( this ) , <nl> - MakeAbstractConformanceForGenericType ( ) ) ; <nl> - <nl> - auto sub = subs . front ( ) ; <nl> - subs = subs . slice ( 1 ) ; <nl> - <nl> - / / Record the replacement type and its conformances . <nl> - if ( auto * archetype = contextTy - > getAs < ArchetypeType > ( ) ) { <nl> - result . addSubstitution ( CanArchetypeType ( archetype ) , sub . getReplacement ( ) ) ; <nl> - assert ( reqts . size ( ) = = sub . getConformances ( ) . size ( ) ) ; <nl> - for ( auto conformance : sub . getConformances ( ) ) <nl> - result . addConformance ( CanType ( archetype ) , conformance ) ; <nl> - return false ; <nl> - } <nl> - <nl> - assert ( contextTy - > hasError ( ) ) ; <nl> - return false ; <nl> - } ) ; <nl> - <nl> - assert ( subs . empty ( ) & & " did not use all substitutions ? ! " ) ; <nl> - <nl> - result . verify ( ) ; <nl> - return result ; <nl> - } <nl> - <nl> SubstitutionMap <nl> GenericEnvironment : : <nl> getSubstitutionMap ( TypeSubstitutionFn subs , <nl> getSubstitutionMap ( TypeSubstitutionFn subs , <nl> <nl> getGenericSignature ( ) - > enumeratePairedRequirements ( <nl> [ & ] ( Type depTy , ArrayRef < Requirement > reqs ) - > bool { <nl> + auto canTy = depTy - > getCanonicalType ( ) ; <nl> <nl> / / Map the interface type to a context type . <nl> auto contextTy = depTy . subst ( QueryInterfaceTypeSubstitutions ( this ) , <nl> getSubstitutionMap ( TypeSubstitutionFn subs , <nl> / / Compute the replacement type . <nl> Type currentReplacement = contextTy . subst ( subs , lookupConformance , <nl> SubstFlags : : UseErrorType ) ; <nl> - if ( auto archetypeTy = contextTy - > getAs < ArchetypeType > ( ) ) { <nl> - subMap . addSubstitution ( CanArchetypeType ( archetypeTy ) , <nl> - currentReplacement ) ; <nl> - <nl> - / / Collect the conformances . <nl> - for ( auto req : reqs ) { <nl> - assert ( req . getKind ( ) = = RequirementKind : : Conformance ) ; <nl> - auto protoType = req . getSecondType ( ) - > castTo < ProtocolType > ( ) ; <nl> - auto conformance = lookupConformance ( CanArchetypeType ( archetypeTy ) , <nl> - currentReplacement , <nl> - protoType ) ; <nl> - if ( conformance ) <nl> - subMap . addConformance ( CanArchetypeType ( archetypeTy ) , * conformance ) ; <nl> - } <nl> + <nl> + if ( auto paramTy = dyn_cast < GenericTypeParamType > ( canTy ) ) <nl> + subMap . addSubstitution ( paramTy , currentReplacement ) ; <nl> + <nl> + / / Collect the conformances . <nl> + for ( auto req : reqs ) { <nl> + assert ( req . getKind ( ) = = RequirementKind : : Conformance ) ; <nl> + auto protoType = req . getSecondType ( ) - > castTo < ProtocolType > ( ) ; <nl> + auto conformance = lookupConformance ( canTy , <nl> + currentReplacement , <nl> + protoType ) ; <nl> + if ( conformance ) <nl> + subMap . addConformance ( canTy , * conformance ) ; <nl> } <nl> <nl> return false ; <nl> mmm a / lib / AST / GenericSignature . cpp <nl> ppp b / lib / AST / GenericSignature . cpp <nl> GenericSignature : : getSubstitutionMap ( SubstitutionList subs ) const { <nl> subs = subs . slice ( 1 ) ; <nl> <nl> auto canTy = depTy - > getCanonicalType ( ) ; <nl> - if ( isa < SubstitutableType > ( canTy ) ) <nl> - result . addSubstitution ( cast < SubstitutableType > ( canTy ) , <nl> + if ( auto paramTy = dyn_cast < GenericTypeParamType > ( canTy ) ) <nl> + result . addSubstitution ( paramTy , <nl> sub . getReplacement ( ) ) ; <nl> assert ( reqts . size ( ) = = sub . getConformances ( ) . size ( ) ) ; <nl> for ( auto conformance : sub . getConformances ( ) ) <nl> getSubstitutionMap ( TypeSubstitutionFn subs , <nl> / / Compute the replacement type . <nl> Type currentReplacement = depTy . subst ( subs , lookupConformance , <nl> SubstFlags : : UseErrorType ) ; <nl> - if ( auto substTy = dyn_cast < SubstitutableType > ( canTy ) ) <nl> - subMap . addSubstitution ( substTy , currentReplacement ) ; <nl> + if ( auto paramTy = dyn_cast < GenericTypeParamType > ( canTy ) ) <nl> + subMap . addSubstitution ( paramTy , currentReplacement ) ; <nl> <nl> / / Collect the conformances . <nl> for ( auto req : reqs ) { <nl> mmm a / lib / AST / ProtocolConformance . cpp <nl> ppp b / lib / AST / ProtocolConformance . cpp <nl> SpecializedProtocolConformance : : getTypeWitnessAndDecl ( <nl> } <nl> <nl> / / Otherwise , perform substitutions to create this witness now . <nl> - auto * genericEnv = GenericConformance - > getGenericEnvironment ( ) ; <nl> + auto * genericSig = GenericConformance - > getGenericSignature ( ) ; <nl> <nl> auto substitutionMap = <nl> - genericEnv - > getSubstitutionMap ( GenericSubstitutions ) ; <nl> + genericSig - > getSubstitutionMap ( GenericSubstitutions ) ; <nl> <nl> auto genericWitnessAndDecl <nl> = GenericConformance - > getTypeWitnessAndDecl ( assocType , resolver ) ; <nl> SpecializedProtocolConformance : : getAssociatedConformance ( Type assocType , <nl> ProtocolConformanceRef conformance = <nl> GenericConformance - > getAssociatedConformance ( assocType , protocol , resolver ) ; <nl> <nl> - auto genericEnv = GenericConformance - > getGenericEnvironment ( ) ; <nl> - auto subMap = genericEnv - > getSubstitutionMap ( GenericSubstitutions ) ; <nl> + auto genericSig = GenericConformance - > getGenericSignature ( ) ; <nl> + auto subMap = genericSig - > getSubstitutionMap ( GenericSubstitutions ) ; <nl> <nl> Type origType = <nl> ( conformance . isConcrete ( ) <nl> ProtocolConformance : : subst ( Type substType , <nl> = = substType - > getNominalOrBoundGenericNominal ( ) <nl> & & " substitution mapped to different nominal ? ! " ) ; <nl> <nl> - / / Since this is a normal conformance , the substitution maps archetypes <nl> - / / in the environment of the conformance to types containing archetypes <nl> - / / of some other generic environment . <nl> - / / <nl> - / / ASTContext : : getSpecializedConformance ( ) wants a substitution map <nl> - / / with interface types as keys , so do the mapping here . <nl> - / / <nl> - / / Once the type of a normal conformance becomes an interface type , <nl> - / / we can remove this . <nl> SubstitutionMap subMap ; <nl> if ( auto * genericSig = getGenericSignature ( ) ) { <nl> auto * genericEnv = getGenericEnvironment ( ) ; <nl> - subMap = genericSig - > getSubstitutionMap ( <nl> - [ & ] ( SubstitutableType * t ) - > Type { <nl> - return genericEnv - > mapTypeIntoContext ( <nl> - t ) . subst ( subs , conformances , SubstFlags : : UseErrorType ) ; <nl> - } , <nl> - [ & ] ( CanType origType , Type substType , ProtocolType * protoType ) <nl> - - > Optional < ProtocolConformanceRef > { <nl> - origType = CanType ( <nl> - genericEnv - > mapTypeIntoContext ( <nl> - origType ) - > castTo < ArchetypeType > ( ) ) ; <nl> - return conformances ( origType , substType , protoType ) ; <nl> - } ) ; <nl> + subMap = genericEnv - > getSubstitutionMap ( subs , conformances ) ; <nl> } <nl> <nl> return substType - > getASTContext ( ) <nl> mmm a / lib / AST / SubstitutionMap . cpp <nl> ppp b / lib / AST / SubstitutionMap . cpp <nl> bool SubstitutionMap : : hasDynamicSelf ( ) const { <nl> } <nl> <nl> Type SubstitutionMap : : lookupSubstitution ( CanSubstitutableType type ) const { <nl> - auto known = subMap . find ( type ) ; <nl> + / / If we have an archetype , map out of the context so we can compute a <nl> + / / conformance access path . <nl> + if ( auto archetype = dyn_cast < ArchetypeType > ( type ) ) { <nl> + if ( archetype - > isOpenedExistential ( ) | | <nl> + archetype - > getParent ( ) ! = nullptr ) <nl> + return Type ( ) ; <nl> + <nl> + auto * genericEnv = archetype - > getGenericEnvironment ( ) ; <nl> + type = cast < GenericTypeParamType > ( <nl> + genericEnv - > mapTypeOutOfContext ( archetype ) - > getCanonicalType ( ) ) ; <nl> + } <nl> + <nl> + auto known = subMap . find ( cast < GenericTypeParamType > ( type ) ) ; <nl> if ( known ! = subMap . end ( ) & & known - > second ) <nl> return known - > second ; <nl> <nl> Type SubstitutionMap : : lookupSubstitution ( CanSubstitutableType type ) const { <nl> } <nl> <nl> void SubstitutionMap : : <nl> - addSubstitution ( CanSubstitutableType type , Type replacement ) { <nl> - assert ( ! ( type - > isTypeParameter ( ) & & ! getGenericSignature ( ) ) & & <nl> - " type parameter substitution map without generic signature " ) ; <nl> + addSubstitution ( CanGenericTypeParamType type , Type replacement ) { <nl> + assert ( getGenericSignature ( ) & & <nl> + " cannot add entries to empty substitution map " ) ; <nl> auto result = subMap . insert ( std : : make_pair ( type , replacement ) ) ; <nl> assert ( result . second | | result . first - > second - > isEqual ( replacement ) ) ; <nl> ( void ) result ; <nl> } <nl> <nl> Optional < ProtocolConformanceRef > <nl> - SubstitutionMap : : lookupConformance ( CanType origType , ProtocolDecl * proto ) const { <nl> - CanType type = origType ; <nl> - <nl> + SubstitutionMap : : lookupConformance ( CanType type , ProtocolDecl * proto ) const { <nl> / / If we have an archetype , map out of the context so we can compute a <nl> / / conformance access path . <nl> - GenericEnvironment * genericEnv = nullptr ; <nl> - if ( auto archetype = type - > getAs < ArchetypeType > ( ) ) { <nl> - genericEnv = archetype - > getGenericEnvironment ( ) ; <nl> + if ( auto archetype = dyn_cast < ArchetypeType > ( type ) ) { <nl> + auto * genericEnv = archetype - > getGenericEnvironment ( ) ; <nl> type = genericEnv - > mapTypeOutOfContext ( type ) - > getCanonicalType ( ) ; <nl> } <nl> <nl> SubstitutionMap : : lookupConformance ( CanType origType , ProtocolDecl * proto ) const <nl> / / Retrieve the starting conformance from the conformance map . <nl> auto getInitialConformance = <nl> [ & ] ( Type type , ProtocolDecl * proto ) - > Optional < ProtocolConformanceRef > { <nl> - / / We ' re working relative to a generic environment , map into that <nl> - / / context before looking into the conformance map . <nl> - if ( genericEnv ) <nl> - type = genericEnv - > mapTypeIntoContext ( type ) ; <nl> - <nl> auto known = conformanceMap . find ( type - > getCanonicalType ( ) . getPointer ( ) ) ; <nl> if ( known = = conformanceMap . end ( ) ) <nl> return None ; <nl> SubstitutionMap : : lookupConformance ( CanType origType , ProtocolDecl * proto ) const <nl> / / FIXME : Rip this out once we can get a concrete conformance from <nl> / / an archetype . <nl> auto * M = proto - > getParentModule ( ) ; <nl> - auto substType = origType . subst ( * this ) ; <nl> + auto substType = type . subst ( * this ) ; <nl> if ( substType & & <nl> ! substType - > is < ArchetypeType > ( ) & & <nl> ! substType - > isTypeParameter ( ) & & <nl> SubstitutionMap : : lookupConformance ( CanType origType , ProtocolDecl * proto ) const <nl> <nl> void SubstitutionMap : : <nl> addConformance ( CanType type , ProtocolConformanceRef conformance ) { <nl> + assert ( ! isa < ArchetypeType > ( type ) ) ; <nl> conformanceMap [ type . getPointer ( ) ] . push_back ( conformance ) ; <nl> } <nl> <nl> mmm a / lib / SILGen / SILGenPoly . cpp <nl> ppp b / lib / SILGen / SILGenPoly . cpp <nl> buildThunkSignature ( SILGenFunction & gen , <nl> genericEnv = gen . F . getGenericEnvironment ( ) ; <nl> auto subsArray = gen . F . getForwardingSubstitutions ( ) ; <nl> interfaceSubs = genericSig - > getSubstitutionMap ( subsArray ) ; <nl> - contextSubs = genericEnv - > getSubstitutionMap ( subsArray ) ; <nl> + contextSubs = interfaceSubs ; <nl> return genericSig ; <nl> } <nl> <nl> buildThunkSignature ( SILGenFunction & gen , <nl> <nl> / / Calculate substitutions to map the caller ' s archetypes to the thunk ' s <nl> / / archetypes . <nl> - if ( auto * calleeGenericEnv = gen . F . getGenericEnvironment ( ) ) { <nl> - contextSubs = calleeGenericEnv - > getSubstitutionMap ( <nl> + if ( auto calleeGenericSig = gen . F . getLoweredFunctionType ( ) <nl> + - > getGenericSignature ( ) ) { <nl> + contextSubs = calleeGenericSig - > getSubstitutionMap ( <nl> [ & ] ( SubstitutableType * type ) - > Type { <nl> - auto depTy = calleeGenericEnv - > mapTypeOutOfContext ( type ) ; <nl> - return genericEnv - > mapTypeIntoContext ( depTy ) ; <nl> + return genericEnv - > mapTypeIntoContext ( type ) ; <nl> } , <nl> MakeAbstractConformanceForGenericType ( ) ) ; <nl> } <nl> mmm a / lib / SILOptimizer / Transforms / PerformanceInliner . cpp <nl> ppp b / lib / SILOptimizer / Transforms / PerformanceInliner . cpp <nl> static bool calleeHasPartialApplyWithOpenedExistentials ( FullApplySite AI ) { <nl> if ( HasNoOpenedExistentials ) <nl> return false ; <nl> <nl> - auto SubsMap = Callee - > getGenericEnvironment ( ) - > getSubstitutionMap ( Subs ) ; <nl> + auto SubsMap = Callee - > getLoweredFunctionType ( ) <nl> + - > getGenericSignature ( ) - > getSubstitutionMap ( Subs ) ; <nl> <nl> for ( auto & BB : * Callee ) { <nl> for ( auto & I : BB ) { <nl> bool SILPerformanceInliner : : isProfitableToInline ( FullApplySite AI , <nl> <nl> SubstitutionMap CalleeSubstMap ; <nl> if ( IsGeneric ) { <nl> - CalleeSubstMap = Callee - > getGenericEnvironment ( ) <nl> + CalleeSubstMap = Callee - > getLoweredFunctionType ( ) <nl> + - > getGenericSignature ( ) <nl> - > getSubstitutionMap ( AI . getSubstitutions ( ) ) ; <nl> } <nl> <nl>
|
Merge pull request from slavapestov / substitution - map - cleanup
|
apple/swift
|
7e46e72e082d4d37ce9d8f17c7921fec574e8109
|
2017-04-24T22:16:29Z
|
mmm a / src / unittest / rwlock_test . cc <nl> ppp b / src / unittest / rwlock_test . cc <nl> <nl> + / / Copyright 2010 - 2014 RethinkDB , all rights reserved . <nl> # include < functional > <nl> <nl> # include " arch / runtime / coroutines . hpp " <nl>
|
Added copyright statement to rwlock_test . cc .
|
rethinkdb/rethinkdb
|
6506f53984324f424fe669ef2f674dfe796d3543
|
2014-02-13T20:08:54Z
|
mmm a / xbmc / filesystem / CircularCache . cpp <nl> ppp b / xbmc / filesystem / CircularCache . cpp <nl> int CCircularCache : : ReadFromCache ( char * buf , size_t len ) <nl> * Note that caller needs to make sure there ' s sufficient space in the forward <nl> * buffer for " minimum " bytes else we may block the full timeout time <nl> * / <nl> - int64_t CCircularCache : : WaitForData ( unsigned int minumum , unsigned int millis ) <nl> + int64_t CCircularCache : : WaitForData ( unsigned int minimum , unsigned int millis ) <nl> { <nl> CSingleLock lock ( m_sync ) ; <nl> int64_t avail = m_end - m_cur ; <nl> int64_t CCircularCache : : WaitForData ( unsigned int minumum , unsigned int millis ) <nl> if ( millis = = 0 | | IsEndOfInput ( ) ) <nl> return avail ; <nl> <nl> - if ( minumum > m_size - m_size_back ) <nl> - minumum = m_size - m_size_back ; <nl> + if ( minimum > m_size - m_size_back ) <nl> + minimum = m_size - m_size_back ; <nl> <nl> XbmcThreads : : EndTime endtime ( millis ) ; <nl> - while ( ! IsEndOfInput ( ) & & avail < minumum & & ! endtime . IsTimePast ( ) ) <nl> + while ( ! IsEndOfInput ( ) & & avail < minimum & & ! endtime . IsTimePast ( ) ) <nl> { <nl> lock . Leave ( ) ; <nl> m_written . WaitMSec ( 50 ) ; / / may miss the deadline . shouldn ' t be a problem . <nl>
|
fixed : Typo in variable name
|
xbmc/xbmc
|
d19f789d3515626b4a78c1b53dcad2a78afa20b3
|
2014-11-23T08:51:29Z
|
mmm a / test / fuzzer / parser . cc <nl> ppp b / test / fuzzer / parser . cc <nl> <nl> # include " test / fuzzer / fuzzer - support . h " <nl> <nl> bool IsValidInput ( const uint8_t * data , size_t size ) { <nl> + / / Ignore too long inputs as they tend to find OOM or timeouts , not real bugs . <nl> + if ( size > 8192 ) { <nl> + return false ; <nl> + } <nl> + <nl> std : : list < char > parentheses ; <nl> const char * ptr = reinterpret_cast < const char * > ( data ) ; <nl> <nl>
|
[ fuzzer ] Fix timeout in v8_script_parser_fuzzer due to unnecessary long inputs .
|
v8/v8
|
087cc34788266a5f176b7936f616d57affa00cb4
|
2018-07-16T14:29:24Z
|
mmm a / util / thread_pool . cpp <nl> ppp b / util / thread_pool . cpp <nl> void ThreadPool : : task_done ( Worker * worker ) { <nl> worker - > set_task ( _tasks . front ( ) ) ; <nl> _tasks . pop_front ( ) ; <nl> } else { <nl> - _freeWorkers . push_back ( worker ) ; <nl> + _freeWorkers . push_front ( worker ) ; <nl> } <nl> <nl> _tasksRemaining - - ; <nl>
|
finished threads go to front of line ( faster )
|
mongodb/mongo
|
00b731fa0b35a36986eb98836fd96c534bcda25e
|
2010-01-12T01:47:22Z
|
mmm a / vendor / init . bat <nl> ppp b / vendor / init . bat <nl> set CMDER_CONFIGURED = 1 <nl> set cmder_init_end = % time % <nl> <nl> if % time_init % gtr 0 ( <nl> - % cmder_root % \ vendor \ bin \ timer . cmd % cmder_init_start % % cmder_init_end % <nl> + " % cmder_root % \ vendor \ bin \ timer . cmd " % cmder_init_start % % cmder_init_end % <nl> ) <nl> exit / b <nl>
|
fix timer error
|
cmderdev/cmder
|
d04cc1f04ea3f79d4259dab7e35b0771a0127de9
|
2018-11-10T18:57:26Z
|
mmm a / include / swift / Sema / IterativeTypeChecker . h <nl> ppp b / include / swift / Sema / IterativeTypeChecker . h <nl> class IterativeTypeChecker { <nl> / / / Diagnose a reference cycle . <nl> void diagnoseCircularReference ( ArrayRef < TypeCheckRequest > requests ) ; <nl> <nl> + / / / Determine whether the given request has already been satisfied . <nl> + bool isSatisfied ( TypeCheckRequest request ) ; <nl> + <nl> public : <nl> IterativeTypeChecker ( TypeChecker & tc ) : TC ( tc ) { } <nl> <nl> class IterativeTypeChecker { <nl> return getDiags ( ) . diagnose ( std : : forward < ArgTypes > ( Args ) . . . ) ; <nl> } <nl> <nl> - / / / Determine whether the given request has already been satisfied . <nl> - bool isSatisfied ( TypeCheckRequest request ) ; <nl> - <nl> / / / Satisfy the given request . <nl> + / / / <nl> + / / / Ensures that the given type check request has been satisfied . On <nl> + / / / completion of this operation , one can query the AST for <nl> + / / / information regarding this particular request , e . g . , get the <nl> + / / / type of a declaration , perform name lookup into a particular <nl> + / / / context , and so on . <nl> void satisfy ( TypeCheckRequest request ) ; <nl> } ; <nl> <nl> mmm a / lib / Sema / ITCDecl . cpp <nl> ppp b / lib / Sema / ITCDecl . cpp <nl> void IterativeTypeChecker : : processResolveTypeDecl ( <nl> typeAliasDecl - > getDeclContext ( ) , <nl> options , nullptr , & unsatisfiedDependency ) ) { <nl> typeAliasDecl - > setInvalid ( ) ; <nl> - typeAliasDecl - > overwriteType ( ErrorType : : get ( TC . Context ) ) ; <nl> + typeAliasDecl - > overwriteType ( ErrorType : : get ( getASTContext ( ) ) ) ; <nl> typeAliasDecl - > getUnderlyingTypeLoc ( ) . setInvalidType ( getASTContext ( ) ) ; <nl> } <nl> <nl> void IterativeTypeChecker : : processResolveTypeDecl ( <nl> bool IterativeTypeChecker : : breakCycleForResolveTypeDecl ( TypeDecl * typeDecl ) { <nl> if ( auto typeAliasDecl = dyn_cast < TypeAliasDecl > ( typeDecl ) ) { <nl> typeAliasDecl - > setInvalid ( ) ; <nl> - typeAliasDecl - > overwriteType ( ErrorType : : get ( TC . Context ) ) ; <nl> + typeAliasDecl - > overwriteType ( ErrorType : : get ( getASTContext ( ) ) ) ; <nl> typeAliasDecl - > getUnderlyingTypeLoc ( ) . setInvalidType ( getASTContext ( ) ) ; <nl> return true ; <nl> } <nl> mmm a / lib / Sema / ITCNameLookup . cpp <nl> ppp b / lib / Sema / ITCNameLookup . cpp <nl> bool IterativeTypeChecker : : isQualifiedLookupInDeclContextSatisfied ( <nl> / / If we needed them for this query , did we already add implicit <nl> / / initializers ? <nl> auto name = payload . Name ; <nl> - if ( ( ! name | | name . matchesRef ( TC . Context . Id_init ) ) & & <nl> + if ( ( ! name | | name . matchesRef ( getASTContext ( ) . Id_init ) ) & & <nl> ! nominal - > addedImplicitInitializers ( ) ) <nl> return false ; <nl> <nl> void IterativeTypeChecker : : processQualifiedLookupInDeclContext ( <nl> / / implicitly - declared initializers . <nl> / / FIXME : Recursion into old type checker . <nl> auto name = payload . Name ; <nl> - if ( ! name | | name . matchesRef ( TC . Context . Id_init ) ) <nl> + if ( ! name | | name . matchesRef ( getASTContext ( ) . Id_init ) ) <nl> TC . resolveImplicitConstructors ( nominal ) ; <nl> } <nl> <nl>
|
Minor cleanups in the iterative type checker . NFC
|
apple/swift
|
2d324cac45fa35ddd19e8b32aed7c9de2d80d553
|
2015-10-09T17:18:50Z
|
mmm a / README . md <nl> ppp b / README . md <nl> Features : < br / > <nl> 6 . no multiple processes , single process only . < br / > <nl> <nl> DevLog : < br / > <nl> - * 2013 - 10 - 23 , support FMLE / FFMPEG publish vp6 codec , h264 / aac not support yet <nl> + * 2013 - 10 - 23 , support FMLE / FFMPEG publish vp6 codec , h264 / aac not support yet . 8184 lines . <nl> * 2013 - 10 - 17 , created . <nl> <nl> Winlin <nl>
|
support FMLE / FFMPEG publish vp6 codec , h264 / aac not support yet
|
ossrs/srs
|
dc7149595bb3a3e8e784151940d87d726d6a2872
|
2013-10-22T16:30:37Z
|
mmm a / stdlib / public / runtime / Casting . cpp <nl> ppp b / stdlib / public / runtime / Casting . cpp <nl> static bool swift_dynamicCastImpl ( OpaqueValue * dest , OpaqueValue * src , <nl> cast < StructMetadata > ( srcType ) , <nl> cast < StructMetadata > ( targetType ) , <nl> flags ) ; <nl> + } else if ( isAnyHashableType ( srcType ) ) { <nl> + / / AnyHashable casts for enums . <nl> + return _dynamicCastFromAnyHashable ( dest , src , srcType , targetType , <nl> + flags ) ; <nl> } <nl> break ; <nl> <nl> mmm a / test / stdlib / AnyHashableCasts . swift . gyb <nl> ppp b / test / stdlib / AnyHashableCasts . swift . gyb <nl> testCases = [ <nl> ( " AnyHashable ( 5 ) " , " Any " , " Int " , " 5 " ) , <nl> ( " HashableStruct ( value : 5 ) " , " HashableStruct " , " AnyHashable " , <nl> " AnyHashable ( HashableStruct ( value : 5 ) ) " ) , <nl> + ( " HashableStruct ( value : 5 ) " , " AnyHashable " , " HashableStruct " , <nl> + " AnyHashable ( HashableStruct ( value : 5 ) ) " ) , <nl> ( " HashableClass ( value : 5 ) " , " HashableClass " , " AnyHashable " , <nl> " AnyHashable ( HashableClass ( value : 5 ) ) " ) , <nl> + ( " HashableClass ( value : 5 ) " , " AnyHashable " , " HashableClass " , <nl> + " AnyHashable ( HashableClass ( value : 5 ) ) " ) , <nl> ( " HashableEnum . value ( 5 ) " , " HashableEnum " , " AnyHashable " , <nl> " AnyHashable ( HashableEnum . value ( 5 ) ) " ) , <nl> + ( " HashableEnum . value ( 5 ) " , " AnyHashable " , " HashableEnum " , <nl> + " AnyHashable ( HashableEnum . value ( 5 ) ) " ) , <nl> ] <nl> } % <nl> <nl>
|
Merge remote - tracking branch ' origin / master ' into master - next
|
apple/swift
|
2bfad8d719471f42bf91480c894c473e9f3f95d5
|
2018-12-06T20:44:40Z
|
mmm a / src / wasm / module - compiler . cc <nl> ppp b / src / wasm / module - compiler . cc <nl> void AsyncCompileJob : : FinishCompile ( ) { <nl> <nl> / / TODO ( bbudge ) Allow deserialization without wrapper compilation , so we can <nl> / / just compile wrappers here . <nl> - if ( is_after_deserialization ) { <nl> - DoSync < AsyncCompileJob : : FinishModule > ( ) ; <nl> - } else { <nl> - / / TODO ( wasm ) : compiling wrappers should be made async as well . <nl> - DoSync < CompileWrappers > ( ) ; <nl> + if ( ! is_after_deserialization ) { <nl> + / / TODO ( wasm ) : compiling wrappers should be made async . <nl> + CompileWrappers ( ) ; <nl> } <nl> + FinishModule ( ) ; <nl> } <nl> <nl> void AsyncCompileJob : : AsyncCompileFailed ( Handle < Object > error_reason ) { <nl> class AsyncCompileJob : : CompileFailed : public CompileStep { <nl> Handle < Object > error_reason_ ; <nl> } ; <nl> <nl> - / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> - / / Step 5 ( sync ) : Compile JS - > wasm wrappers . <nl> - / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> - class AsyncCompileJob : : CompileWrappers : public CompileStep { <nl> + void AsyncCompileJob : : CompileWrappers ( ) { <nl> / / TODO ( wasm ) : Compile all wrappers here , including the start function wrapper <nl> / / and the wrappers for the function table elements . <nl> - void RunInForeground ( AsyncCompileJob * job ) override { <nl> - TRACE_COMPILE ( " ( 5 ) Compile wrappers . . . \ n " ) ; <nl> - / / Compile JS - > wasm wrappers for exported functions . <nl> - CompileJsToWasmWrappers ( <nl> - job - > isolate_ , job - > module_object_ - > native_module ( ) - > module ( ) , <nl> - handle ( job - > module_object_ - > export_wrappers ( ) , job - > isolate_ ) ) ; <nl> - job - > DoSync < FinishModule > ( ) ; <nl> + TRACE_COMPILE ( " ( 5 ) Compile wrappers . . . \ n " ) ; <nl> + / / Compile JS - > wasm wrappers for exported functions . <nl> + CompileJsToWasmWrappers ( isolate_ , module_object_ - > native_module ( ) - > module ( ) , <nl> + handle ( module_object_ - > export_wrappers ( ) , isolate_ ) ) ; <nl> + } <nl> + <nl> + void AsyncCompileJob : : FinishModule ( ) { <nl> + TRACE_COMPILE ( " ( 6 ) Finish module . . . \ n " ) ; <nl> + AsyncCompileSucceeded ( module_object_ ) ; <nl> + <nl> + size_t num_functions = native_module_ - > num_functions ( ) - <nl> + native_module_ - > num_imported_functions ( ) ; <nl> + auto * compilation_state = Impl ( native_module_ - > compilation_state ( ) ) ; <nl> + if ( compilation_state - > compile_mode ( ) = = CompileMode : : kRegular | | <nl> + num_functions = = 0 ) { <nl> + / / If we do not tier up , the async compile job is done here and <nl> + / / can be deleted . <nl> + isolate_ - > wasm_engine ( ) - > RemoveCompileJob ( this ) ; <nl> + return ; <nl> } <nl> - } ; <nl> - <nl> - / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> - / / Step 6 ( sync ) : Finish the module and resolve the promise . <nl> - / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> - class AsyncCompileJob : : FinishModule : public CompileStep { <nl> - void RunInForeground ( AsyncCompileJob * job ) override { <nl> - TRACE_COMPILE ( " ( 6 ) Finish module . . . \ n " ) ; <nl> - job - > AsyncCompileSucceeded ( job - > module_object_ ) ; <nl> - <nl> - size_t num_functions = job - > native_module_ - > num_functions ( ) - <nl> - job - > native_module_ - > num_imported_functions ( ) ; <nl> - auto * compilation_state = Impl ( job - > native_module_ - > compilation_state ( ) ) ; <nl> - if ( compilation_state - > compile_mode ( ) = = CompileMode : : kRegular | | <nl> - num_functions = = 0 ) { <nl> - / / If we do not tier up , the async compile job is done here and <nl> - / / can be deleted . <nl> - job - > isolate_ - > wasm_engine ( ) - > RemoveCompileJob ( job ) ; <nl> - return ; <nl> - } <nl> - DCHECK_EQ ( CompileMode : : kTiering , compilation_state - > compile_mode ( ) ) ; <nl> - if ( compilation_state - > baseline_compilation_finished ( ) ) { <nl> - job - > isolate_ - > wasm_engine ( ) - > RemoveCompileJob ( job ) ; <nl> - } <nl> + DCHECK_EQ ( CompileMode : : kTiering , compilation_state - > compile_mode ( ) ) ; <nl> + if ( compilation_state - > baseline_compilation_finished ( ) ) { <nl> + isolate_ - > wasm_engine ( ) - > RemoveCompileJob ( this ) ; <nl> } <nl> - } ; <nl> + } <nl> <nl> AsyncStreamingProcessor : : AsyncStreamingProcessor ( AsyncCompileJob * job ) <nl> : decoder_ ( job - > enabled_features_ ) , <nl> mmm a / src / wasm / module - compiler . h <nl> ppp b / src / wasm / module - compiler . h <nl> class AsyncCompileJob { <nl> class DecodeFail ; / / Step 1b ( sync ) <nl> class PrepareAndStartCompile ; / / Step 2 ( sync ) <nl> class CompileFailed ; / / Step 4b ( sync ) <nl> - class CompileWrappers ; / / Step 5 ( sync ) <nl> - class FinishModule ; / / Step 6 ( sync ) <nl> <nl> friend class AsyncStreamingProcessor ; <nl> <nl> class AsyncCompileJob { <nl> <nl> void AsyncCompileSucceeded ( Handle < WasmModuleObject > result ) ; <nl> <nl> + void CompileWrappers ( ) ; <nl> + <nl> + void FinishModule ( ) ; <nl> + <nl> void StartForegroundTask ( ) ; <nl> void ExecuteForegroundTaskImmediately ( ) ; <nl> <nl>
|
[ wasm ] Merge foreground work after compilation
|
v8/v8
|
01f824c1767842aa3ccd9166a3ab2feb05266bc4
|
2019-01-09T16:17:29Z
|
mmm a / src / idl_gen_js . cpp <nl> ppp b / src / idl_gen_js . cpp <nl> std : : string GenDefaultValue ( const Value & value , const std : : string & context ) { <nl> } <nl> } <nl> <nl> - std : : string GenTypeName ( const Type & type , bool input ) { <nl> + std : : string GenTypeName ( const Type & type , bool input , bool allowNull = false ) { <nl> if ( ! input ) { <nl> - if ( type . base_type = = BASE_TYPE_STRING ) { <nl> - return " string | Uint8Array " ; <nl> - } <nl> - if ( type . base_type = = BASE_TYPE_STRUCT ) { <nl> - return WrapInNameSpace ( * type . struct_def ) ; <nl> + if ( type . base_type = = BASE_TYPE_STRING | | type . base_type = = BASE_TYPE_STRUCT ) { <nl> + std : : string name ; <nl> + if ( type . base_type = = BASE_TYPE_STRING ) { <nl> + name = " string | Uint8Array " ; <nl> + } else { <nl> + name = WrapInNameSpace ( * type . struct_def ) ; <nl> + } <nl> + return ( allowNull ) ? ( name + " | null " ) : ( name ) ; <nl> } <nl> } <nl> <nl> void GenStruct ( const Parser & parser , StructDef & struct_def , <nl> code + = " / * * \ n " ; <nl> code + = " * @ type { flatbuffers . ByteBuffer } \ n " ; <nl> code + = " * / \ n " ; <nl> - code + = " bb : flatbuffers . ByteBuffer = null ; \ n " ; <nl> + code + = " bb : flatbuffers . ByteBuffer ; \ n " ; <nl> code + = " \ n " ; <nl> code + = " / * * \ n " ; <nl> code + = " * @ type { number } \ n " ; <nl> void GenStruct ( const Parser & parser , StructDef & struct_def , <nl> code + = " / * * \ n " ; <nl> code + = " * @ type { flatbuffers . ByteBuffer } \ n " ; <nl> code + = " * / \ n " ; <nl> - code + = " this . bb = null ; \ n " ; <nl> + code + = " this . bb = undefined ; \ n " ; <nl> code + = " \ n " ; <nl> code + = " / * * \ n " ; <nl> code + = " * @ type { number } \ n " ; <nl> void GenStruct ( const Parser & parser , StructDef & struct_def , <nl> GenDocComment ( field . doc_comment , code_ptr , <nl> std : : string ( field . value . type . base_type = = BASE_TYPE_STRING ? <nl> " @ param { flatbuffers . Encoding = } optionalEncoding \ n " : " " ) + <nl> - " @ returns { " + GenTypeName ( field . value . type , false ) + " } " ) ; <nl> + " @ returns { " + GenTypeName ( field . value . type , false , true ) + " } " ) ; <nl> if ( lang_ . language = = IDLOptions : : kTs ) { <nl> std : : string prefix = MakeCamel ( field . name , false ) + " ( " ; <nl> if ( field . value . type . base_type = = BASE_TYPE_STRING ) { <nl> - code + = prefix + " ) : string \ n " ; <nl> + code + = prefix + " ) : string | null \ n " ; <nl> code + = prefix + " optionalEncoding : flatbuffers . Encoding " + " ) : " + <nl> - GenTypeName ( field . value . type , false ) + " \ n " ; <nl> + GenTypeName ( field . value . type , false , true ) + " \ n " ; <nl> code + = prefix + " optionalEncoding ? : any " ; <nl> } else { <nl> code + = prefix ; <nl> } <nl> if ( field . value . type . enum_def ) { <nl> code + = " ) : " + <nl> - GenPrefixedTypeName ( GenTypeName ( field . value . type , false ) , <nl> + GenPrefixedTypeName ( GenTypeName ( field . value . type , false , true ) , <nl> field . value . type . enum_def - > file ) + " { \ n " ; <nl> } else { <nl> - code + = " ) : " + GenTypeName ( field . value . type , false ) + " { \ n " ; <nl> + code + = " ) : " + GenTypeName ( field . value . type , false , true ) + " { \ n " ; <nl> } <nl> } else { <nl> code + = object_name + " . prototype . " + MakeCamel ( field . name , false ) ; <nl> void GenStruct ( const Parser & parser , StructDef & struct_def , <nl> case BASE_TYPE_STRUCT : { <nl> auto type = WrapInNameSpace ( * field . value . type . struct_def ) ; <nl> GenDocComment ( field . doc_comment , code_ptr , <nl> - " @ param { " + type + " = } obj \ n @ returns { " + type + " } " ) ; <nl> + " @ param { " + type + " = } obj \ n @ returns { " + type + " | null } " ) ; <nl> if ( lang_ . language = = IDLOptions : : kTs ) { <nl> type = GenPrefixedTypeName ( type , field . value . type . struct_def - > file ) ; <nl> code + = MakeCamel ( field . name , false ) ; <nl> - code + = " ( obj ? : " + type + " ) : " + type + " { \ n " ; <nl> + code + = " ( obj ? : " + type + " ) : " + type + " | null { \ n " ; <nl> } else { <nl> code + = object_name + " . prototype . " + MakeCamel ( field . name , false ) ; <nl> code + = " = function ( obj ) { \ n " ; <nl> void GenStruct ( const Parser & parser , StructDef & struct_def , <nl> } else { <nl> code + = prefix ; <nl> } <nl> - code + = " ) : " + vectortypename + " { \ n " ; <nl> + code + = " ) : " + vectortypename + " | null { \ n " ; <nl> } else { <nl> code + = object_name + " . prototype . " + MakeCamel ( field . name , false ) ; <nl> code + = " = function ( index " ; <nl> void GenStruct ( const Parser & parser , StructDef & struct_def , <nl> " @ returns { ? flatbuffers . Table } " ) ; <nl> if ( lang_ . language = = IDLOptions : : kTs ) { <nl> code + = MakeCamel ( field . name , false ) ; <nl> - code + = " < T extends flatbuffers . Table > ( obj : T ) : T { \ n " ; <nl> + code + = " < T extends flatbuffers . Table > ( obj : T ) : T | null { \ n " ; <nl> } else { <nl> code + = object_name + " . prototype . " + MakeCamel ( field . name , false ) ; <nl> code + = " = function ( obj ) { \ n " ; <nl> void GenStruct ( const Parser & parser , StructDef & struct_def , <nl> <nl> if ( lang_ . language = = IDLOptions : : kTs ) { <nl> code + = MakeCamel ( field . name , false ) ; <nl> - code + = " Array ( ) : " + GenType ( vectorType ) + " Array { \ n " + <nl> + code + = " Array ( ) : " + GenType ( vectorType ) + " Array | null { \ n " + <nl> offset_prefix ; <nl> } else { <nl> code + = object_name + " . prototype . " + MakeCamel ( field . name , false ) ; <nl> void GenStruct ( const Parser & parser , StructDef & struct_def , <nl> <nl> if ( lang_ . language = = IDLOptions : : kTs ) { <nl> code + = " static create " + struct_def . name + " ( builder : flatbuffers . Builder " ; <nl> - code + = arguments + " ) : flatbuffers . Offset { \ n " ; <nl> + code + = arguments + " ) : flatbuffers . Offset | null { \ n " ; <nl> } else { <nl> code + = object_name + " . create " + struct_def . name + " = function ( builder " ; <nl> code + = arguments + " ) { \ n " ; <nl> void GenStruct ( const Parser & parser , StructDef & struct_def , <nl> type + = " | Uint8Array " ; <nl> } <nl> code + = " Vector ( builder : flatbuffers . Builder , data : " + type + <nl> - " ) : flatbuffers . Offset { \ n " ; <nl> - code + = " if ( ! data ) { \ n return null \ n } \ n " ; <nl> + " ) : flatbuffers . Offset | null { \ n " ; <nl> + code + = " if ( ! data ) { \ n return null ; \ n } \ n " ; <nl> } else { <nl> code + = object_name + " . create " + MakeCamel ( field . name ) ; <nl> code + = " Vector = function ( builder , data ) { \ n " ; <nl> mmm a / tests / TypeScriptTest . sh <nl> ppp b / tests / TypeScriptTest . sh <nl> pushd " $ ( dirname $ 0 ) " > / dev / null <nl> . . / flatc - - ts - - no - fb - import - - gen - mutable - o ts monster_test . fbs <nl> . . / flatc - b monster_test . fbs unicode_test . json <nl> npm install @ types / flatbuffers <nl> - tsc ts / monster_test_generated . ts <nl> + tsc - - strict - - noUnusedParameters - - noUnusedLocals - - noImplicitReturns - - strictNullChecks ts / monster_test_generated . ts <nl> npm uninstall @ types / flatbuffers <nl> node JavaScriptTest . / ts / monster_test_generated <nl> mmm a / tests / monster_test_generated . js <nl> ppp b / tests / monster_test_generated . js <nl> MyGame . Example2 . Monster = function ( ) { <nl> / * * <nl> * @ type { flatbuffers . ByteBuffer } <nl> * / <nl> - this . bb = null ; <nl> + this . bb = undefined ; <nl> <nl> / * * <nl> * @ type { number } <nl> MyGame . Example . Test = function ( ) { <nl> / * * <nl> * @ type { flatbuffers . ByteBuffer } <nl> * / <nl> - this . bb = null ; <nl> + this . bb = undefined ; <nl> <nl> / * * <nl> * @ type { number } <nl> MyGame . Example . TestSimpleTableWithEnum = function ( ) { <nl> / * * <nl> * @ type { flatbuffers . ByteBuffer } <nl> * / <nl> - this . bb = null ; <nl> + this . bb = undefined ; <nl> <nl> / * * <nl> * @ type { number } <nl> MyGame . Example . Vec3 = function ( ) { <nl> / * * <nl> * @ type { flatbuffers . ByteBuffer } <nl> * / <nl> - this . bb = null ; <nl> + this . bb = undefined ; <nl> <nl> / * * <nl> * @ type { number } <nl> MyGame . Example . Ability = function ( ) { <nl> / * * <nl> * @ type { flatbuffers . ByteBuffer } <nl> * / <nl> - this . bb = null ; <nl> + this . bb = undefined ; <nl> <nl> / * * <nl> * @ type { number } <nl> MyGame . Example . Stat = function ( ) { <nl> / * * <nl> * @ type { flatbuffers . ByteBuffer } <nl> * / <nl> - this . bb = null ; <nl> + this . bb = undefined ; <nl> <nl> / * * <nl> * @ type { number } <nl> MyGame . Example . Stat . getRootAsStat = function ( bb , obj ) { <nl> <nl> / * * <nl> * @ param { flatbuffers . Encoding = } optionalEncoding <nl> - * @ returns { string | Uint8Array } <nl> + * @ returns { string | Uint8Array | null } <nl> * / <nl> MyGame . Example . Stat . prototype . id = function ( optionalEncoding ) { <nl> var offset = this . bb . __offset ( this . bb_pos , 4 ) ; <nl> MyGame . Example . Monster = function ( ) { <nl> / * * <nl> * @ type { flatbuffers . ByteBuffer } <nl> * / <nl> - this . bb = null ; <nl> + this . bb = undefined ; <nl> <nl> / * * <nl> * @ type { number } <nl> MyGame . Example . Monster . prototype . mutate_hp = function ( value ) { <nl> <nl> / * * <nl> * @ param { flatbuffers . Encoding = } optionalEncoding <nl> - * @ returns { string | Uint8Array } <nl> + * @ returns { string | Uint8Array | null } <nl> * / <nl> MyGame . Example . Monster . prototype . name = function ( optionalEncoding ) { <nl> var offset = this . bb . __offset ( this . bb_pos , 10 ) ; <nl> mmm a / tests / monster_test_generated . ts <nl> ppp b / tests / monster_test_generated . ts <nl> export class Monster { <nl> / * * <nl> * @ type { flatbuffers . ByteBuffer } <nl> * / <nl> - bb : flatbuffers . ByteBuffer = null ; <nl> + bb : flatbuffers . ByteBuffer ; <nl> <nl> / * * <nl> * @ type { number } <nl> export class Test { <nl> / * * <nl> * @ type { flatbuffers . ByteBuffer } <nl> * / <nl> - bb : flatbuffers . ByteBuffer = null ; <nl> + bb : flatbuffers . ByteBuffer ; <nl> <nl> / * * <nl> * @ type { number } <nl> export class TestSimpleTableWithEnum { <nl> / * * <nl> * @ type { flatbuffers . ByteBuffer } <nl> * / <nl> - bb : flatbuffers . ByteBuffer = null ; <nl> + bb : flatbuffers . ByteBuffer ; <nl> <nl> / * * <nl> * @ type { number } <nl> export class Vec3 { <nl> / * * <nl> * @ type { flatbuffers . ByteBuffer } <nl> * / <nl> - bb : flatbuffers . ByteBuffer = null ; <nl> + bb : flatbuffers . ByteBuffer ; <nl> <nl> / * * <nl> * @ type { number } <nl> export class Ability { <nl> / * * <nl> * @ type { flatbuffers . ByteBuffer } <nl> * / <nl> - bb : flatbuffers . ByteBuffer = null ; <nl> + bb : flatbuffers . ByteBuffer ; <nl> <nl> / * * <nl> * @ type { number } <nl> export class Stat { <nl> / * * <nl> * @ type { flatbuffers . ByteBuffer } <nl> * / <nl> - bb : flatbuffers . ByteBuffer = null ; <nl> + bb : flatbuffers . ByteBuffer ; <nl> <nl> / * * <nl> * @ type { number } <nl> static getRootAsStat ( bb : flatbuffers . ByteBuffer , obj ? : Stat ) : Stat { <nl> <nl> / * * <nl> * @ param { flatbuffers . Encoding = } optionalEncoding <nl> - * @ returns { string | Uint8Array } <nl> + * @ returns { string | Uint8Array | null } <nl> * / <nl> - id ( ) : string <nl> - id ( optionalEncoding : flatbuffers . Encoding ) : string | Uint8Array <nl> + id ( ) : string | null <nl> + id ( optionalEncoding : flatbuffers . Encoding ) : string | Uint8Array | null <nl> id ( optionalEncoding ? : any ) : string | Uint8Array { <nl> var offset = this . bb . __offset ( this . bb_pos , 4 ) ; <nl> return offset ? this . bb . __string ( this . bb_pos + offset , optionalEncoding ) : null ; <nl> export class Monster { <nl> / * * <nl> * @ type { flatbuffers . ByteBuffer } <nl> * / <nl> - bb : flatbuffers . ByteBuffer = null ; <nl> + bb : flatbuffers . ByteBuffer ; <nl> <nl> / * * <nl> * @ type { number } <nl> mutate_hp ( value : number ) : boolean { <nl> <nl> / * * <nl> * @ param { flatbuffers . Encoding = } optionalEncoding <nl> - * @ returns { string | Uint8Array } <nl> + * @ returns { string | Uint8Array | null } <nl> * / <nl> - name ( ) : string <nl> - name ( optionalEncoding : flatbuffers . Encoding ) : string | Uint8Array <nl> + name ( ) : string | null <nl> + name ( optionalEncoding : flatbuffers . Encoding ) : string | Uint8Array | null <nl> name ( optionalEncoding ? : any ) : string | Uint8Array { <nl> var offset = this . bb . __offset ( this . bb_pos , 10 ) ; <nl> return offset ? this . bb . __string ( this . bb_pos + offset , optionalEncoding ) : null ; <nl> mmm a / tests / namespace_test / namespace_test1_generated . js <nl> ppp b / tests / namespace_test / namespace_test1_generated . js <nl> NamespaceA . NamespaceB . TableInNestedNS = function ( ) { <nl> / * * <nl> * @ type { flatbuffers . ByteBuffer } <nl> * / <nl> - this . bb = null ; <nl> + this . bb = undefined ; <nl> <nl> / * * <nl> * @ type { number } <nl> NamespaceA . NamespaceB . StructInNestedNS = function ( ) { <nl> / * * <nl> * @ type { flatbuffers . ByteBuffer } <nl> * / <nl> - this . bb = null ; <nl> + this . bb = undefined ; <nl> <nl> / * * <nl> * @ type { number } <nl> mmm a / tests / namespace_test / namespace_test1_generated . ts <nl> ppp b / tests / namespace_test / namespace_test1_generated . ts <nl> export class TableInNestedNS { <nl> / * * <nl> * @ type { flatbuffers . ByteBuffer } <nl> * / <nl> - bb : flatbuffers . ByteBuffer = null ; <nl> + bb : flatbuffers . ByteBuffer ; <nl> <nl> / * * <nl> * @ type { number } <nl> export class StructInNestedNS { <nl> / * * <nl> * @ type { flatbuffers . ByteBuffer } <nl> * / <nl> - bb : flatbuffers . ByteBuffer = null ; <nl> + bb : flatbuffers . ByteBuffer ; <nl> <nl> / * * <nl> * @ type { number } <nl> mmm a / tests / namespace_test / namespace_test2_generated . js <nl> ppp b / tests / namespace_test / namespace_test2_generated . js <nl> NamespaceA . TableInFirstNS = function ( ) { <nl> / * * <nl> * @ type { flatbuffers . ByteBuffer } <nl> * / <nl> - this . bb = null ; <nl> + this . bb = undefined ; <nl> <nl> / * * <nl> * @ type { number } <nl> NamespaceC . TableInC = function ( ) { <nl> / * * <nl> * @ type { flatbuffers . ByteBuffer } <nl> * / <nl> - this . bb = null ; <nl> + this . bb = undefined ; <nl> <nl> / * * <nl> * @ type { number } <nl> NamespaceA . SecondTableInA = function ( ) { <nl> / * * <nl> * @ type { flatbuffers . ByteBuffer } <nl> * / <nl> - this . bb = null ; <nl> + this . bb = undefined ; <nl> <nl> / * * <nl> * @ type { number } <nl> mmm a / tests / namespace_test / namespace_test2_generated . ts <nl> ppp b / tests / namespace_test / namespace_test2_generated . ts <nl> export class TableInFirstNS { <nl> / * * <nl> * @ type { flatbuffers . ByteBuffer } <nl> * / <nl> - bb : flatbuffers . ByteBuffer = null ; <nl> + bb : flatbuffers . ByteBuffer ; <nl> <nl> / * * <nl> * @ type { number } <nl> export class TableInC { <nl> / * * <nl> * @ type { flatbuffers . ByteBuffer } <nl> * / <nl> - bb : flatbuffers . ByteBuffer = null ; <nl> + bb : flatbuffers . ByteBuffer ; <nl> <nl> / * * <nl> * @ type { number } <nl> export class SecondTableInA { <nl> / * * <nl> * @ type { flatbuffers . ByteBuffer } <nl> * / <nl> - bb : flatbuffers . ByteBuffer = null ; <nl> + bb : flatbuffers . ByteBuffer ; <nl> <nl> / * * <nl> * @ type { number } <nl>
|
Generating the most strict TS code possible ( )
|
google/flatbuffers
|
86777bd66baafc6bc59cbcb83e2c522b3da1bc77
|
2017-05-01T23:05:53Z
|
mmm a / emcc . py <nl> ppp b / emcc . py <nl> def check ( input_file ) : <nl> # used for warnings in emscripten . py <nl> shared . Settings . ORIGINAL_EXPORTED_FUNCTIONS = original_exported_response or shared . Settings . EXPORTED_FUNCTIONS [ : ] <nl> <nl> + # - s ASSERTIONS = 1 implies the heaviest stack overflow check mode . Set the implication here explicitly to avoid having to <nl> + # do preprocessor " # if defined ( ASSERTIONS ) | | defined ( STACK_OVERFLOW_CHECK ) " in . js files , which is not supported . <nl> + if shared . Settings . ASSERTIONS : shared . Settings . STACK_OVERFLOW_CHECK = 2 <nl> + <nl> try : <nl> assert shared . Settings . ASM_JS > 0 , ' ASM_JS must be enabled in fastcomp ' <nl> assert shared . Settings . SAFE_HEAP in [ 0 , 1 ] , ' safe heap must be 0 or 1 in fastcomp ' <nl> mmm a / emscripten . py <nl> ppp b / emscripten . py <nl> def keyfunc ( other ) : <nl> ' " ) ; ' + extra <nl> <nl> basic_funcs = [ ' abort ' , ' assert ' ] + [ m . replace ( ' . ' , ' _ ' ) for m in math_envs ] <nl> + if settings [ ' STACK_OVERFLOW_CHECK ' ] : basic_funcs + = [ ' abortStackOverflow ' ] <nl> <nl> asm_safe_heap = settings [ ' SAFE_HEAP ' ] and not settings [ ' SAFE_HEAP_LOG ' ] and not settings [ ' RELOCATABLE ' ] # optimized safe heap in asm , when we can <nl> <nl> def string_contains_any ( s , str_list ) : <nl> ret = STACKTOP ; <nl> STACKTOP = ( STACKTOP + size ) | 0 ; <nl> STACKTOP = ( STACKTOP + 15 ) & - 16 ; <nl> - ' ' ' + ( ' if ( ( STACKTOP | 0 ) > = ( STACK_MAX | 0 ) ) abort ( ) ; \ n ' if settings [ ' ASSERTIONS ' ] else ' ' ) + ' ' ' <nl> + ' ' ' + ( ' if ( ( STACKTOP | 0 ) > = ( STACK_MAX | 0 ) ) abortStackOverflow ( size | 0 ) ; \ n ' if ( settings [ ' ASSERTIONS ' ] or settings [ ' STACK_OVERFLOW_CHECK ' ] > = 2 ) else ' ' ) + ' ' ' <nl> return ret | 0 ; <nl> } <nl> function stackSave ( ) { <nl> mmm a / site / source / docs / porting / Debugging . rst <nl> ppp b / site / source / docs / porting / Debugging . rst <nl> The most important settings are : <nl> <nl> You can also set ` ` SAFE_HEAP_LOG ` ` to log ` ` SAFE_HEAP ` ` operations . <nl> <nl> + - <nl> + . . _debugging - STACK_OVERFLOW_CHECK : <nl> + <nl> + Passing the ` ` STACK_OVERFLOW_CHECK = 1 ` ` linker flag adds a runtime magic token value at the end of the stack , which is checked in certain locations to verify that the user code does not accidentally write past the end of the stack . While overrunning the Emscripten stack is not a security issue ( JavaScript is sandboxed already ) , writing past the stack causes memory corruption in global data and dynamically allocated memory sections in the Emscripten HEAP , which makes the application fail in unexpected ways . The value ` ` STACK_OVERFLOW_CHECK = 2 ` ` enables slightly more detailed stack guard checks , which can give a more precise callstack at the expense of some performance . Default value is 2 if ` ` ASSERTIONS = 1 ` ` is set , and disabled otherwise . <nl> + <nl> A number of other useful debug settings are defined in ` src / settings . js < https : / / github . com / kripken / emscripten / blob / master / src / settings . js > ` _ . For more information , search that file for the keywords " check " and " debug " . <nl> <nl> <nl> mmm a / src / library_browser . js <nl> ppp b / src / library_browser . js <nl> var LibraryBrowser = { <nl> } <nl> } ) ; <nl> <nl> + # if STACK_OVERFLOW_CHECK <nl> + checkStackCookie ( ) ; <nl> + # endif <nl> + <nl> / / catch pauses from the main loop itself <nl> if ( thisMainLoopId < Browser . mainLoop . currentlyRunningMainloop ) return ; <nl> <nl> mmm a / src / postamble . js <nl> ppp b / src / postamble . js <nl> function run ( args ) { <nl> return ; <nl> } <nl> <nl> + # if STACK_OVERFLOW_CHECK <nl> + writeStackCookie ( ) ; <nl> + # endif <nl> + <nl> preRun ( ) ; <nl> <nl> if ( runDependencies > 0 ) return ; / / a preRun added a dependency , run will be called later <nl> function run ( args ) { <nl> } else { <nl> doRun ( ) ; <nl> } <nl> + # if STACK_OVERFLOW_CHECK <nl> + checkStackCookie ( ) ; <nl> + # endif <nl> } <nl> Module [ ' run ' ] = Module . run = run ; <nl> <nl> mmm a / src / preamble . js <nl> ppp b / src / preamble . js <nl> if ( ENVIRONMENT_IS_PTHREAD ) { <nl> } <nl> # endif <nl> <nl> + # if STACK_OVERFLOW_CHECK <nl> + / / Initializes the stack cookie . Called at the startup of main and at the startup of each thread in pthreads mode . <nl> + function writeStackCookie ( ) { <nl> + assert ( ( STACK_MAX & 3 ) = = 0 ) ; <nl> + HEAPU32 [ ( STACK_MAX > > 2 ) - 1 ] = 0x02135467 ; <nl> + HEAPU32 [ ( STACK_MAX > > 2 ) - 2 ] = 0x89BACDFE ; <nl> + } <nl> + <nl> + function checkStackCookie ( ) { <nl> + if ( HEAPU32 [ ( STACK_MAX > > 2 ) - 1 ] ! = 0x02135467 | | HEAPU32 [ ( STACK_MAX > > 2 ) - 2 ] ! = 0x89BACDFE ) { <nl> + abort ( ' Stack overflow ! Stack cookie has been overwritten , expected hex dwords 0x89BACDFE and 0x02135467 , but received 0x ' + HEAPU32 [ ( STACK_MAX > > 2 ) - 2 ] . toString ( 16 ) + ' ' + HEAPU32 [ ( STACK_MAX > > 2 ) - 1 ] . toString ( 16 ) ) ; <nl> + } <nl> + } <nl> + # endif <nl> + <nl> + function abortStackOverflow ( allocSize ) { <nl> + abort ( ' Stack overflow ! Attempted to allocate ' + allocSize + ' bytes on the stack , but stack has only ' + ( STACK_MAX - STACKTOP ) + ' bytes available ! ' ) ; <nl> + } <nl> + <nl> # if ALLOW_MEMORY_GROWTH = = 0 <nl> function abortOnCannotGrowMemory ( ) { <nl> abort ( ' Cannot enlarge memory arrays . Either ( 1 ) compile with - s TOTAL_MEMORY = X with X higher than the current value ' + TOTAL_MEMORY + ' , ( 2 ) compile with - s ALLOW_MEMORY_GROWTH = 1 which adjusts the size at runtime but prevents some optimizations , ( 3 ) set Module . TOTAL_MEMORY to a higher value before the program runs , or if you want malloc to return NULL ( 0 ) instead of this abort , compile with - s ABORTING_MALLOC = 0 ' ) ; <nl> function preRun ( ) { <nl> } <nl> <nl> function ensureInitRuntime ( ) { <nl> + # if STACK_OVERFLOW_CHECK <nl> + checkStackCookie ( ) ; <nl> + # endif <nl> # if USE_PTHREADS <nl> if ( ENVIRONMENT_IS_PTHREAD ) return ; / / PThreads reuse the runtime from the main thread . <nl> # endif <nl> function ensureInitRuntime ( ) { <nl> } <nl> <nl> function preMain ( ) { <nl> + # if STACK_OVERFLOW_CHECK <nl> + checkStackCookie ( ) ; <nl> + # endif <nl> # if USE_PTHREADS <nl> if ( ENVIRONMENT_IS_PTHREAD ) return ; / / PThreads reuse the runtime from the main thread . <nl> # endif <nl> function preMain ( ) { <nl> } <nl> <nl> function exitRuntime ( ) { <nl> + # if STACK_OVERFLOW_CHECK <nl> + checkStackCookie ( ) ; <nl> + # endif <nl> # if USE_PTHREADS <nl> if ( ENVIRONMENT_IS_PTHREAD ) return ; / / PThreads reuse the runtime from the main thread . <nl> # endif <nl> function exitRuntime ( ) { <nl> } <nl> <nl> function postRun ( ) { <nl> + # if STACK_OVERFLOW_CHECK <nl> + checkStackCookie ( ) ; <nl> + # endif <nl> # if USE_PTHREADS <nl> if ( ENVIRONMENT_IS_PTHREAD ) return ; / / PThreads reuse the runtime from the main thread . <nl> # endif <nl> mmm a / src / runtime . js <nl> ppp b / src / runtime . js <nl> var RuntimeGenerator = { <nl> stackAlloc : function ( size , sep ) { <nl> sep = sep | | ' ; ' ; <nl> var ret = RuntimeGenerator . alloc ( size , ' STACK ' , sep , ( isNumber ( size ) & & parseInt ( size ) % { { { STACK_ALIGN } } } = = 0 ) ) ; <nl> - if ( ASSERTIONS ) { <nl> + if ( ASSERTIONS | | STACK_OVERFLOW_CHECK > = 2 ) { <nl> ret + = sep + ' ( assert ( ' + asmCoercion ( ' ( STACKTOP | 0 ) < ( STACK_MAX | 0 ) ' , ' i32 ' ) + ' ) | 0 ) ' ; <nl> } <nl> return ret ; <nl> mmm a / src / settings . js <nl> ppp b / src / settings . js <nl> var ASSERTIONS = 1 ; / / Whether we should add runtime assertions , for example to <nl> / / of positive size , etc . , whether we should throw if we encounter a bad __label__ , i . e . , <nl> / / if code flow runs into a fault <nl> / / ASSERTIONS = = 2 gives even more runtime checks <nl> + var STACK_OVERFLOW_CHECK = 0 ; / / Chooses what kind of stack smash checks to emit to generated code : <nl> + / / 0 : Stack overflows are not checked . <nl> + / / 1 : Adds a security cookie at the top of the stack , which is checked at end of each tick and at exit ( practically zero performance overhead ) <nl> + / / 2 : Same as above , but also adds an explicit check for allocate ( ) calls which call ALLOC_STACK . Has a small performance cost . <nl> + / / - s ASSERTIONS = 1 automatically enables - s STACK_OVERFLOW_CHECK = 2 . <nl> var VERBOSE = 0 ; / / When set to 1 , will generate more verbose output during compilation . <nl> <nl> var INVOKE_RUN = 1 ; / / Whether we will run the main ( ) function . Disable if you embed the generated <nl> new file mode 100644 <nl> index 00000000000 . . f4e01c1553c <nl> mmm / dev / null <nl> ppp b / tests / stack_overflow . cpp <nl> <nl> + # include < stdio . h > <nl> + # include < string . h > <nl> + # include < emscripten . h > <nl> + <nl> + void __attribute__ ( ( noinline ) ) InteropString ( ) <nl> + { <nl> + char * string = ( char * ) EM_ASM_INT_V ( { <nl> + var str = " hello , this is a string ! " ; <nl> + for ( var i = 0 ; i < 16 ; + + i ) <nl> + str = str + str ; <nl> + var stringOnTheStack = allocate ( intArrayFromString ( str ) , ' i8 ' , ALLOC_STACK ) ; <nl> + return stringOnTheStack ; <nl> + } ) ; <nl> + <nl> + int stringLength = strlen ( string ) ; <nl> + printf ( " Got string : % s \ n " , string ) ; <nl> + printf ( " Received a string of length % d . \ n " , stringLength ) ; <nl> + } <nl> + <nl> + int main ( ) <nl> + { <nl> + InteropString ( ) ; <nl> + } <nl> mmm a / tests / test_core . py <nl> ppp b / tests / test_core . py <nl> def test_fs_dict ( self ) : <nl> self . emcc_args + = [ ' - - pre - js ' , ' pre . js ' ] <nl> self . do_run ( ' ' , ' object \ nobject \ nobject ' ) <nl> <nl> + def test_stack_overflow_check ( self ) : <nl> + args = self . emcc_args + [ ' - s ' , ' TOTAL_STACK = 1048576 ' ] <nl> + self . emcc_args = args + [ ' - s ' , ' STACK_OVERFLOW_CHECK = 1 ' , ' - s ' , ' ASSERTIONS = 0 ' ] <nl> + self . do_run ( open ( path_from_root ( ' tests ' , ' stack_overflow . cpp ' ) , ' r ' ) . read ( ) , ' Stack overflow ! Stack cookie has been overwritten ' ) <nl> + <nl> + self . emcc_args = args + [ ' - s ' , ' STACK_OVERFLOW_CHECK = 2 ' , ' - s ' , ' ASSERTIONS = 0 ' ] <nl> + self . do_run ( open ( path_from_root ( ' tests ' , ' stack_overflow . cpp ' ) , ' r ' ) . read ( ) , ' Stack overflow ! Attempted to allocate ' ) <nl> + <nl> + self . emcc_args = args + [ ' - s ' , ' ASSERTIONS = 1 ' ] <nl> + self . do_run ( open ( path_from_root ( ' tests ' , ' stack_overflow . cpp ' ) , ' r ' ) . read ( ) , ' Stack overflow ! Attempted to allocate ' ) <nl> + <nl> # Generate tests for everything <nl> def make_run ( fullname , name = - 1 , compiler = - 1 , embetter = 0 , quantum_size = 0 , <nl> typed_arrays = 0 , emcc_args = None , env = None ) : <nl>
|
Implement - s STACK_OVERFLOW_CHECK = 0 / 1 / 2 option which adds in runtime checking against Emscripten stack overrun .
|
emscripten-core/emscripten
|
8ffbc44d4972a9d656d1a06d4ca0b838369f3433
|
2016-03-04T16:47:26Z
|
mmm a / test / test_jit . py <nl> ppp b / test / test_jit . py <nl> def fct_loop ( x ) : <nl> jit_trace = torch . jit . trace ( fct_loop , x ) <nl> out_trace = jit_trace ( x ) <nl> <nl> + def test_bailout_loop_carried_deps_name_clash ( self ) : <nl> + with enable_profiling_mode ( ) : <nl> + NUM_ITERATIONS = 10 <nl> + @ torch . jit . script <nl> + def fct_loop ( z , size ) : <nl> + # type : ( int , int ) - > Tuple [ Tensor , List [ int ] ] <nl> + counters = torch . jit . annotate ( List [ int ] , [ ] ) <nl> + j = 0 <nl> + y = torch . ones ( 2 ) <nl> + for i in range ( size ) : <nl> + counters . append ( i + j ) <nl> + y = torch . cat ( ( y , torch . ones ( z ) ) , 0 ) <nl> + j = j + 1 <nl> + return y , counters <nl> + <nl> + inputs = [ 1 , 2 , 3 , 4 ] <nl> + expected = [ x * 2 for x in range ( NUM_ITERATIONS ) ] <nl> + for inp in inputs : <nl> + results = fct_loop ( inp , NUM_ITERATIONS ) <nl> + self . assertEqual ( results [ 1 ] , expected ) <nl> + <nl> def test_bailout_loop_counter_transition ( self ) : <nl> with enable_profiling_mode ( ) : <nl> NUM_ITERATIONS = 10 <nl> mmm a / torch / csrc / jit / passes / bailout_graph . cpp <nl> ppp b / torch / csrc / jit / passes / bailout_graph . cpp <nl> struct BailOutGraphBuilderForNode { <nl> if ( node - > kind ( ) = = prim : : Constant ) { <nl> TORCH_INTERNAL_ASSERT ( ! shouldBeCapturedInByBailOut ( node ) ) ; <nl> auto new_const = copy_graph_ - > createClone ( node , { nullptr } ) ; <nl> - copy_graph_ - > block ( ) - > appendNode ( new_const ) ; <nl> + copy_graph_ - > block ( ) - > prependNode ( new_const ) ; <nl> return new_const - > output ( ) ; <nl> } <nl> <nl> live_inputs_ . push_back ( old_value ) ; <nl> auto new_value = copy_graph_ - > block ( ) - > addInput ( ) ; <nl> + GRAPH_DEBUG ( <nl> + " Adding a new value % " , <nl> + new_value - > debugName ( ) , <nl> + " for % " , <nl> + old_value - > debugName ( ) ) ; <nl> return mapValueAndCopyMetadata ( old_value , new_value ) ; <nl> } <nl> <nl> struct BailOutGraphBuilderForNode { <nl> auto cur_iter = getInputForValue ( lv . currentTripCount ( ) ) ; <nl> auto block_outputs = lv . bodyBlock ( ) - > outputs ( ) ; <nl> auto carried_deps = lv . carriedInputsWithCond ( ) ; <nl> - mapValues ( block_outputs , carried_deps ) ; <nl> + <nl> auto * block = copy_graph_ - > block ( ) ; <nl> / / subtract the number of iterations <nl> WithInsertPoint guard ( * block - > nodes ( ) . end ( ) ) ; <nl> struct BailOutGraphBuilderForNode { <nl> updated_max_trip_count = <nl> copy_graph_ - > insert ( aten : : sub , { updated_max_trip_count , one } ) ; <nl> TORCH_INTERNAL_ASSERT ( old_to_new_ . count ( outer_node - > inputs ( ) [ 0 ] ) ! = 0 ) ; <nl> - mapValueAndCopyMetadata ( outer_node - > inputs ( ) [ 0 ] , updated_max_trip_count ) ; <nl> auto cur_plus_one = copy_graph_ - > insert ( aten : : add , { one , cur_iter } ) ; <nl> <nl> - auto new_loop = cloneNode ( outer_node ) ; <nl> + / / We need to be careful when mapping ` block_outputs ` to continuation <nl> + / / loop ' s inputs since ` cloneFrom ` will replace ` % 4 ` with the same value <nl> + / / in both , ` prim : : Loop ` and ` aten : : cat ` in the example below : <nl> + / / <nl> + / / . . . : Tensor = prim : : Loop ( % MAX_TRIP_COUNT , % COND , . . . , % 4 ) <nl> + / / block0 ( % i . 2 : int , . . . ) : <nl> + / / . . . <nl> + / / % y . 5 : Double ( 3 ) = aten : : cat ( % 22 , % 4 ) <nl> + / / . . . <nl> + / / <nl> + / / However for the cloned loop node , the values should be different . <nl> + / / Namely , the value in ` prim : : Loop ` should come from <nl> + / / ` lv . bodyBlock ( ) - > outputs ( ) ` which are mapped to the outputs of the <nl> + / / current iteration whereas ` % 4 ` in ` aten : : cat ` needs to be mapped to the <nl> + / / cloned value of ` % 4 ` in a bailout graph . To work around this , we manually <nl> + / / clone loop nodes <nl> + <nl> + / / map the residual loop ' s inputs to the outputs of the current iteration <nl> + / / ( i . e . ` block_outputs ` ) <nl> + auto new_loop = <nl> + copy_graph_ - > insertNode ( copy_graph_ - > create ( prim : : Loop , { } , 0 ) ) <nl> + - > setSourceRange ( outer_node - > sourceRange ( ) ) ; <nl> + new_loop - > addInput ( updated_max_trip_count ) ; <nl> + for ( auto bo : block_outputs ) { <nl> + new_loop - > addInput ( getOrAddInputForValue ( bo ) ) ; <nl> + } <nl> + <nl> + / / clone the loop body and map old loop ' s outputs to new loop ' s outputs <nl> + auto new_loop_body = new_loop - > addBlock ( ) ; <nl> + auto env = [ this ] ( Value * v ) { return getOrAddInputForValue ( v ) ; } ; <nl> + new_loop_body - > cloneFrom ( lv . bodyBlock ( ) , env ) ; <nl> + for ( auto ov : lv . carriedOutputs ( ) ) { <nl> + auto no = new_loop - > addOutput ( ) ; <nl> + mapValueAndCopyMetadata ( ov , no ) ; <nl> + } <nl> LoopView new_lv ( new_loop ) ; <nl> { <nl> WithInsertPoint guard_in_loop ( * new_lv . bodyBlock ( ) - > nodes ( ) . begin ( ) ) ; <nl> TORCH_API std : : shared_ptr < Graph > BuildBailOutGraphFrom ( <nl> bailout_index = = orig_bailout_node - > i ( attr : : index ) ) ; <nl> BailOutGraphBuilderForNode bg ( orig , target ) ; <nl> auto bailout_graph = bg . buildBailOutGraphFrom ( orig_bailout_node ) ; <nl> + GRAPH_DUMP ( " bailout_graph " , bailout_graph ) ; <nl> removeBailouts ( bailout_graph - > block ( ) ) ; <nl> return bailout_graph ; <nl> } <nl>
|
fixing a naming issue in creating a residual loop node in a bailout graph ( )
|
pytorch/pytorch
|
fc3103b1162a3312e4ad74005d0b698a333c0750
|
2019-12-19T08:34:50Z
|
mmm a / src / net . cpp <nl> ppp b / src / net . cpp <nl> int Net : : forward_layer ( int layer_index , std : : vector < Mat > & blob_mats , const Optio <nl> # endif <nl> } <nl> <nl> - Mat bottom_blob_packed ; <nl> - convert_packing ( bottom_blob , bottom_blob_packed , dst_elempack , opt ) ; <nl> - bottom_blob = bottom_blob_packed ; <nl> + if ( bottom_blob . elempack ! = dst_elempack ) <nl> + { <nl> + Mat bottom_blob_packed ; <nl> + convert_packing ( bottom_blob , bottom_blob_packed , dst_elempack , opt ) ; <nl> + bottom_blob = bottom_blob_packed ; <nl> + } <nl> } <nl> <nl> / / forward <nl> int Net : : forward_layer ( int layer_index , std : : vector < Mat > & blob_mats , const Optio <nl> # endif <nl> } <nl> <nl> - Mat bottom_blob_packed ; <nl> - convert_packing ( bottom_blobs [ i ] , bottom_blob_packed , dst_elempack , opt ) ; <nl> - bottom_blobs [ i ] = bottom_blob_packed ; <nl> + if ( bottom_blobs [ i ] . elempack ! = dst_elempack ) <nl> + { <nl> + Mat bottom_blob_packed ; <nl> + convert_packing ( bottom_blobs [ i ] , bottom_blob_packed , dst_elempack , opt ) ; <nl> + bottom_blobs [ i ] = bottom_blob_packed ; <nl> + } <nl> } <nl> } <nl> <nl> int Extractor : : extract ( int blob_index , Mat & feat , int type ) <nl> <nl> feat = blob_mats [ blob_index ] ; <nl> <nl> - if ( opt . use_packing_layout & & ( type = = 0 ) ) <nl> + if ( opt . use_packing_layout & & ( type = = 0 ) & & feat . elempack ! = 1 ) <nl> { <nl> Mat bottom_blob_unpacked ; <nl> convert_packing ( feat , bottom_blob_unpacked , 1 , opt ) ; <nl>
|
add decrease unpack pack overhead ( )
|
Tencent/ncnn
|
0f325d7910b92c87e46d6daa37af5ce97d78e22e
|
2020-12-22T11:07:33Z
|
mmm a / README . rst <nl> ppp b / README . rst <nl> MacOS X <nl> <nl> SQLite Database Browser works pretty well on MacOS X . <nl> <nl> - - OSX 10 . 7 ( Lion ) works <nl> - - OSX 10 . 8 ( Mountain Lion ) probably works , but hasn ' t been tested yet . <nl> + - OSX 10 . 7 ( Lion ) and 10 . 8 ( Mountain Lion ) are tested and known to work <nl> <nl> Building on OSX is simple , but depends on SQLite and Qt to be installed <nl> using Homebrew first : : <nl> using Homebrew first : : <nl> <nl> Then it ' s just a matter of : : <nl> <nl> - $ git checkout https : / / github . com / rp - / sqlitebrowser . git <nl> + $ git clone https : / / github . com / rp - / sqlitebrowser . git <nl> $ cd sqlitebrowser <nl> $ qmake <nl> $ make <nl>
|
Updates and typo fixes
|
sqlitebrowser/sqlitebrowser
|
6a15658b06ee6f1594a9a43b31a9752f71998442
|
2013-09-05T22:21:55Z
|
mmm a / hphp / runtime / vm / jit / vasm - jumps . cpp <nl> ppp b / hphp / runtime / vm / jit / vasm - jumps . cpp <nl> void optimizeJmps ( Vunit & unit , MaybeVinstrId clobber ) { <nl> bool changed = false ; <nl> bool ever_changed = false ; <nl> <nl> + removeTrivialNops ( unit ) ; <nl> + <nl> / / The number of incoming edges from ( reachable ) predecessors for each block . <nl> jit : : vector < int > npreds ( unit . blocks . size ( ) , 0 ) ; <nl> <nl>
|
Remove trivial nops before jump optimizations
|
facebook/hhvm
|
96fc7ea76dd22a15e67e318c6f930a3ca9aa4fad
|
2019-08-27T01:44:04Z
|
mmm a / src / js / array - iterator . js <nl> ppp b / src / js / array - iterator . js <nl> var IteratorPrototype = utils . ImportNow ( " IteratorPrototype " ) ; <nl> var iteratorSymbol = utils . ImportNow ( " iterator_symbol " ) ; <nl> var MakeTypeError ; <nl> var toStringTagSymbol = utils . ImportNow ( " to_string_tag_symbol " ) ; <nl> - <nl> - macro TYPED_ARRAYS ( FUNCTION ) <nl> - FUNCTION ( Uint8Array ) <nl> - FUNCTION ( Int8Array ) <nl> - FUNCTION ( Uint16Array ) <nl> - FUNCTION ( Int16Array ) <nl> - FUNCTION ( Uint32Array ) <nl> - FUNCTION ( Int32Array ) <nl> - FUNCTION ( Float32Array ) <nl> - FUNCTION ( Float64Array ) <nl> - FUNCTION ( Uint8ClampedArray ) <nl> - endmacro <nl> - <nl> - macro COPY_FROM_GLOBAL ( NAME ) <nl> - var GlobalNAME = global . NAME ; <nl> - endmacro <nl> - <nl> - TYPED_ARRAYS ( COPY_FROM_GLOBAL ) <nl> + var GlobalTypedArray = global . Uint8Array . __proto__ ; <nl> <nl> utils . Import ( function ( from ) { <nl> MakeTypeError = from . MakeTypeError ; <nl> utils . SetFunctionName ( ArrayValues , ' values ' ) ; <nl> % AddNamedProperty ( GlobalArray . prototype , iteratorSymbol , ArrayValues , <nl> DONT_ENUM ) ; <nl> <nl> - macro EXTEND_TYPED_ARRAY ( NAME ) <nl> - % AddNamedProperty ( GlobalNAME . prototype , ' entries ' , ArrayEntries , DONT_ENUM ) ; <nl> - % AddNamedProperty ( GlobalNAME . prototype , ' values ' , ArrayValues , DONT_ENUM ) ; <nl> - % AddNamedProperty ( GlobalNAME . prototype , ' keys ' , ArrayKeys , DONT_ENUM ) ; <nl> - % AddNamedProperty ( GlobalNAME . prototype , iteratorSymbol , ArrayValues , <nl> - DONT_ENUM ) ; <nl> - endmacro <nl> - <nl> - TYPED_ARRAYS ( EXTEND_TYPED_ARRAY ) <nl> + % AddNamedProperty ( GlobalTypedArray . prototype , <nl> + ' entries ' , ArrayEntries , DONT_ENUM ) ; <nl> + % AddNamedProperty ( GlobalTypedArray . prototype , ' values ' , ArrayValues , DONT_ENUM ) ; <nl> + % AddNamedProperty ( GlobalTypedArray . prototype , ' keys ' , ArrayKeys , DONT_ENUM ) ; <nl> + % AddNamedProperty ( GlobalTypedArray . prototype , <nl> + iteratorSymbol , ArrayValues , DONT_ENUM ) ; <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> / / Exports <nl> mmm a / src / js / typedarray . js <nl> ppp b / src / js / typedarray . js <nl> function NAMEConstructor ( arg1 , arg2 , arg3 ) { <nl> } <nl> } <nl> <nl> - function NAME_GetBuffer ( ) { <nl> - if ( ! ( % _ClassOf ( this ) = = = ' NAME ' ) ) { <nl> - throw MakeTypeError ( kIncompatibleMethodReceiver , " NAME . buffer " , this ) ; <nl> - } <nl> - return % TypedArrayGetBuffer ( this ) ; <nl> - } <nl> - <nl> - function NAME_GetByteLength ( ) { <nl> - if ( ! ( % _ClassOf ( this ) = = = ' NAME ' ) ) { <nl> - throw MakeTypeError ( kIncompatibleMethodReceiver , " NAME . byteLength " , this ) ; <nl> - } <nl> - return % _ArrayBufferViewGetByteLength ( this ) ; <nl> - } <nl> - <nl> - function NAME_GetByteOffset ( ) { <nl> - if ( ! ( % _ClassOf ( this ) = = = ' NAME ' ) ) { <nl> - throw MakeTypeError ( kIncompatibleMethodReceiver , " NAME . byteOffset " , this ) ; <nl> - } <nl> - return % _ArrayBufferViewGetByteOffset ( this ) ; <nl> - } <nl> - <nl> - function NAME_GetLength ( ) { <nl> - if ( ! ( % _ClassOf ( this ) = = = ' NAME ' ) ) { <nl> - throw MakeTypeError ( kIncompatibleMethodReceiver , " NAME . length " , this ) ; <nl> - } <nl> - return % _TypedArrayGetLength ( this ) ; <nl> - } <nl> - <nl> function NAMESubArray ( begin , end ) { <nl> - if ( ! ( % _ClassOf ( this ) = = = ' NAME ' ) ) { <nl> - throw MakeTypeError ( kIncompatibleMethodReceiver , " NAME . subarray " , this ) ; <nl> - } <nl> var beginInt = TO_INTEGER ( begin ) ; <nl> if ( ! IS_UNDEFINED ( end ) ) { <nl> var endInt = TO_INTEGER ( end ) ; <nl> endmacro <nl> <nl> TYPED_ARRAYS ( TYPED_ARRAY_CONSTRUCTOR ) <nl> <nl> + function TypedArraySubArray ( begin , end ) { <nl> + switch ( % _ClassOf ( this ) ) { <nl> + macro TYPED_ARRAY_SUBARRAY_CASE ( ARRAY_ID , NAME , ELEMENT_SIZE ) <nl> + case " NAME " : <nl> + return % _Call ( NAMESubArray , this , begin , end ) ; <nl> + endmacro <nl> + TYPED_ARRAYS ( TYPED_ARRAY_SUBARRAY_CASE ) <nl> + } <nl> + throw MakeTypeError ( kIncompatibleMethodReceiver , <nl> + " get TypedArray . prototype . subarray " , this ) ; <nl> + } <nl> + % SetForceInlineFlag ( TypedArraySubArray ) ; <nl> + <nl> + function TypedArrayGetBuffer ( ) { <nl> + if ( ! % _IsTypedArray ( this ) ) { <nl> + throw MakeTypeError ( kIncompatibleMethodReceiver , <nl> + " get TypedArray . prototype . buffer " , this ) ; <nl> + } <nl> + return % TypedArrayGetBuffer ( this ) ; <nl> + } <nl> + % SetForceInlineFlag ( TypedArrayGetBuffer ) ; <nl> + <nl> + function TypedArrayGetByteLength ( ) { <nl> + if ( ! % _IsTypedArray ( this ) ) { <nl> + throw MakeTypeError ( kIncompatibleMethodReceiver , <nl> + " get TypedArray . prototype . byteLength " , this ) ; <nl> + } <nl> + return % _ArrayBufferViewGetByteLength ( this ) ; <nl> + } <nl> + % SetForceInlineFlag ( TypedArrayGetByteLength ) ; <nl> + <nl> + function TypedArrayGetByteOffset ( ) { <nl> + if ( ! % _IsTypedArray ( this ) ) { <nl> + throw MakeTypeError ( kIncompatibleMethodReceiver , <nl> + " get TypedArray . prototype . byteOffset " , this ) ; <nl> + } <nl> + return % _ArrayBufferViewGetByteOffset ( this ) ; <nl> + } <nl> + % SetForceInlineFlag ( TypedArrayGetByteOffset ) ; <nl> + <nl> + function TypedArrayGetLength ( ) { <nl> + if ( ! % _IsTypedArray ( this ) ) { <nl> + throw MakeTypeError ( kIncompatibleMethodReceiver , <nl> + " get TypedArray . prototype . length " , this ) ; <nl> + } <nl> + return % _TypedArrayGetLength ( this ) ; <nl> + } <nl> + % SetForceInlineFlag ( TypedArrayGetLength ) ; <nl> + <nl> + <nl> <nl> function TypedArraySetFromArrayLike ( target , source , sourceLength , offset ) { <nl> if ( offset > 0 ) { <nl> function TypedArrayFrom ( source , mapfn , thisArg ) { <nl> } <nl> % FunctionSetLength ( TypedArrayFrom , 1 ) ; <nl> <nl> + function TypedArray ( ) { <nl> + if ( IS_UNDEFINED ( new . target ) ) { <nl> + throw MakeTypeError ( kConstructorNonCallable , " TypedArray " ) ; <nl> + } <nl> + if ( new . target = = = TypedArray ) { <nl> + throw MakeTypeError ( kConstructAbstractClass , " TypedArray " ) ; <nl> + } <nl> + } <nl> + <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> <nl> - / / TODO ( littledan ) : Fix the TypedArray proto chain ( bug v8 : 4085 ) . <nl> + % FunctionSetPrototype ( TypedArray , new GlobalObject ( ) ) ; <nl> + % AddNamedProperty ( TypedArray . prototype , <nl> + " constructor " , TypedArray , DONT_ENUM ) ; <nl> + utils . InstallFunctions ( TypedArray , DONT_ENUM | DONT_DELETE | READ_ONLY , [ <nl> + " from " , TypedArrayFrom , <nl> + " of " , TypedArrayOf <nl> + ] ) ; <nl> + utils . InstallGetter ( TypedArray . prototype , " buffer " , TypedArrayGetBuffer ) ; <nl> + utils . InstallGetter ( TypedArray . prototype , " byteOffset " , TypedArrayGetByteOffset , <nl> + DONT_ENUM | DONT_DELETE ) ; <nl> + utils . InstallGetter ( TypedArray . prototype , " byteLength " , <nl> + TypedArrayGetByteLength , DONT_ENUM | DONT_DELETE ) ; <nl> + utils . InstallGetter ( TypedArray . prototype , " length " , TypedArrayGetLength , <nl> + DONT_ENUM | DONT_DELETE ) ; <nl> + utils . InstallGetter ( TypedArray . prototype , toStringTagSymbol , <nl> + TypedArrayGetToStringTag ) ; <nl> + utils . InstallFunctions ( TypedArray . prototype , DONT_ENUM , [ <nl> + " subarray " , TypedArraySubArray , <nl> + " set " , TypedArraySet , <nl> + " copyWithin " , TypedArrayCopyWithin , <nl> + " every " , TypedArrayEvery , <nl> + " fill " , TypedArrayFill , <nl> + " filter " , TypedArrayFilter , <nl> + " find " , TypedArrayFind , <nl> + " findIndex " , TypedArrayFindIndex , <nl> + " includes " , TypedArrayIncludes , <nl> + " indexOf " , TypedArrayIndexOf , <nl> + " join " , TypedArrayJoin , <nl> + " lastIndexOf " , TypedArrayLastIndexOf , <nl> + " forEach " , TypedArrayForEach , <nl> + " map " , TypedArrayMap , <nl> + " reduce " , TypedArrayReduce , <nl> + " reduceRight " , TypedArrayReduceRight , <nl> + " reverse " , TypedArrayReverse , <nl> + " slice " , TypedArraySlice , <nl> + " some " , TypedArraySome , <nl> + " sort " , TypedArraySort , <nl> + " toString " , TypedArrayToString , <nl> + " toLocaleString " , TypedArrayToLocaleString <nl> + ] ) ; <nl> + <nl> + <nl> macro SETUP_TYPED_ARRAY ( ARRAY_ID , NAME , ELEMENT_SIZE ) <nl> % SetCode ( GlobalNAME , NAMEConstructor ) ; <nl> % FunctionSetPrototype ( GlobalNAME , new GlobalObject ( ) ) ; <nl> + % InternalSetPrototype ( GlobalNAME , TypedArray ) ; <nl> + % InternalSetPrototype ( GlobalNAME . prototype , TypedArray . prototype ) ; <nl> <nl> % AddNamedProperty ( GlobalNAME , " BYTES_PER_ELEMENT " , ELEMENT_SIZE , <nl> READ_ONLY | DONT_ENUM | DONT_DELETE ) ; <nl> <nl> - utils . InstallFunctions ( GlobalNAME , DONT_ENUM | DONT_DELETE | READ_ONLY , [ <nl> - " from " , TypedArrayFrom , <nl> - " of " , TypedArrayOf <nl> - ] ) ; <nl> - <nl> % AddNamedProperty ( GlobalNAME . prototype , <nl> " constructor " , global . NAME , DONT_ENUM ) ; <nl> % AddNamedProperty ( GlobalNAME . prototype , <nl> " BYTES_PER_ELEMENT " , ELEMENT_SIZE , <nl> READ_ONLY | DONT_ENUM | DONT_DELETE ) ; <nl> - utils . InstallGetter ( GlobalNAME . prototype , " buffer " , NAME_GetBuffer ) ; <nl> - utils . InstallGetter ( GlobalNAME . prototype , " byteOffset " , NAME_GetByteOffset , <nl> - DONT_ENUM | DONT_DELETE ) ; <nl> - utils . InstallGetter ( GlobalNAME . prototype , " byteLength " , NAME_GetByteLength , <nl> - DONT_ENUM | DONT_DELETE ) ; <nl> - utils . InstallGetter ( GlobalNAME . prototype , " length " , NAME_GetLength , <nl> - DONT_ENUM | DONT_DELETE ) ; <nl> - utils . InstallGetter ( GlobalNAME . prototype , toStringTagSymbol , <nl> - TypedArrayGetToStringTag ) ; <nl> - utils . InstallFunctions ( GlobalNAME . prototype , DONT_ENUM , [ <nl> - " subarray " , NAMESubArray , <nl> - " set " , TypedArraySet , <nl> - " copyWithin " , TypedArrayCopyWithin , <nl> - " every " , TypedArrayEvery , <nl> - " fill " , TypedArrayFill , <nl> - " filter " , TypedArrayFilter , <nl> - " find " , TypedArrayFind , <nl> - " findIndex " , TypedArrayFindIndex , <nl> - " includes " , TypedArrayIncludes , <nl> - " indexOf " , TypedArrayIndexOf , <nl> - " join " , TypedArrayJoin , <nl> - " lastIndexOf " , TypedArrayLastIndexOf , <nl> - " forEach " , TypedArrayForEach , <nl> - " map " , TypedArrayMap , <nl> - " reduce " , TypedArrayReduce , <nl> - " reduceRight " , TypedArrayReduceRight , <nl> - " reverse " , TypedArrayReverse , <nl> - " slice " , TypedArraySlice , <nl> - " some " , TypedArraySome , <nl> - " sort " , TypedArraySort , <nl> - " toString " , TypedArrayToString , <nl> - " toLocaleString " , TypedArrayToLocaleString <nl> - ] ) ; <nl> endmacro <nl> <nl> TYPED_ARRAYS ( SETUP_TYPED_ARRAY ) <nl> mmm a / src / messages . h <nl> ppp b / src / messages . h <nl> class CallSite { <nl> T ( CannotFreezeArrayBufferView , \ <nl> " Cannot freeze array buffer views with elements " ) \ <nl> T ( CircularStructure , " Converting circular structure to JSON " ) \ <nl> + T ( ConstructAbstractClass , " Abstract class % not directly constructable " ) \ <nl> T ( ConstAssign , " Assignment to constant variable . " ) \ <nl> T ( ConstructorNonCallable , \ <nl> " Class constructor % cannot be invoked without ' new ' " ) \ <nl> mmm a / test / mjsunit / es6 / built - in - accessor - names . js <nl> ppp b / test / mjsunit / es6 / built - in - accessor - names . js <nl> assertGetterName ( ' get size ' , Set . prototype , ' size ' ) ; <nl> assertGetterName ( ' get size ' , Map . prototype , ' size ' ) ; <nl> <nl> <nl> - let typedArrays = [ <nl> - Uint8Array , <nl> - Int8Array , <nl> - Uint16Array , <nl> - Int16Array , <nl> - Uint32Array , <nl> - Int32Array , <nl> - Float32Array , <nl> - Float64Array , <nl> - Uint8ClampedArray <nl> - ] ; <nl> - <nl> - for ( let f of typedArrays ) { <nl> - assertGetterName ( ' get buffer ' , f . prototype , ' buffer ' ) ; <nl> - assertGetterName ( ' get byteOffset ' , f . prototype , ' byteOffset ' ) ; <nl> - assertGetterName ( ' get byteLength ' , f . prototype , ' byteLength ' ) ; <nl> - assertGetterName ( ' get length ' , f . prototype , ' length ' ) ; <nl> - assertGetterName ( ' get [ Symbol . toStringTag ] ' , f . prototype , Symbol . toStringTag ) ; <nl> - } <nl> + let TypedArray = Uint8Array . __proto__ ; <nl> + <nl> + assertGetterName ( ' get buffer ' , TypedArray . prototype , ' buffer ' ) ; <nl> + assertGetterName ( ' get byteOffset ' , TypedArray . prototype , ' byteOffset ' ) ; <nl> + assertGetterName ( ' get byteLength ' , TypedArray . prototype , ' byteLength ' ) ; <nl> + assertGetterName ( ' get length ' , TypedArray . prototype , ' length ' ) ; <nl> + assertGetterName ( ' get [ Symbol . toStringTag ] ' , TypedArray . prototype , Symbol . toStringTag ) ; <nl> <nl> <nl> assertGetterName ( ' get buffer ' , DataView . prototype , ' buffer ' ) ; <nl> mmm a / test / mjsunit / es6 / classes - subclass - builtins . js <nl> ppp b / test / mjsunit / es6 / classes - subclass - builtins . js <nl> function TestErrorSubclassing ( error ) { <nl> } ) ( ) ; <nl> <nl> <nl> - function TestArraySubclassing ( array ) { <nl> + ( function TestArraySubclassing ( ) { <nl> + class A extends Array { <nl> + constructor ( . . . args ) { <nl> + assertFalse ( new . target = = = undefined ) ; <nl> + super ( . . . args ) ; <nl> + this . a = 42 ; <nl> + this . d = 4 . 2 ; <nl> + this . o = { foo : 153 } ; <nl> + } <nl> + } <nl> + <nl> + var o = new Array ( 13 ) ; <nl> + assertTrue ( o instanceof Object ) ; <nl> + assertTrue ( o instanceof Array ) ; <nl> + assertEquals ( " object " , typeof o ) ; <nl> + checkPrototypeChain ( o , [ Array , Object ] ) ; <nl> + assertEquals ( 13 , o . length ) ; <nl> + <nl> + var o = new A ( 10 ) ; <nl> + assertTrue ( o instanceof Object ) ; <nl> + assertTrue ( o instanceof Array ) ; <nl> + assertTrue ( o instanceof A ) ; <nl> + assertEquals ( " object " , typeof o ) ; <nl> + checkPrototypeChain ( o , [ A , Array , Object ] ) ; <nl> + assertEquals ( 10 , o . length ) ; <nl> + assertEquals ( 42 , o . a ) ; <nl> + assertEquals ( 4 . 2 , o . d ) ; <nl> + assertEquals ( 153 , o . o . foo ) ; <nl> + <nl> + var o1 = new A ( 7 ) ; <nl> + assertTrue ( % HaveSameMap ( o , o1 ) ) ; <nl> + } ) ( ) ; <nl> + <nl> + <nl> + var TypedArray = Uint8Array . __proto__ ; <nl> + <nl> + function TestTypedArraySubclassing ( array ) { <nl> class A extends array { <nl> constructor ( . . . args ) { <nl> assertFalse ( new . target = = = undefined ) ; <nl> function TestArraySubclassing ( array ) { <nl> <nl> var o = new array ( 13 ) ; <nl> assertTrue ( o instanceof Object ) ; <nl> + assertTrue ( o instanceof TypedArray ) ; <nl> assertTrue ( o instanceof array ) ; <nl> assertEquals ( " object " , typeof o ) ; <nl> - checkPrototypeChain ( o , [ array , Object ] ) ; <nl> + checkPrototypeChain ( o , [ array , TypedArray , Object ] ) ; <nl> assertEquals ( 13 , o . length ) ; <nl> <nl> var o = new A ( 10 ) ; <nl> assertTrue ( o instanceof Object ) ; <nl> + assertTrue ( o instanceof TypedArray ) ; <nl> assertTrue ( o instanceof array ) ; <nl> assertTrue ( o instanceof A ) ; <nl> assertEquals ( " object " , typeof o ) ; <nl> - checkPrototypeChain ( o , [ A , array , Object ] ) ; <nl> + checkPrototypeChain ( o , [ A , array , TypedArray , Object ] ) ; <nl> assertEquals ( 10 , o . length ) ; <nl> assertEquals ( 42 , o . a ) ; <nl> assertEquals ( 4 . 2 , o . d ) ; <nl> function TestArraySubclassing ( array ) { <nl> <nl> <nl> ( function ( ) { <nl> - TestArraySubclassing ( Array ) ; <nl> - TestArraySubclassing ( Int8Array ) ; <nl> - TestArraySubclassing ( Uint8Array ) ; <nl> - TestArraySubclassing ( Uint8ClampedArray ) ; <nl> - TestArraySubclassing ( Int16Array ) ; <nl> - TestArraySubclassing ( Uint16Array ) ; <nl> - TestArraySubclassing ( Int32Array ) ; <nl> - TestArraySubclassing ( Uint32Array ) ; <nl> - TestArraySubclassing ( Float32Array ) ; <nl> - TestArraySubclassing ( Float64Array ) ; <nl> + TestTypedArraySubclassing ( Int8Array ) ; <nl> + TestTypedArraySubclassing ( Uint8Array ) ; <nl> + TestTypedArraySubclassing ( Uint8ClampedArray ) ; <nl> + TestTypedArraySubclassing ( Int16Array ) ; <nl> + TestTypedArraySubclassing ( Uint16Array ) ; <nl> + TestTypedArraySubclassing ( Int32Array ) ; <nl> + TestTypedArraySubclassing ( Uint32Array ) ; <nl> + TestTypedArraySubclassing ( Float32Array ) ; <nl> + TestTypedArraySubclassing ( Float64Array ) ; <nl> } ) ( ) ; <nl> <nl> <nl> mmm a / test / mjsunit / es6 / typed - array - iterator . js <nl> ppp b / test / mjsunit / es6 / typed - array - iterator . js <nl> var constructors = [ Uint8Array , Int8Array , <nl> Float32Array , Float64Array , <nl> Uint8ClampedArray ] ; <nl> <nl> - function TestTypedArrayPrototype ( constructor ) { <nl> - assertTrue ( constructor . prototype . hasOwnProperty ( ' entries ' ) ) ; <nl> - assertTrue ( constructor . prototype . hasOwnProperty ( ' values ' ) ) ; <nl> - assertTrue ( constructor . prototype . hasOwnProperty ( ' keys ' ) ) ; <nl> - assertTrue ( constructor . prototype . hasOwnProperty ( Symbol . iterator ) ) ; <nl> - <nl> - assertFalse ( constructor . prototype . propertyIsEnumerable ( ' entries ' ) ) ; <nl> - assertFalse ( constructor . prototype . propertyIsEnumerable ( ' values ' ) ) ; <nl> - assertFalse ( constructor . prototype . propertyIsEnumerable ( ' keys ' ) ) ; <nl> - assertFalse ( constructor . prototype . propertyIsEnumerable ( Symbol . iterator ) ) ; <nl> - <nl> - assertEquals ( Array . prototype . entries , constructor . prototype . entries ) ; <nl> - assertEquals ( Array . prototype [ Symbol . iterator ] , constructor . prototype . values ) ; <nl> - assertEquals ( Array . prototype . keys , constructor . prototype . keys ) ; <nl> - assertEquals ( Array . prototype [ Symbol . iterator ] , constructor . prototype [ Symbol . iterator ] ) ; <nl> - } <nl> - constructors . forEach ( TestTypedArrayPrototype ) ; <nl> + var TypedArrayPrototype = Uint8Array . prototype . __proto__ ; <nl> + <nl> + assertTrue ( TypedArrayPrototype . hasOwnProperty ( ' entries ' ) ) ; <nl> + assertTrue ( TypedArrayPrototype . hasOwnProperty ( ' values ' ) ) ; <nl> + assertTrue ( TypedArrayPrototype . hasOwnProperty ( ' keys ' ) ) ; <nl> + assertTrue ( TypedArrayPrototype . hasOwnProperty ( Symbol . iterator ) ) ; <nl> + <nl> + assertFalse ( TypedArrayPrototype . propertyIsEnumerable ( ' entries ' ) ) ; <nl> + assertFalse ( TypedArrayPrototype . propertyIsEnumerable ( ' values ' ) ) ; <nl> + assertFalse ( TypedArrayPrototype . propertyIsEnumerable ( ' keys ' ) ) ; <nl> + assertFalse ( TypedArrayPrototype . propertyIsEnumerable ( Symbol . iterator ) ) ; <nl> + <nl> + assertEquals ( Array . prototype . entries , TypedArrayPrototype . entries ) ; <nl> + assertEquals ( Array . prototype [ Symbol . iterator ] , TypedArrayPrototype . values ) ; <nl> + assertEquals ( Array . prototype . keys , TypedArrayPrototype . keys ) ; <nl> + assertEquals ( Array . prototype [ Symbol . iterator ] , TypedArrayPrototype [ Symbol . iterator ] ) ; <nl> <nl> <nl> function TestTypedArrayValues ( constructor ) { <nl> mmm a / test / mjsunit / es6 / typedarray - of . js <nl> ppp b / test / mjsunit / es6 / typedarray - of . js <nl> function TestTypedArrayOf ( constructor ) { <nl> assertEquals ( " pass " , status ) ; <nl> <nl> / / Check superficial features of % TypedArray % . of . <nl> - var desc = Object . getOwnPropertyDescriptor ( constructor , " of " ) ; <nl> + var desc = Object . getOwnPropertyDescriptor ( constructor . __proto__ , " of " ) ; <nl> <nl> assertEquals ( desc . configurable , false ) ; <nl> assertEquals ( desc . enumerable , false ) ; <nl> mmm a / test / mjsunit / es6 / typedarray - proto . js <nl> ppp b / test / mjsunit / es6 / typedarray - proto . js <nl> <nl> <nl> / / Test that the methods for different TypedArray types have the same <nl> / / identity . <nl> - / / TODO ( dehrenberg ) : Test that the TypedArray proto hierarchy is set <nl> - / / up properly . <nl> - / / TODO ( dehrenberg ) : subarray is currently left out because that still <nl> - / / uses per - type methods . When that ' s fixed , stop leaving it out . <nl> <nl> - var typedArrayConstructors = [ <nl> + ' use strict ' ; <nl> + <nl> + let typedArrayConstructors = [ <nl> Uint8Array , <nl> Int8Array , <nl> Uint16Array , <nl> var typedArrayConstructors = [ <nl> Float32Array , <nl> Float64Array ] ; <nl> <nl> + let TypedArray = Uint8Array . __proto__ ; <nl> + let TypedArrayPrototype = TypedArray . prototype ; <nl> + <nl> + assertEquals ( TypedArray . __proto__ , Function . prototype ) ; <nl> + assertEquals ( TypedArrayPrototype . __proto__ , Object . prototype ) ; <nl> + <nl> + / / There are extra own class properties due to it simply being a function <nl> + let classProperties = new Set ( [ <nl> + " length " , " name " , " arguments " , " caller " , " prototype " , " BYTES_PER_ELEMENT " <nl> + ] ) ; <nl> + let instanceProperties = new Set ( [ " BYTES_PER_ELEMENT " , " constructor " , " prototype " ] ) ; <nl> + <nl> function functionProperties ( object ) { <nl> return Object . getOwnPropertyNames ( object ) . filter ( function ( name ) { <nl> return typeof Object . getOwnPropertyDescriptor ( object , name ) . value <nl> function functionProperties ( object ) { <nl> } ) ; <nl> } <nl> <nl> - var typedArrayMethods = functionProperties ( Uint8Array . prototype ) ; <nl> - var typedArrayClassMethods = functionProperties ( Uint8Array ) ; <nl> + let typedArrayMethods = functionProperties ( Uint8Array . prototype ) ; <nl> + let typedArrayClassMethods = functionProperties ( Uint8Array ) ; <nl> <nl> - for ( var constructor of typedArrayConstructors ) { <nl> - for ( var method of typedArrayMethods ) { <nl> - assertEquals ( constructor . prototype [ method ] , <nl> - Uint8Array . prototype [ method ] , method ) ; <nl> + for ( let constructor of typedArrayConstructors ) { <nl> + for ( let property of Object . getOwnPropertyNames ( constructor . prototype ) ) { <nl> + assertTrue ( instanceProperties . has ( property ) , property ) ; <nl> } <nl> - for ( var classMethod of typedArrayClassMethods ) { <nl> - assertEquals ( constructor [ method ] , Uint8Array [ method ] , classMethod ) ; <nl> + for ( let property of Object . getOwnPropertyNames ( constructor ) ) { <nl> + assertTrue ( classProperties . has ( property ) , property ) ; <nl> } <nl> } <nl> + <nl> + / / Abstract % TypedArray % class can ' t be constructed directly <nl> + <nl> + assertThrows ( ( ) = > new TypedArray ( ) , TypeError ) ; <nl> + <nl> + / / The " prototype " property is nonconfigurable , nonenumerable , nonwritable , <nl> + / / both for % TypedArray % and for all subclasses <nl> + <nl> + let desc = Object . getOwnPropertyDescriptor ( TypedArray , " prototype " ) ; <nl> + assertFalse ( desc . writable ) ; <nl> + assertFalse ( desc . configurable ) ; <nl> + assertFalse ( desc . enumerable ) ; <nl> + <nl> + for ( let constructor of typedArrayConstructors ) { <nl> + let desc = Object . getOwnPropertyDescriptor ( constructor , " prototype " ) ; <nl> + assertFalse ( desc . writable ) ; <nl> + assertFalse ( desc . configurable ) ; <nl> + assertFalse ( desc . enumerable ) ; <nl> + } <nl> mmm a / test / mjsunit / es6 / typedarray . js <nl> ppp b / test / mjsunit / es6 / typedarray . js <nl> function TestTypedArray ( constr , elementSize , typicalElement ) { <nl> assertEquals ( " [ object " + constr . name + " ] " , <nl> Object . prototype . toString . call ( a ) ) ; <nl> var desc = Object . getOwnPropertyDescriptor ( <nl> - constr . prototype , Symbol . toStringTag ) ; <nl> + constr . prototype . __proto__ , Symbol . toStringTag ) ; <nl> assertTrue ( desc . configurable ) ; <nl> assertFalse ( desc . enumerable ) ; <nl> assertFalse ( ! ! desc . writable ) ; <nl> var typedArrayConstructors = [ <nl> function TestPropertyTypeChecks ( constructor ) { <nl> function CheckProperty ( name ) { <nl> assertThrows ( function ( ) { ' use strict ' ; new constructor ( 10 ) [ name ] = 0 ; } ) <nl> - var d = Object . getOwnPropertyDescriptor ( constructor . prototype , name ) ; <nl> + var d = Object . getOwnPropertyDescriptor ( constructor . prototype . __proto__ , name ) ; <nl> var o = { } ; <nl> assertThrows ( function ( ) { d . get . call ( o ) ; } , TypeError ) ; <nl> for ( var i = 0 ; i < typedArrayConstructors . length ; i + + ) { <nl> var ctor = typedArrayConstructors [ i ] ; <nl> var a = new ctor ( 10 ) ; <nl> - if ( ctor = = = constructor ) { <nl> - d . get . call ( a ) ; / / shouldn ' t throw <nl> - } else { <nl> - assertThrows ( function ( ) { d . get . call ( a ) ; } , TypeError ) ; <nl> - } <nl> + d . get . call ( a ) ; / / shouldn ' t throw <nl> } <nl> } <nl> <nl> mmm a / test / mjsunit / get - prototype - of . js <nl> ppp b / test / mjsunit / get - prototype - of . js <nl> var functions = [ <nl> / / DataView , <nl> Date , <nl> Error , <nl> - Float32Array , <nl> - Float64Array , <nl> + / / Float32Array , prototype is % TypedArray % <nl> + / / Float64Array , <nl> Function , <nl> - Int16Array , <nl> - Int32Array , <nl> - Int8Array , <nl> + / / Int16Array , <nl> + / / Int32Array , <nl> + / / Int8Array , <nl> Map , <nl> Number , <nl> Object , <nl> var functions = [ <nl> Set , <nl> String , <nl> / / Symbol , not constructible <nl> - Uint16Array , <nl> - Uint32Array , <nl> - Uint8Array , <nl> - Uint8ClampedArray , <nl> + / / Uint16Array , <nl> + / / Uint32Array , <nl> + / / Uint8Array , <nl> + / / Uint8ClampedArray , <nl> WeakMap , <nl> WeakSet , <nl> ] ; <nl> mmm a / test / mjsunit / harmony / reflect - get - prototype - of . js <nl> ppp b / test / mjsunit / harmony / reflect - get - prototype - of . js <nl> var functions = [ <nl> / / DataView , <nl> Date , <nl> Error , <nl> - Float32Array , <nl> - Float64Array , <nl> + / / Float32Array , prototype is % TypedArray % <nl> + / / Float64Array , <nl> Function , <nl> - Int16Array , <nl> - Int32Array , <nl> - Int8Array , <nl> + / / Int16Array , <nl> + / / Int32Array , <nl> + / / Int8Array , <nl> Map , <nl> Number , <nl> Object , <nl> var functions = [ <nl> Set , <nl> String , <nl> / / Symbol , not constructible <nl> - Uint16Array , <nl> - Uint32Array , <nl> - Uint8Array , <nl> - Uint8ClampedArray , <nl> + / / Uint16Array , <nl> + / / Uint32Array , <nl> + / / Uint8Array , <nl> + / / Uint8ClampedArray , <nl> WeakMap , <nl> WeakSet , <nl> ] ; <nl> mmm a / test / mjsunit / harmony / sharedarraybuffer . js <nl> ppp b / test / mjsunit / harmony / sharedarraybuffer . js <nl> function TestTypedArray ( constr , elementSize , typicalElement ) { <nl> assertEquals ( " [ object " + constr . name + " ] " , <nl> Object . prototype . toString . call ( a ) ) ; <nl> var desc = Object . getOwnPropertyDescriptor ( <nl> - constr . prototype , Symbol . toStringTag ) ; <nl> + constr . prototype . __proto__ , Symbol . toStringTag ) ; <nl> assertTrue ( desc . configurable ) ; <nl> assertFalse ( desc . enumerable ) ; <nl> assertFalse ( ! ! desc . writable ) ; <nl> var typedArrayConstructors = [ <nl> <nl> function TestPropertyTypeChecks ( constructor ) { <nl> function CheckProperty ( name ) { <nl> - var d = Object . getOwnPropertyDescriptor ( constructor . prototype , name ) ; <nl> + var d = Object . getOwnPropertyDescriptor ( constructor . prototype . __proto__ , <nl> + name ) ; <nl> var o = { } ; <nl> assertThrows ( function ( ) { d . get . call ( o ) ; } , TypeError ) ; <nl> for ( var i = 0 ; i < typedArrayConstructors . length ; i + + ) { <nl> var ctor = typedArrayConstructors [ i ] ; <nl> var a = MakeSharedTypedArray ( ctor , 10 ) ; <nl> - if ( ctor = = = constructor ) { <nl> - d . get . call ( a ) ; / / shouldn ' t throw <nl> - } else { <nl> - assertThrows ( function ( ) { d . get . call ( a ) ; } , TypeError ) ; <nl> - } <nl> + d . get . call ( a ) ; / / shouldn ' t throw <nl> } <nl> } <nl> <nl> mmm a / test / mjsunit / regress / regress - typedarray - length . js <nl> ppp b / test / mjsunit / regress / regress - typedarray - length . js <nl> assertEquals ( undefined , get ( a ) ) ; <nl> } ) ( ) ; <nl> <nl> / / Ensure we cannot delete length , byteOffset , byteLength . <nl> - assertTrue ( Int32Array . prototype . hasOwnProperty ( " length " ) ) ; <nl> - assertTrue ( Int32Array . prototype . hasOwnProperty ( " byteOffset " ) ) ; <nl> - assertTrue ( Int32Array . prototype . hasOwnProperty ( " byteLength " ) ) ; <nl> - assertFalse ( delete Int32Array . prototype . length ) ; <nl> - assertFalse ( delete Int32Array . prototype . byteOffset ) ; <nl> - assertFalse ( delete Int32Array . prototype . byteLength ) ; <nl> + assertTrue ( Int32Array . prototype . __proto__ . hasOwnProperty ( " length " ) ) ; <nl> + assertTrue ( Int32Array . prototype . __proto__ . hasOwnProperty ( " byteOffset " ) ) ; <nl> + assertTrue ( Int32Array . prototype . __proto__ . hasOwnProperty ( " byteLength " ) ) ; <nl> + assertFalse ( delete Int32Array . prototype . __proto__ . length ) ; <nl> + assertFalse ( delete Int32Array . prototype . __proto__ . byteOffset ) ; <nl> + assertFalse ( delete Int32Array . prototype . __proto__ . byteLength ) ; <nl> <nl> a = new Int32Array ( 100 ) ; <nl> <nl>
|
Use ES2015 - style TypedArray prototype chain
|
v8/v8
|
07c91dccbe55c7be3ec75857dee5ad59873330b7
|
2015-12-28T17:28:54Z
|
mmm a / build / fbcode_builder / specs / fbthrift . py <nl> ppp b / build / fbcode_builder / specs / fbthrift . py <nl> <nl> import specs . wangle as wangle <nl> import specs . zstd as zstd <nl> <nl> - from shell_quoting import ShellQuoted <nl> - <nl> <nl> def fbcode_builder_spec ( builder ) : <nl> - # This API should change rarely , so build the latest tag instead of master . <nl> - builder . add_option ( <nl> - ' no1msd / mstch : git_hash ' , <nl> - ShellQuoted ( ' $ ( git describe - - abbrev = 0 - - tags ) ' ) <nl> - ) <nl> return { <nl> ' depends_on ' : [ folly , fizz , fmt , sodium , rsocket , wangle , zstd ] , <nl> ' steps ' : [ <nl> - # This isn ' t a separete spec , since only fbthrift uses mstch . <nl> - builder . github_project_workdir ( ' no1msd / mstch ' , ' build ' ) , <nl> - builder . cmake_install ( ' no1msd / mstch ' ) , <nl> builder . fb_github_cmake_install ( ' fbthrift / thrift ' ) , <nl> ] , <nl> } <nl>
|
remove mstch from fbthrift ' s fbcode_builder spec
|
facebook/folly
|
fd4e016588aa57ab8bb0c3123c605c0c586aaee8
|
2019-05-09T19:42:41Z
|
mmm a / tensorflow / models / rnn / ptb / ptb_word_lm . py <nl> ppp b / tensorflow / models / rnn / ptb / ptb_word_lm . py <nl> def run_epoch ( session , model , data , eval_op , verbose = False ) : <nl> start_time = time . time ( ) <nl> costs = 0 . 0 <nl> iters = 0 <nl> - state = [ ] <nl> - for c , m in model . initial_state : # initial_state : ( ( c1 , m1 ) , ( c2 , m2 ) ) <nl> - state . append ( ( c . eval ( ) , m . eval ( ) ) ) <nl> + state = session . run ( model . initial_state ) <nl> for step , ( x , y ) in enumerate ( reader . ptb_iterator ( data , model . batch_size , <nl> model . num_steps ) ) : <nl> - fetches = [ ] <nl> - fetches . append ( model . cost ) <nl> - fetches . append ( eval_op ) <nl> - for c , m in model . final_state : # final_state : ( ( c1 , m1 ) , ( c2 , m2 ) ) <nl> - fetches . append ( c ) <nl> - fetches . append ( m ) <nl> + fetches = [ model . cost , model . final_state , eval_op ] <nl> feed_dict = { } <nl> feed_dict [ model . input_data ] = x <nl> feed_dict [ model . targets ] = y <nl> - for i , ( c , m ) in enumerate ( model . initial_state ) : <nl> - feed_dict [ c ] , feed_dict [ m ] = state [ i ] <nl> - res = session . run ( fetches , feed_dict ) <nl> - cost = res [ 0 ] <nl> - state_flat = res [ 2 : ] # [ c1 , m1 , c2 , m2 ] <nl> - state = [ state_flat [ i : i + 2 ] for i in range ( 0 , len ( state_flat ) , 2 ) ] <nl> - costs + = cost <nl> + for i , ( c , h ) in enumerate ( model . initial_state ) : <nl> + feed_dict [ c ] = state [ i ] . c <nl> + feed_dict [ h ] = state [ i ] . h <nl> + cost , state , _ = session . run ( fetches , feed_dict ) <nl> iters + = model . num_steps <nl> <nl> if verbose and step % ( epoch_size / / 10 ) = = 10 : <nl>
|
Modify RNN PTB example codes to be more clear
|
tensorflow/tensorflow
|
44eb83dfc743e10af90a3fe4044d70bf6b55ec2d
|
2016-08-10T04:16:56Z
|
mmm a / modules / prediction / container / obstacles / BUILD <nl> ppp b / modules / prediction / container / obstacles / BUILD <nl> cc_library ( <nl> " / / modules / common / util : lru_cache " , <nl> " / / modules / prediction / common : feature_output " , <nl> " / / modules / prediction / common : prediction_gflags " , <nl> + " / / modules / prediction / common : environment_features " , <nl> " / / modules / prediction / proto : scenario_proto " , <nl> " / / modules / prediction / container " , <nl> " / / modules / prediction / container / obstacles : obstacle " , <nl> mmm a / modules / prediction / container / obstacles / obstacles_container . cc <nl> ppp b / modules / prediction / container / obstacles / obstacles_container . cc <nl> void ObstaclesContainer : : BuildLaneGraph ( ) { <nl> } <nl> } <nl> <nl> - void ObstaclesContainer : : PrioritizeObstacles ( const Scenario & scenario ) { <nl> + void ObstaclesContainer : : PrioritizeObstacles ( const Scenario & scenario , <nl> + const EnvironmentFeatures & environment_features ) { <nl> / / TODO ( all ) implement <nl> / / According to scenario and filtered lanes and junctions , etc <nl> / / set priorities for obstacles <nl> mmm a / modules / prediction / container / obstacles / obstacles_container . h <nl> ppp b / modules / prediction / container / obstacles / obstacles_container . h <nl> <nl> <nl> # include " modules / common / util / lru_cache . h " <nl> # include " modules / prediction / proto / scenario . pb . h " <nl> + # include " modules / prediction / common / environment_features . h " <nl> # include " modules / prediction / container / container . h " <nl> # include " modules / prediction / container / obstacles / obstacle . h " <nl> # include " modules / prediction / container / pose / pose_container . h " <nl> class ObstaclesContainer : public Container { <nl> / * * <nl> * @ brief Set obstacles ' priority to predict <nl> * / <nl> - void PrioritizeObstacles ( const Scenario & scenario ) ; <nl> + void PrioritizeObstacles ( const Scenario & scenario , <nl> + const EnvironmentFeatures & environment_features ) ; <nl> <nl> / * * <nl> * @ brief Get obstacle pointer <nl> mmm a / modules / prediction / prediction_component . cc <nl> ppp b / modules / prediction / prediction_component . cc <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> - * Copyright 2017 The Apollo Authors . All Rights Reserved . <nl> + * Copyright 2018 The Apollo 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> mmm a / modules / prediction / prediction_component . h <nl> ppp b / modules / prediction / prediction_component . h <nl> <nl> / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> - * Copyright 2017 The Apollo Authors . All Rights Reserved . <nl> + * Copyright 2018 The Apollo 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> mmm a / modules / prediction / scenario / scenario_manager . cc <nl> ppp b / modules / prediction / scenario / scenario_manager . cc <nl> void ScenarioManager : : PrioritizeObstacles ( ) { <nl> ObstaclesContainer * obstacles_container = dynamic_cast < ObstaclesContainer * > ( <nl> ContainerManager : : Instance ( ) - > GetContainer ( <nl> AdapterConfig : : PERCEPTION_OBSTACLES ) ) ; <nl> - obstacles_container - > PrioritizeObstacles ( scenario_analyzer_ . scenario ( ) ) ; <nl> + obstacles_container - > PrioritizeObstacles ( <nl> + scenario_analyzer_ . scenario ( ) , <nl> + feature_extractor_ . GetEnvironmentFeatures ( ) ) ; <nl> } <nl> <nl> } / / namespace prediction <nl>
|
Prediction : parse environment features into prioritize obstacles
|
ApolloAuto/apollo
|
cd510f3835a6602338aa29accdf65e74163fa1df
|
2018-09-20T18:00:21Z
|
new file mode 100644 <nl> index 00000000000 . . 3353774af69 <nl> mmm / dev / null <nl> ppp b / ports / urdfdom / 0003_import_prefix . patch <nl> <nl> + diff - - git a / cmake / urdfdom - config . cmake . in b / cmake / urdfdom - config . cmake . in <nl> + index fb81b47 . . 3ccad51 100644 <nl> + mmm a / cmake / urdfdom - config . cmake . in <nl> ppp + b / cmake / urdfdom - config . cmake . in <nl> + if ( @ PKG_NAME @ _CONFIG_INCLUDED ) <nl> + endif ( ) <nl> + set ( @ PKG_NAME @ _CONFIG_INCLUDED TRUE ) <nl> + <nl> + + # Vcpkg fix - ups <nl> + + get_filename_component ( _IMPORT_PREFIX " $ { CMAKE_CURRENT_LIST_FILE } " PATH ) <nl> + + get_filename_component ( _IMPORT_PREFIX " $ { _IMPORT_PREFIX } " PATH ) <nl> + + <nl> + set ( @ PKG_NAME @ _INCLUDE_DIRS " @ CMAKE_INSTALL_PREFIX @ / include " " @ TinyXML_INCLUDE_DIRS @ " ) <nl> + <nl> + foreach ( lib @ PKG_LIBRARIES @ ) <nl> mmm a / ports / urdfdom / CONTROL <nl> ppp b / ports / urdfdom / CONTROL <nl> <nl> Source : urdfdom <nl> - Version : 1 . 0 . 4 <nl> + Version : 1 . 0 . 4 - 1 <nl> Homepage : https : / / github . com / ros / urdfdom <nl> Description : Provides core data structures and a simple XML parsers for populating the class data structures from an URDF file . <nl> Build - Depends : console - bridge , tinyxml , urdfdom - headers <nl> mmm a / ports / urdfdom / portfile . cmake <nl> ppp b / ports / urdfdom / portfile . cmake <nl> vcpkg_from_github ( <nl> PATCHES <nl> 0001_use_math_defines . patch <nl> 0002_fix_exports . patch <nl> + 0003_import_prefix . patch <nl> ) <nl> <nl> vcpkg_configure_cmake ( <nl>
|
[ urdfdom ] Fixing up _IMPORT_PREFIX ( )
|
microsoft/vcpkg
|
4db27d95a80e7822213f0abec5c79778acd941c4
|
2020-09-11T19:45:31Z
|
mmm a / ports / corrade / CONTROL <nl> ppp b / ports / corrade / CONTROL <nl> <nl> Source : corrade <nl> - Version : 2019 . 01 - 1 <nl> + Version : 2019 . 10 <nl> Description : C + + 11 / C + + 14 multiplatform utility library <nl> Homepage : https : / / magnum . graphics / corrade / <nl> Default - Features : interconnect , pluginmanager , testsuite , utility <nl> deleted file mode 100644 <nl> index e6e2ffccc88 . . 00000000000 <nl> mmm a / ports / corrade / fixC2666 . patch <nl> ppp / dev / null <nl> <nl> - diff - - git a / modules / UseCorrade . cmake b / modules / UseCorrade . cmake <nl> - index 744d5a1 . . 129e75f 100644 <nl> mmm - a / modules / UseCorrade . cmake <nl> - ppp b / modules / UseCorrade . cmake <nl> - elseif ( CMAKE_CXX_COMPILER_ID STREQUAL " MSVC " OR CMAKE_CXX_SIMULATE_ID STREQUAL " <nl> - # " dllexport and extern are incompatible on an explicit instantiation " . <nl> - # Why the error is emitted only on classes ? Functions are okay with <nl> - # dllexport extern ? ! <nl> - - " / wd4910 " ) <nl> - + " / wd4910 " <nl> - + <nl> - + # Add the / permissive - option <nl> - + " / permissive - " ) <nl> - set ( CORRADE_PEDANTIC_COMPILER_DEFINITIONS <nl> - # Disabling warning for not using " secure - but - not - standard " STL algos <nl> - " _CRT_SECURE_NO_WARNINGS " " _SCL_SECURE_NO_WARNINGS " <nl> mmm a / ports / corrade / portfile . cmake <nl> ppp b / ports / corrade / portfile . cmake <nl> include ( vcpkg_common_functions ) <nl> vcpkg_from_github ( <nl> OUT_SOURCE_PATH SOURCE_PATH <nl> REPO mosra / corrade <nl> - REF v2019 . 01 <nl> - SHA512 63468ee0a9362d92d61e2bc77fb8c3e455761894998393910f6bce4111b0ec74db8fe2a8658cec1292c5ceb26e57e005324b34f1ec343d4216abf3a955eaa97e <nl> + REF v2019 . 10 <nl> + SHA512 5d161f78844b06e1a9979c7e244968a691012e7212e05df3ee3572f5df9aa69e86309f426a89f356f483f6de3871366a8e11b1701a578f865ea738cc8eee515b <nl> HEAD_REF master <nl> - PATCHES fixC2666 . patch <nl> ) <nl> <nl> string ( COMPARE EQUAL " $ { VCPKG_LIBRARY_LINKAGE } " " static " BUILD_STATIC ) <nl> mmm a / ports / magnum - extras / CONTROL <nl> ppp b / ports / magnum - extras / CONTROL <nl> <nl> - Source : magnum - extras <nl> - Version : 2019 . 01 - 2 <nl> - Build - Depends : magnum [ core ] <nl> - Description : Extras for magnum , C + + 11 / C + + 14 graphics middleware for games and data visualization <nl> - Homepage : https : / / magnum . graphics / <nl> - <nl> - Feature : ui <nl> - Description : Ui library <nl> - Build - Depends : corrade [ interconnect ] , magnum [ text ] <nl> + Source : magnum - extras <nl> + Version : 2019 . 10 <nl> + Build - Depends : magnum [ core ] <nl> + Description : Extras for magnum , C + + 11 / C + + 14 graphics middleware for games and data visualization <nl> + Homepage : https : / / magnum . graphics / <nl> + <nl> + Feature : ui <nl> + Description : Ui library <nl> + Build - Depends : corrade [ interconnect ] , magnum [ text ] <nl> mmm a / ports / magnum - extras / portfile . cmake <nl> ppp b / ports / magnum - extras / portfile . cmake <nl> include ( vcpkg_common_functions ) <nl> vcpkg_from_github ( <nl> OUT_SOURCE_PATH SOURCE_PATH <nl> REPO mosra / magnum - extras <nl> - REF v2019 . 01 <nl> - SHA512 b7116e53a6132c937ad1dc10d251d0b98884375a14e947c5ddfa046cd7a8e7e60eddf2802e1c945168fcb42d78fb13639fe65ea259c6a44f064e6065ee5ae3af <nl> + REF v2019 . 10 <nl> + SHA512 75335a75f1662e6223d2be7bc2f3cdb12af0e13ed11f3551dbd68a9488ab2e37ba9cd7ee786cc13e545689ed213558b305bfaffbaf8fa7d3be61eb21eeeeba4a <nl> HEAD_REF master <nl> ) <nl> <nl> mmm a / ports / magnum - integration / CONTROL <nl> ppp b / ports / magnum - integration / CONTROL <nl> <nl> Source : magnum - integration <nl> - Version : 2019 . 01 - 2 <nl> + Version : 2019 . 10 <nl> Build - Depends : magnum [ core ] <nl> Description : Integrations for magnum , C + + 11 / C + + 14 graphics middleware for games and data visualization <nl> Homepage : https : / / magnum . graphics / <nl> Feature : bullet <nl> Description : BulletIntegration library <nl> Build - Depends : bullet3 <nl> <nl> + Feature : eigen <nl> + Description : EigenIntegration library <nl> + Build - Depends : eigen3 <nl> + <nl> Feature : glm <nl> Description : GlmIntegration library <nl> Build - Depends : glm <nl> mmm a / ports / magnum - integration / portfile . cmake <nl> ppp b / ports / magnum - integration / portfile . cmake <nl> include ( vcpkg_common_functions ) <nl> vcpkg_from_github ( <nl> OUT_SOURCE_PATH SOURCE_PATH <nl> REPO mosra / magnum - integration <nl> - REF v2019 . 01 <nl> - SHA512 4f892c30c3824aea5d51b9178ca5001b97eb89659b45ac6f5f2182ea2a3a8ff54d80e6b143679ea7f5a07c408afb480d11895c6e7afdc9003951f68e14000f9f <nl> + REF v2019 . 10 <nl> + SHA512 be8b21da07b9720ad19263d6ee0a234ff97ee4a1d5770e3ab33047bc54711689532945b099431c24f6ae863bb55a0883b3ba34a48d7d17768082b26651a9621e <nl> HEAD_REF master <nl> ) <nl> <nl> mmm a / ports / magnum - plugins / CONTROL <nl> ppp b / ports / magnum - plugins / CONTROL <nl> <nl> Source : magnum - plugins <nl> - Version : 2019 . 01 - 2 <nl> + Version : 2019 . 10 <nl> Build - Depends : magnum [ core ] <nl> Description : Plugins for magnum , C + + 11 / C + + 14 graphics middleware for games and data visualization <nl> Homepage : https : / / magnum . graphics / <nl> Build - Depends : assimp , magnum [ anyimageimporter ] , magnum [ trade ] <nl> Feature : openddl <nl> Description : OpenDdl library <nl> <nl> + Feature : basisimageconverter <nl> + Description : BasisImageConverter plugin <nl> + Build - Depends : magnum [ trade ] , basisu <nl> + <nl> + Feature : basisimporter <nl> + Description : BasisImporter plugin <nl> + Build - Depends : magnum [ trade ] , basisu <nl> + <nl> Feature : ddsimporter <nl> Description : DdsImporter plugin <nl> Build - Depends : magnum [ trade ] <nl> Feature : drflacaudioimporter <nl> Description : DrFlacAudioImporter plugin <nl> Build - Depends : magnum [ audio ] <nl> <nl> + Feature : drmp3audioimporter <nl> + Description : DrMp3AudioImporter plugin <nl> + Build - Depends : magnum [ audio ] <nl> + <nl> Feature : drwavaudioimporter <nl> Description : DrWavAudioImporter plugin <nl> Build - Depends : magnum [ audio ] <nl> mmm a / ports / magnum - plugins / portfile . cmake <nl> ppp b / ports / magnum - plugins / portfile . cmake <nl> include ( vcpkg_common_functions ) <nl> vcpkg_from_github ( <nl> OUT_SOURCE_PATH SOURCE_PATH <nl> REPO mosra / magnum - plugins <nl> - REF v2019 . 01 <nl> - SHA512 482131372671ce0b86b6643f8c584f000db4324fe0f7e32bf9a31febded7b97ab7e947028fe21ce649554d2cff2bc11dfd94fad0006c465911c9f44b28c2d2a5 <nl> + REF v2019 . 10 <nl> + SHA512 702c43b0d323dc5b903ffee3dd9aaecf2de3b6bb00e7b243880e433df12efe337e512aac75a6f38adce02eb94f3065770ff6a03b7241198f27b5c46de63e5750 <nl> HEAD_REF master <nl> PATCHES <nl> 001 - tools - path . patch <nl> deleted file mode 100644 <nl> index 8dd37d0105e . . 00000000000 <nl> mmm a / ports / magnum / 003 - glfw - find - module . patch <nl> ppp / dev / null <nl> <nl> mmmmmm a / modules / FindGLFW . cmake <nl> - ppp b / modules / FindGLFW . cmake <nl> - if ( TARGET glfw ) <nl> - endif ( ) <nl> - <nl> - # In case no config file was found , try manually finding the library . <nl> - - find_library ( GLFW_LIBRARY NAMES glfw glfw3 ) <nl> - + find_library ( GLFW_LIBRARY NAMES glfw glfw3 glfw3dll ) <nl> - <nl> - # Include dir <nl> - find_path ( GLFW_INCLUDE_DIR <nl> mmm a / ports / magnum / CONTROL <nl> ppp b / ports / magnum / CONTROL <nl> <nl> Source : magnum <nl> - Version : 2019 . 01 - 2 <nl> + Version : 2019 . 10 <nl> Build - Depends : corrade [ utility ] <nl> Description : C + + 11 / C + + 14 graphics middleware for games and data visualization <nl> Homepage : https : / / magnum . graphics / <nl> mmm a / ports / magnum / portfile . cmake <nl> ppp b / ports / magnum / portfile . cmake <nl> include ( vcpkg_common_functions ) <nl> vcpkg_from_github ( <nl> OUT_SOURCE_PATH SOURCE_PATH <nl> REPO mosra / magnum <nl> - REF v2019 . 01 <nl> - SHA512 1edce0a38af90bd456a827b073d30d470a13b47797d62ba22001643be7519722c6886498a63be5e2ee65b8649a7eb2c217bbe2cd36ab4f4523d91aaee573ffd5 <nl> + REF v2019 . 10 <nl> + SHA512 b1c991199fa9b09b780ea822de4b2251c70fcc95e7f28bb14a6184861d92fcd4c6e6fe43ad21acfbfd191cd46e79bf58b867240ad6f706b07cd1fbe145b8eaff <nl> HEAD_REF master <nl> PATCHES <nl> 001 - sdl - includes . patch <nl> 002 - tools - path . patch <nl> - 003 - glfw - find - module . patch <nl> ) <nl> <nl> if ( VCPKG_LIBRARY_LINKAGE STREQUAL static ) <nl>
|
Update magnum ports to new version ( )
|
microsoft/vcpkg
|
3b868ac7695942fa252001720a494457c9b88d02
|
2019-10-25T20:05:28Z
|
mmm a / NEWS <nl> ppp b / NEWS <nl> <nl> - aria2 1 . 21 . 0 <nl> + aria2 1 . 22 . 0 <nl> = = = = = = = = = = = = <nl> <nl> Release Note <nl> mmmmmmmmmmmm <nl> <nl> - This release fixes several bugs , see the Changes for details . We <nl> - added " following " key to the response of aria2 . tellStatus RPC method <nl> - as reverse link for followedBy . <nl> + This release adds new feature that manages the number of concurrent <nl> + downloads dynamically . - - stream - piece - selector option gets new value <nl> + " random " which randomizes the piece selection for HTTP / FTP downloads . <nl> + This effectively randomizes the order of files on multi - file Web <nl> + Seeding . Now all contributor ' s names are in AUTHORS file . <nl> + Previously , aria2 shows error when it sees floating point number in a <nl> + torrent file because torrent file specification does not allow <nl> + floating point number . In this release , they are just ignored , and <nl> + aria2 continues to parse the rest of the torrent file as if there is <nl> + nothing wrong . <nl> <nl> Changes <nl> mmmmmm - <nl> <nl> - * SessionSerializer : Fix bug that pause = true is added to wrong item <nl> + * Add description about possible fragmentation with <nl> + - - file - allocation = trunc <nl> <nl> - This change also defers writing metadata download to the location <nl> - where first its follower download is written . <nl> + * Make single - entry metalink download with multi - file torrent work <nl> <nl> - * Add " following " to aria2 . tellStatus response key as reverse link for <nl> - followedBy <nl> + * Add all contributor ' s names in AUTHORS <nl> <nl> - * mingw : Add warning for falloc <nl> + * Ignore floating number in torrent file <nl> <nl> - * Update ciphers in AppleTLS <nl> + * Added support for a dynamic management of the number of concurrent <nl> + downloads as a function of the overall bandwidth observed <nl> <nl> - Also enable fast start while at it <nl> + This change adds - - optimize - concurrent - downloads option . <nl> <nl> - * OSX : Enable libssh2 and sftp <nl> + Patch from oliviercommelarbre <nl> <nl> - Closes GH - 468 <nl> - <nl> - * Update OSX dependencies <nl> - <nl> - Closes GH - 466 <nl> - <nl> - * Fix compile error without TLS support <nl> - <nl> - * Add support for using gnutls system wide crypto policy <nl> - <nl> - Patch from Athmane Madjoudj <nl> + * Add - - stream - piece - selector = random <nl>
|
Update NEWS
|
aria2/aria2
|
45361920eed695d6732fbaf93546d0fff792e568
|
2016-04-15T14:09:54Z
|
mmm a / src / builtins / builtins - collections - gen . cc <nl> ppp b / src / builtins / builtins - collections - gen . cc <nl> TNode < JSArray > CollectionsBuiltinsAssembler : : MapIteratorToList ( <nl> CSA_ASSERT ( this , IntPtrEqual ( index , IntPtrConstant ( 0 ) ) ) ; <nl> <nl> TNode < IntPtrT > size = <nl> - LoadAndUntagObjectField ( table , OrderedHashMap : : kNumberOfElementsOffset ) ; <nl> + LoadAndUntagObjectField ( table , OrderedHashMap : : NumberOfElementsOffset ( ) ) ; <nl> <nl> const ElementsKind kind = PACKED_ELEMENTS ; <nl> TNode < Map > array_map = <nl> TNode < JSArray > CollectionsBuiltinsAssembler : : MapIteratorToList ( <nl> JS_MAP_VALUE_ITERATOR_TYPE ) ) ; <nl> TNode < Object > entry_value = <nl> LoadFixedArrayElement ( table , entry_start_position , <nl> - ( OrderedHashMap : : kHashTableStartIndex + <nl> + ( OrderedHashMap : : HashTableStartIndex ( ) + <nl> OrderedHashMap : : kValueOffset ) * <nl> kPointerSize ) ; <nl> <nl> TNode < JSArray > CollectionsBuiltinsAssembler : : SetOrSetIteratorToList ( <nl> BIND ( & copy ) ; <nl> TNode < OrderedHashSet > table = var_table . value ( ) ; <nl> TNode < IntPtrT > size = <nl> - LoadAndUntagObjectField ( table , OrderedHashMap : : kNumberOfElementsOffset ) ; <nl> + LoadAndUntagObjectField ( table , OrderedHashMap : : NumberOfElementsOffset ( ) ) ; <nl> <nl> const ElementsKind kind = PACKED_ELEMENTS ; <nl> TNode < Map > array_map = <nl> TF_BUILTIN ( OrderedHashTableHealIndex , CollectionsBuiltinsAssembler ) { <nl> GotoIfNot ( SmiLessThan ( SmiConstant ( 0 ) , index ) , & return_zero ) ; <nl> <nl> / / Check if the { table } was cleared . <nl> - STATIC_ASSERT ( OrderedHashMap : : kNumberOfDeletedElementsOffset = = <nl> - OrderedHashSet : : kNumberOfDeletedElementsOffset ) ; <nl> + STATIC_ASSERT ( OrderedHashMap : : NumberOfDeletedElementsOffset ( ) = = <nl> + OrderedHashSet : : NumberOfDeletedElementsOffset ( ) ) ; <nl> Node * number_of_deleted_elements = LoadAndUntagObjectField ( <nl> - table , OrderedHashMap : : kNumberOfDeletedElementsOffset ) ; <nl> + table , OrderedHashMap : : NumberOfDeletedElementsOffset ( ) ) ; <nl> STATIC_ASSERT ( OrderedHashMap : : kClearedTableSentinel = = <nl> OrderedHashSet : : kClearedTableSentinel ) ; <nl> GotoIf ( WordEqual ( number_of_deleted_elements , <nl> TF_BUILTIN ( OrderedHashTableHealIndex , CollectionsBuiltinsAssembler ) { <nl> { <nl> Node * i = var_i . value ( ) ; <nl> GotoIfNot ( IntPtrLessThan ( i , number_of_deleted_elements ) , & return_index ) ; <nl> - STATIC_ASSERT ( OrderedHashMap : : kRemovedHolesIndex = = <nl> - OrderedHashSet : : kRemovedHolesIndex ) ; <nl> + STATIC_ASSERT ( OrderedHashMap : : RemovedHolesIndex ( ) = = <nl> + OrderedHashSet : : RemovedHolesIndex ( ) ) ; <nl> TNode < Smi > removed_index = CAST ( LoadFixedArrayElement ( <nl> - CAST ( table ) , i , OrderedHashMap : : kRemovedHolesIndex * kPointerSize ) ) ; <nl> + CAST ( table ) , i , OrderedHashMap : : RemovedHolesIndex ( ) * kPointerSize ) ) ; <nl> GotoIf ( SmiGreaterThanOrEqual ( removed_index , index ) , & return_index ) ; <nl> Decrement ( & var_index , 1 , SMI_PARAMETERS ) ; <nl> Increment ( & var_i ) ; <nl> CollectionsBuiltinsAssembler : : Transition ( <nl> TVARIABLE ( TableType , var_table , table ) ; <nl> Label if_done ( this ) , if_transition ( this , Label : : kDeferred ) ; <nl> Branch ( TaggedIsSmi ( <nl> - LoadObjectField ( var_table . value ( ) , TableType : : kNextTableOffset ) ) , <nl> + LoadObjectField ( var_table . value ( ) , TableType : : NextTableOffset ( ) ) ) , <nl> & if_done , & if_transition ) ; <nl> <nl> BIND ( & if_transition ) ; <nl> CollectionsBuiltinsAssembler : : Transition ( <nl> TNode < IntPtrT > index = var_index . value ( ) ; <nl> <nl> TNode < Object > next_table = <nl> - LoadObjectField ( table , TableType : : kNextTableOffset ) ; <nl> + LoadObjectField ( table , TableType : : NextTableOffset ( ) ) ; <nl> GotoIf ( TaggedIsSmi ( next_table ) , & done_loop ) ; <nl> <nl> var_table = CAST ( next_table ) ; <nl> CollectionsBuiltinsAssembler : : NextSkipHoles ( TNode < TableType > table , <nl> Label * if_end ) { <nl> / / Compute the used capacity for the { table } . <nl> TNode < IntPtrT > number_of_buckets = <nl> - LoadAndUntagObjectField ( table , TableType : : kNumberOfBucketsOffset ) ; <nl> + LoadAndUntagObjectField ( table , TableType : : NumberOfBucketsOffset ( ) ) ; <nl> TNode < IntPtrT > number_of_elements = <nl> - LoadAndUntagObjectField ( table , TableType : : kNumberOfElementsOffset ) ; <nl> - TNode < IntPtrT > number_of_deleted_elements = <nl> - LoadAndUntagObjectField ( table , TableType : : kNumberOfDeletedElementsOffset ) ; <nl> + LoadAndUntagObjectField ( table , TableType : : NumberOfElementsOffset ( ) ) ; <nl> + TNode < IntPtrT > number_of_deleted_elements = LoadAndUntagObjectField ( <nl> + table , TableType : : NumberOfDeletedElementsOffset ( ) ) ; <nl> TNode < IntPtrT > used_capacity = <nl> IntPtrAdd ( number_of_elements , number_of_deleted_elements ) ; <nl> <nl> CollectionsBuiltinsAssembler : : NextSkipHoles ( TNode < TableType > table , <nl> number_of_buckets ) ; <nl> entry_key = <nl> LoadFixedArrayElement ( table , entry_start_position , <nl> - TableType : : kHashTableStartIndex * kPointerSize ) ; <nl> + TableType : : HashTableStartIndex ( ) * kPointerSize ) ; <nl> Increment ( & var_index ) ; <nl> Branch ( IsTheHole ( entry_key ) , & loop , & done_loop ) ; <nl> } <nl> TF_BUILTIN ( MapPrototypeGet , CollectionsBuiltinsAssembler ) { <nl> BIND ( & if_found ) ; <nl> Return ( LoadFixedArrayElement ( <nl> CAST ( table ) , SmiUntag ( index ) , <nl> - ( OrderedHashMap : : kHashTableStartIndex + OrderedHashMap : : kValueOffset ) * <nl> + ( OrderedHashMap : : HashTableStartIndex ( ) + OrderedHashMap : : kValueOffset ) * <nl> kPointerSize ) ) ; <nl> <nl> BIND ( & if_not_found ) ; <nl> TF_BUILTIN ( MapPrototypeSet , CollectionsBuiltinsAssembler ) { <nl> / / If we found the entry , we just store the value there . <nl> StoreFixedArrayElement ( table , entry_start_position_or_hash . value ( ) , value , <nl> UPDATE_WRITE_BARRIER , <nl> - kPointerSize * ( OrderedHashMap : : kHashTableStartIndex + <nl> + kPointerSize * ( OrderedHashMap : : HashTableStartIndex ( ) + <nl> OrderedHashMap : : kValueOffset ) ) ; <nl> Return ( receiver ) ; <nl> <nl> TF_BUILTIN ( MapPrototypeSet , CollectionsBuiltinsAssembler ) { <nl> { <nl> / / Check we have enough space for the entry . <nl> number_of_buckets . Bind ( SmiUntag ( CAST ( <nl> - LoadFixedArrayElement ( table , OrderedHashMap : : kNumberOfBucketsIndex ) ) ) ) ; <nl> + LoadFixedArrayElement ( table , OrderedHashMap : : NumberOfBucketsIndex ( ) ) ) ) ) ; <nl> <nl> STATIC_ASSERT ( OrderedHashMap : : kLoadFactor = = 2 ) ; <nl> Node * const capacity = WordShl ( number_of_buckets . value ( ) , 1 ) ; <nl> Node * const number_of_elements = SmiUntag ( <nl> - CAST ( LoadObjectField ( table , OrderedHashMap : : kNumberOfElementsOffset ) ) ) ; <nl> + CAST ( LoadObjectField ( table , OrderedHashMap : : NumberOfElementsOffset ( ) ) ) ) ; <nl> Node * const number_of_deleted = SmiUntag ( CAST ( LoadObjectField ( <nl> - table , OrderedHashMap : : kNumberOfDeletedElementsOffset ) ) ) ; <nl> + table , OrderedHashMap : : NumberOfDeletedElementsOffset ( ) ) ) ) ; <nl> occupancy . Bind ( IntPtrAdd ( number_of_elements , number_of_deleted ) ) ; <nl> GotoIf ( IntPtrLessThan ( occupancy . value ( ) , capacity ) , & store_new_entry ) ; <nl> <nl> TF_BUILTIN ( MapPrototypeSet , CollectionsBuiltinsAssembler ) { <nl> CallRuntime ( Runtime : : kMapGrow , context , receiver ) ; <nl> table_var = CAST ( LoadObjectField ( receiver , JSMap : : kTableOffset ) ) ; <nl> number_of_buckets . Bind ( SmiUntag ( CAST ( LoadFixedArrayElement ( <nl> - table_var . value ( ) , OrderedHashMap : : kNumberOfBucketsIndex ) ) ) ) ; <nl> + table_var . value ( ) , OrderedHashMap : : NumberOfBucketsIndex ( ) ) ) ) ) ; <nl> Node * const new_number_of_elements = SmiUntag ( CAST ( LoadObjectField ( <nl> - table_var . value ( ) , OrderedHashMap : : kNumberOfElementsOffset ) ) ) ; <nl> + table_var . value ( ) , OrderedHashMap : : NumberOfElementsOffset ( ) ) ) ) ; <nl> Node * const new_number_of_deleted = SmiUntag ( CAST ( LoadObjectField ( <nl> - table_var . value ( ) , OrderedHashMap : : kNumberOfDeletedElementsOffset ) ) ) ; <nl> + table_var . value ( ) , OrderedHashMap : : NumberOfDeletedElementsOffset ( ) ) ) ) ; <nl> occupancy . Bind ( IntPtrAdd ( new_number_of_elements , new_number_of_deleted ) ) ; <nl> Goto ( & store_new_entry ) ; <nl> } <nl> void CollectionsBuiltinsAssembler : : StoreOrderedHashMapNewEntry ( <nl> Node * const bucket = <nl> WordAnd ( hash , IntPtrSub ( number_of_buckets , IntPtrConstant ( 1 ) ) ) ; <nl> Node * const bucket_entry = LoadFixedArrayElement ( <nl> - table , bucket , OrderedHashMap : : kHashTableStartIndex * kPointerSize ) ; <nl> + table , bucket , OrderedHashMap : : HashTableStartIndex ( ) * kPointerSize ) ; <nl> <nl> / / Store the entry elements . <nl> Node * const entry_start = IntPtrAdd ( <nl> IntPtrMul ( occupancy , IntPtrConstant ( OrderedHashMap : : kEntrySize ) ) , <nl> number_of_buckets ) ; <nl> StoreFixedArrayElement ( table , entry_start , key , UPDATE_WRITE_BARRIER , <nl> - kPointerSize * OrderedHashMap : : kHashTableStartIndex ) ; <nl> + kPointerSize * OrderedHashMap : : HashTableStartIndex ( ) ) ; <nl> StoreFixedArrayElement ( table , entry_start , value , UPDATE_WRITE_BARRIER , <nl> - kPointerSize * ( OrderedHashMap : : kHashTableStartIndex + <nl> + kPointerSize * ( OrderedHashMap : : HashTableStartIndex ( ) + <nl> OrderedHashMap : : kValueOffset ) ) ; <nl> StoreFixedArrayElement ( table , entry_start , bucket_entry , SKIP_WRITE_BARRIER , <nl> - kPointerSize * ( OrderedHashMap : : kHashTableStartIndex + <nl> + kPointerSize * ( OrderedHashMap : : HashTableStartIndex ( ) + <nl> OrderedHashMap : : kChainOffset ) ) ; <nl> <nl> / / Update the bucket head . <nl> StoreFixedArrayElement ( table , bucket , SmiTag ( occupancy ) , SKIP_WRITE_BARRIER , <nl> - OrderedHashMap : : kHashTableStartIndex * kPointerSize ) ; <nl> + OrderedHashMap : : HashTableStartIndex ( ) * kPointerSize ) ; <nl> <nl> / / Bump the elements count . <nl> TNode < Smi > const number_of_elements = <nl> - CAST ( LoadObjectField ( table , OrderedHashMap : : kNumberOfElementsOffset ) ) ; <nl> - StoreObjectFieldNoWriteBarrier ( table , OrderedHashMap : : kNumberOfElementsOffset , <nl> + CAST ( LoadObjectField ( table , OrderedHashMap : : NumberOfElementsOffset ( ) ) ) ; <nl> + StoreObjectFieldNoWriteBarrier ( table , <nl> + OrderedHashMap : : NumberOfElementsOffset ( ) , <nl> SmiAdd ( number_of_elements , SmiConstant ( 1 ) ) ) ; <nl> } <nl> <nl> TF_BUILTIN ( MapPrototypeDelete , CollectionsBuiltinsAssembler ) { <nl> / / If we found the entry , mark the entry as deleted . <nl> StoreFixedArrayElement ( table , entry_start_position_or_hash . value ( ) , <nl> TheHoleConstant ( ) , UPDATE_WRITE_BARRIER , <nl> - kPointerSize * OrderedHashMap : : kHashTableStartIndex ) ; <nl> + kPointerSize * OrderedHashMap : : HashTableStartIndex ( ) ) ; <nl> StoreFixedArrayElement ( table , entry_start_position_or_hash . value ( ) , <nl> TheHoleConstant ( ) , UPDATE_WRITE_BARRIER , <nl> - kPointerSize * ( OrderedHashMap : : kHashTableStartIndex + <nl> + kPointerSize * ( OrderedHashMap : : HashTableStartIndex ( ) + <nl> OrderedHashMap : : kValueOffset ) ) ; <nl> <nl> / / Decrement the number of elements , increment the number of deleted elements . <nl> TNode < Smi > const number_of_elements = SmiSub ( <nl> - CAST ( LoadObjectField ( table , OrderedHashMap : : kNumberOfElementsOffset ) ) , <nl> + CAST ( LoadObjectField ( table , OrderedHashMap : : NumberOfElementsOffset ( ) ) ) , <nl> SmiConstant ( 1 ) ) ; <nl> - StoreObjectFieldNoWriteBarrier ( table , OrderedHashMap : : kNumberOfElementsOffset , <nl> - number_of_elements ) ; <nl> + StoreObjectFieldNoWriteBarrier ( <nl> + table , OrderedHashMap : : NumberOfElementsOffset ( ) , number_of_elements ) ; <nl> TNode < Smi > const number_of_deleted = <nl> SmiAdd ( CAST ( LoadObjectField ( <nl> - table , OrderedHashMap : : kNumberOfDeletedElementsOffset ) ) , <nl> + table , OrderedHashMap : : NumberOfDeletedElementsOffset ( ) ) ) , <nl> SmiConstant ( 1 ) ) ; <nl> StoreObjectFieldNoWriteBarrier ( <nl> - table , OrderedHashMap : : kNumberOfDeletedElementsOffset , number_of_deleted ) ; <nl> + table , OrderedHashMap : : NumberOfDeletedElementsOffset ( ) , <nl> + number_of_deleted ) ; <nl> <nl> - TNode < Smi > const number_of_buckets = <nl> - CAST ( LoadFixedArrayElement ( table , OrderedHashMap : : kNumberOfBucketsIndex ) ) ; <nl> + TNode < Smi > const number_of_buckets = CAST ( <nl> + LoadFixedArrayElement ( table , OrderedHashMap : : NumberOfBucketsIndex ( ) ) ) ; <nl> <nl> / / If there fewer elements than # buckets / 2 , shrink the table . <nl> Label shrink ( this ) ; <nl> TF_BUILTIN ( SetPrototypeAdd , CollectionsBuiltinsAssembler ) { <nl> { <nl> / / Check we have enough space for the entry . <nl> number_of_buckets . Bind ( SmiUntag ( CAST ( <nl> - LoadFixedArrayElement ( table , OrderedHashSet : : kNumberOfBucketsIndex ) ) ) ) ; <nl> + LoadFixedArrayElement ( table , OrderedHashSet : : NumberOfBucketsIndex ( ) ) ) ) ) ; <nl> <nl> STATIC_ASSERT ( OrderedHashSet : : kLoadFactor = = 2 ) ; <nl> Node * const capacity = WordShl ( number_of_buckets . value ( ) , 1 ) ; <nl> Node * const number_of_elements = SmiUntag ( <nl> - CAST ( LoadObjectField ( table , OrderedHashSet : : kNumberOfElementsOffset ) ) ) ; <nl> + CAST ( LoadObjectField ( table , OrderedHashSet : : NumberOfElementsOffset ( ) ) ) ) ; <nl> Node * const number_of_deleted = SmiUntag ( CAST ( LoadObjectField ( <nl> - table , OrderedHashSet : : kNumberOfDeletedElementsOffset ) ) ) ; <nl> + table , OrderedHashSet : : NumberOfDeletedElementsOffset ( ) ) ) ) ; <nl> occupancy . Bind ( IntPtrAdd ( number_of_elements , number_of_deleted ) ) ; <nl> GotoIf ( IntPtrLessThan ( occupancy . value ( ) , capacity ) , & store_new_entry ) ; <nl> <nl> TF_BUILTIN ( SetPrototypeAdd , CollectionsBuiltinsAssembler ) { <nl> CallRuntime ( Runtime : : kSetGrow , context , receiver ) ; <nl> table_var = CAST ( LoadObjectField ( receiver , JSMap : : kTableOffset ) ) ; <nl> number_of_buckets . Bind ( SmiUntag ( CAST ( LoadFixedArrayElement ( <nl> - table_var . value ( ) , OrderedHashSet : : kNumberOfBucketsIndex ) ) ) ) ; <nl> + table_var . value ( ) , OrderedHashSet : : NumberOfBucketsIndex ( ) ) ) ) ) ; <nl> Node * const new_number_of_elements = SmiUntag ( CAST ( LoadObjectField ( <nl> - table_var . value ( ) , OrderedHashSet : : kNumberOfElementsOffset ) ) ) ; <nl> + table_var . value ( ) , OrderedHashSet : : NumberOfElementsOffset ( ) ) ) ) ; <nl> Node * const new_number_of_deleted = SmiUntag ( CAST ( LoadObjectField ( <nl> - table_var . value ( ) , OrderedHashSet : : kNumberOfDeletedElementsOffset ) ) ) ; <nl> + table_var . value ( ) , OrderedHashSet : : NumberOfDeletedElementsOffset ( ) ) ) ) ; <nl> occupancy . Bind ( IntPtrAdd ( new_number_of_elements , new_number_of_deleted ) ) ; <nl> Goto ( & store_new_entry ) ; <nl> } <nl> void CollectionsBuiltinsAssembler : : StoreOrderedHashSetNewEntry ( <nl> Node * const bucket = <nl> WordAnd ( hash , IntPtrSub ( number_of_buckets , IntPtrConstant ( 1 ) ) ) ; <nl> Node * const bucket_entry = LoadFixedArrayElement ( <nl> - table , bucket , OrderedHashSet : : kHashTableStartIndex * kPointerSize ) ; <nl> + table , bucket , OrderedHashSet : : HashTableStartIndex ( ) * kPointerSize ) ; <nl> <nl> / / Store the entry elements . <nl> Node * const entry_start = IntPtrAdd ( <nl> IntPtrMul ( occupancy , IntPtrConstant ( OrderedHashSet : : kEntrySize ) ) , <nl> number_of_buckets ) ; <nl> StoreFixedArrayElement ( table , entry_start , key , UPDATE_WRITE_BARRIER , <nl> - kPointerSize * OrderedHashSet : : kHashTableStartIndex ) ; <nl> + kPointerSize * OrderedHashSet : : HashTableStartIndex ( ) ) ; <nl> StoreFixedArrayElement ( table , entry_start , bucket_entry , SKIP_WRITE_BARRIER , <nl> - kPointerSize * ( OrderedHashSet : : kHashTableStartIndex + <nl> + kPointerSize * ( OrderedHashSet : : HashTableStartIndex ( ) + <nl> OrderedHashSet : : kChainOffset ) ) ; <nl> <nl> / / Update the bucket head . <nl> StoreFixedArrayElement ( table , bucket , SmiTag ( occupancy ) , SKIP_WRITE_BARRIER , <nl> - OrderedHashSet : : kHashTableStartIndex * kPointerSize ) ; <nl> + OrderedHashSet : : HashTableStartIndex ( ) * kPointerSize ) ; <nl> <nl> / / Bump the elements count . <nl> TNode < Smi > const number_of_elements = <nl> - CAST ( LoadObjectField ( table , OrderedHashSet : : kNumberOfElementsOffset ) ) ; <nl> - StoreObjectFieldNoWriteBarrier ( table , OrderedHashSet : : kNumberOfElementsOffset , <nl> + CAST ( LoadObjectField ( table , OrderedHashSet : : NumberOfElementsOffset ( ) ) ) ; <nl> + StoreObjectFieldNoWriteBarrier ( table , <nl> + OrderedHashSet : : NumberOfElementsOffset ( ) , <nl> SmiAdd ( number_of_elements , SmiConstant ( 1 ) ) ) ; <nl> } <nl> <nl> TF_BUILTIN ( SetPrototypeDelete , CollectionsBuiltinsAssembler ) { <nl> / / If we found the entry , mark the entry as deleted . <nl> StoreFixedArrayElement ( table , entry_start_position_or_hash . value ( ) , <nl> TheHoleConstant ( ) , UPDATE_WRITE_BARRIER , <nl> - kPointerSize * OrderedHashSet : : kHashTableStartIndex ) ; <nl> + kPointerSize * OrderedHashSet : : HashTableStartIndex ( ) ) ; <nl> <nl> / / Decrement the number of elements , increment the number of deleted elements . <nl> TNode < Smi > const number_of_elements = SmiSub ( <nl> - CAST ( LoadObjectField ( table , OrderedHashSet : : kNumberOfElementsOffset ) ) , <nl> + CAST ( LoadObjectField ( table , OrderedHashSet : : NumberOfElementsOffset ( ) ) ) , <nl> SmiConstant ( 1 ) ) ; <nl> - StoreObjectFieldNoWriteBarrier ( table , OrderedHashSet : : kNumberOfElementsOffset , <nl> - number_of_elements ) ; <nl> + StoreObjectFieldNoWriteBarrier ( <nl> + table , OrderedHashSet : : NumberOfElementsOffset ( ) , number_of_elements ) ; <nl> TNode < Smi > const number_of_deleted = <nl> SmiAdd ( CAST ( LoadObjectField ( <nl> - table , OrderedHashSet : : kNumberOfDeletedElementsOffset ) ) , <nl> + table , OrderedHashSet : : NumberOfDeletedElementsOffset ( ) ) ) , <nl> SmiConstant ( 1 ) ) ; <nl> StoreObjectFieldNoWriteBarrier ( <nl> - table , OrderedHashSet : : kNumberOfDeletedElementsOffset , number_of_deleted ) ; <nl> + table , OrderedHashSet : : NumberOfDeletedElementsOffset ( ) , <nl> + number_of_deleted ) ; <nl> <nl> - TNode < Smi > const number_of_buckets = <nl> - CAST ( LoadFixedArrayElement ( table , OrderedHashSet : : kNumberOfBucketsIndex ) ) ; <nl> + TNode < Smi > const number_of_buckets = CAST ( <nl> + LoadFixedArrayElement ( table , OrderedHashSet : : NumberOfBucketsIndex ( ) ) ) ; <nl> <nl> / / If there fewer elements than # buckets / 2 , shrink the table . <nl> Label shrink ( this ) ; <nl> TF_BUILTIN ( MapPrototypeGetSize , CollectionsBuiltinsAssembler ) { <nl> ThrowIfNotInstanceType ( context , receiver , JS_MAP_TYPE , <nl> " get Map . prototype . size " ) ; <nl> Node * const table = LoadObjectField ( receiver , JSMap : : kTableOffset ) ; <nl> - Return ( LoadObjectField ( table , OrderedHashMap : : kNumberOfElementsOffset ) ) ; <nl> + Return ( LoadObjectField ( table , OrderedHashMap : : NumberOfElementsOffset ( ) ) ) ; <nl> } <nl> <nl> TF_BUILTIN ( MapPrototypeForEach , CollectionsBuiltinsAssembler ) { <nl> TF_BUILTIN ( MapPrototypeForEach , CollectionsBuiltinsAssembler ) { <nl> / / Load the entry value as well . <nl> Node * entry_value = LoadFixedArrayElement ( <nl> table , entry_start_position , <nl> - ( OrderedHashMap : : kHashTableStartIndex + OrderedHashMap : : kValueOffset ) * <nl> + ( OrderedHashMap : : HashTableStartIndex ( ) + OrderedHashMap : : kValueOffset ) * <nl> kPointerSize ) ; <nl> <nl> / / Invoke the { callback } passing the { entry_key } , { entry_value } and the <nl> TF_BUILTIN ( MapIteratorPrototypeNext , CollectionsBuiltinsAssembler ) { <nl> & return_value ) ; <nl> var_value . Bind ( LoadFixedArrayElement ( <nl> table , entry_start_position , <nl> - ( OrderedHashMap : : kHashTableStartIndex + OrderedHashMap : : kValueOffset ) * <nl> + ( OrderedHashMap : : HashTableStartIndex ( ) + OrderedHashMap : : kValueOffset ) * <nl> kPointerSize ) ) ; <nl> Branch ( InstanceTypeEqual ( receiver_instance_type , JS_MAP_VALUE_ITERATOR_TYPE ) , <nl> & return_value , & return_entry ) ; <nl> TF_BUILTIN ( SetPrototypeGetSize , CollectionsBuiltinsAssembler ) { <nl> ThrowIfNotInstanceType ( context , receiver , JS_SET_TYPE , <nl> " get Set . prototype . size " ) ; <nl> Node * const table = LoadObjectField ( receiver , JSSet : : kTableOffset ) ; <nl> - Return ( LoadObjectField ( table , OrderedHashSet : : kNumberOfElementsOffset ) ) ; <nl> + Return ( LoadObjectField ( table , OrderedHashSet : : NumberOfElementsOffset ( ) ) ) ; <nl> } <nl> <nl> TF_BUILTIN ( SetPrototypeForEach , CollectionsBuiltinsAssembler ) { <nl> mmm a / src / code - stub - assembler . cc <nl> ppp b / src / code - stub - assembler . cc <nl> Node * CodeStubAssembler : : AllocateOrderedHashTable ( ) { <nl> static const int kBucketCount = kCapacity / CollectionType : : kLoadFactor ; <nl> static const int kDataTableLength = kCapacity * CollectionType : : kEntrySize ; <nl> static const int kFixedArrayLength = <nl> - CollectionType : : kHashTableStartIndex + kBucketCount + kDataTableLength ; <nl> + CollectionType : : HashTableStartIndex ( ) + kBucketCount + kDataTableLength ; <nl> static const int kDataTableStartIndex = <nl> - CollectionType : : kHashTableStartIndex + kBucketCount ; <nl> + CollectionType : : HashTableStartIndex ( ) + kBucketCount ; <nl> <nl> STATIC_ASSERT ( base : : bits : : IsPowerOfTwo ( kCapacity ) ) ; <nl> - STATIC_ASSERT ( kCapacity < = CollectionType : : kMaxCapacity ) ; <nl> + STATIC_ASSERT ( kCapacity < = CollectionType : : MaxCapacity ( ) ) ; <nl> <nl> / / Allocate the table and add the proper map . <nl> const ElementsKind elements_kind = HOLEY_ELEMENTS ; <nl> Node * CodeStubAssembler : : AllocateOrderedHashTable ( ) { <nl> <nl> / / Initialize the OrderedHashTable fields . <nl> const WriteBarrierMode barrier_mode = SKIP_WRITE_BARRIER ; <nl> - StoreFixedArrayElement ( table , CollectionType : : kNumberOfElementsIndex , <nl> + StoreFixedArrayElement ( table , CollectionType : : NumberOfElementsIndex ( ) , <nl> SmiConstant ( 0 ) , barrier_mode ) ; <nl> - StoreFixedArrayElement ( table , CollectionType : : kNumberOfDeletedElementsIndex , <nl> + StoreFixedArrayElement ( table , CollectionType : : NumberOfDeletedElementsIndex ( ) , <nl> SmiConstant ( 0 ) , barrier_mode ) ; <nl> - StoreFixedArrayElement ( table , CollectionType : : kNumberOfBucketsIndex , <nl> + StoreFixedArrayElement ( table , CollectionType : : NumberOfBucketsIndex ( ) , <nl> SmiConstant ( kBucketCount ) , barrier_mode ) ; <nl> <nl> / / Fill the buckets with kNotFound . <nl> TNode < Smi > not_found = SmiConstant ( CollectionType : : kNotFound ) ; <nl> - STATIC_ASSERT ( CollectionType : : kHashTableStartIndex = = <nl> - CollectionType : : kNumberOfBucketsIndex + 1 ) ; <nl> - STATIC_ASSERT ( ( CollectionType : : kHashTableStartIndex + kBucketCount ) = = <nl> + STATIC_ASSERT ( CollectionType : : HashTableStartIndex ( ) = = <nl> + CollectionType : : NumberOfBucketsIndex ( ) + 1 ) ; <nl> + STATIC_ASSERT ( ( CollectionType : : HashTableStartIndex ( ) + kBucketCount ) = = <nl> kDataTableStartIndex ) ; <nl> for ( int i = 0 ; i < kBucketCount ; i + + ) { <nl> - StoreFixedArrayElement ( table , CollectionType : : kHashTableStartIndex + i , <nl> + StoreFixedArrayElement ( table , CollectionType : : HashTableStartIndex ( ) + i , <nl> not_found , barrier_mode ) ; <nl> } <nl> <nl> TNode < CollectionType > CodeStubAssembler : : AllocateSmallOrderedHashTable ( <nl> capacity , IntPtrConstant ( CollectionType : : kMaxCapacity ) ) ) ; <nl> <nl> TNode < IntPtrT > data_table_start_offset = <nl> - IntPtrConstant ( CollectionType : : kDataTableStartOffset ) ; <nl> + IntPtrConstant ( CollectionType : : DataTableStartOffset ( ) ) ; <nl> <nl> TNode < IntPtrT > data_table_size = IntPtrMul ( <nl> capacity , IntPtrConstant ( CollectionType : : kEntrySize * kPointerSize ) ) ; <nl> TNode < CollectionType > CodeStubAssembler : : AllocateSmallOrderedHashTable ( <nl> <nl> / / Initialize the SmallOrderedHashTable fields . <nl> StoreObjectByteNoWriteBarrier ( <nl> - table , CollectionType : : kNumberOfBucketsOffset , <nl> + table , CollectionType : : NumberOfBucketsOffset ( ) , <nl> Word32And ( Int32Constant ( 0xFF ) , hash_table_size ) ) ; <nl> - StoreObjectByteNoWriteBarrier ( table , CollectionType : : kNumberOfElementsOffset , <nl> + StoreObjectByteNoWriteBarrier ( table , CollectionType : : NumberOfElementsOffset ( ) , <nl> Int32Constant ( 0 ) ) ; <nl> StoreObjectByteNoWriteBarrier ( <nl> - table , CollectionType : : kNumberOfDeletedElementsOffset , Int32Constant ( 0 ) ) ; <nl> + table , CollectionType : : NumberOfDeletedElementsOffset ( ) , Int32Constant ( 0 ) ) ; <nl> <nl> TNode < IntPtrT > table_address = <nl> IntPtrSub ( BitcastTaggedToWord ( table ) , IntPtrConstant ( kHeapObjectTag ) ) ; <nl> void CodeStubAssembler : : FindOrderedHashTableEntry ( <nl> Variable * entry_start_position , Label * entry_found , Label * not_found ) { <nl> / / Get the index of the bucket . <nl> Node * const number_of_buckets = SmiUntag ( CAST ( LoadFixedArrayElement ( <nl> - CAST ( table ) , CollectionType : : kNumberOfBucketsIndex ) ) ) ; <nl> + CAST ( table ) , CollectionType : : NumberOfBucketsIndex ( ) ) ) ) ; <nl> Node * const bucket = <nl> WordAnd ( hash , IntPtrSub ( number_of_buckets , IntPtrConstant ( 1 ) ) ) ; <nl> Node * const first_entry = SmiUntag ( CAST ( LoadFixedArrayElement ( <nl> CAST ( table ) , bucket , <nl> - CollectionType : : kHashTableStartIndex * kPointerSize ) ) ) ; <nl> + CollectionType : : HashTableStartIndex ( ) * kPointerSize ) ) ) ; <nl> <nl> / / Walk the bucket chain . <nl> Node * entry_start ; <nl> void CodeStubAssembler : : FindOrderedHashTableEntry ( <nl> <nl> / / Make sure the entry index is within range . <nl> CSA_ASSERT ( <nl> - this , UintPtrLessThan ( <nl> - var_entry . value ( ) , <nl> - SmiUntag ( SmiAdd ( <nl> - CAST ( LoadFixedArrayElement ( <nl> - CAST ( table ) , CollectionType : : kNumberOfElementsIndex ) ) , <nl> - CAST ( LoadFixedArrayElement ( <nl> - CAST ( table ) , <nl> - CollectionType : : kNumberOfDeletedElementsIndex ) ) ) ) ) ) ; <nl> + this , <nl> + UintPtrLessThan ( <nl> + var_entry . value ( ) , <nl> + SmiUntag ( SmiAdd ( <nl> + CAST ( LoadFixedArrayElement ( <nl> + CAST ( table ) , CollectionType : : NumberOfElementsIndex ( ) ) ) , <nl> + CAST ( LoadFixedArrayElement ( <nl> + CAST ( table ) , <nl> + CollectionType : : NumberOfDeletedElementsIndex ( ) ) ) ) ) ) ) ; <nl> <nl> / / Compute the index of the entry relative to kHashTableStartIndex . <nl> entry_start = <nl> void CodeStubAssembler : : FindOrderedHashTableEntry ( <nl> / / Load the key from the entry . <nl> Node * const candidate_key = LoadFixedArrayElement ( <nl> CAST ( table ) , entry_start , <nl> - CollectionType : : kHashTableStartIndex * kPointerSize ) ; <nl> + CollectionType : : HashTableStartIndex ( ) * kPointerSize ) ; <nl> <nl> key_compare ( candidate_key , & if_key_found , & continue_next_entry ) ; <nl> <nl> void CodeStubAssembler : : FindOrderedHashTableEntry ( <nl> / / Load the index of the next entry in the bucket chain . <nl> var_entry . Bind ( SmiUntag ( CAST ( LoadFixedArrayElement ( <nl> CAST ( table ) , entry_start , <nl> - ( CollectionType : : kHashTableStartIndex + CollectionType : : kChainOffset ) * <nl> + ( CollectionType : : HashTableStartIndex ( ) + CollectionType : : kChainOffset ) * <nl> kPointerSize ) ) ) ) ; <nl> <nl> Goto ( & loop ) ; <nl> mmm a / src / compiler / access - builder . cc <nl> ppp b / src / compiler / access - builder . cc <nl> FieldAccess AccessBuilder : : ForHashTableBaseCapacity ( ) { <nl> FieldAccess AccessBuilder : : ForOrderedHashMapOrSetNextTable ( ) { <nl> / / TODO ( turbofan ) : This will be redundant with the HashTableBase <nl> / / methods above once the hash table unification is done . <nl> - STATIC_ASSERT ( OrderedHashMap : : kNextTableOffset = = <nl> - OrderedHashSet : : kNextTableOffset ) ; <nl> + STATIC_ASSERT ( OrderedHashMap : : NextTableOffset ( ) = = <nl> + OrderedHashSet : : NextTableOffset ( ) ) ; <nl> FieldAccess const access = { <nl> - kTaggedBase , OrderedHashMap : : kNextTableOffset , <nl> + kTaggedBase , OrderedHashMap : : NextTableOffset ( ) , <nl> MaybeHandle < Name > ( ) , MaybeHandle < Map > ( ) , <nl> Type : : Any ( ) , MachineType : : AnyTagged ( ) , <nl> kFullWriteBarrier } ; <nl> FieldAccess AccessBuilder : : ForOrderedHashMapOrSetNextTable ( ) { <nl> FieldAccess AccessBuilder : : ForOrderedHashMapOrSetNumberOfBuckets ( ) { <nl> / / TODO ( turbofan ) : This will be redundant with the HashTableBase <nl> / / methods above once the hash table unification is done . <nl> - STATIC_ASSERT ( OrderedHashMap : : kNumberOfBucketsOffset = = <nl> - OrderedHashSet : : kNumberOfBucketsOffset ) ; <nl> + STATIC_ASSERT ( OrderedHashMap : : NumberOfBucketsOffset ( ) = = <nl> + OrderedHashSet : : NumberOfBucketsOffset ( ) ) ; <nl> FieldAccess const access = { kTaggedBase , <nl> - OrderedHashMap : : kNumberOfBucketsOffset , <nl> + OrderedHashMap : : NumberOfBucketsOffset ( ) , <nl> MaybeHandle < Name > ( ) , <nl> MaybeHandle < Map > ( ) , <nl> TypeCache : : Get ( ) . kFixedArrayLengthType , <nl> FieldAccess AccessBuilder : : ForOrderedHashMapOrSetNumberOfBuckets ( ) { <nl> FieldAccess AccessBuilder : : ForOrderedHashMapOrSetNumberOfDeletedElements ( ) { <nl> / / TODO ( turbofan ) : This will be redundant with the HashTableBase <nl> / / methods above once the hash table unification is done . <nl> - STATIC_ASSERT ( OrderedHashMap : : kNumberOfDeletedElementsOffset = = <nl> - OrderedHashSet : : kNumberOfDeletedElementsOffset ) ; <nl> + STATIC_ASSERT ( OrderedHashMap : : NumberOfDeletedElementsOffset ( ) = = <nl> + OrderedHashSet : : NumberOfDeletedElementsOffset ( ) ) ; <nl> FieldAccess const access = { kTaggedBase , <nl> - OrderedHashMap : : kNumberOfDeletedElementsOffset , <nl> + OrderedHashMap : : NumberOfDeletedElementsOffset ( ) , <nl> MaybeHandle < Name > ( ) , <nl> MaybeHandle < Map > ( ) , <nl> TypeCache : : Get ( ) . kFixedArrayLengthType , <nl> FieldAccess AccessBuilder : : ForOrderedHashMapOrSetNumberOfDeletedElements ( ) { <nl> FieldAccess AccessBuilder : : ForOrderedHashMapOrSetNumberOfElements ( ) { <nl> / / TODO ( turbofan ) : This will be redundant with the HashTableBase <nl> / / methods above once the hash table unification is done . <nl> - STATIC_ASSERT ( OrderedHashMap : : kNumberOfElementsOffset = = <nl> - OrderedHashSet : : kNumberOfElementsOffset ) ; <nl> + STATIC_ASSERT ( OrderedHashMap : : NumberOfElementsOffset ( ) = = <nl> + OrderedHashSet : : NumberOfElementsOffset ( ) ) ; <nl> FieldAccess const access = { kTaggedBase , <nl> - OrderedHashMap : : kNumberOfElementsOffset , <nl> + OrderedHashMap : : NumberOfElementsOffset ( ) , <nl> MaybeHandle < Name > ( ) , <nl> MaybeHandle < Map > ( ) , <nl> TypeCache : : Get ( ) . kFixedArrayLengthType , <nl> FieldAccess AccessBuilder : : ForOrderedHashMapOrSetNumberOfElements ( ) { <nl> / / static <nl> ElementAccess AccessBuilder : : ForOrderedHashMapEntryValue ( ) { <nl> ElementAccess const access = { kTaggedBase , <nl> - OrderedHashMap : : kHashTableStartOffset + <nl> + OrderedHashMap : : HashTableStartOffset ( ) + <nl> OrderedHashMap : : kValueOffset * kPointerSize , <nl> Type : : Any ( ) , MachineType : : AnyTagged ( ) , <nl> kFullWriteBarrier } ; <nl> mmm a / src / compiler / effect - control - linearizer . cc <nl> ppp b / src / compiler / effect - control - linearizer . cc <nl> Node * EffectControlLinearizer : : LowerFindOrderedHashMapEntryForInt32Key ( <nl> Node * first_entry = ChangeSmiToIntPtr ( __ Load ( <nl> MachineType : : TaggedSigned ( ) , table , <nl> __ IntAdd ( __ WordShl ( hash , __ IntPtrConstant ( kPointerSizeLog2 ) ) , <nl> - __ IntPtrConstant ( OrderedHashMap : : kHashTableStartOffset - <nl> + __ IntPtrConstant ( OrderedHashMap : : HashTableStartOffset ( ) - <nl> kHeapObjectTag ) ) ) ) ; <nl> <nl> auto loop = __ MakeLoopLabel ( MachineType : : PointerRepresentation ( ) ) ; <nl> Node * EffectControlLinearizer : : LowerFindOrderedHashMapEntryForInt32Key ( <nl> Node * candidate_key = __ Load ( <nl> MachineType : : AnyTagged ( ) , table , <nl> __ IntAdd ( __ WordShl ( entry , __ IntPtrConstant ( kPointerSizeLog2 ) ) , <nl> - __ IntPtrConstant ( OrderedHashMap : : kHashTableStartOffset - <nl> + __ IntPtrConstant ( OrderedHashMap : : HashTableStartOffset ( ) - <nl> kHeapObjectTag ) ) ) ; <nl> <nl> auto if_match = __ MakeLabel ( ) ; <nl> Node * EffectControlLinearizer : : LowerFindOrderedHashMapEntryForInt32Key ( <nl> MachineType : : TaggedSigned ( ) , table , <nl> __ IntAdd ( <nl> __ WordShl ( entry , __ IntPtrConstant ( kPointerSizeLog2 ) ) , <nl> - __ IntPtrConstant ( OrderedHashMap : : kHashTableStartOffset + <nl> + __ IntPtrConstant ( OrderedHashMap : : HashTableStartOffset ( ) + <nl> OrderedHashMap : : kChainOffset * kPointerSize - <nl> kHeapObjectTag ) ) ) ) ; <nl> __ Goto ( & loop , next_entry ) ; <nl> mmm a / src / compiler / js - call - reducer . cc <nl> ppp b / src / compiler / js - call - reducer . cc <nl> Reduction JSCallReducer : : ReduceCollectionIteratorPrototypeNext ( <nl> Node * etrue0 = effect ; <nl> { <nl> / / Load the key of the entry . <nl> - STATIC_ASSERT ( OrderedHashMap : : kHashTableStartIndex = = <nl> - OrderedHashSet : : kHashTableStartIndex ) ; <nl> + STATIC_ASSERT ( OrderedHashMap : : HashTableStartIndex ( ) = = <nl> + OrderedHashSet : : HashTableStartIndex ( ) ) ; <nl> Node * entry_start_position = graph ( ) - > NewNode ( <nl> simplified ( ) - > NumberAdd ( ) , <nl> graph ( ) - > NewNode ( <nl> Reduction JSCallReducer : : ReduceCollectionIteratorPrototypeNext ( <nl> graph ( ) - > NewNode ( simplified ( ) - > NumberMultiply ( ) , index , <nl> jsgraph ( ) - > Constant ( entry_size ) ) , <nl> number_of_buckets ) , <nl> - jsgraph ( ) - > Constant ( OrderedHashMap : : kHashTableStartIndex ) ) ; <nl> + jsgraph ( ) - > Constant ( OrderedHashMap : : HashTableStartIndex ( ) ) ) ; <nl> Node * entry_key = etrue0 = graph ( ) - > NewNode ( <nl> simplified ( ) - > LoadElement ( AccessBuilder : : ForFixedArrayElement ( ) ) , <nl> table , entry_start_position , etrue0 , if_true0 ) ; <nl> mmm a / src / heap / setup - heap - internal . cc <nl> ppp b / src / heap / setup - heap - internal . cc <nl> void Heap : : CreateInitialObjects ( ) { <nl> <nl> / / Allocate the empty OrderedHashMap . <nl> Handle < FixedArray > empty_ordered_hash_map = factory - > NewFixedArray ( <nl> - OrderedHashMap : : kHashTableStartIndex , TENURED_READ_ONLY ) ; <nl> + OrderedHashMap : : HashTableStartIndex ( ) , TENURED_READ_ONLY ) ; <nl> empty_ordered_hash_map - > set_map_no_write_barrier ( <nl> * factory - > ordered_hash_map_map ( ) ) ; <nl> for ( int i = 0 ; i < empty_ordered_hash_map - > length ( ) ; + + i ) { <nl> void Heap : : CreateInitialObjects ( ) { <nl> <nl> / / Allocate the empty OrderedHashSet . <nl> Handle < FixedArray > empty_ordered_hash_set = factory - > NewFixedArray ( <nl> - OrderedHashSet : : kHashTableStartIndex , TENURED_READ_ONLY ) ; <nl> + OrderedHashSet : : HashTableStartIndex ( ) , TENURED_READ_ONLY ) ; <nl> empty_ordered_hash_set - > set_map_no_write_barrier ( <nl> * factory - > ordered_hash_set_map ( ) ) ; <nl> for ( int i = 0 ; i < empty_ordered_hash_set - > length ( ) ; + + i ) { <nl> mmm a / src / keys . cc <nl> ppp b / src / keys . cc <nl> void KeyAccumulator : : AddKey ( Handle < Object > key , AddKeyConversion convert ) { <nl> / / The keys_ Set is converted directly to a FixedArray in GetKeys which can <nl> / / be left - trimmer . Hence the previous Set should not keep a pointer to the <nl> / / new one . <nl> - keys_ - > set ( OrderedHashSet : : kNextTableIndex , Smi : : kZero ) ; <nl> + keys_ - > set ( OrderedHashSet : : NextTableIndex ( ) , Smi : : kZero ) ; <nl> / / TODO ( 3770 ) : Drop explicit conversion . <nl> keys_ = Handle < FixedArray > ( new_set . location ( ) ) ; <nl> } <nl> mmm a / src / objects - body - descriptors - inl . h <nl> ppp b / src / objects - body - descriptors - inl . h <nl> class SmallOrderedHashTable < Derived > : : BodyDescriptor final <nl> public : <nl> static bool IsValidSlot ( Map map , HeapObject * obj , int offset ) { <nl> Derived table = Derived : : cast ( obj ) ; <nl> - if ( offset < kDataTableStartOffset ) return false ; <nl> + if ( offset < DataTableStartOffset ( ) ) return false ; <nl> if ( offset > = table - > GetBucketsStartOffset ( ) ) return false ; <nl> return IsValidSlotImpl ( map , obj , offset ) ; <nl> } <nl> class SmallOrderedHashTable < Derived > : : BodyDescriptor final <nl> ObjectVisitor * v ) { <nl> Derived table = Derived : : cast ( obj ) ; <nl> <nl> - int offset = kDataTableStartOffset ; <nl> + int offset = DataTableStartOffset ( ) ; <nl> int entry = 0 ; <nl> for ( int i = 0 ; i < table - > Capacity ( ) ; i + + ) { <nl> for ( int j = 0 ; j < Derived : : kEntrySize ; j + + ) { <nl> mmm a / src / objects / ordered - hash - table . cc <nl> ppp b / src / objects / ordered - hash - table . cc <nl> Handle < Derived > OrderedHashTable < Derived , entrysize > : : Allocate ( <nl> / / to something other than 2 , capacity should be stored as another <nl> / / field of this object . <nl> capacity = base : : bits : : RoundUpToPowerOfTwo32 ( Max ( kMinCapacity , capacity ) ) ; <nl> - if ( capacity > kMaxCapacity ) { <nl> + if ( capacity > MaxCapacity ( ) ) { <nl> isolate - > heap ( ) - > FatalProcessOutOfMemory ( " invalid table size " ) ; <nl> } <nl> int num_buckets = capacity / kLoadFactor ; <nl> Handle < FixedArray > backing_store = isolate - > factory ( ) - > NewFixedArrayWithMap ( <nl> Derived : : GetMapRootIndex ( ) , <nl> - kHashTableStartIndex + num_buckets + ( capacity * kEntrySize ) , pretenure ) ; <nl> + HashTableStartIndex ( ) + num_buckets + ( capacity * kEntrySize ) , pretenure ) ; <nl> Handle < Derived > table = Handle < Derived > : : cast ( backing_store ) ; <nl> for ( int i = 0 ; i < num_buckets ; + + i ) { <nl> - table - > set ( kHashTableStartIndex + i , Smi : : FromInt ( kNotFound ) ) ; <nl> + table - > set ( HashTableStartIndex ( ) + i , Smi : : FromInt ( kNotFound ) ) ; <nl> } <nl> table - > SetNumberOfBuckets ( num_buckets ) ; <nl> table - > SetNumberOfElements ( 0 ) ; <nl> Handle < OrderedHashSet > OrderedHashSet : : Add ( Isolate * isolate , <nl> table - > set ( new_index , * key ) ; <nl> table - > set ( new_index + kChainOffset , Smi : : FromInt ( previous_entry ) ) ; <nl> / / and point the bucket to the new entry . <nl> - table - > set ( kHashTableStartIndex + bucket , Smi : : FromInt ( new_entry ) ) ; <nl> + table - > set ( HashTableStartIndex ( ) + bucket , Smi : : FromInt ( new_entry ) ) ; <nl> table - > SetNumberOfElements ( nof + 1 ) ; <nl> return table ; <nl> } <nl> Handle < FixedArray > OrderedHashSet : : ConvertToKeysArray ( <nl> int const kMaxStringTableEntries = <nl> isolate - > heap ( ) - > MaxNumberToStringCacheSize ( ) ; <nl> for ( int i = 0 ; i < length ; i + + ) { <nl> - int index = kHashTableStartIndex + nof_buckets + ( i * kEntrySize ) ; <nl> + int index = HashTableStartIndex ( ) + nof_buckets + ( i * kEntrySize ) ; <nl> Object * key = table - > get ( index ) ; <nl> if ( convert = = GetKeysConversion : : kConvertToString ) { <nl> uint32_t index_value ; <nl> Handle < Derived > OrderedHashTable < Derived , entrysize > : : Rehash ( <nl> <nl> Object * hash = key - > GetHash ( ) ; <nl> int bucket = Smi : : ToInt ( hash ) & ( new_buckets - 1 ) ; <nl> - Object * chain_entry = new_table - > get ( kHashTableStartIndex + bucket ) ; <nl> - new_table - > set ( kHashTableStartIndex + bucket , Smi : : FromInt ( new_entry ) ) ; <nl> + Object * chain_entry = new_table - > get ( HashTableStartIndex ( ) + bucket ) ; <nl> + new_table - > set ( HashTableStartIndex ( ) + bucket , Smi : : FromInt ( new_entry ) ) ; <nl> int new_index = new_table - > EntryToIndex ( new_entry ) ; <nl> int old_index = table - > EntryToIndex ( old_entry ) ; <nl> for ( int i = 0 ; i < entrysize ; + + i ) { <nl> Handle < OrderedHashMap > OrderedHashMap : : Add ( Isolate * isolate , <nl> table - > set ( new_index + kValueOffset , * value ) ; <nl> table - > set ( new_index + kChainOffset , Smi : : FromInt ( previous_entry ) ) ; <nl> / / and point the bucket to the new entry . <nl> - table - > set ( kHashTableStartIndex + bucket , Smi : : FromInt ( new_entry ) ) ; <nl> + table - > set ( HashTableStartIndex ( ) + bucket , Smi : : FromInt ( new_entry ) ) ; <nl> table - > SetNumberOfElements ( nof + 1 ) ; <nl> return table ; <nl> } <nl> Handle < OrderedNameDictionary > OrderedNameDictionary : : Add ( <nl> <nl> table - > set ( new_index + kChainOffset , Smi : : FromInt ( previous_entry ) ) ; <nl> / / and point the bucket to the new entry . <nl> - table - > set ( kHashTableStartIndex + bucket , Smi : : FromInt ( new_entry ) ) ; <nl> + table - > set ( HashTableStartIndex ( ) + bucket , Smi : : FromInt ( new_entry ) ) ; <nl> table - > SetNumberOfElements ( nof + 1 ) ; <nl> return table ; <nl> } <nl> void SmallOrderedHashTable < Derived > : : Initialize ( Isolate * isolate , <nl> num_buckets + num_chains ) ; <nl> <nl> if ( Heap : : InNewSpace ( * this ) ) { <nl> - MemsetTagged ( RawField ( kDataTableStartOffset ) , <nl> + MemsetTagged ( RawField ( DataTableStartOffset ( ) ) , <nl> ReadOnlyRoots ( isolate ) . the_hole_value ( ) , <nl> capacity * Derived : : kEntrySize ) ; <nl> } else { <nl> mmm a / src / objects / ordered - hash - table . h <nl> ppp b / src / objects / ordered - hash - table . h <nl> namespace internal { <nl> / / Originally attributed to Tyler Close . <nl> / / <nl> / / Memory layout : <nl> - / / [ 0 ] : element count <nl> - / / [ 1 ] : deleted element count <nl> - / / [ 2 ] : bucket count <nl> - / / [ 3 . . ( 3 + NumberOfBuckets ( ) - 1 ) ] : " hash table " , where each item is an <nl> - / / offset into the data table ( see below ) where the <nl> - / / first item in this bucket is stored . <nl> - / / [ 3 + NumberOfBuckets ( ) . . length ] : " data table " , an array of length <nl> - / / Capacity ( ) * kEntrySize , where the first entrysize <nl> - / / items are handled by the derived class and the <nl> - / / item at kChainOffset is another entry into the <nl> - / / data table indicating the next entry in this hash <nl> - / / bucket . <nl> + / / [ 0 ] : Prefix <nl> + / / [ kPrefixSize ] : element count <nl> + / / [ kPrefixSize + 1 ] : deleted element count <nl> + / / [ kPrefixSize + 2 ] : bucket count <nl> + / / [ kPrefixSize + 3 . . ( 3 + NumberOfBuckets ( ) - 1 ) ] : " hash table " , <nl> + / / where each item is an offset into the <nl> + / / data table ( see below ) where the first <nl> + / / item in this bucket is stored . <nl> + / / [ kPrefixSize + 3 + NumberOfBuckets ( ) . . length ] : " data table " , an <nl> + / / array of length Capacity ( ) * kEntrySize , <nl> + / / where the first entrysize items are <nl> + / / handled by the derived class and the <nl> + / / item at kChainOffset is another entry <nl> + / / into the data table indicating the next <nl> + / / entry in this hash bucket . <nl> / / <nl> / / When we transition the table to a new version we obsolete it and reuse parts <nl> / / of the memory to store information how to transition an iterator to the new <nl> / / table : <nl> / / <nl> / / Memory layout for obsolete table : <nl> - / / [ 0 ] : bucket count <nl> - / / [ 1 ] : Next newer table <nl> - / / [ 2 ] : Number of removed holes or - 1 when the table was cleared . <nl> - / / [ 3 . . ( 3 + NumberOfRemovedHoles ( ) - 1 ) ] : The indexes of the removed holes . <nl> - / / [ 3 + NumberOfRemovedHoles ( ) . . length ] : Not used <nl> - / / <nl> + / / [ 0 ] : Prefix <nl> + / / [ kPrefixSize + 0 ] : bucket count <nl> + / / [ kPrefixSize + 1 ] : Next newer table <nl> + / / [ kPrefixSize + 2 ] : Number of removed holes or - 1 when the table was <nl> + / / cleared . <nl> + / / [ kPrefixSize + 3 . . ( 3 + NumberOfRemovedHoles ( ) - 1 ) ] : The indexes <nl> + / / of the removed holes . <nl> + / / [ kPrefixSize + 3 + NumberOfRemovedHoles ( ) . . length ] : Not used <nl> template < class Derived , int entrysize > <nl> class OrderedHashTable : public FixedArray { <nl> public : <nl> class OrderedHashTable : public FixedArray { <nl> int FindEntry ( Isolate * isolate , Object * key ) ; <nl> <nl> int NumberOfElements ( ) const { <nl> - return Smi : : ToInt ( get ( kNumberOfElementsIndex ) ) ; <nl> + return Smi : : ToInt ( get ( NumberOfElementsIndex ( ) ) ) ; <nl> } <nl> <nl> int NumberOfDeletedElements ( ) const { <nl> - return Smi : : ToInt ( get ( kNumberOfDeletedElementsIndex ) ) ; <nl> + return Smi : : ToInt ( get ( NumberOfDeletedElementsIndex ( ) ) ) ; <nl> } <nl> <nl> / / Returns the number of contiguous entries in the data table , starting at 0 , <nl> class OrderedHashTable : public FixedArray { <nl> return NumberOfElements ( ) + NumberOfDeletedElements ( ) ; <nl> } <nl> <nl> - int NumberOfBuckets ( ) const { return Smi : : ToInt ( get ( kNumberOfBucketsIndex ) ) ; } <nl> + int NumberOfBuckets ( ) const { <nl> + return Smi : : ToInt ( get ( NumberOfBucketsIndex ( ) ) ) ; <nl> + } <nl> <nl> / / Returns an index into | this | for the given entry . <nl> int EntryToIndex ( int entry ) { <nl> - return kHashTableStartIndex + NumberOfBuckets ( ) + ( entry * kEntrySize ) ; <nl> + return HashTableStartIndex ( ) + NumberOfBuckets ( ) + ( entry * kEntrySize ) ; <nl> } <nl> <nl> int HashToBucket ( int hash ) { return hash & ( NumberOfBuckets ( ) - 1 ) ; } <nl> <nl> int HashToEntry ( int hash ) { <nl> int bucket = HashToBucket ( hash ) ; <nl> - Object * entry = this - > get ( kHashTableStartIndex + bucket ) ; <nl> + Object * entry = this - > get ( HashTableStartIndex ( ) + bucket ) ; <nl> return Smi : : ToInt ( entry ) ; <nl> } <nl> <nl> class OrderedHashTable : public FixedArray { <nl> return get ( EntryToIndex ( entry ) ) ; <nl> } <nl> <nl> - bool IsObsolete ( ) { return ! get ( kNextTableIndex ) - > IsSmi ( ) ; } <nl> + bool IsObsolete ( ) { return ! get ( NextTableIndex ( ) ) - > IsSmi ( ) ; } <nl> <nl> / / The next newer table . This is only valid if the table is obsolete . <nl> - Derived NextTable ( ) { return Derived : : cast ( get ( kNextTableIndex ) ) ; } <nl> + Derived NextTable ( ) { return Derived : : cast ( get ( NextTableIndex ( ) ) ) ; } <nl> <nl> / / When the table is obsolete we store the indexes of the removed holes . <nl> int RemovedIndexAt ( int index ) { <nl> - return Smi : : ToInt ( get ( kRemovedHolesIndex + index ) ) ; <nl> + return Smi : : ToInt ( get ( RemovedHolesIndex ( ) + index ) ) ; <nl> } <nl> <nl> static const int kEntrySize = entrysize + 1 ; <nl> class OrderedHashTable : public FixedArray { <nl> static const int kNotFound = - 1 ; <nl> static const int kMinCapacity = 4 ; <nl> <nl> - static const int kNumberOfElementsIndex = 0 ; <nl> + static constexpr int PrefixIndex ( ) { return 0 ; } <nl> + <nl> + static constexpr int NumberOfElementsIndex ( ) { return Derived : : kPrefixSize ; } <nl> + <nl> / / The next table is stored at the same index as the nof elements . <nl> - static const int kNextTableIndex = kNumberOfElementsIndex ; <nl> - static const int kNumberOfDeletedElementsIndex = kNumberOfElementsIndex + 1 ; <nl> - static const int kNumberOfBucketsIndex = kNumberOfDeletedElementsIndex + 1 ; <nl> - static const int kHashTableStartIndex = kNumberOfBucketsIndex + 1 ; <nl> - static const int kRemovedHolesIndex = kHashTableStartIndex ; <nl> - <nl> - static constexpr const int kNumberOfElementsOffset = <nl> - FixedArray : : OffsetOfElementAt ( kNumberOfElementsIndex ) ; <nl> - static constexpr const int kNextTableOffset = <nl> - FixedArray : : OffsetOfElementAt ( kNextTableIndex ) ; <nl> - static constexpr const int kNumberOfDeletedElementsOffset = <nl> - FixedArray : : OffsetOfElementAt ( kNumberOfDeletedElementsIndex ) ; <nl> - static constexpr const int kNumberOfBucketsOffset = <nl> - FixedArray : : OffsetOfElementAt ( kNumberOfBucketsIndex ) ; <nl> - static constexpr const int kHashTableStartOffset = <nl> - FixedArray : : OffsetOfElementAt ( kHashTableStartIndex ) ; <nl> + static constexpr int NextTableIndex ( ) { return NumberOfElementsIndex ( ) ; } <nl> + <nl> + static constexpr int NumberOfDeletedElementsIndex ( ) { <nl> + return NumberOfElementsIndex ( ) + 1 ; <nl> + } <nl> + <nl> + static constexpr int NumberOfBucketsIndex ( ) { <nl> + return NumberOfDeletedElementsIndex ( ) + 1 ; <nl> + } <nl> + <nl> + static constexpr int HashTableStartIndex ( ) { <nl> + return NumberOfBucketsIndex ( ) + 1 ; <nl> + } <nl> + <nl> + static constexpr int RemovedHolesIndex ( ) { return HashTableStartIndex ( ) ; } <nl> + <nl> + static constexpr int NumberOfElementsOffset ( ) { <nl> + return FixedArray : : OffsetOfElementAt ( NumberOfElementsIndex ( ) ) ; <nl> + } <nl> + <nl> + static constexpr int NextTableOffset ( ) { <nl> + return FixedArray : : OffsetOfElementAt ( NextTableIndex ( ) ) ; <nl> + } <nl> + <nl> + static constexpr int NumberOfDeletedElementsOffset ( ) { <nl> + return FixedArray : : OffsetOfElementAt ( NumberOfDeletedElementsIndex ( ) ) ; <nl> + } <nl> + <nl> + static constexpr int NumberOfBucketsOffset ( ) { <nl> + return FixedArray : : OffsetOfElementAt ( NumberOfBucketsIndex ( ) ) ; <nl> + } <nl> + <nl> + static constexpr int HashTableStartOffset ( ) { <nl> + return FixedArray : : OffsetOfElementAt ( HashTableStartIndex ( ) ) ; <nl> + } <nl> <nl> static const int kLoadFactor = 2 ; <nl> <nl> class OrderedHashTable : public FixedArray { <nl> / / the table is cleared , which allows iterator transitions to <nl> / / optimize that case . <nl> static const int kClearedTableSentinel = - 1 ; <nl> - static const int kMaxCapacity = <nl> - ( FixedArray : : kMaxLength - kHashTableStartIndex ) / <nl> - ( 1 + ( kEntrySize * kLoadFactor ) ) ; <nl> + static constexpr int MaxCapacity ( ) { <nl> + return ( FixedArray : : kMaxLength - HashTableStartIndex ( ) ) / <nl> + ( 1 + ( kEntrySize * kLoadFactor ) ) ; <nl> + } <nl> <nl> protected : <nl> static Handle < Derived > Rehash ( Isolate * isolate , Handle < Derived > table , <nl> int new_capacity ) ; <nl> <nl> void SetNumberOfBuckets ( int num ) { <nl> - set ( kNumberOfBucketsIndex , Smi : : FromInt ( num ) ) ; <nl> + set ( NumberOfBucketsIndex ( ) , Smi : : FromInt ( num ) ) ; <nl> } <nl> <nl> void SetNumberOfElements ( int num ) { <nl> - set ( kNumberOfElementsIndex , Smi : : FromInt ( num ) ) ; <nl> + set ( NumberOfElementsIndex ( ) , Smi : : FromInt ( num ) ) ; <nl> } <nl> <nl> void SetNumberOfDeletedElements ( int num ) { <nl> - set ( kNumberOfDeletedElementsIndex , Smi : : FromInt ( num ) ) ; <nl> + set ( NumberOfDeletedElementsIndex ( ) , Smi : : FromInt ( num ) ) ; <nl> } <nl> <nl> / / Returns the number elements that can fit into the allocated buffer . <nl> int Capacity ( ) { return NumberOfBuckets ( ) * kLoadFactor ; } <nl> <nl> - void SetNextTable ( Derived next_table ) { set ( kNextTableIndex , next_table ) ; } <nl> + void SetNextTable ( Derived next_table ) { set ( NextTableIndex ( ) , next_table ) ; } <nl> <nl> void SetRemovedIndexAt ( int index , int removed_index ) { <nl> - return set ( kRemovedHolesIndex + index , Smi : : FromInt ( removed_index ) ) ; <nl> + return set ( RemovedHolesIndex ( ) + index , Smi : : FromInt ( removed_index ) ) ; <nl> } <nl> <nl> OBJECT_CONSTRUCTORS ( OrderedHashTable , FixedArray ) <nl> class OrderedHashSet : public OrderedHashTable < OrderedHashSet , 1 > { <nl> static HeapObject * GetEmpty ( ReadOnlyRoots ro_roots ) ; <nl> static inline RootIndex GetMapRootIndex ( ) ; <nl> static inline bool Is ( Handle < HeapObject > table ) ; <nl> + static const int kPrefixSize = 0 ; <nl> <nl> OBJECT_CONSTRUCTORS ( OrderedHashSet , OrderedHashTable < OrderedHashSet , 1 > ) <nl> } ; <nl> class OrderedHashMap : public OrderedHashTable < OrderedHashMap , 2 > { <nl> static inline bool Is ( Handle < HeapObject > table ) ; <nl> <nl> static const int kValueOffset = 1 ; <nl> + static const int kPrefixSize = 0 ; <nl> <nl> OBJECT_CONSTRUCTORS ( OrderedHashMap , OrderedHashTable < OrderedHashMap , 2 > ) <nl> } ; <nl> class OrderedHashMap : public OrderedHashTable < OrderedHashMap , 2 > { <nl> / / that the DataTable entries start aligned . A bucket or chain value <nl> / / of 255 is used to denote an unknown entry . <nl> / / <nl> - / / Memory layout : [ Header ] [ Padding ] [ DataTable ] [ HashTable ] [ Chains ] <nl> + / / The prefix size is calculated as the kPrefixSize * kPointerSize . <nl> + / / <nl> + / / Memory layout : [ Prefix ] [ Header ] [ Padding ] [ DataTable ] [ HashTable ] <nl> + / / [ Chains ] <nl> / / <nl> / / The index are represented as bytes , on a 64 bit machine with <nl> / / kEntrySize = 1 , capacity = 4 and entries = 2 : <nl> / / <nl> + / / [ 0 ] : Prefix <nl> + / / <nl> + / / Note : For the sake of brevity , the following start with index 0 <nl> + / / but , they actually start from kPrefixSize * kPointerSize to <nl> + / / account for the the prefix . <nl> + / / <nl> / / [ Header ] : <nl> / / [ 0 ] : Number of elements <nl> / / [ 1 ] : Number of deleted elements <nl> class SmallOrderedHashTable : public HeapObjectPtr { <nl> int data_table_size = DataTableSizeFor ( capacity ) ; <nl> int hash_table_size = capacity / kLoadFactor ; <nl> int chain_table_size = capacity ; <nl> - int total_size = kDataTableStartOffset + data_table_size + hash_table_size + <nl> - chain_table_size ; <nl> + int total_size = DataTableStartOffset ( ) + data_table_size + <nl> + hash_table_size + chain_table_size ; <nl> <nl> return RoundUp ( total_size , kPointerSize ) ; <nl> } <nl> class SmallOrderedHashTable : public HeapObjectPtr { <nl> <nl> / / Returns the number elements that are present in the table . <nl> int NumberOfElements ( ) const { <nl> - int nof_elements = getByte ( kNumberOfElementsOffset , 0 ) ; <nl> + int nof_elements = getByte ( NumberOfElementsOffset ( ) , 0 ) ; <nl> DCHECK_LE ( nof_elements , Capacity ( ) ) ; <nl> <nl> return nof_elements ; <nl> } <nl> <nl> int NumberOfDeletedElements ( ) const { <nl> - int nof_deleted_elements = getByte ( kNumberOfDeletedElementsOffset , 0 ) ; <nl> + int nof_deleted_elements = getByte ( NumberOfDeletedElementsOffset ( ) , 0 ) ; <nl> DCHECK_LE ( nof_deleted_elements , Capacity ( ) ) ; <nl> <nl> return nof_deleted_elements ; <nl> } <nl> <nl> - int NumberOfBuckets ( ) const { return getByte ( kNumberOfBucketsOffset , 0 ) ; } <nl> + int NumberOfBuckets ( ) const { return getByte ( NumberOfBucketsOffset ( ) , 0 ) ; } <nl> <nl> DECL_VERIFIER ( SmallOrderedHashTable ) <nl> <nl> class SmallOrderedHashTable : public HeapObjectPtr { <nl> Offset GetBucketsStartOffset ( ) const { <nl> int capacity = Capacity ( ) ; <nl> int data_table_size = DataTableSizeFor ( capacity ) ; <nl> - return kDataTableStartOffset + data_table_size ; <nl> + return DataTableStartOffset ( ) + data_table_size ; <nl> } <nl> <nl> Address GetHashTableStartAddress ( int capacity ) const { <nl> - return FIELD_ADDR ( this , kDataTableStartOffset + DataTableSizeFor ( capacity ) ) ; <nl> + return FIELD_ADDR ( this , <nl> + DataTableStartOffset ( ) + DataTableSizeFor ( capacity ) ) ; <nl> } <nl> <nl> void SetFirstEntry ( int bucket , byte value ) { <nl> class SmallOrderedHashTable : public HeapObjectPtr { <nl> <nl> int data_table_size = DataTableSizeFor ( capacity ) ; <nl> int hash_table_size = nof_buckets ; <nl> - return kDataTableStartOffset + data_table_size + hash_table_size ; <nl> + return DataTableStartOffset ( ) + data_table_size + hash_table_size ; <nl> } <nl> <nl> void SetNextEntry ( int entry , int next_entry ) { <nl> class SmallOrderedHashTable : public HeapObjectPtr { <nl> return entry ; <nl> } <nl> <nl> - void SetNumberOfBuckets ( int num ) { setByte ( kNumberOfBucketsOffset , 0 , num ) ; } <nl> + void SetNumberOfBuckets ( int num ) { setByte ( NumberOfBucketsOffset ( ) , 0 , num ) ; } <nl> <nl> void SetNumberOfElements ( int num ) { <nl> DCHECK_LE ( static_cast < unsigned > ( num ) , Capacity ( ) ) ; <nl> - setByte ( kNumberOfElementsOffset , 0 , num ) ; <nl> + setByte ( NumberOfElementsOffset ( ) , 0 , num ) ; <nl> } <nl> <nl> void SetNumberOfDeletedElements ( int num ) { <nl> DCHECK_LE ( static_cast < unsigned > ( num ) , Capacity ( ) ) ; <nl> - setByte ( kNumberOfDeletedElementsOffset , 0 , num ) ; <nl> + setByte ( NumberOfDeletedElementsOffset ( ) , 0 , num ) ; <nl> } <nl> <nl> - static const Offset kNumberOfElementsOffset = kHeaderSize ; <nl> - static const Offset kNumberOfDeletedElementsOffset = <nl> - kNumberOfElementsOffset + kOneByteSize ; <nl> - static const Offset kNumberOfBucketsOffset = <nl> - kNumberOfDeletedElementsOffset + kOneByteSize ; <nl> - static const constexpr Offset kDataTableStartOffset = <nl> - RoundUp < kPointerSize > ( kNumberOfBucketsOffset ) ; <nl> + static constexpr Offset PrefixOffset ( ) { return kHeaderSize ; } <nl> + <nl> + static constexpr Offset NumberOfElementsOffset ( ) { <nl> + return PrefixOffset ( ) + ( Derived : : kPrefixSize * kPointerSize ) ; <nl> + } <nl> + <nl> + static constexpr Offset NumberOfDeletedElementsOffset ( ) { <nl> + return NumberOfElementsOffset ( ) + kOneByteSize ; <nl> + } <nl> + <nl> + static constexpr Offset NumberOfBucketsOffset ( ) { <nl> + return NumberOfDeletedElementsOffset ( ) + kOneByteSize ; <nl> + } <nl> + <nl> + static constexpr Offset DataTableStartOffset ( ) { <nl> + return RoundUp < kPointerSize > ( NumberOfBucketsOffset ( ) ) ; <nl> + } <nl> <nl> static constexpr int DataTableSizeFor ( int capacity ) { <nl> return capacity * Derived : : kEntrySize * kPointerSize ; <nl> class SmallOrderedHashTable : public HeapObjectPtr { <nl> / / This is used for accessing the non | DataTable | part of the <nl> / / structure . <nl> byte getByte ( Offset offset , ByteIndex index ) const { <nl> - DCHECK ( offset < kDataTableStartOffset | | offset > = GetBucketsStartOffset ( ) ) ; <nl> + DCHECK ( offset < DataTableStartOffset ( ) | | <nl> + offset > = GetBucketsStartOffset ( ) ) ; <nl> return READ_BYTE_FIELD ( this , offset + ( index * kOneByteSize ) ) ; <nl> } <nl> <nl> void setByte ( Offset offset , ByteIndex index , byte value ) { <nl> - DCHECK ( offset < kDataTableStartOffset | | offset > = GetBucketsStartOffset ( ) ) ; <nl> + DCHECK ( offset < DataTableStartOffset ( ) | | <nl> + offset > = GetBucketsStartOffset ( ) ) ; <nl> WRITE_BYTE_FIELD ( this , offset + ( index * kOneByteSize ) , value ) ; <nl> } <nl> <nl> class SmallOrderedHashTable : public HeapObjectPtr { <nl> DCHECK_LT ( entry , Capacity ( ) ) ; <nl> int offset_in_datatable = entry * Derived : : kEntrySize * kPointerSize ; <nl> int offset_in_entry = relative_index * kPointerSize ; <nl> - return kDataTableStartOffset + offset_in_datatable + offset_in_entry ; <nl> + return DataTableStartOffset ( ) + offset_in_datatable + offset_in_entry ; <nl> } <nl> <nl> int UsedCapacity ( ) const { <nl> class SmallOrderedHashSet : public SmallOrderedHashTable < SmallOrderedHashSet > { <nl> <nl> static const int kKeyIndex = 0 ; <nl> static const int kEntrySize = 1 ; <nl> + static const int kPrefixSize = 0 ; <nl> <nl> / / Adds | value | to | table | , if the capacity isn ' t enough , a new <nl> / / table is created . The original | table | is returned if there is <nl> class SmallOrderedHashMap : public SmallOrderedHashTable < SmallOrderedHashMap > { <nl> static const int kKeyIndex = 0 ; <nl> static const int kValueIndex = 1 ; <nl> static const int kEntrySize = 2 ; <nl> + static const int kPrefixSize = 0 ; <nl> <nl> / / Adds | value | to | table | , if the capacity isn ' t enough , a new <nl> / / table is created . The original | table | is returned if there is <nl> class OrderedNameDictionary <nl> <nl> static const int kValueOffset = 1 ; <nl> static const int kPropertyDetailsOffset = 2 ; <nl> + static const int kPrefixSize = 1 ; <nl> <nl> OBJECT_CONSTRUCTORS ( OrderedNameDictionary , <nl> OrderedHashTable < OrderedNameDictionary , 3 > ) <nl> class SmallOrderedNameDictionary <nl> static const int kValueIndex = 1 ; <nl> static const int kPropertyDetailsIndex = 2 ; <nl> static const int kEntrySize = 3 ; <nl> + static const int kPrefixSize = 1 ; <nl> <nl> / / Adds | value | to | table | , if the capacity isn ' t enough , a new <nl> / / table is created . The original | table | is returned if there is <nl>
|
[ dict ] Prefix a slot in ordered dicts
|
v8/v8
|
fbc82ec3cc39a4fb547a6a001d81536c98aab085
|
2018-12-06T00:14:45Z
|
mmm a / tensorflow / lite / c / c_api_internal . c <nl> ppp b / tensorflow / lite / c / c_api_internal . c <nl> TfLiteIntArray * TfLiteIntArrayCopy ( const TfLiteIntArray * src ) { <nl> <nl> void TfLiteIntArrayFree ( TfLiteIntArray * a ) { free ( a ) ; } <nl> <nl> + # endif / / TF_LITE_STATIC_MEMORY <nl> + <nl> int TfLiteFloatArrayGetSizeInBytes ( int size ) { <nl> static TfLiteFloatArray dummy ; <nl> return sizeof ( dummy ) + sizeof ( dummy . data [ 0 ] ) * size ; <nl> } <nl> <nl> + # ifndef TF_LITE_STATIC_MEMORY <nl> + <nl> TfLiteFloatArray * TfLiteFloatArrayCreate ( int size ) { <nl> TfLiteFloatArray * ret = <nl> ( TfLiteFloatArray * ) malloc ( TfLiteFloatArrayGetSizeInBytes ( size ) ) ; <nl>
|
Define TfLiteFloatArrayGetSizeInBytes even when TF_LITE_STATIC_MEMORY is defined .
|
tensorflow/tensorflow
|
7bde126aabbf84b50f83e89ae85a8db821b18438
|
2019-10-24T16:18:32Z
|
mmm a / docs / quickstart / apollo_software_installation_guide . md <nl> ppp b / docs / quickstart / apollo_software_installation_guide . md <nl> The Docker container is the simplest way to set up the build environment for Apo <nl> <nl> For more information , see the detailed Docker tutorial [ here ] ( https : / / docs . docker . com / ) . <nl> <nl> - 1 . Please follow the <nl> + 1 . If you are working on Ubuntu 16 . 04 + , the easiest way is to leverage the <nl> + modern snap package manager which is available out of the box : <nl> + <nl> + ` ` ` bash <nl> + sudo snap install docker <nl> + ` ` ` <nl> + <nl> + Otherwise , please follow the <nl> [ official guide to install the docker - ce ] ( https : / / docs . docker . com / install / linux / docker - ce / ubuntu ) . <nl> <nl> Don ' t forget the <nl>
|
Docs : Install docker easily with snap .
|
ApolloAuto/apollo
|
dc1b1000f59d35fc29f4cc6120a33fdae5db9d9f
|
2018-08-07T21:18:13Z
|
mmm a / drivers / gles2 / rasterizer_scene_gles2 . cpp <nl> ppp b / drivers / gles2 / rasterizer_scene_gles2 . cpp <nl> void RasterizerSceneGLES2 : : _setup_light_type ( LightInstance * p_light , ShadowAtlas <nl> } <nl> } <nl> <nl> - void RasterizerSceneGLES2 : : _setup_light ( LightInstance * light , ShadowAtlas * shadow_atlas , const Transform & p_view_transform ) { <nl> + void RasterizerSceneGLES2 : : _setup_light ( LightInstance * light , ShadowAtlas * shadow_atlas , const Transform & p_view_transform , bool accum_pass ) { <nl> <nl> RasterizerStorageGLES2 : : Light * light_ptr = light - > light_ptr ; <nl> <nl> / / common parameters <nl> float energy = light_ptr - > param [ VS : : LIGHT_PARAM_ENERGY ] ; <nl> float specular = light_ptr - > param [ VS : : LIGHT_PARAM_SPECULAR ] ; <nl> - float sign = light_ptr - > negative ? - 1 : 1 ; <nl> + float sign = ( light_ptr - > negative & & ! accum_pass ) ? - 1 : 1 ; / / inverse color for base pass lights only <nl> <nl> state . scene_shader . set_uniform ( SceneShaderGLES2 : : LIGHT_SPECULAR , specular ) ; <nl> Color color = light_ptr - > color * sign * energy * Math_PI ; <nl> void RasterizerSceneGLES2 : : _render_render_list ( RenderList : : Element * * p_elements , <nl> <nl> if ( accum_pass ) { / / accum pass force pass <nl> blend_mode = RasterizerStorageGLES2 : : Shader : : Spatial : : BLEND_MODE_ADD ; <nl> + if ( rebind_light & & light & & light - > light_ptr - > negative ) { <nl> + glBlendEquation ( GL_FUNC_REVERSE_SUBTRACT ) ; <nl> + glBlendFunc ( GL_SRC_ALPHA , GL_ONE ) ; <nl> + blend_mode = RasterizerStorageGLES2 : : Shader : : Spatial : : BLEND_MODE_SUB ; <nl> + } <nl> } <nl> <nl> if ( prev_blend_mode ! = blend_mode ) { <nl> void RasterizerSceneGLES2 : : _render_render_list ( RenderList : : Element * * p_elements , <nl> } <nl> <nl> if ( rebind_light & & light ) { <nl> - _setup_light ( light , shadow_atlas , p_view_transform ) ; <nl> + _setup_light ( light , shadow_atlas , p_view_transform , accum_pass ) ; <nl> } <nl> <nl> if ( rebind_reflection & & ( refprobe_1 | | refprobe_2 ) ) { <nl> mmm a / drivers / gles2 / rasterizer_scene_gles2 . h <nl> ppp b / drivers / gles2 / rasterizer_scene_gles2 . h <nl> class RasterizerSceneGLES2 : public RasterizerScene { <nl> _FORCE_INLINE_ bool _setup_material ( RasterizerStorageGLES2 : : Material * p_material , bool p_alpha_pass , Size2i p_skeleton_tex_size = Size2i ( 0 , 0 ) ) ; <nl> _FORCE_INLINE_ void _setup_geometry ( RenderList : : Element * p_element , RasterizerStorageGLES2 : : Skeleton * p_skeleton ) ; <nl> _FORCE_INLINE_ void _setup_light_type ( LightInstance * p_light , ShadowAtlas * shadow_atlas ) ; <nl> - _FORCE_INLINE_ void _setup_light ( LightInstance * p_light , ShadowAtlas * shadow_atlas , const Transform & p_view_transform ) ; <nl> + _FORCE_INLINE_ void _setup_light ( LightInstance * p_light , ShadowAtlas * shadow_atlas , const Transform & p_view_transform , bool accum_pass ) ; <nl> _FORCE_INLINE_ void _setup_refprobes ( ReflectionProbeInstance * p_refprobe1 , ReflectionProbeInstance * p_refprobe2 , const Transform & p_view_transform , Environment * p_env ) ; <nl> _FORCE_INLINE_ void _render_geometry ( RenderList : : Element * p_element ) ; <nl> <nl>
|
allow omnilights and spotlights to use negative in GLES2
|
godotengine/godot
|
96c30048558d1954288b7b69f7a63400012e3d4f
|
2019-07-31T06:44:22Z
|
mmm a / src / mongo / util / string_map . h <nl> ppp b / src / mongo / util / string_map . h <nl> struct StringMapDefaultConvertorOther { <nl> } ; <nl> <nl> template < typename V > <nl> - class StringMap : public UnorderedFastKeyTable < StringData , / / K_L <nl> - std : : string , / / K_S <nl> - V , / / V <nl> - StringMapDefaultHash , <nl> - StringMapDefaultEqual , <nl> - StringMapDefaultConvertor , <nl> - StringMapDefaultConvertorOther > { } ; <nl> - } <nl> + using StringMap = UnorderedFastKeyTable < StringData , / / K_L <nl> + std : : string , / / K_S <nl> + V , <nl> + StringMapDefaultHash , <nl> + StringMapDefaultEqual , <nl> + StringMapDefaultConvertor , <nl> + StringMapDefaultConvertorOther > ; <nl> + } / / namespace mongo <nl> mmm a / src / mongo / util / string_map_test . cpp <nl> ppp b / src / mongo / util / string_map_test . cpp <nl> TEST ( StringMapTest , Assign ) { <nl> y = m ; <nl> ASSERT_EQUALS ( 5 , y [ " eliot " ] ) ; <nl> } <nl> + <nl> + TEST ( StringMapTest , InitWithInitializerList ) { <nl> + StringMap < int > smap { <nl> + { " q " , 1 } , { " coollog " , 2 } , { " mango " , 3 } , { " mango " , 4 } , <nl> + } ; <nl> + <nl> + ASSERT_EQ ( 1 , smap [ " q " ] ) ; <nl> + ASSERT_EQ ( 2 , smap [ " coollog " ] ) ; <nl> + ASSERT_EQ ( 3 , smap [ " mango " ] ) ; <nl> + } <nl> } <nl> mmm a / src / mongo / util / unordered_fast_key_table . h <nl> ppp b / src / mongo / util / unordered_fast_key_table . h <nl> class UnorderedFastKeyTable { <nl> <nl> UnorderedFastKeyTable ( const UnorderedFastKeyTable & other ) ; <nl> <nl> + UnorderedFastKeyTable ( std : : initializer_list < std : : pair < key_type , mapped_type > > entries ) ; <nl> + <nl> UnorderedFastKeyTable & operator = ( const UnorderedFastKeyTable & other ) { <nl> other . copyTo ( this ) ; <nl> return * this ; <nl> mmm a / src / mongo / util / unordered_fast_key_table_internal . h <nl> ppp b / src / mongo / util / unordered_fast_key_table_internal . h <nl> inline UnorderedFastKeyTable < K_L , K_S , V , H , E , C , C_LS > : : UnorderedFastKeyTable ( <nl> _convertor ( other . _convertor ) , <nl> _convertorOther ( other . _convertorOther ) { } <nl> <nl> + template < typename K_L , typename K_S , typename V , typename H , typename E , typename C , typename C_LS > <nl> + inline UnorderedFastKeyTable < K_L , K_S , V , H , E , C , C_LS > : : UnorderedFastKeyTable ( <nl> + std : : initializer_list < std : : pair < key_type , mapped_type > > entries ) <nl> + : UnorderedFastKeyTable < K_L , K_S , V , H , E , C , C_LS > ( ) { <nl> + for ( auto & & entry : entries ) { <nl> + / / Only insert the entry if the key is not equivalent to the key of any other element <nl> + / / already in the table . <nl> + if ( find ( entry . first ) = = end ( ) ) { <nl> + get ( entry . first ) = entry . second ; <nl> + } <nl> + } <nl> + } <nl> + <nl> template < typename K_L , typename K_S , typename V , typename H , typename E , typename C , typename C_LS > <nl> inline void UnorderedFastKeyTable < K_L , K_S , V , H , E , C , C_LS > : : copyTo ( <nl> UnorderedFastKeyTable * out ) const { <nl>
|
SERVER - 19450 UnorderedFastKeyTable / StringMap construct with std : : initializer_list
|
mongodb/mongo
|
84921ca797830b4adaedae01a4357d2bfccfb0a6
|
2015-07-23T14:43:46Z
|
mmm a / lib / AST / GenericSignatureBuilder . cpp <nl> ppp b / lib / AST / GenericSignatureBuilder . cpp <nl> namespace { <nl> BaseIterator base ; <nl> BaseIterator baseEnd ; <nl> <nl> - void advance ( ) { <nl> - + + base ; <nl> - } <nl> - <nl> public : <nl> using difference_type = ptrdiff_t ; <nl> using value_type = EquivalenceClassVizNode ; <nl> namespace { <nl> EquivalenceClassVizIterator ( EquivalenceClassVizNode node , <nl> BaseIterator base , BaseIterator baseEnd ) <nl> : node ( node ) , base ( base ) , baseEnd ( baseEnd ) { <nl> - advance ( ) ; <nl> } <nl> <nl> BaseIterator & getBase ( ) { return base ; } <nl> namespace { <nl> <nl> EquivalenceClassVizIterator & operator + + ( ) { <nl> + + getBase ( ) ; <nl> - advance ( ) ; <nl> return * this ; <nl> } <nl> <nl>
|
[ GSB ] Fix GraphViz printing of equivalence classes .
|
apple/swift
|
20ffe48425100320aeb15c190e44faaacb3f0337
|
2018-02-16T19:16:22Z
|
mmm a / PowerEditor / src / langs . model . xml <nl> ppp b / PowerEditor / src / langs . model . xml <nl> <nl> < Language name = " normal " ext = " txt " / > <nl> < Language name = " actionscript " ext = " as mx " commentLine = " / / " commentStart = " / * " commentEnd = " * / " > <nl> < Keywords name = " instre1 " > add for lt tellTarget and function ne this break ge new typeof continue gt not var delete if on void do ifFrameLoaded onClipEvent while else in or with eq le return instanceof case default switch < / Keywords > <nl> - < Keywords name = " type1 " > arguments constructor class dynamic false extends implements import interface intrinsic newline null private public super static true undefined Accessibility Arguments Array Boolean Button Camera ContextMenu ContextMenuItem CustomActions Color Date Error Function Key LoadVars LocalConnection Math Microphone Mouse MovieClip MovieClipLoader NetConnection NetStream Number PrintJob Object TextField StyleSheet TextFormat TextSnapshot SharedObject Selection Sound Stage String System XML XMLNode XMLSocket Void abs acos asin atan atan2 ceil cos exp floor log max min pow random round sin sqrt tan onActivity onChanged onClose onConnect onData onDragOut onDragOver onEnterFrame onID3 onKeyDown onKeyUp onKillFocus onLoad onLoadComplete onLoadError onLoadInit onLoadProgress onLoadStart onMouseDown onMouseMove onMouseUp onMouseWheel onPress onRelease onReleaseOutside onResize onRollOut onRollOver onScroller onSelect onSetFocus onSoundComplete onStatus onUnload onUpdate onXML addListener addPage addProperty addRequestHeader allowDomain allowInsecureDomain appendChild apply applyChanges asfunction attachAudio attachMovie attachSound attachVideo beginFill beginGradientFill call ceil charAt charCodeAt clear clearInterval cloneNode close concat connect copy cos createElement createEmptyMovieClip createTextField createTextNode curveTo domain duplicateMovieClip endFill escape eval evaluate exp findText floor fscommand flush fromCharCode get getAscii getBeginIndex getBounds getBytesLoaded getBytesTotal getCaretIndex getCode getCount getDate getDay getDepth getEndIndex getFocus getFontList getFullYear getHours getInstanceAtDepth getLocal getMilliseconds getMinutes getMonth getNewTextFormat getNextHighestDepth getPan getProggress getProperty getRGB getSeconds getSelected getSelectedText getSize getStyle getStyleNames getSWFVersion getText getTextExtent getTextFormat getTextSnapshot getTime getTimer getTimezoneOffset getTransform getURL getUTCDate getUTCDay getUTCFullYear getUTCHours getUTCMilliseconds getUTCMinutes getUTCMonth getUTCSeconds getVersion getVolume getYear globalToLocal gotoAndPlay gotoAndStop hasChildNodes hide hideBuiltInItems hitTest hitTestTextNearPos indexOf insertBefore install isActive isDown isToggled join lastIndexOf lineStyle lineTo list load loadClip loadMovie loadMovieNum loadSound loadVariables loadVariablesNum localToGlobal log mbchr mblength mbord mbsubstring min MMExecute moveTo nextFrame nextScene parseCSS parseFloat parseInt parseXML pause play pop pow prevScene print printAsBitmap printAsBitmapNum printNum push random registerClass removeListener removeMovieClip removeNode removeTextField replaceSel replaceText reverse round seek send sendAndLoad setBufferTime set setDate setFocus setFullYear setGain setHours setInterval setMask setMilliseconds setMinutes setMode setMonth setMotionLevel setNewTextFormat setPan setProperty setQuality setRate setRGB setSeconds setSelectColor setSelected setSelection setSilenceLevel setStyle setTextFormat setTime setTransform setUseEchoSuppression setUTCDate setUTCFullYear setUTCHours setUTCMilliseconds setUTCMinutes setUTCMonth setUTCSeconds setVolume setYear shift show showSettings silenceLevel silenceTimeout sin slice sort sortOn splice split sqrt start startDrag stop stopAllSounds stopDrag substr substring swapDepths tan toggleHighQuality toLowerCase toString toUpperCase trace unescape uninstall unLoadClip unloadMovie unloadMovieNum unshift unwatch updateAfterEvent updateProperties useEchoSuppression valueOf watch endinitclip include initclip __proto__ _accProps _alpha _currentframe _droptarget _focusrect _framesloaded _global _height _highquality _level _lockroot _name _parent _quality _root _rotation _soundbuftime _target _totalframes _url _visible _width _x _xmouse _xscale _y _ymouse _yscale activityLevel align allowDomain allowInsecureDomain attributes autoSize avHardwareDisable background backgroundColor bandwidth blockIndent bold border borderColor bottomScroll bufferLenght bufferTime builtInItems bullet bytesLoaded bytesTotal callee caller capabilities caption childNodes color condenseWhite contentType currentFps customItems data deblocking docTypeDecl duration embedFonts enabled exactSettings firstChild focusEnabled font fps gain globalStyleFormat hasAccessibility hasAudio hasAudioEncoder hasEmbeddedVideo hasMP3 hasPrinting hasScreenBroadcast hasScreenPlayback hasStreamingAudio hasStreamingVideo hasVideoEncoder height hitArea hscroll html htmlText indent index italic instanceof int ignoreWhite isDebugger isDown isFinite italic language lastChild leading leftMargin length loaded localFileReadDisable manufacturer maxChars maxhscroll maxscroll menu message motionLevel motionTimeout mouseWheelEnabled multiline muted name names NaN nextSibling nodeName nodeType nodeValue os parentNode password pixelAspectRatio playerType previousSibling prototype quality rate restrict resolutionX resolutionY rightMargin scaleMode screenColor screenDPI screenResolutionX screenResolutionY scroll selectable separatorBefore showMenu size smoothing status styleSheet tabChildren tabEnabled tabIndex tabStops target targetPath text textColor textHeight textWidth time trackAsMenu type underline url useCodepage useEchoSuppression useHandCursor variable version visible width wordWrap xmlDecl < / Keywords > <nl> + < Keywords name = " type1 " > arguments constructor class dynamic false extends implements import interface intrinsic newline null private public super static true undefined Accessibility Arguments Array Boolean Button Camera ContextMenu ContextMenuItem CustomActions Color Date Error Function Key LoadVars LocalConnection Math Microphone Mouse MovieClip MovieClipLoader NetConnection NetStream Number PrintJob Object TextField StyleSheet TextFormat TextSnapshot SharedObject Selection Sound Stage String System XML XMLNode XMLSocket Void abs acos asin atan atan2 ceil cos exp floor log max min pow random round sin sqrt tan onActivity onChanged onClose onConnect onData onDragOut onDragOver onEnterFrame onID3 onKeyDown onKeyUp onKillFocus onLoad onLoadComplete onLoadError onLoadInit onLoadProgress onLoadStart onMouseDown onMouseMove onMouseUp onMouseWheel onPress onRelease onReleaseOutside onResize onRollOut onRollOver onScroller onSelect onSetFocus onSoundComplete onStatus onUnload onUpdate onXML addListener addPage addProperty addRequestHeader allowDomain allowInsecureDomain appendChild apply applyChanges asfunction attachAudio attachMovie attachSound attachVideo beginFill beginGradientFill call charAt charCodeAt clear clearInterval cloneNode close concat connect copy createElement createEmptyMovieClip createTextField createTextNode curveTo domain duplicateMovieClip endFill escape eval evaluate findText fscommand flush fromCharCode get getAscii getBeginIndex getBounds getBytesLoaded getBytesTotal getCaretIndex getCode getCount getDate getDay getDepth getEndIndex getFocus getFontList getFullYear getHours getInstanceAtDepth getLocal getMilliseconds getMinutes getMonth getNewTextFormat getNextHighestDepth getPan getProggress getProperty getRGB getSeconds getSelected getSelectedText getSize getStyle getStyleNames getSWFVersion getText getTextExtent getTextFormat getTextSnapshot getTime getTimer getTimezoneOffset getTransform getURL getUTCDate getUTCDay getUTCFullYear getUTCHours getUTCMilliseconds getUTCMinutes getUTCMonth getUTCSeconds getVersion getVolume getYear globalToLocal gotoAndPlay gotoAndStop hasChildNodes hide hideBuiltInItems hitTest hitTestTextNearPos indexOf insertBefore install isActive isDown isToggled join lastIndexOf lineStyle lineTo list load loadClip loadMovie loadMovieNum loadSound loadVariables loadVariablesNum localToGlobal mbchr mblength mbord mbsubstring MMExecute moveTo nextFrame nextScene parseCSS parseFloat parseInt parseXML pause play pop prevScene print printAsBitmap printAsBitmapNum printNum push registerClass removeListener removeMovieClip removeNode removeTextField replaceSel replaceText reverse seek send sendAndLoad setBufferTime set setDate setFocus setFullYear setGain setHours setInterval setMask setMilliseconds setMinutes setMode setMonth setMotionLevel setNewTextFormat setPan setProperty setQuality setRate setRGB setSeconds setSelectColor setSelected setSelection setSilenceLevel setStyle setTextFormat setTime setTransform setUseEchoSuppression setUTCDate setUTCFullYear setUTCHours setUTCMilliseconds setUTCMinutes setUTCMonth setUTCSeconds setVolume setYear shift show showSettings silenceLevel silenceTimeout slice sort sortOn splice split start startDrag stop stopAllSounds stopDrag substr substring swapDepths toggleHighQuality toLowerCase toString toUpperCase trace unescape uninstall unLoadClip unloadMovie unloadMovieNum unshift unwatch updateAfterEvent updateProperties useEchoSuppression valueOf watch endinitclip include initclip __proto__ _accProps _alpha _currentframe _droptarget _focusrect _framesloaded _global _height _highquality _level _lockroot _name _parent _quality _root _rotation _soundbuftime _target _totalframes _url _visible _width _x _xmouse _xscale _y _ymouse _yscale activityLevel align attributes autoSize avHardwareDisable background backgroundColor bandwidth blockIndent bold border borderColor bottomScroll bufferLenght bufferTime builtInItems bullet bytesLoaded bytesTotal callee caller capabilities caption childNodes color condenseWhite contentType currentFps customItems data deblocking docTypeDecl duration embedFonts enabled exactSettings firstChild focusEnabled font fps gain globalStyleFormat hasAccessibility hasAudio hasAudioEncoder hasEmbeddedVideo hasMP3 hasPrinting hasScreenBroadcast hasScreenPlayback hasStreamingAudio hasStreamingVideo hasVideoEncoder height hitArea hscroll html htmlText indent index italic instanceof int ignoreWhite isDebugger isFinite language lastChild leading leftMargin length loaded localFileReadDisable manufacturer maxChars maxhscroll maxscroll menu message motionLevel motionTimeout mouseWheelEnabled multiline muted name names NaN nextSibling nodeName nodeType nodeValue os parentNode password pixelAspectRatio playerType previousSibling prototype quality rate restrict resolutionX resolutionY rightMargin scaleMode screenColor screenDPI screenResolutionX screenResolutionY scroll selectable separatorBefore showMenu size smoothing status styleSheet tabChildren tabEnabled tabIndex tabStops target targetPath text textColor textHeight textWidth time trackAsMenu type underline url useCodepage useHandCursor variable version visible width wordWrap xmlDecl < / Keywords > <nl> < / Language > <nl> < Language name = " ada " ext = " ada ads adb " commentLine = " - - " commentStart = " " commentEnd = " " > <nl> - < Keywords name = " instre1 " > abort abs abstract accept access aliased all and array at begin body case constant declare delay delta digits do else elsif end entry exception exit for function generic goto if in interface is limited loop mod new not null of or others out overriding package pragma private procedure protected raise range record rem renames requeue return reverse select separate some subtype synchronized tagged task terminate then type until use when while with with xor < / Keywords > <nl> + < Keywords name = " instre1 " > abort abs abstract accept access aliased all and array at begin body case constant declare delay delta digits do else elsif end entry exception exit for function generic goto if in interface is limited loop mod new not null of or others out overriding package pragma private procedure protected raise range record rem renames requeue return reverse select separate some subtype synchronized tagged task terminate then type until use when while with xor < / Keywords > <nl> < / Language > <nl> < Language name = " asm " ext = " asm " commentLine = " ; " commentStart = " " commentEnd = " " > <nl> < Keywords name = " instre1 " > aaa aad aam aas adc add and call cbw cdqe clc cld cli cmc cmp cmps cmpsb cmpsw cwd daa das dec div esc hlt idiv imul in inc int into iret ja jae jb jbe jc jcxz je jg jge jl jle jmp jna jnae jnb jnbe jnc jne jng jnge jnl jnle jno jnp jns jnz jo jp jpe jpo js jz lahf lds lea les lods lodsb lodsw loop loope loopew loopne loopnew loopnz loopnzw loopw loopz loopzw mov movs movsb movsw mul neg nop not or out pop popf push pushf rcl rcr ret retf retn rol ror sahf sal sar sbb scas scasb scasw shl shr stc std sti stos stosb stosw sub test wait xchg xlat xlatb xor bound enter ins insb insw leave outs outsb outsw popa pusha pushw arpl lar lsl sgdt sidt sldt smsw str verr verw clts lgdt lidt lldt lmsw ltr bsf bsr bt btc btr bts cdq cmpsd cwde insd iretd iretdf iretf jecxz lfs lgs lodsd loopd looped loopned loopnzd loopzd lss movsd movsx movsxd movzx outsd popad popfd pushad pushd pushfd scasd seta setae setb setbe setc sete setg setge setl setle setna setnae setnb setnbe setnc setne setng setnge setnl setnle setno setnp setns setnz seto setp setpe setpo sets setz shld shrd stosd bswap cmpxchg invd invlpg wbinvd xadd lock rep repe repne repnz repz cflush cpuid emms femms cmovo cmovno cmovb cmovc cmovnae cmovae cmovnb cmovnc cmove cmovz cmovne cmovnz cmovbe cmovna cmova cmovnbe cmovs cmovns cmovp cmovpe cmovnp cmovpo cmovl cmovnge cmovge cmovnl cmovle cmovng cmovg cmovnle cmpxchg486 cmpxchg8b loadall loadall286 ibts icebp int1 int3 int01 int03 iretw popaw popfw pushaw pushfw rdmsr rdpmc rdshr rdtsc rsdc rsldt rsm rsts salc smi smint smintold svdc svldt svts syscall sysenter sysexit sysret ud0 ud1 ud2 umov xbts wrmsr wrshr < / Keywords > <nl> < Keywords name = " instre2 " > f2xm1 fabs fadd faddp fbld fbstp fchs fclex fcom fcomp fcompp fdecstp fdisi fdiv fdivp fdivr fdivrp feni ffree fiadd ficom ficomp fidiv fidivr fild fimul fincstp finit fist fistp fisub fisubr fld fld1 fldcw fldenv fldenvw fldl2e fldl2t fldlg2 fldln2 fldpi fldz fmul fmulp fnclex fndisi fneni fninit fnop fnsave fnsavew fnstcw fnstenv fnstenvw fnstsw fpatan fprem fptan frndint frstor frstorw fsave fsavew fscale fsqrt fst fstcw fstenv fstenvw fstp fstsw fsub fsubp fsubr fsubrp ftst fwait fxam fxch fxtract fyl2x fyl2xp1 fsetpm fcos fldenvd fnsaved fnstenvd fprem1 frstord fsaved fsin fsincos fstenvd fucom fucomp fucompp fcomi fcomip ffreep fcmovb fcmove fcmovbe fcmovu fcmovnb fcmovne fcmovnbe fcmovnu < / Keywords > <nl> < Keywords name = " type1 " > ah al ax bh bl bp bx ch cl cr0 cr2 cr3 cr4 cs cx dh di dl dr0 dr1 dr2 dr3 dr6 dr7 ds dx eax ebp ebx ecx edi edx es esi esp fs gs si sp ss st tr3 tr4 tr5 tr6 tr7 st0 st1 st2 st3 st4 st5 st6 st7 mm0 mm1 mm2 mm3 mm4 mm5 mm6 mm7 xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 < / Keywords > <nl> - < Keywords name = " type2 " > . 186 . 286 . 286c . 286p . 287 . 386 . 386c . 386p . 387 . 486 . 486p . 8086 . 8087 . alpha . break . code . const . continue . cref . data . data ? . dosseg . else . elseif . endif . endw . err . err1 . err2 . errb . errdef . errdif . errdifi . erre . erridn . erridni . errnb . errndef . errnz . exit . fardata . fardata ? . if . lall . lfcond . list . listall . listif . listmacro . listmacroall . model . no87 . nocref . nolist . nolistif . nolistmacro . radix . repeat . sall . seq . sfcond . stack . startup . tfcond . type . until . untilcxz . while . xall . xcref . xlist alias align assume catstr comm comment db dd df dosseg dq dt dup dw echo else elseif elseif1 elseif2 elseifb elseifdef elseifdif elseifdifi elseife elseifidn elseifidni elseifnb elseifndef end endif endm endp ends eq equ even exitm extern externdef extrn for forc ge goto group gt high highword if if1 if2 ifb ifdef ifdif ifdifi ife ifidn ifidni ifnb ifndef include includelib instr invoke irp irpc label le length lengthof local low lowword lroffset lt macro mask mod . msfloat name ne offset opattr option org % out page popcontext proc proto ptr public purge pushcontext record repeat rept seg segment short size sizeof sizestr struc struct substr subtitle subttl textequ this title type typedef union while width db dw dd dq dt resb resw resd resq rest incbin equ times % define % idefine % xdefine % xidefine % undef % assign % iassign % strlen % substr % macro % imacro % endmacro % rotate . nolist % if % elif % else % endif % ifdef % ifndef % elifdef % elifndef % ifmacro % ifnmacro % elifmacro % elifnmacro % ifctk % ifnctk % elifctk % elifnctk % ifidn % ifnidn % elifidn % elifnidn % ifidni % ifnidni % elifidni % elifnidni % ifid % ifnid % elifid % elifnid % ifstr % ifnstr % elifstr % elifnstr % ifnum % ifnnum % elifnum % elifnnum % error % rep % endrep % exitrep % include % push % pop % repl struct endstruc istruc at iend align alignb % arg % stacksize % local % line bits use16 use32 section absolute extern global common cpu org section group import export < / Keywords > <nl> - < Keywords name = " type3 " > $ ? @ b @ f addr basic byte c carry ? dword far far16 fortran fword near near16 overflow ? parity ? pascal qword real4 real8 real10 sbyte sdword sign ? stdcall sword syscall tbyte vararg word zero ? flat near32 far32 abs all assumes at casemap common compact cpu dotname emulator epilogue error export expr16 expr32 farstack flat forceframe huge language large listing ljmp loadds m510 medium memory nearstack nodotname noemulator nokeyword noljmp nom510 none nonunique nooldmacros nooldstructs noreadonly noscoped nosignextend nothing notpublic oldmacros oldstructs os_dos para private prologue radix readonly req scoped setif2 smallstack tiny use16 use32 uses a16 a32 o16 o32 byte word dword nosplit $ $ $ seq wrt flat large small . text . data . bss near far % 0 % 1 % 2 % 3 % 4 % 5 % 6 % 7 % 8 % 9 < / Keywords > <nl> - < Keywords name = " type4 " > addpd addps addsd addss andpd andps andnpd andnps cmpeqpd cmpltpd cmplepd cmpunordpd cmpnepd cmpnltpd cmpnlepd cmpordpd cmpeqps cmpltps cmpleps cmpunordps cmpneps cmpnltps cmpnleps cmpordps cmpeqsd cmpltsd cmplesd cmpunordsd cmpnesd cmpnltsd cmpnlesd cmpordsd cmpeqss cmpltss cmpless cmpunordss cmpness cmpnltss cmpnless cmpordss comisd comiss cvtdq2pd cvtdq2ps cvtpd2dq cvtpd2pi cvtpd2ps cvtpi2pd cvtpi2ps cvtps2dq cvtps2pd cvtps2pi cvtss2sd cvtss2si cvtsd2si cvtsd2ss cvtsi2sd cvtsi2ss cvttpd2dq cvttpd2pi cvttps2dq cvttps2pi cvttsd2si cvttss2si divpd divps divsd divss fxrstor fxsave ldmxscr lfence mfence maskmovdqu maskmovdq maxpd maxps paxsd maxss minpd minps minsd minss movapd movaps movdq2q movdqa movdqu movhlps movhpd movhps movd movq movlhps movlpd movlps movmskpd movmskps movntdq movnti movntpd movntps movntq movq2dq movsd movss movupd movups mulpd mulps mulsd mulss orpd orps packssdw packsswb packuswb paddb paddsb paddw paddsw paddd paddsiw paddq paddusb paddusw pand pandn pause paveb pavgb pavgw pavgusb pdistib pextrw pcmpeqb pcmpeqw pcmpeqd pcmpgtb pcmpgtw pcmpgtd pf2id pf2iw pfacc pfadd pfcmpeq pfcmpge pfcmpgt pfmax pfmin pfmul pmachriw pmaddwd pmagw pmaxsw pmaxub pminsw pminub pmovmskb pmulhrwc pmulhriw pmulhrwa pmulhuw pmulhw pmullw pmuludq pmvzb pmvnzb pmvlzb pmvgezb pfnacc pfpnacc por prefetch prefetchw prefetchnta prefetcht0 prefetcht1 prefetcht2 pfrcp pfrcpit1 pfrcpit2 pfrsqit1 pfrsqrt pfsub pfsubr pi2fd pf2iw pinsrw psadbw pshufd pshufhw pshuflw pshufw psllw pslld psllq pslldq psraw psrad psrlw psrld psrlq psrldq psubb psubw psubd psubq psubsb psubsw psubusb psubusw psubsiw pswapd punpckhbw punpckhwd punpckhdq punpckhqdq punpcklbw punpcklwd punpckldq punpcklqdq pxor rcpps rcpss rsqrtps rsqrtss sfence shufpd shufps sqrtpd sqrtps sqrtsd sqrtss stmxcsr subpd subps subsd subss ucomisd ucomiss unpckhpd unpckhps unpcklpd unpcklps xorpd xorps < / Keywords > <nl> + < Keywords name = " type2 " > . 186 . 286 . 286c . 286p . 287 . 386 . 386c . 386p . 387 . 486 . 486p . 8086 . 8087 . alpha . break . code . const . continue . cref . data . data ? . dosseg . else . elseif . endif . endw . err . err1 . err2 . errb . errdef . errdif . errdifi . erre . erridn . erridni . errnb . errndef . errnz . exit . fardata . fardata ? . if . lall . lfcond . list . listall . listif . listmacro . listmacroall . model . no87 . nocref . nolist . nolistif . nolistmacro . radix . repeat . sall . seq . sfcond . stack . startup . tfcond . type . until . untilcxz . while . xall . xcref . xlist alias align assume catstr comm comment db dd df dosseg dq dt dup dw echo else elseif elseif1 elseif2 elseifb elseifdef elseifdif elseifdifi elseife elseifidn elseifidni elseifnb elseifndef end endif endm endp ends eq equ even exitm extern externdef extrn for forc ge goto group gt high highword if if1 if2 ifb ifdef ifdif ifdifi ife ifidn ifidni ifnb ifndef include includelib instr invoke irp irpc label le length lengthof local low lowword lroffset lt macro mask mod . msfloat name ne offset opattr option org % out page popcontext proc proto ptr public purge pushcontext record repeat rept seg segment short size sizeof sizestr struc struct substr subtitle subttl textequ this title type typedef union while width resb resw resd resq rest incbin times % define % idefine % xdefine % xidefine % undef % assign % iassign % strlen % substr % macro % imacro % endmacro % rotate % if % elif % else % endif % ifdef % ifndef % elifdef % elifndef % ifmacro % ifnmacro % elifmacro % elifnmacro % ifctk % ifnctk % elifctk % elifnctk % ifidn % ifnidn % elifidn % elifnidn % ifidni % ifnidni % elifidni % elifnidni % ifid % ifnid % elifid % elifnid % ifstr % ifnstr % elifstr % elifnstr % ifnum % ifnnum % elifnum % elifnnum % error % rep % endrep % exitrep % include % push % pop % repl endstruc istruc at iend alignb % arg % stacksize % local % line bits use16 use32 section absolute global common cpu import export < / Keywords > <nl> + < Keywords name = " type3 " > $ ? @ b @ f addr basic byte c carry ? dword far far16 fortran fword near near16 overflow ? parity ? pascal qword real4 real8 real10 sbyte sdword sign ? stdcall sword syscall tbyte vararg word zero ? flat near32 far32 abs all assumes at casemap common compact cpu dotname emulator epilogue error export expr16 expr32 farstack forceframe huge language large listing ljmp loadds m510 medium memory nearstack nodotname noemulator nokeyword noljmp nom510 none nonunique nooldmacros nooldstructs noreadonly noscoped nosignextend nothing notpublic oldmacros oldstructs os_dos para private prologue radix readonly req scoped setif2 smallstack tiny use16 use32 uses a16 a32 o16 o32 nosplit $ $ seq wrt small . text . data . bss % 0 % 1 % 2 % 3 % 4 % 5 % 6 % 7 % 8 % 9 < / Keywords > <nl> + < Keywords name = " type4 " > addpd addps addsd addss andpd andps andnpd andnps cmpeqpd cmpltpd cmplepd cmpunordpd cmpnepd cmpnltpd cmpnlepd cmpordpd cmpeqps cmpltps cmpleps cmpunordps cmpneps cmpnltps cmpnleps cmpordps cmpeqsd cmpltsd cmplesd cmpunordsd cmpnesd cmpnltsd cmpnlesd cmpordsd cmpeqss cmpltss cmpless cmpunordss cmpness cmpnltss cmpnless cmpordss comisd comiss cvtdq2pd cvtdq2ps cvtpd2dq cvtpd2pi cvtpd2ps cvtpi2pd cvtpi2ps cvtps2dq cvtps2pd cvtps2pi cvtss2sd cvtss2si cvtsd2si cvtsd2ss cvtsi2sd cvtsi2ss cvttpd2dq cvttpd2pi cvttps2dq cvttps2pi cvttsd2si cvttss2si divpd divps divsd divss fxrstor fxsave ldmxscr lfence mfence maskmovdqu maskmovdq maxpd maxps paxsd maxss minpd minps minsd minss movapd movaps movdq2q movdqa movdqu movhlps movhpd movhps movd movq movlhps movlpd movlps movmskpd movmskps movntdq movnti movntpd movntps movntq movq2dq movsd movss movupd movups mulpd mulps mulsd mulss orpd orps packssdw packsswb packuswb paddb paddsb paddw paddsw paddd paddsiw paddq paddusb paddusw pand pandn pause paveb pavgb pavgw pavgusb pdistib pextrw pcmpeqb pcmpeqw pcmpeqd pcmpgtb pcmpgtw pcmpgtd pf2id pf2iw pfacc pfadd pfcmpeq pfcmpge pfcmpgt pfmax pfmin pfmul pmachriw pmaddwd pmagw pmaxsw pmaxub pminsw pminub pmovmskb pmulhrwc pmulhriw pmulhrwa pmulhuw pmulhw pmullw pmuludq pmvzb pmvnzb pmvlzb pmvgezb pfnacc pfpnacc por prefetch prefetchw prefetchnta prefetcht0 prefetcht1 prefetcht2 pfrcp pfrcpit1 pfrcpit2 pfrsqit1 pfrsqrt pfsub pfsubr pi2fd pinsrw psadbw pshufd pshufhw pshuflw pshufw psllw pslld psllq pslldq psraw psrad psrlw psrld psrlq psrldq psubb psubw psubd psubq psubsb psubsw psubusb psubusw psubsiw pswapd punpckhbw punpckhwd punpckhdq punpckhqdq punpcklbw punpcklwd punpckldq punpcklqdq pxor rcpps rcpss rsqrtps rsqrtss sfence shufpd shufps sqrtpd sqrtps sqrtsd sqrtss stmxcsr subpd subps subsd subss ucomisd ucomiss unpckhpd unpckhps unpcklpd unpcklps xorpd xorps < / Keywords > <nl> < / Language > <nl> < Language name = " asp " ext = " asp " commentLine = " ' " > <nl> < Keywords name = " instre1 " > addhandler addressof andalso alias and ansi as assembly attribute auto begin boolean byref byte byval call case catch cbool cbyte cchar cdate cdec cdbl char cint class clng cobj compare const continue cshort csng cstr ctype currency date decimal declare default delegate dim do double each else elseif end enum erase error event exit explicit false finally for friend function get gettype global gosub goto handles if implement implements imports in inherits integer interface is let lib like load long loop lset me mid mod module mustinherit mustoverride mybase myclass namespace new next not nothing notinheritable notoverridable object on option optional or orelse overloads overridable overrides paramarray preserve private property protected public raiseevent readonly redim rem removehandler rset resume return select set shadows shared short single static step stop string structure sub synclock then throw to true try type typeof unload unicode until variant wend when while with withevents writeonly xor < / Keywords > <nl> < / Language > <nl> < Language name = " autoit " ext = " au3 " commentLine = " ; " commentStart = " # CS " commentEnd = " # CE " > <nl> - < Keywords name = " instre1 " > and byref case continueloop dim do else elseif endfunc endif endselect exit exitloop for func global if local next not or return select step then to until wend while exit < / Keywords > <nl> + < Keywords name = " instre1 " > and byref case continueloop dim do else elseif endfunc endif endselect exit exitloop for func global if local next not or return select step then to until wend while < / Keywords > <nl> < Keywords name = " instre2 " > abs acos adlibdisable adlibenable asc asin atan autoitsetoption autoitwingettitle autoitwinsettitle bitand bitnot bitor bitshift bitxor blockinput break call cdtray chr clipget clipput controlclick controlcommand controldisable controlenable controlfocus controlgetfocus controlgetpos controlgettext controlhide controlmove controlsend controlsettext controlshow cos dec dircopy dircreate dirmove dirremove drivegetdrive drivegetfilesystem drivegetlabel drivegetserial drivegettype drivesetlabel drivespacefree drivespacetotal drivestatus envget envset envupdate eval exp filechangedir fileclose filecopy filecreateshortcut filedelete fileexists filefindfirstfile filefindnextfile filegetattrib filegetlongname filegetshortname filegetsize filegettime filegetversion fileinstall filemove fileopen fileopendialog fileread filereadline filerecycle filerecycleempty filesavedialog fileselectfolder filesetattrib filesettime filewrite filewriteline guicreate guicreateex guidefaultfont guidelete guigetcontrolstate guihide guimsg guiread guirecvmsg guisendmsg guisetcontrol guisetcontroldata guisetcontrolex guisetcontrolfont guisetcontrolnotify guisetcoord guisetcursor guishow guiwaitclose guiwrite hex hotkeyset inidelete iniread iniwrite inputbox int isadmin isarray isdeclared isfloat isint isnumber isstring log memgetstats mod mouseclick mouseclickdrag mousedown mousegetcursor mousegetpos mousemove mouseup mousewheel msgbox number pixelchecksum pixelgetcolor pixelsearch processclose processexists processsetpriority processwait processwaitclose progressoff progresson progressset random regdelete regenumkey regenumval regread regwrite round run runasset runwait send seterror shutdown sin sleep soundplay soundsetwavevolume splashimageon splashoff splashtexton sqrt statusbargettext string stringaddcr stringformat stringinstr stringisalnum stringisalpha stringisascii stringisdigit stringisfloat stringisint stringislower stringisspace stringisupper stringisxdigit stringleft stringlen stringlower stringmid stringreplace stringright stringsplit stringstripcr stringstripws stringtrimleft stringtrimright stringupper tan timerstart timerstop tooltip traytip ubound urldownloadtofile winactivate winactive winclose winexists wingetcaretpos wingetclasslist wingetclientsize wingethandle wingetpos wingetstate wingettext wingettitle winkill winmenuselectitem winminimizeall winminimizeallundo winmove winsetontop winsetstate winsettitle winwait winwaitactive winwaitclose winwaitnotactive < / Keywords > <nl> < Keywords name = " type1 " > @ appdatacommondir @ appdatadir @ autoitversion @ commonfilesdir @ compiled @ computername @ comspec @ cr @ crlf @ desktopcommondir @ desktopdir @ desktopheight @ desktopwidth @ documentscommondir @ error @ favoritescommondir @ favoritesdir @ homedrive @ homepath @ homeshare @ hour @ ipaddress1 @ ipaddress2 @ ipaddress3 @ ipaddress4 @ lf @ logondnsdomain @ logondomain @ logonserver @ mday @ min @ mon @ mydocumentsdir @ osbuild @ oslang @ osservicepack @ ostype @ osversion @ programfilesdir @ programscommondir @ programsdir @ scriptdir @ scriptfullpath @ scriptname @ sec @ startmenucommondir @ startmenudir @ startupcommondir @ startupdir @ sw_hide @ sw_maximize @ sw_minimize @ sw_restore @ sw_show @ systemdir @ tab @ tempdir @ userprofiledir @ username @ wday @ windowsdir @ workingdir @ yday @ year < / Keywords > <nl> < Keywords name = " type2 " > { ! } { # } { ^ } { { } { } } { + } { alt } { altdown } { altup } { appskey } { asc } { backspace } { browser_back } { browser_favorites } { browser_forward } { browser_home } { browser_refresh } { browser_search } { browser_stop } { bs } { capslock } { ctrlbreak } { ctrldown } { ctrlup } { del } { delete } { down } { end } { enter } { esc } { escape } { f1 } { f10 } { f11 } { f12 } { f2 } { f3 } { f4 } { f5 } { f6 } { f7 } { f8 } { f9 } { home } { ins } { insert } { lalt } { launch_app1 } { launch_app2 } { launch_mail } { launch_media } { lctrl } { left } { lshift } { lwin } { lwindown } { media_next } { media_play_pause } { media_prev } { media_stop } { numlock } { numpad0 } { numpad1 } { numpad2 } { numpad3 } { numpad4 } { numpad5 } { numpad6 } { numpad7 } { numpad8 } { numpad9 } { numpadadd } { numpaddiv } { numpaddot } { numpadenter } { numpadmult } { numpadsub } { pause } { pgdn } { pgup } { printscreen } { ralt } { rctrl } { right } { rshift } { rwin } { rwindown } { scrolllock } { shiftdown } { shiftup } { sleep } { space } { tab } { up } { volume_down } { volume_mute } { volume_up } < / Keywords > <nl> <nl> < Language name = " cobol " ext = " cbl cbd cdb cdc cob " commentLine = " * " > <nl> < Keywords name = " instre1 " > configuration data declaratives division environment environment - division file file - control function i - o i - o - control identification input input - output linkage local - storage output procedure program program - id section special - names working - storage < / Keywords > <nl> < Keywords name = " instre2 " > accept add alter apply assign call chain close compute continue control convert count delete display divide draw drop eject else enable end - accept end - add end - call end - chain end - compute end - delete end - display end - divide end - evaluate end - if end - invoke end - multiply end - perform end - read end - receive end - return end - rewrite end - search end - start end - string end - subtract end - unstring end - write erase evaluate examine exec execute exit go goback generate if ignore initialize initiate insert inspect invoke leave merge move multiply open otherwise perform print read receive release reload replace report reread rerun reserve reset return rewind rewrite rollback run search seek select send set sort start stop store string subtract sum suppress terminate then transform unlock unstring update use wait when wrap write < / Keywords > <nl> - < Keywords name = " type1 " > access acquire actual address advancing after all allowing alphabet alphabetic alphabetic - lower alphabetic - upper alphanumeric alphanumeric - edited also alternate and any are area areas as ascending at attribute author auto auto - hyphen - skip auto - skip automatic autoterminate background - color background - colour backward basis beep before beginning bell binary blank blink blinking block bold bottom box boxed by c01 c02 c03 c04 c05 c06 c07 c08 c09 c10 c11 c12 cancel cbl cd centered cf ch chaining changed character characters chart class clock - units cobol code code - set col collating color colour column com - reg comma command - line commit commitment common communication comp comp - 0 comp - 1 comp - 2 comp - 3 comp - 4 comp - 5 comp - 6 comp - x compression computational computational - 1 computational - 2 computational - 3 computational - 4 computational - 5 computational - 6 computational - x computational console contains content control - area controls conversion converting core - index corr corresponding crt crt - under csp currency current - date cursor cycle cyl - index cyl - overflow date date - compiled date - written day day - of - week dbcs de debug debug - contents debug - item debug - line debug - name debug - sub - 1 debug - sub - 2 debug - sub - 3 debugging decimal - point default delimited delimiter depending descending destination detail disable disk disp display - 1 display - st down duplicates dynamic echo egcs egi emi empty - check encryption end end - of - page ending enter entry eol eop eos equal equals error escape esi every exceeds exception excess - 3 exclusive exhibit extend extended - search external externally - described - key factory false fd fh - - fcd fh - - keydef file - id file - limit file - limits file - prefix filler final first fixed footing for foreground - color foreground - colour footing format from full giving global greater grid group heading high high - value high - values highlight id in index indexed indic indicate indicator indicators inheriting initial installation into invalid invoked is japanese just justified kanji kept key keyboard label last leading left left - justify leftline length length - check less limit limits lin linage linage - counter line line - counter lines lock lock - holding locking low low - value low - values lower lowlight manual mass - update master - index memory message method mode modified modules more - labels multiple name named national national - edited native nchar negative next no no - echo nominal not note nstd - reels null nulls number numeric numeric - edited numeric - fill o - fill object object - computer object - storage occurs of off omitted on oostackptr optional or order organization other others overflow overline packed - decimal padding page page - counter packed - decimal paragraph password pf ph pic picture plus pointer pop - up pos position positioning positive previous print - control print - switch printer printer - 1 printing prior private procedure - pointer procedures proceed process processing prompt protected public purge queue quote quotes random range rd readers ready record record - overflow recording records redefines reel reference references relative remainder remarks removal renames reorg - criteria repeated replacing reporting reports required resident return - code returning reverse reverse - video reversed rf rh right right - justify rolling rounded s01 s02 s03 s04 s05 same screen scroll sd secure security segment segment - limit selective self selfclass sentence separate sequence sequential service setshadow shift - in shift - out sign size skip1 skip2 skip3 sort - control sort - core - size sort - file - size sort - merge sort - message sort - mode - size sort - option sort - return source source - computer space spaces space - fill spaces standard standard - 1 standard - 2 starting status sub - queue - 1 sub - queue - 2 sub - queue - 3 subfile super symbolic sync synchronized sysin sysipt syslst sysout syspch syspunch system - info tab tallying tape terminal terminal - info test text than through thru time time - of - day time - out timeout times title to top totaled totaling trace track - area track - limit tracks trailing trailing - sign transaction true type typedef underline underlined unequal unit until up updaters upon upper upsi - 0 upsi - 1 upsi - 2 upsi - 3 upsi - 4 upsi - 5 upsi - 6 upsi - 7 usage user using value values variable varying when - compiled window with words write - only write - verify writerszero zero zero - fill zeros zeroes < / Keywords > <nl> + < Keywords name = " type1 " > access acquire actual address advancing after all allowing alphabet alphabetic alphabetic - lower alphabetic - upper alphanumeric alphanumeric - edited also alternate and any are area areas as ascending at attribute author auto auto - hyphen - skip auto - skip automatic autoterminate background - color background - colour backward basis beep before beginning bell binary blank blink blinking block bold bottom box boxed by c01 c02 c03 c04 c05 c06 c07 c08 c09 c10 c11 c12 cancel cbl cd centered cf ch chaining changed character characters chart class clock - units cobol code code - set col collating color colour column com - reg comma command - line commit commitment common communication comp comp - 0 comp - 1 comp - 2 comp - 3 comp - 4 comp - 5 comp - 6 comp - x compression computational computational - 1 computational - 2 computational - 3 computational - 4 computational - 5 computational - 6 computational - x console contains content control - area controls conversion converting core - index corr corresponding crt crt - under csp currency current - date cursor cycle cyl - index cyl - overflow date date - compiled date - written day day - of - week dbcs de debug debug - contents debug - item debug - line debug - name debug - sub - 1 debug - sub - 2 debug - sub - 3 debugging decimal - point default delimited delimiter depending descending destination detail disable disk disp display - 1 display - st down duplicates dynamic echo egcs egi emi empty - check encryption end end - of - page ending enter entry eol eop eos equal equals error escape esi every exceeds exception excess - 3 exclusive exhibit extend extended - search external externally - described - key factory false fd fh - - fcd fh - - keydef file - id file - limit file - limits file - prefix filler final first fixed footing for foreground - color foreground - colour format from full giving global greater grid group heading high high - value high - values highlight id in index indexed indic indicate indicator indicators inheriting initial installation into invalid invoked is japanese just justified kanji kept key keyboard label last leading left left - justify leftline length length - check less limit limits lin linage linage - counter line line - counter lines lock lock - holding locking low low - value low - values lower lowlight manual mass - update master - index memory message method mode modified modules more - labels multiple name named national national - edited native nchar negative next no no - echo nominal not note nstd - reels null nulls number numeric numeric - edited numeric - fill o - fill object object - computer object - storage occurs of off omitted on oostackptr optional or order organization other others overflow overline packed - decimal padding page page - counter paragraph password pf ph pic picture plus pointer pop - up pos position positioning positive previous print - control print - switch printer printer - 1 printing prior private procedure - pointer procedures proceed process processing prompt protected public purge queue quote quotes random range rd readers ready record record - overflow recording records redefines reel reference references relative remainder remarks removal renames reorg - criteria repeated replacing reporting reports required resident return - code returning reverse reverse - video reversed rf rh right right - justify rolling rounded s01 s02 s03 s04 s05 same screen scroll sd secure security segment segment - limit selective self selfclass sentence separate sequence sequential service setshadow shift - in shift - out sign size skip1 skip2 skip3 sort - control sort - core - size sort - file - size sort - merge sort - message sort - mode - size sort - option sort - return source source - computer space spaces space - fill standard standard - 1 standard - 2 starting status sub - queue - 1 sub - queue - 2 sub - queue - 3 subfile super symbolic sync synchronized sysin sysipt syslst sysout syspch syspunch system - info tab tallying tape terminal terminal - info test text than through thru time time - of - day time - out timeout times title to top totaled totaling trace track - area track - limit tracks trailing trailing - sign transaction true type typedef underline underlined unequal unit until up updaters upon upper upsi - 0 upsi - 1 upsi - 2 upsi - 3 upsi - 4 upsi - 5 upsi - 6 upsi - 7 usage user using value values variable varying when - compiled window with words write - only write - verify writerszero zero zero - fill zeros zeroes < / Keywords > <nl> < / Language > <nl> < Language name = " coffeescript " ext = " litcoffee " commentLine = " # " commentStart = " " commentEnd = " " > <nl> < Keywords name = " instre1 " > new instanceof do return break continue throw for while until loop if else unless switch when then in of by typeof delete where try catch finally prototype jQuery case default function var void with const let enum export import native __hasProp __extends __slice __bind __indexOf < / Keywords > <nl> <nl> < Keywords name = " instre1 " > as case class data default deriving do else hiding if import in infix infixl infixr instance let module newtype of proc qualified rec then type where _ < / Keywords > <nl> < / Language > <nl> < Language name = " html " ext = " html htm shtml shtm xhtml xht hta " commentLine = " " commentStart = " & lt ; ! - - " commentEnd = " - - & gt ; " > <nl> - < Keywords name = " instre1 " > ! doctype a abbr accept accept - charset accesskey acronym action address align alink alt applet archive area article aside audio axis b background base basefont bdi bdo bgsound bgcolor big blink blockquote body border br button canvas caption cellpadding cellspacing center char charoff charset checkbox checked cite class classid clear code codebase codetype col colgroup color cols colspan command compact content contenteditable contextmenu coords data datafld dataformatas datalist datapagesize datasrc datetime dd declare defer del details dfn dialog dir disabled div dl draggable dropzone dt element em embed enctype event face fieldset figcaption figure file font footer for form frame frameborder frameset h1 h2 h3 h4 h5 h6 head header height hgroup hidden hr href hreflang hspace html http - equiv i id iframe image img input ins isindex ismap kbd keygen label lang language leftmargin legend li link listing longdesc main map marginheight marginwidth mark marquee maxlength media menu menuitem meta meter multicol method multiple name nav nobr noembed noframes nohref noresize noscript noshade nowrap object ol onabort onautocomplete onautocompleteerror onafterprint onbeforeonload onbeforeprint onblur oncancel oncanplay oncanplaythrough onchange onclick onclose oncontextmenu oncuechange ondblclick ondrag ondragend ondragenter ondragleave ondragover ondragstart ondrop ondurationchange onemptied onended onerror onfocus onhashchange oninput oninvalid onkeydown onkeypress onkeyup onload onloadeddata onloadedmetadata onloadstart onmessage onmousedown onmouseenter onmouseleave onmousemove onmouseout onmouseover onmouseup onmousewheel onoffline ononline onpagehide onpageshow onpause onplay onplaying onpointercancel onpointerdown onpointerenter onpointerleave onpointerlockchange onpointerlockerror onpointermove onpointerout onpointerover onpointerup onpopstate onprogress onratechange onreadystatechange onredo onreset onresize onscroll onseeked onseeking onselect onshow onsort onselect onstalled onstorage onsubmit onsuspend ontimeupdate ontoggle onundo onunload onvolumechange onwaiting optgroup option output p param picture plaintext password placeholder pre profile progress prompt public q radio readonly rel reset rev rows rowspan rp rt rtc ruby rules s samp scheme scope script section select shadow selected shape size small source spacer span spellcheck src standby start strike strong style sub submit summary sup svg svg : svg tabindex table target tbody td template text textarea tfoot th thead time title topmargin tr track tt type u ul usemap valign value valuetype var version video vlink vspace wbr xmp width xml xmlns < / Keywords > <nl> + < Keywords name = " instre1 " > ! doctype a abbr accept accept - charset accesskey acronym action address align alink alt applet archive area article aside audio axis b background base basefont bdi bdo bgsound bgcolor big blink blockquote body border br button canvas caption cellpadding cellspacing center char charoff charset checkbox checked cite class classid clear code codebase codetype col colgroup color cols colspan command compact content contenteditable contextmenu coords data datafld dataformatas datalist datapagesize datasrc datetime dd declare defer del details dfn dialog dir disabled div dl draggable dropzone dt element em embed enctype event face fieldset figcaption figure file font footer for form frame frameborder frameset h1 h2 h3 h4 h5 h6 head header height hgroup hidden hr href hreflang hspace html http - equiv i id iframe image img input ins isindex ismap kbd keygen label lang language leftmargin legend li link listing longdesc main map marginheight marginwidth mark marquee maxlength media menu menuitem meta meter multicol method multiple name nav nobr noembed noframes nohref noresize noscript noshade nowrap object ol onabort onautocomplete onautocompleteerror onafterprint onbeforeonload onbeforeprint onblur oncancel oncanplay oncanplaythrough onchange onclick onclose oncontextmenu oncuechange ondblclick ondrag ondragend ondragenter ondragleave ondragover ondragstart ondrop ondurationchange onemptied onended onerror onfocus onhashchange oninput oninvalid onkeydown onkeypress onkeyup onload onloadeddata onloadedmetadata onloadstart onmessage onmousedown onmouseenter onmouseleave onmousemove onmouseout onmouseover onmouseup onmousewheel onoffline ononline onpagehide onpageshow onpause onplay onplaying onpointercancel onpointerdown onpointerenter onpointerleave onpointerlockchange onpointerlockerror onpointermove onpointerout onpointerover onpointerup onpopstate onprogress onratechange onreadystatechange onredo onreset onresize onscroll onseeked onseeking onselect onshow onsort onstalled onstorage onsubmit onsuspend ontimeupdate ontoggle onundo onunload onvolumechange onwaiting optgroup option output p param picture plaintext password placeholder pre profile progress prompt public q radio readonly rel reset rev rows rowspan rp rt rtc ruby rules s samp scheme scope script section select shadow selected shape size small source spacer span spellcheck src standby start strike strong style sub submit summary sup svg svg : svg tabindex table target tbody td template text textarea tfoot th thead time title topmargin tr track tt type u ul usemap valign value valuetype var version video vlink vspace wbr xmp width xml xmlns < / Keywords > <nl> < / Language > <nl> < Language name = " ini " ext = " ini inf reg url wer " commentLine = " ; " > <nl> < / Language > <nl> <nl> < Keywords name = " type1 " > address build color comment cpu crlf csd curdir date day domain dos error fullname homedir homedrive homeshr hostname inwin ipaddress0 ipaddress1 ipaddress2 ipaddress3 kix lanroot ldomain ldrive lm logonmode longhomedir lserver maxpwage mdayno mhz monthno month msecs pid primarygroup priv productsuite producttype pwage ras result rserver scriptdir scriptexe scriptname serror sid site startdir syslang ticks time userid userlang wdayno wksta wuserid ydayno year < / Keywords > <nl> < / Language > <nl> < Language name = " lisp " ext = " lsp lisp " commentLine = " ; " > <nl> - < Keywords name = " instre1 " > not defun + - * / = & lt ; & gt ; & lt ; = & gt ; = princ eval apply funcall quote identity function complement backquote lambda set setq setf defun defmacro gensym make symbol intern symbol name symbol value symbol plist get getf putprop remprop hash make array aref car cdr caar cadr cdar cddr caaar caadr cadar caddr cdaar cdadr cddar cdddr caaaar caaadr caadar caaddr cadaar cadadr caddar cadddr cdaaar cdaadr cdadar cdaddr cddaar cddadr cdddar cddddr cons list append reverse last nth nthcdr member assoc subst sublis nsubst nsublis remove length list length mapc mapcar mapl maplist mapcan mapcon rplaca rplacd nconc delete atom symbolp numberp boundp null listp consp minusp zerop plusp evenp oddp eq eql equal cond case and or let l if prog prog1 prog2 progn go return do dolist dotimes catch throw error cerror break continue errset baktrace evalhook truncate float rem min max abs sin cos tan expt exp sqrt random logand logior logxor lognot bignums logeqv lognand lognor logorc2 logtest logbitp logcount integer length nil < / Keywords > <nl> + < Keywords name = " instre1 " > not defun + - * / = & lt ; & gt ; & lt ; = & gt ; = princ eval apply funcall quote identity function complement backquote lambda set setq setf defmacro gensym make symbol intern name value plist get getf putprop remprop hash array aref car cdr caar cadr cdar cddr caaar caadr cadar caddr cdaar cdadr cddar cdddr caaaar caaadr caadar caaddr cadaar cadadr caddar cadddr cdaaar cdaadr cdadar cdaddr cddaar cddadr cdddar cddddr cons list append reverse last nth nthcdr member assoc subst sublis nsubst nsublis remove length mapc mapcar mapl maplist mapcan mapcon rplaca rplacd nconc delete atom symbolp numberp boundp null listp consp minusp zerop plusp evenp oddp eq eql equal cond case and or let l if prog prog1 prog2 progn go return do dolist dotimes catch throw error cerror break continue errset baktrace evalhook truncate float rem min max abs sin cos tan expt exp sqrt random logand logior logxor lognot bignums logeqv lognand lognor logorc2 logtest logbitp logcount integer nil < / Keywords > <nl> < Keywords name = " instre2 " > < / Keywords > <nl> < / Language > <nl> < Language commentLine = " - - " ext = " lua " name = " lua " > <nl> <nl> variant_add variant_and variant_cast variant_cat variant_cmp variant_date_from_timestamp variant_date_to_timestamp variant_div variant_eqv variant_fix variant_get_type variant_idiv variant_imp variant_int variant_mod variant_mul variant_neg variant_not variant_or variant_pow variant_round variant_set variant_set_type variant_sub variant_xor version_compare vfprintf virtual void vpopmail_add_alias_domain vpopmail_add_alias_domain_ex vpopmail_add_domain vpopmail_add_domain_ex vpopmail_add_user vpopmail_alias_add vpopmail_alias_del vpopmail_alias_del_domain vpopmail_alias_get vpopmail_alias_get_all vpopmail_auth_user vpopmail_del_domain vpopmail_del_domain_ex vpopmail_del_user vpopmail_error vpopmail_passwd vpopmail_set_user_quota vprintf vsprintf vt_array vt_bool vt_bstr vt_byref vt_cy vt_date vt_decimal vt_dispatch vt_empty vt_error vt_i1 vt_i2 vt_i4 vt_int vt_null vt_r4 vt_r8 vt_ui1 vt_ui2 vt_ui4 vt_uint vt_unknown vt_variant wddx_add_vars wddx_deserialize wddx_packet_end wddx_packet_start wddx_serialize_value wddx_serialize_vars while win32_above_normal_priority_class win32_below_normal_priority_class win32_continue_service win32_create_service win32_delete_service win32_error_access_denied win32_error_circular_dependency win32_error_database_does_not_exist win32_error_dependent_services_running win32_error_duplicate_service_name win32_error_failed_service_controller_connect win32_error_insufficient_buffer win32_error_invalid_data win32_error_invalid_handle win32_error_invalid_level win32_error_invalid_name win32_error_invalid_parameter win32_error_invalid_service_account win32_error_invalid_service_control win32_error_path_not_found win32_error_service_already_running win32_error_service_cannot_accept_ctrl win32_error_service_database_locked win32_error_service_dependency_deleted win32_error_service_dependency_fail win32_error_service_disabled win32_error_service_does_not_exist win32_error_service_exists win32_error_service_logon_failed win32_error_service_marked_for_delete win32_error_service_no_thread win32_error_service_not_active win32_error_service_request_timeout win32_error_shutdown_in_progress win32_get_last_control_message win32_high_priority_class win32_idle_priority_class win32_no_error win32_normal_priority_class win32_pause_service win32_ps_list_procs win32_ps_stat_mem win32_ps_stat_proc win32_query_service_status win32_realtime_priority_class win32_service_accept_pause_continue win32_service_accept_preshutdown win32_service_accept_shutdown win32_service_accept_stop win32_service_auto_start win32_service_continue_pending win32_service_control_continue win32_service_control_interrogate win32_service_control_pause win32_service_control_preshutdown win32_service_control_shutdown win32_service_control_stop win32_service_demand_start win32_service_disabled win32_service_error_ignore win32_service_error_normal win32_service_interactive_process win32_service_pause_pending win32_service_paused win32_service_running win32_service_runs_in_system_process win32_service_start_pending win32_service_stop_pending win32_service_stopped win32_service_win32_own_process win32_service_win32_own_process_interactive win32_set_service_status win32_start_service win32_start_service_ctrl_dispatcher win32_stop_service wincache_fcache_fileinfo wincache_fcache_meminfo wincache_lock wincache_ocache_fileinfo wincache_ocache_meminfo wincache_refresh_if_changed wincache_rplist_fileinfo wincache_rplist_meminfo wincache_scache_info wincache_scache_meminfo wincache_ucache_add wincache_ucache_cas wincache_ucache_clear wincache_ucache_dec wincache_ucache_delete wincache_ucache_exists wincache_ucache_get wincache_ucache_inc wincache_ucache_info wincache_ucache_meminfo wincache_ucache_set wincache_unlock wnohang wordwrap wsdl_cache_both wsdl_cache_disk wsdl_cache_memory wsdl_cache_none wuntraced x509_purpose_any x509_purpose_crl_sign x509_purpose_ns_ssl_server x509_purpose_smime_encrypt x509_purpose_smime_sign x509_purpose_ssl_client x509_purpose_ssl_server xattr_create xattr_dontfollow xattr_get xattr_list xattr_remove xattr_replace xattr_root xattr_set xattr_supported xdiff_file_bdiff xdiff_file_bdiff_size xdiff_file_bpatch xdiff_file_diff xdiff_file_diff_binary xdiff_file_merge3 xdiff_file_patch xdiff_file_patch_binary xdiff_file_rabdiff xdiff_patch_normal xdiff_patch_reverse xdiff_string_bdiff xdiff_string_bdiff_size xdiff_string_bpatch xdiff_string_diff xdiff_string_diff_binary xdiff_string_merge3 xdiff_string_patch xdiff_string_patch_binary xdiff_string_rabdiff xhprof_disable xhprof_enable xhprof_sample_disable xhprof_sample_enable xml_attribute_cdata xml_attribute_decl_node xml_attribute_entity xml_attribute_enumeration xml_attribute_id xml_attribute_idref xml_attribute_idrefs xml_attribute_nmtoken xml_attribute_nmtokens xml_attribute_node xml_attribute_notation xml_cdata_section_node xml_comment_node xml_document_frag_node xml_document_node xml_document_type_node xml_dtd_node xml_element_decl_node xml_element_node xml_entity_decl_node xml_entity_node xml_entity_ref_node xml_error_async_entity xml_error_attribute_external_entity_ref xml_error_bad_char_ref xml_error_binary_entity_ref xml_error_duplicate_attribute xml_error_external_entity_handling xml_error_incorrect_encoding xml_error_invalid_token xml_error_junk_after_doc_element xml_error_misplaced_xml_pi xml_error_no_elements xml_error_no_memory xml_error_none xml_error_param_entity_ref xml_error_partial_char xml_error_recursive_entity_ref xml_error_string xml_error_syntax xml_error_tag_mismatch xml_error_unclosed_cdata_section xml_error_unclosed_token xml_error_undefined_entity xml_error_unknown_encoding xml_get_current_byte_index xml_get_current_column_number xml_get_current_line_number xml_get_error_code xml_html_document_node xml_local_namespace xml_namespace_decl_node xml_notation_node xml_option_case_folding xml_option_skip_tagstart xml_option_skip_white xml_option_target_encoding xml_parse xml_parse_into_struct xml_parser_create xml_parser_create_ns xml_parser_free xml_parser_get_option xml_parser_set_option xml_pi_node xml_sax_impl xml_set_character_data_handler xml_set_default_handler xml_set_element_handler xml_set_end_namespace_decl_handler xml_set_external_entity_ref_handler xml_set_notation_decl_handler xml_set_object xml_set_processing_instruction_handler xml_set_start_namespace_decl_handler xml_set_unparsed_entity_decl_handler xml_text_node xmlrpc_decode xmlrpc_decode_request xmlrpc_encode xmlrpc_encode_request xmlrpc_get_type xmlrpc_is_fault xmlrpc_parse_method_descriptions xmlrpc_server_add_introspection_data xmlrpc_server_call_method xmlrpc_server_create xmlrpc_server_destroy xmlrpc_server_register_introspection_callback xmlrpc_server_register_method xmlrpc_set_type xmlwriter_end_attribute xmlwriter_end_cdata xmlwriter_end_comment xmlwriter_end_document xmlwriter_end_dtd xmlwriter_end_dtd_attlist xmlwriter_end_dtd_element xmlwriter_end_dtd_entity xmlwriter_end_element xmlwriter_end_pi xmlwriter_flush xmlwriter_full_end_element xmlwriter_open_memory xmlwriter_open_uri xmlwriter_output_memory xmlwriter_set_indent xmlwriter_set_indent_string xmlwriter_start_attribute xmlwriter_start_attribute_ns xmlwriter_start_cdata xmlwriter_start_comment xmlwriter_start_document xmlwriter_start_dtd xmlwriter_start_dtd_attlist xmlwriter_start_dtd_element xmlwriter_start_dtd_entity xmlwriter_start_element xmlwriter_start_element_ns xmlwriter_start_pi xmlwriter_text xmlwriter_write_attribute xmlwriter_write_attribute_ns xmlwriter_write_cdata xmlwriter_write_comment xmlwriter_write_dtd xmlwriter_write_dtd_attlist xmlwriter_write_dtd_element xmlwriter_write_dtd_entity xmlwriter_write_element xmlwriter_write_element_ns xmlwriter_write_pi xmlwriter_write_raw xor xsd_1999_namespace xsd_1999_timeinstant xsd_anytype xsd_anyuri xsd_anyxml xsd_base64binary xsd_boolean xsd_byte xsd_date xsd_datetime xsd_decimal xsd_double xsd_duration xsd_entities xsd_entity xsd_float xsd_gday xsd_gmonth xsd_gmonthday xsd_gyear xsd_gyearmonth xsd_hexbinary xsd_id xsd_idref xsd_idrefs xsd_int xsd_integer xsd_language xsd_long xsd_name xsd_namespace xsd_ncname xsd_negativeinteger xsd_nmtoken xsd_nmtokens xsd_nonnegativeinteger xsd_nonpositiveinteger xsd_normalizedstring xsd_notation xsd_positiveinteger xsd_qname xsd_short xsd_string xsd_time xsd_token xsd_unsignedbyte xsd_unsignedint xsd_unsignedlong xsd_unsignedshort xsl_clone_always xsl_clone_auto xsl_clone_never xsl_secpref_create_directory xsl_secpref_default xsl_secpref_none xsl_secpref_read_file xsl_secpref_read_network xsl_secpref_write_file xsl_secpref_write_network yaml_any_break yaml_any_encoding yaml_any_scalar_style yaml_bool_tag yaml_cr_break yaml_crln_break yaml_double_quoted_scalar_style yaml_emit yaml_emit_file yaml_float_tag yaml_folded_scalar_style yaml_int_tag yaml_literal_scalar_style yaml_ln_break yaml_map_tag yaml_null_tag yaml_parse yaml_parse_file yaml_parse_url yaml_php_tag yaml_plain_scalar_style yaml_seq_tag yaml_single_quoted_scalar_style yaml_str_tag yaml_timestamp_tag yaml_utf16be_encoding yaml_utf16le_encoding yaml_utf8_encoding yesexpr yesstr yield zend_debug_build zend_logo_guid zend_multibyte zend_thread_id zend_thread_safe zend_version zip_close zip_entry_close zip_entry_compressedsize zip_entry_compressionmethod zip_entry_filesize zip_entry_name zip_entry_open zip_entry_read zip_open zip_read zlib_decode zlib_encode zlib_encoding_deflate zlib_encoding_gzip zlib_encoding_raw zlib_get_coding_type < / Keywords > <nl> < / Language > <nl> < Language name = " postscript " ext = " ps " commentLine = " % " > <nl> - < Keywords name = " instre1 " > $ error = = = FontDirectory StandardEncoding UserObjects abs add aload anchorsearch and arc arcn arcto array ashow astore atan awidthshow begin bind bitshift bytesavailable cachestatus ceiling charpath clear cleardictstack cleartomark clip clippath closefile closepath concat concatmatrix copy copypage cos count countdictstack countexecstack counttomark currentcmykcolor currentcolorspace currentdash currentdict currentfile currentflat currentfont currentgray currenthsbcolor currentlinecap currentlinejoin currentlinewidth currentmatrix currentmiterlimit currentpagedevice currentpoint currentrgbcolor currentscreen currenttransfer cvi cvlit cvn cvr cvrs cvs cvx def defaultmatrix definefont dict dictstack div dtransform dup echo end eoclip eofill eq erasepage errordict exch exec execstack executeonly executive exit exp false file fill findfont flattenpath floor flush flushfile for forall ge get getinterval grestore grestoreall gsave gt idetmatrix idiv idtransform if ifelse image imagemask index initclip initgraphics initmatrix inustroke invertmatrix itransform known kshow le length lineto ln load log loop lt makefont mark matrix maxlength mod moveto mul ne neg newpath noaccess nor not null nulldevice or pathbbox pathforall pop print prompt pstack put putinterval quit rand rcheck rcurveto read readhexstring readline readonly readstring rectstroke repeat resetfile restore reversepath rlineto rmoveto roll rotate round rrand run save scale scalefont search setblackgeneration setcachedevice setcachelimit setcharwidth setcolorscreen setcolortransfer setdash setflat setfont setgray sethsbcolor setlinecap setlinejoin setlinewidth setmatrix setmiterlimit setpagedevice setrgbcolor setscreen settransfer setvmthreshold show showpage sin sqrt srand stack start status statusdict stop stopped store string stringwidth stroke strokepath sub systemdict token token transform translate true truncate type ueofill undefineresource userdict usertime version vmstatus wcheck where widthshow write writehexstring writestring xcheck xor < / Keywords > <nl> + < Keywords name = " instre1 " > $ error = = = FontDirectory StandardEncoding UserObjects abs add aload anchorsearch and arc arcn arcto array ashow astore atan awidthshow begin bind bitshift bytesavailable cachestatus ceiling charpath clear cleardictstack cleartomark clip clippath closefile closepath concat concatmatrix copy copypage cos count countdictstack countexecstack counttomark currentcmykcolor currentcolorspace currentdash currentdict currentfile currentflat currentfont currentgray currenthsbcolor currentlinecap currentlinejoin currentlinewidth currentmatrix currentmiterlimit currentpagedevice currentpoint currentrgbcolor currentscreen currenttransfer cvi cvlit cvn cvr cvrs cvs cvx def defaultmatrix definefont dict dictstack div dtransform dup echo end eoclip eofill eq erasepage errordict exch exec execstack executeonly executive exit exp false file fill findfont flattenpath floor flush flushfile for forall ge get getinterval grestore grestoreall gsave gt idetmatrix idiv idtransform if ifelse image imagemask index initclip initgraphics initmatrix inustroke invertmatrix itransform known kshow le length lineto ln load log loop lt makefont mark matrix maxlength mod moveto mul ne neg newpath noaccess nor not null nulldevice or pathbbox pathforall pop print prompt pstack put putinterval quit rand rcheck rcurveto read readhexstring readline readonly readstring rectstroke repeat resetfile restore reversepath rlineto rmoveto roll rotate round rrand run save scale scalefont search setblackgeneration setcachedevice setcachelimit setcharwidth setcolorscreen setcolortransfer setdash setflat setfont setgray sethsbcolor setlinecap setlinejoin setlinewidth setmatrix setmiterlimit setpagedevice setrgbcolor setscreen settransfer setvmthreshold show showpage sin sqrt srand stack start status statusdict stop stopped store string stringwidth stroke strokepath sub systemdict token transform translate true truncate type ueofill undefineresource userdict usertime version vmstatus wcheck where widthshow write writehexstring writestring xcheck xor < / Keywords > <nl> < Keywords name = " instre2 " > GlobalFontDirectory ISOLatin1Encoding SharedFontDirectory UserObject arct colorimage cshow currentblackgeneration currentcacheparams currentcmykcolor currentcolor currentcolorrendering currentcolorscreen currentcolorspace currentcolortransfer currentdevparams currentglobal currentgstate currenthalftone currentobjectformat currentoverprint currentpacking currentpagedevice currentshared currentstrokeadjust currentsystemparams currentundercolorremoval currentuserparams defineresource defineuserobject deletefile execform execuserobject filenameforall fileposition filter findencoding findresource gcheck globaldict glyphshow gstate ineofill infill instroke inueofill inufill inustroke languagelevel makepattern packedarray printobject product realtime rectclip rectfill rectstroke renamefile resourceforall resourcestatus revision rootfont scheck selectfont serialnumber setbbox setblackgeneration setcachedevice2 setcacheparams setcmykcolor setcolor setcolorrendering setcolorscreen setcolorspace setcolortranfer setdevparams setfileposition setglobal setgstate sethalftone setobjectformat setoverprint setpacking setpagedevice setpattern setshared setstrokeadjust setsystemparams setucacheparams setundercolorremoval setuserparams setvmthreshold shareddict startjob uappend ucache ucachestatus ueofill ufill undef undefinefont undefineresource undefineuserobject upath ustroke ustrokepath vmreclaim writeobject xshow xyshow yshow < / Keywords > <nl> < Keywords name = " type1 " > cliprestore clipsave composefont currentsmoothness findcolorrendering setsmoothness shfill < / Keywords > <nl> - < Keywords name = " type2 " > . begintransparencygroup . begintransparencymask . bytestring . charboxpath . currentaccuratecurves . currentblendmode . currentcurvejoin . currentdashadapt . currentdotlength . currentfilladjust2 . currentlimitclamp . currentopacityalpha . currentoverprintmode . currentrasterop . currentshapealpha . currentsourcetransparent . currenttextknockout . currenttexturetransparent . dashpath . dicttomark . discardtransparencygroup . discardtransparencymask . endtransparencygroup . endtransparencymask . execn . filename . filename . fileposition . forceput . forceundef . forgetsave . getbitsrect . getdevice . inittransparencymask . knownget . locksafe . makeoperator . namestring . oserrno . oserrorstring . peekstring . rectappend . runandhide . setaccuratecurves . setblendmode . setcurvejoin . setdashadapt . setdebug . setdefaultmatrix . setdotlength . setfilladjust2 . setlimitclamp . setmaxlength . setopacityalpha . setoverprintmode . setrasterop . setsafe . setshapealpha . setsourcetransparent . settextknockout . settexturetransparent . stringbreak . stringmatch . tempfile . type1decrypt . type1encrypt . type1execchar . unread arccos arcsin copydevice copyscanlines currentdevice finddevice findlibfile findprotodevice flushpage getdeviceprops getenv makeimagedevice makewordimagedevice max min putdeviceprops setdevice < / Keywords > <nl> + < Keywords name = " type2 " > . begintransparencygroup . begintransparencymask . bytestring . charboxpath . currentaccuratecurves . currentblendmode . currentcurvejoin . currentdashadapt . currentdotlength . currentfilladjust2 . currentlimitclamp . currentopacityalpha . currentoverprintmode . currentrasterop . currentshapealpha . currentsourcetransparent . currenttextknockout . currenttexturetransparent . dashpath . dicttomark . discardtransparencygroup . discardtransparencymask . endtransparencygroup . endtransparencymask . execn . filename . fileposition . forceput . forceundef . forgetsave . getbitsrect . getdevice . inittransparencymask . knownget . locksafe . makeoperator . namestring . oserrno . oserrorstring . peekstring . rectappend . runandhide . setaccuratecurves . setblendmode . setcurvejoin . setdashadapt . setdebug . setdefaultmatrix . setdotlength . setfilladjust2 . setlimitclamp . setmaxlength . setopacityalpha . setoverprintmode . setrasterop . setsafe . setshapealpha . setsourcetransparent . settextknockout . settexturetransparent . stringbreak . stringmatch . tempfile . type1decrypt . type1encrypt . type1execchar . unread arccos arcsin copydevice copyscanlines currentdevice finddevice findlibfile findprotodevice flushpage getdeviceprops getenv makeimagedevice makewordimagedevice max min putdeviceprops setdevice < / Keywords > <nl> < / Language > <nl> < Language name = " powershell " ext = " ps1 psm1 " commentLine = " # " commentStart = " & lt ; # " commentEnd = " # & gt ; " > <nl> < Keywords name = " instre1 " > break continue do else elseif filter for foreach function if in return switch until where while < / Keywords > <nl> <nl> < Language name = " r " ext = " r s splus " commentLine = " # " > <nl> < Keywords name = " instre1 " > if else repeat while function for in next break TRUE FALSE NULL NA Inf NaN < / Keywords > <nl> < Keywords name = " instre2 " > abbreviate abline abs acf acos acosh addmargins aggregate agrep alarm alias alist all anova any aov aperm append apply approx approxfun apropos ar args arima array arrows asin asinh assign assocplot atan atanh attach attr attributes autoload autoloader ave axis backsolve barplot basename beta bindtextdomain binomial biplot bitmap bmp body box boxplot bquote break browser builtins bxp by bzfile c call cancor capabilities casefold cat category cbind ccf ceiling character charmatch chartr chol choose chull citation class close cm cmdscale codes coef coefficients col colnames colors colorspaces colours comment complex confint conflicts contour contrasts contributors convolve cophenetic coplot cor cos cosh cov covratio cpgram crossprod cummax cummin cumprod cumsum curve cut cutree cycle data dataentry date dbeta dbinom dcauchy dchisq de debug debugger decompose delay deltat demo dendrapply density deparse deriv det detach determinant deviance dexp df dfbeta dfbetas dffits dgamma dgeom dget dhyper diag diff diffinv difftime digamma dim dimnames dir dirname dist dlnorm dlogis dmultinom dnbinom dnorm dotchart double dpois dput drop dsignrank dt dump dunif duplicated dweibull dwilcox eapply ecdf edit effects eigen emacs embed end environment eval evalq example exists exp expression factanal factor factorial family fft fifo file filter find fitted fivenum fix floor flush for force formals format formula forwardsolve fourfoldplot frame frequency ftable function gamma gaussian gc gcinfo gctorture get getenv geterrmessage gettext gettextf getwd gl glm globalenv gray grep grey grid gsub gzcon gzfile hat hatvalues hcl hclust head heatmap help hist history hsv httpclient iconv iconvlist identical identify if ifelse image influence inherits integer integrate interaction interactive intersect invisible isoreg jitter jpeg julian kappa kernapply kernel kmeans knots kronecker ksmooth labels lag lapply layout lbeta lchoose lcm legend length letters levels lfactorial lgamma library licence license line lines list lm load loadhistory loadings local locator loess log logb logical loglin lowess ls lsfit machine mad mahalanobis makepredictcall manova mapply match matlines matplot matpoints matrix max mean median medpolish menu merge message methods mget min missing mode monthplot months mosaicplot mtext mvfft names napredict naprint naresid nargs nchar ncol next nextn ngettext nlevels nlm nls noquote nrow numeric objects offset open optim optimise optimize options order ordered outer pacf page pairlist pairs palette par parse paste pbeta pbinom pbirthday pcauchy pchisq pdf pentagamma person persp pexp pf pgamma pgeom phyper pi pico pictex pie piechart pipe plclust plnorm plogis plot pmatch pmax pmin pnbinom png pnorm points poisson poly polygon polym polyroot postscript power ppoints ppois ppr prcomp predict preplot pretty princomp print prmatrix prod profile profiler proj promax prompt provide psigamma psignrank pt ptukey punif pweibull pwilcox q qbeta qbinom qbirthday qcauchy qchisq qexp qf qgamma qgeom qhyper qlnorm qlogis qnbinom qnorm qpois qqline qqnorm qqplot qr qsignrank qt qtukey quantile quarters quasi quasibinomial quasipoisson quit qunif quote qweibull qwilcox rainbow range rank raw rbeta rbind rbinom rcauchy rchisq readline real recover rect reformulate regexpr relevel remove reorder rep repeat replace replicate replications require reshape resid residuals restart return rev rexp rf rgamma rgb rgeom rhyper rle rlnorm rlogis rm rmultinom rnbinom rnorm round row rownames rowsum rpois rsignrank rstandard rstudent rt rug runif runmed rweibull rwilcox sample sapply save savehistory scale scan screen screeplot sd search searchpaths seek segments seq sequence serialize setdiff setequal setwd shell sign signif sin single sinh sink smooth solve sort source spectrum spline splinefun split sprintf sqrt stack stars start stderr stdin stdout stem step stepfun stl stop stopifnot str strftime strheight stripchart strptime strsplit strtrim structure strwidth strwrap sub subset substitute substr substring sum summary sunflowerplot supsmu svd sweep switch symbols symnum system t table tabulate tail tan tanh tapply tempdir tempfile termplot terms tetragamma text time title toeplitz tolower topenv toupper trace traceback transform trigamma trunc truncate try ts tsdiag tsp typeof unclass undebug union unique uniroot unix unlink unlist unname unserialize unsplit unstack untrace unz update upgrade url var varimax vcov vector version vi vignette warning warnings weekdays weights which while window windows with write wsbrowser xedit xemacs xfig xinch xor xtabs xyinch yinch zapsmall < / Keywords > <nl> - < Keywords name = " type1 " > acme aids aircondit amis aml banking barchart barley beaver bigcity boot brambles breslow bs bwplot calcium cane capability cav censboot channing city claridge cloth cloud coal condense contourplot control corr darwin densityplot dogs dotplot ducks empinf envelope environmental ethanol fir frets gpar grav gravity grob hirose histogram islay knn larrows levelplot llines logit lpoints lsegments lset ltext lvqinit lvqtest manaus melanoma melanoma motor multiedit neuro nitrofen nodal ns nuclear oneway parallel paulsen poisons polar qq qqmath remission rfs saddle salinity shingle simplex singer somgrid splom stripplot survival tau tmd tsboot tuna unit urine viewport wireframe wool xyplot < / Keywords > <nl> + < Keywords name = " type1 " > acme aids aircondit amis aml banking barchart barley beaver bigcity boot brambles breslow bs bwplot calcium cane capability cav censboot channing city claridge cloth cloud coal condense contourplot control corr darwin densityplot dogs dotplot ducks empinf envelope environmental ethanol fir frets gpar grav gravity grob hirose histogram islay knn larrows levelplot llines logit lpoints lsegments lset ltext lvqinit lvqtest manaus melanoma motor multiedit neuro nitrofen nodal ns nuclear oneway parallel paulsen poisons polar qq qqmath remission rfs saddle salinity shingle simplex singer somgrid splom stripplot survival tau tmd tsboot tuna unit urine viewport wireframe wool xyplot < / Keywords > <nl> < / Language > <nl> < Language name = " rc " ext = " rc " commentLine = " / / " commentStart = " / * " commentEnd = " * / " > <nl> < Keywords name = " instre1 " > ACCELERATORS ALT AUTO3STATE AUTOCHECKBOX AUTORADIOBUTTON BEGIN BITMAP BLOCK BUTTON CAPTION CHARACTERISTICS CHECKBOX CLASS COMBOBOX CONTROL CTEXT CURSOR DEFPUSHBUTTON DIALOG DIALOGEX DISCARDABLE EDITTEXT END EXSTYLE FONT GROUPBOX ICON LANGUAGE LISTBOX LTEXT MENU MENUEX MENUITEM MESSAGETABLE POPUP PUSHBUTTON RADIOBUTTON RCDATA RTEXT SCROLLBAR SEPARATOR SHIFT STATE3 STRINGTABLE STYLE TEXTINCLUDE VALUE VERSION VERSIONINFO VIRTKEY < / Keywords > <nl> <nl> < Keywords name = " instre1 " > ARGF ARGV BEGIN END ENV FALSE DATA NIL RUBY_PATCHLEVEL RUBY_PLATFORM RUBY_RELEASE_DATE RUBY_VERSION PLATFORM RELEASE_DATE STDERR STDIN STDOUT TOPLEVEL_BINDING TRUE __ENCODING__ __END__ __FILE__ __LINE__ alias and begin break case class def defined ? do else elsif end ensure false for if in module next nil not or redo rescue retry return self super then true undef unless until when while yield < / Keywords > <nl> < / Language > <nl> < Language name = " scheme " ext = " scm smd ss " commentLine = " ; " > <nl> - < Keywords name = " instre1 " > + - * / = & lt ; & gt ; & lt ; = & gt ; = = & gt ; abs acos and angle append apply asin assoc assoc assq assv atan begin boolean ? caar cadr call - with - current - continuation call / cc call - with - input - file call - with - output - file call - with - values car cdr caar cadr cdar cddr caaar caadr cadar caddr cdaar cdadr cddar cdddr caaaar caaadr caadar caaddr cadaar cadadr caddar cadddr cdaaar cdaadr cdadar cdaddr cddaar cddadr cdddar cddddr case ceiling char - & gt ; integer char - alphabetic ? char - ci & lt ; = ? char - ci & lt ; ? char - ci = ? char - ci & gt ; = ? char - ci & gt ; ? char - downcase char - lower - case ? char - numeric ? char - ready ? char - upcase char - upper - case ? char - whitespace ? char & lt ; = ? char & lt ; ? char = ? char & gt ; = ? char & gt ; ? char ? close - input - port close - output - port complex ? cond cons cos current - input - port current - output - port define define - syntax delay denominator display do dynamic - wind else eof - object ? eq ? equal ? eqv ? eval even ? exact - & gt ; inexact exact ? exp expt floor for - each force gcd if imag - part inexact - & gt ; exact inexact ? input - port ? integer - & gt ; char integer ? interaction - environment lambda lcm length let let * let - syntax letrec letrec - syntax list list - & gt ; string list - & gt ; vector list - ref list - tail list ? load log magnitude make - polar make - rectangular make - string make - vector map max member memq memv min modulo negative ? newline not null - environment null ? number - & gt ; string number ? numerator odd ? open - input - file open - output - file or output - port ? pair ? peek - char input - port ? output - port ? positive ? procedure ? quasiquote quote quotient rational ? rationalize read read - char real - part real ? remainder reverse round scheme - report - environment set ! set - car ! set - cdr ! sin sqrt string string - & gt ; list string - & gt ; number string - & gt ; symbol string - append string - ci & lt ; = ? string - ci & lt ; ? string - ci = ? string - ci & gt ; = ? string - ci & gt ; ? string - copy string - fill ! string - length string - ref string - set ! string & lt ; = ? string & lt ; ? string = ? string & gt ; = ? string & gt ; ? string ? substring symbol - & gt ; string symbol ? syntax - rules transcript - off transcript - on truncate unquote unquote - splicing values vector vector - & gt ; list vector - fill ! vector - length vector - ref vector - set ! vector ? with - input - from - file with - output - to - file write write - char zero ? < / Keywords > <nl> + < Keywords name = " instre1 " > + - * / = & lt ; & gt ; & lt ; = & gt ; = = & gt ; abs acos and angle append apply asin assoc assq assv atan begin boolean ? caar cadr call - with - current - continuation call / cc call - with - input - file call - with - output - file call - with - values car cdr cdar cddr caaar caadr cadar caddr cdaar cdadr cddar cdddr caaaar caaadr caadar caaddr cadaar cadadr caddar cadddr cdaaar cdaadr cdadar cdaddr cddaar cddadr cdddar cddddr case ceiling char - & gt ; integer char - alphabetic ? char - ci & lt ; = ? char - ci & lt ; ? char - ci = ? char - ci & gt ; = ? char - ci & gt ; ? char - downcase char - lower - case ? char - numeric ? char - ready ? char - upcase char - upper - case ? char - whitespace ? char & lt ; = ? char & lt ; ? char = ? char & gt ; = ? char & gt ; ? char ? close - input - port close - output - port complex ? cond cons cos current - input - port current - output - port define define - syntax delay denominator display do dynamic - wind else eof - object ? eq ? equal ? eqv ? eval even ? exact - & gt ; inexact exact ? exp expt floor for - each force gcd if imag - part inexact - & gt ; exact inexact ? input - port ? integer - & gt ; char integer ? interaction - environment lambda lcm length let let * let - syntax letrec letrec - syntax list list - & gt ; string list - & gt ; vector list - ref list - tail list ? load log magnitude make - polar make - rectangular make - string make - vector map max member memq memv min modulo negative ? newline not null - environment null ? number - & gt ; string number ? numerator odd ? open - input - file open - output - file or output - port ? pair ? peek - char positive ? procedure ? quasiquote quote quotient rational ? rationalize read read - char real - part real ? remainder reverse round scheme - report - environment set ! set - car ! set - cdr ! sin sqrt string string - & gt ; list string - & gt ; number string - & gt ; symbol string - append string - ci & lt ; = ? string - ci & lt ; ? string - ci = ? string - ci & gt ; = ? string - ci & gt ; ? string - copy string - fill ! string - length string - ref string - set ! string & lt ; = ? string & lt ; ? string = ? string & gt ; = ? string & gt ; ? string ? substring symbol - & gt ; string symbol ? syntax - rules transcript - off transcript - on truncate unquote unquote - splicing values vector vector - & gt ; list vector - fill ! vector - length vector - ref vector - set ! vector ? with - input - from - file with - output - to - file write write - char zero ? < / Keywords > <nl> < Keywords name = " instre2 " > < / Keywords > <nl> < / Language > <nl> < Language name = " smalltalk " ext = " st " commentStart = " & quot ; " commentEnd = " & quot ; " > <nl> < Keywords name = " instre1 " > ifTrue : ifFalse : whileTrue : whileFalse : ifNil : ifNotNil : whileTrue whileFalse repeat isNil notNil < / Keywords > <nl> < / Language > <nl> < Language name = " sql " ext = " sql " commentStart = " / * " commentEnd = " * / " commentLine = " - - " > <nl> - < Keywords name = " instre1 " > abs absolute access acos add add_months adddate admin after aggregate all allocate alter and any app_name are array as asc ascii asin assertion at atan atn2 audit authid authorization autonomous_transaction avg before begin benchmark between bfilename bigint bin binary binary_checksum binary_integer bit bit_count bit_and bit_or blob body boolean both breadth bulk by call cascade cascaded case cast catalog ceil ceiling char char_base character charindex chartorowid check checksum checksum_agg chr class clob close cluster coalesce col_length col_name collate collation collect column comment commit completion compress concat concat_ws connect connection constant constraint constraints constructorcreate contains containsable continue conv convert corr corresponding cos cot count count_big covar_pop covar_samp create cross cube cume_dist current current_date current_path current_role current_time current_timestamp current_user currval cursor cycle data datalength databasepropertyex date date_add date_format date_sub dateadd datediff datename datepart datetime day db_id db_name deallocate dec declare decimal decode default deferrable deferred degrees delete dense_rank depth deref desc describe descriptor destroy destructor deterministic diagnostics dictionary disconnect difference distinct do domain double drop dump dynamic each else elsif empth encode encrypt end end - exec equals escape every except exception exclusive exec execute exists exit exp export_set extends external extract false fetch first first_value file float floor file_id file_name filegroup_id filegroup_name filegroupproperty fileproperty for forall foreign format formatmessage found freetexttable from from_days fulltextcatalog fulltextservice function general get get_lock getdate getansinull getutcdate global go goto grant greatest group grouping having heap hex hextoraw host host_id host_name hour ident_incr ident_seed ident_current identified identity if ifnull ignore immediate in increment index index_col indexproperty indicator initcap initial initialize initially inner inout input insert instr instrb int integer interface intersect interval into is is_member is_srvrolemember is_null is_numeric isdate isnull isolation iterate java join key lag language large last last_day last_value lateral lcase lead leading least left len length lengthb less level like limit limited ln lpad local localtime localtimestamp locator lock log log10 long loop lower ltrim make_ref map match max maxextents mid min minus minute mlslabel mod mode modifies modify module month months_between names national natural naturaln nchar nclob new new_time newid next next_day nextval no noaudit nocompress nocopy none not nowait null nullif number number_base numeric nvl nvl2 object object_id object_name object_property ocirowid oct of off offline old on online only opaque open operator operation option or ord order ordinalityorganization others out outer output package pad parameter parameters partial partition path pctfree percent_rank pi pls_integer positive positiven postfix pow power pragma precision prefix preorder prepare preserve primary prior private privileges procedure public radians raise rand range rank ratio_to_export raw rawtohex read reads real record recursive ref references referencing reftohex relative release release_lock rename repeat replace resource restrict result return returns reverse revoke right rollback rollup round routine row row_number rowid rowidtochar rowlabel rownum rows rowtype rpad rtrim savepoint schema scroll scope search second section seddev_samp select separate sequence session session_user set sets share sign sin sinh size smallint some soundex space specific specifictype sql sqlcode sqlerrm sqlexception sqlstate sqlwarning sqrt start state statement static std stddev stdev_pop strcmp structure subdate substr substrb substring substring_index subtype successful sum synonym sys_context sys_guid sysdate system_user table tan tanh temporary terminate than then time timestamp timezone_abbr timezone_minute timezone_hour timezone_region tinyint to to_char to_date to_days to_number to_single_byte trailing transaction translate translation treat trigger trim true trunc truncate type ucase uid under union unique unknown unnest update upper usage use user userenv using validate value values var_pop var_samp varbinary varchar varchar2 variable variance varying view vsize when whenever where with without while with work write year zone < / Keywords > <nl> + < Keywords name = " instre1 " > abs absolute access acos add add_months adddate admin after aggregate all allocate alter and any app_name are array as asc ascii asin assertion at atan atn2 audit authid authorization autonomous_transaction avg before begin benchmark between bfilename bigint bin binary binary_checksum binary_integer bit bit_count bit_and bit_or blob body boolean both breadth bulk by call cascade cascaded case cast catalog ceil ceiling char char_base character charindex chartorowid check checksum checksum_agg chr class clob close cluster coalesce col_length col_name collate collation collect column comment commit completion compress concat concat_ws connect connection constant constraint constraints constructorcreate contains containsable continue conv convert corr corresponding cos cot count count_big covar_pop covar_samp create cross cube cume_dist current current_date current_path current_role current_time current_timestamp current_user currval cursor cycle data datalength databasepropertyex date date_add date_format date_sub dateadd datediff datename datepart datetime day db_id db_name deallocate dec declare decimal decode default deferrable deferred degrees delete dense_rank depth deref desc describe descriptor destroy destructor deterministic diagnostics dictionary disconnect difference distinct do domain double drop dump dynamic each else elsif empth encode encrypt end end - exec equals escape every except exception exclusive exec execute exists exit exp export_set extends external extract false fetch first first_value file float floor file_id file_name filegroup_id filegroup_name filegroupproperty fileproperty for forall foreign format formatmessage found freetexttable from from_days fulltextcatalog fulltextservice function general get get_lock getdate getansinull getutcdate global go goto grant greatest group grouping having heap hex hextoraw host host_id host_name hour ident_incr ident_seed ident_current identified identity if ifnull ignore immediate in increment index index_col indexproperty indicator initcap initial initialize initially inner inout input insert instr instrb int integer interface intersect interval into is is_member is_srvrolemember is_null is_numeric isdate isnull isolation iterate java join key lag language large last last_day last_value lateral lcase lead leading least left len length lengthb less level like limit limited ln lpad local localtime localtimestamp locator lock log log10 long loop lower ltrim make_ref map match max maxextents mid min minus minute mlslabel mod mode modifies modify module month months_between names national natural naturaln nchar nclob new new_time newid next next_day nextval no noaudit nocompress nocopy none not nowait null nullif number number_base numeric nvl nvl2 object object_id object_name object_property ocirowid oct of off offline old on online only opaque open operator operation option or ord order ordinalityorganization others out outer output package pad parameter parameters partial partition path pctfree percent_rank pi pls_integer positive positiven postfix pow power pragma precision prefix preorder prepare preserve primary prior private privileges procedure public radians raise rand range rank ratio_to_export raw rawtohex read reads real record recursive ref references referencing reftohex relative release release_lock rename repeat replace resource restrict result return returns reverse revoke right rollback rollup round routine row row_number rowid rowidtochar rowlabel rownum rows rowtype rpad rtrim savepoint schema scroll scope search second section seddev_samp select separate sequence session session_user set sets share sign sin sinh size smallint some soundex space specific specifictype sql sqlcode sqlerrm sqlexception sqlstate sqlwarning sqrt start state statement static std stddev stdev_pop strcmp structure subdate substr substrb substring substring_index subtype successful sum synonym sys_context sys_guid sysdate system_user table tan tanh temporary terminate than then time timestamp timezone_abbr timezone_minute timezone_hour timezone_region tinyint to to_char to_date to_days to_number to_single_byte trailing transaction translate translation treat trigger trim true trunc truncate type ucase uid under union unique unknown unnest update upper usage use user userenv using validate value values var_pop var_samp varbinary varchar varchar2 variable variance varying view vsize when whenever where with without while work write year zone < / Keywords > <nl> < / Language > <nl> < Language name = " tcl " ext = " tcl " commentLine = " # " > <nl> < Keywords name = " instre1 " > after append array auto_execok auto_import auto_load auto_load_index auto_qualify beep binary break case catch cd clock close concat continue dde default echo else elseif encoding eof error eval exec exit expr fblocked fconfigure fcopy file fileevent flush for foreach format gets glob global history if incr info interp join lappend lindex linsert list llength load lrange lreplace lsearch lsort namespace open package pid pkg_mkIndex proc puts pwd read regexp regsub rename resource return scan seek set socket source split string subst switch tclLog tclMacPkgSearch tclPkgSetup tclPkgUnknown tell time trace unknown unset update uplevel upvar variable vwait while < / Keywords > <nl>
|
Remove duplicate keywords from langs . model . xml
|
notepad-plus-plus/notepad-plus-plus
|
5045b02fa39dffbaa598f2060cfd47dd688e80c2
|
2016-11-27T14:57:47Z
|
mmm a / python / mxnet / io . py <nl> ppp b / python / mxnet / io . py <nl> def __init__ ( self , iters , rename_data = None , rename_label = None ) : <nl> self . n_iter = len ( iters ) <nl> assert self . n_iter > 0 <nl> self . iters = iters <nl> - if rename_data is None : <nl> - self . provide_data = sum ( [ i . provide_data for i in iters ] , [ ] ) <nl> - else : <nl> - self . provide_data = sum ( [ [ ( r [ n ] , s ) for n , s in i . provide_data ] \ <nl> - for r , i in zip ( rename_data , iters ) ] , [ ] ) <nl> - if rename_label is None : <nl> - self . provide_label = sum ( [ i . provide_label for i in iters ] , [ ] ) <nl> - else : <nl> - self . provide_label = sum ( [ [ ( r [ n ] , s ) for n , s in i . provide_label ] \ <nl> - for r , i in zip ( rename_label , iters ) ] , [ ] ) <nl> + self . rename_data = rename_data <nl> + self . rename_label = rename_label <nl> self . batch_size = self . provide_data [ 0 ] [ 1 ] [ 0 ] <nl> self . data_ready = [ threading . Event ( ) for i in range ( self . n_iter ) ] <nl> self . data_taken = [ threading . Event ( ) for i in range ( self . n_iter ) ] <nl> def __del__ ( self ) : <nl> for thread in self . prefetch_threads : <nl> thread . join ( ) <nl> <nl> + @ property <nl> + def provide_data ( self ) : <nl> + " " " The name and shape of data provided by this iterator " " " <nl> + if self . rename_data is None : <nl> + return sum ( [ i . provide_data for i in self . iters ] , [ ] ) <nl> + else : <nl> + return sum ( [ [ ( r [ n ] , s ) for n , s in i . provide_data ] \ <nl> + for r , i in zip ( self . rename_data , self . iters ) ] , [ ] ) <nl> + <nl> + @ property <nl> + def provide_label ( self ) : <nl> + " " " The name and shape of label provided by this iterator " " " <nl> + if self . rename_label is None : <nl> + return sum ( [ i . provide_label for i in self . iters ] , [ ] ) <nl> + else : <nl> + return sum ( [ [ ( r [ n ] , s ) for n , s in i . provide_label ] \ <nl> + for r , i in zip ( self . rename_label , self . iters ) ] , [ ] ) <nl> + <nl> def reset ( self ) : <nl> for e in self . data_ready : <nl> e . wait ( ) <nl> def iter_next ( self ) : <nl> self . current_batch = DataBatch ( sum ( [ batch . data for batch in self . next_batch ] , [ ] ) , <nl> sum ( [ batch . label for batch in self . next_batch ] , [ ] ) , <nl> self . next_batch [ 0 ] . pad , <nl> - self . next_batch [ 0 ] . index ) <nl> + self . next_batch [ 0 ] . index , <nl> + provide_data = self . provide_data , <nl> + provide_label = self . provide_label ) <nl> for e in self . data_ready : <nl> e . clear ( ) <nl> for e in self . data_taken : <nl>
|
fix PrefetchingIter for provide_data / label ( )
|
apache/incubator-mxnet
|
147c6dc70c18b491d84d6b5a243696213a224026
|
2016-10-08T01:53:27Z
|
mmm a / src / mongo / base / error_codes . err <nl> ppp b / src / mongo / base / error_codes . err <nl> error_code ( " XXX_TEMP_NAME_ReadCommittedCurrentlyUnavailable " , 134 ) <nl> error_code ( " StaleTerm " , 135 ) <nl> error_code ( " CappedPositionLost " , 136 ) <nl> error_code ( " IncompatibleShardingConfigVersion " , 137 ) <nl> + error_code ( " RemoteOplogStale " , 138 ) <nl> <nl> # Non - sequential error codes ( for compatibility only ) <nl> error_code ( " NotMaster " , 10107 ) # this comes from assert_util . h <nl> mmm a / src / mongo / db / SConscript <nl> ppp b / src / mongo / db / SConscript <nl> serverOnlyFiles = [ <nl> " range_deleter_db_env . cpp " , <nl> " range_deleter_service . cpp " , <nl> " repair_database . cpp " , <nl> - " repl / bgsync . cpp " , <nl> " repl / initial_sync . cpp " , <nl> " repl / master_slave . cpp " , <nl> " repl / minvalid . cpp " , <nl> serveronlyLibdeps = [ <nl> " pipeline / pipeline " , <nl> " query / query " , <nl> " range_deleter " , <nl> + " repl / bgsync " , <nl> " repl / repl_coordinator_global " , <nl> " repl / repl_coordinator_impl " , <nl> " repl / repl_settings " , <nl> mmm a / src / mongo / db / repl / SConscript <nl> ppp b / src / mongo / db / repl / SConscript <nl> <nl> <nl> Import ( " env " ) <nl> <nl> + env . Library ( <nl> + target = ' bgsync ' , <nl> + source = [ <nl> + ' bgsync . cpp ' , <nl> + ] , <nl> + LIBDEPS = [ <nl> + ' repl_coordinator_interface ' , <nl> + ' rollback_source_impl ' , <nl> + ' rs_rollback ' , <nl> + ' $ BUILD_DIR / mongo / db / auth / authorization_manager_global ' , <nl> + ' $ BUILD_DIR / mongo / db / commands / server_status_core ' , <nl> + ' $ BUILD_DIR / mongo / db / concurrency / write_conflict_exception ' , <nl> + ' $ BUILD_DIR / mongo / db / service_context ' , <nl> + ' $ BUILD_DIR / mongo / db / stats / timer_stats ' , <nl> + ' $ BUILD_DIR / mongo / executor / task_executor_interface ' , <nl> + ' $ BUILD_DIR / mongo / util / fail_point ' , <nl> + ] , <nl> + ) <nl> + <nl> env . Library ( ' repl_settings ' , <nl> ' repl_settings . cpp ' , <nl> LIBDEPS = [ <nl> mmm a / src / mongo / db / repl / bgsync . cpp <nl> ppp b / src / mongo / db / repl / bgsync . cpp <nl> <nl> # include " mongo / util / exit . h " <nl> # include " mongo / util / fail_point_service . h " <nl> # include " mongo / util / log . h " <nl> + # include " mongo / util / mongoutils / str . h " <nl> <nl> namespace mongo { <nl> <nl> void BackgroundSync : : _produce ( OperationContext * txn , executor : : TaskExecutor * tas <nl> return ; <nl> } <nl> <nl> - if ( _rollbackIfNeeded ( txn , syncSourceReader ) ) { <nl> - stop ( ) ; <nl> - return ; <nl> + { <nl> + / / Prefer host in oplog reader to _syncSourceHost because _syncSourceHost may be cleared <nl> + / / if sync source feedback fails . <nl> + const HostAndPort source = syncSourceReader . getHost ( ) ; <nl> + <nl> + auto getNextOperation = [ & syncSourceReader ] ( ) - > StatusWith < BSONObj > { <nl> + if ( ! syncSourceReader . more ( ) ) { <nl> + return Status ( ErrorCodes : : OplogStartMissing , " remote oplog start missing " ) ; <nl> + } <nl> + return syncSourceReader . nextSafe ( ) ; <nl> + } ; <nl> + auto getConnection = <nl> + [ & syncSourceReader ] ( ) - > DBClientBase * { return syncSourceReader . conn ( ) ; } ; <nl> + <nl> + auto remoteOplogStartStatus = _checkRemoteOplogStart ( getNextOperation ) ; <nl> + if ( ! remoteOplogStartStatus . isOK ( ) ) { <nl> + log ( ) < < " starting rollback : " < < remoteOplogStartStatus ; <nl> + _rollback ( txn , source , getConnection ) ; <nl> + stop ( ) ; <nl> + return ; <nl> + } <nl> } <nl> <nl> while ( ! inShutdown ( ) ) { <nl> void BackgroundSync : : consume ( ) { <nl> bufferSizeGauge . decrement ( getSize ( op ) ) ; <nl> } <nl> <nl> - bool BackgroundSync : : _rollbackIfNeeded ( OperationContext * txn , OplogReader & r ) { <nl> - string hn = r . conn ( ) - > getServerAddress ( ) ; <nl> - <nl> - / / Abort only when syncRollback detects we are in a unrecoverable state . <nl> - / / In other cases , we log the message contained in the error status and retry later . <nl> - auto fassertRollbackStatusNoTrace = [ ] ( int msgid , const Status & status ) { <nl> - if ( status . isOK ( ) ) { <nl> - return ; <nl> - } <nl> - if ( ErrorCodes : : UnrecoverableRollbackError = = status . code ( ) ) { <nl> - fassertNoTrace ( msgid , status ) ; <nl> - } <nl> - warning ( ) < < " rollback cannot proceed at this time ( retrying later ) : " < < status ; <nl> - } ; <nl> - <nl> - if ( ! r . more ( ) ) { <nl> + Status BackgroundSync : : _checkRemoteOplogStart ( <nl> + stdx : : function < StatusWith < BSONObj > ( ) > getNextOperation ) { <nl> + auto result = getNextOperation ( ) ; <nl> + if ( ! result . isOK ( ) ) { <nl> / / The GTE query from upstream returns nothing , so we ' re ahead of the upstream . <nl> - log ( ) < < " we are ahead of the sync source , will try to roll back " ; <nl> - fassertRollbackStatusNoTrace ( 28656 , <nl> - syncRollback ( txn , <nl> - _replCoord - > getMyLastOptime ( ) , <nl> - OplogInterfaceLocal ( txn , rsOplogName ) , <nl> - RollbackSourceImpl ( r . conn ( ) , rsOplogName ) , <nl> - _replCoord ) ) ; <nl> - <nl> - return true ; <nl> + return Status ( ErrorCodes : : RemoteOplogStale , <nl> + " we are ahead of the sync source , will try to roll back " ) ; <nl> } <nl> - <nl> - BSONObj o = r . nextSafe ( ) ; <nl> + BSONObj o = result . getValue ( ) ; <nl> OpTime opTime = extractOpTime ( o ) ; <nl> long long hash = o [ " h " ] . numberLong ( ) ; <nl> if ( opTime ! = _lastOpTimeFetched | | hash ! = _lastFetchedHash ) { <nl> - log ( ) < < " our last op time fetched : " < < _lastOpTimeFetched ; <nl> - log ( ) < < " source ' s GTE : " < < opTime ; <nl> - fassertRollbackStatusNoTrace ( 28657 , <nl> - syncRollback ( txn , <nl> - _replCoord - > getMyLastOptime ( ) , <nl> - OplogInterfaceLocal ( txn , rsOplogName ) , <nl> - RollbackSourceImpl ( r . conn ( ) , rsOplogName ) , <nl> - _replCoord ) ) ; <nl> - return true ; <nl> + return Status ( ErrorCodes : : OplogStartMissing , <nl> + str : : stream ( ) < < " our last op time fetched : " < < _lastOpTimeFetched . toString ( ) <nl> + < < " . source ' s GTE : " < < opTime . toString ( ) ) ; <nl> } <nl> + return Status : : OK ( ) ; <nl> + } <nl> <nl> - return false ; <nl> + void BackgroundSync : : _rollback ( OperationContext * txn , <nl> + const HostAndPort & source , <nl> + stdx : : function < DBClientBase * ( ) > getConnection ) { <nl> + / / Abort only when syncRollback detects we are in a unrecoverable state . <nl> + / / In other cases , we log the message contained in the error status and retry later . <nl> + auto status = syncRollback ( txn , <nl> + _replCoord - > getMyLastOptime ( ) , <nl> + OplogInterfaceLocal ( txn , rsOplogName ) , <nl> + RollbackSourceImpl ( getConnection , source , rsOplogName ) , <nl> + _replCoord ) ; <nl> + if ( status . isOK ( ) ) { <nl> + return ; <nl> + } <nl> + if ( ErrorCodes : : UnrecoverableRollbackError = = status . code ( ) ) { <nl> + fassertNoTrace ( 28723 , status ) ; <nl> + } <nl> + warning ( ) < < " rollback cannot proceed at this time ( retrying later ) : " < < status ; <nl> } <nl> <nl> HostAndPort BackgroundSync : : getSyncTarget ( ) { <nl> void BackgroundSync : : stop ( ) { <nl> void BackgroundSync : : start ( OperationContext * txn ) { <nl> massert ( 16235 , " going to start syncing , but buffer is not empty " , _buffer . empty ( ) ) ; <nl> <nl> - long long updatedLastAppliedHash = _readLastAppliedHash ( txn ) ; <nl> + long long lastFetchedHash = _readLastAppliedHash ( txn ) ; <nl> stdx : : lock_guard < stdx : : mutex > lk ( _mutex ) ; <nl> _pause = false ; <nl> <nl> / / reset _last fields with current oplog data <nl> _lastOpTimeFetched = _replCoord - > getMyLastOptime ( ) ; <nl> - _lastFetchedHash = updatedLastAppliedHash ; <nl> + _lastFetchedHash = lastFetchedHash ; <nl> <nl> LOG ( 1 ) < < " bgsync fetch queue set to : " < < _lastOpTimeFetched < < " " < < _lastFetchedHash ; <nl> } <nl> mmm a / src / mongo / db / repl / bgsync . h <nl> ppp b / src / mongo / db / repl / bgsync . h <nl> <nl> <nl> # pragma once <nl> <nl> + # include " mongo / base / status_with . h " <nl> # include " mongo / db / jsobj . h " <nl> # include " mongo / db / repl / optime . h " <nl> # include " mongo / stdx / condition_variable . h " <nl> + # include " mongo / stdx / functional . h " <nl> # include " mongo / stdx / mutex . h " <nl> # include " mongo / util / net / hostandport . h " <nl> # include " mongo / util / queue . h " <nl> <nl> namespace mongo { <nl> <nl> + class DBClientBase ; <nl> class OperationContext ; <nl> <nl> namespace executor { <nl> class TaskExecutor ; <nl> namespace repl { <nl> <nl> class Member ; <nl> - class OplogReader ; <nl> class ReplicationCoordinator ; <nl> <nl> / / This interface exists to facilitate easier testing ; <nl> class BackgroundSync : public BackgroundSyncInterface { <nl> / / Production thread <nl> void _producerThread ( executor : : TaskExecutor * taskExecutor ) ; <nl> void _produce ( OperationContext * txn , executor : : TaskExecutor * taskExecutor ) ; <nl> - / / Checks the criteria for rolling back and executes a rollback if warranted . <nl> - bool _rollbackIfNeeded ( OperationContext * txn , OplogReader & r ) ; <nl> + <nl> + / * * <nl> + * Checks the criteria for rolling back . <nl> + * ' getNextOperation ' returns the first result of the oplog tailing query . <nl> + * Returns RemoteOplogStale if the oplog query has no results . <nl> + * Returns OplogStartMissing if we cannot find the timestamp of the last fetched operation in <nl> + * the remote oplog . <nl> + * / <nl> + Status _checkRemoteOplogStart ( stdx : : function < StatusWith < BSONObj > ( ) > getNextOperation ) ; <nl> + <nl> + / * * <nl> + * Executes a rollback . <nl> + * ' getConnection ' returns a connection to the sync source . <nl> + * / <nl> + void _rollback ( OperationContext * txn , <nl> + const HostAndPort & source , <nl> + stdx : : function < DBClientBase * ( ) > getConnection ) ; <nl> <nl> / / Evaluate if the current sync target is still good <nl> bool _shouldChangeSyncSource ( const HostAndPort & syncSource ) ; <nl> mmm a / src / mongo / db / repl / oplog_interface_remote . cpp <nl> ppp b / src / mongo / db / repl / oplog_interface_remote . cpp <nl> StatusWith < OplogInterface : : Iterator : : Value > OplogIteratorRemote : : next ( ) { <nl> <nl> } / / namespace <nl> <nl> - OplogInterfaceRemote : : OplogInterfaceRemote ( DBClientConnection * conn , <nl> + OplogInterfaceRemote : : OplogInterfaceRemote ( GetConnectionFn getConnection , <nl> const std : : string & collectionName ) <nl> - : _conn ( conn ) , _collectionName ( collectionName ) { <nl> - invariant ( conn ) ; <nl> - } <nl> + : _getConnection ( getConnection ) , _collectionName ( collectionName ) { } <nl> <nl> std : : string OplogInterfaceRemote : : toString ( ) const { <nl> - return _conn - > toString ( ) ; <nl> + return _getConnection ( ) - > toString ( ) ; <nl> } <nl> <nl> std : : unique_ptr < OplogInterface : : Iterator > OplogInterfaceRemote : : makeIterator ( ) const { <nl> const Query query = Query ( ) . sort ( BSON ( " $ natural " < < - 1 ) ) ; <nl> const BSONObj fields = BSON ( " ts " < < 1 < < " h " < < 1 ) ; <nl> - return std : : unique_ptr < OplogInterface : : Iterator > ( <nl> - new OplogIteratorRemote ( _conn - > query ( _collectionName , query , 0 , 0 , & fields , 0 , 0 ) ) ) ; <nl> + return std : : unique_ptr < OplogInterface : : Iterator > ( new OplogIteratorRemote ( <nl> + _getConnection ( ) - > query ( _collectionName , query , 0 , 0 , & fields , 0 , 0 ) ) ) ; <nl> } <nl> <nl> } / / namespace repl <nl> mmm a / src / mongo / db / repl / oplog_interface_remote . h <nl> ppp b / src / mongo / db / repl / oplog_interface_remote . h <nl> <nl> # pragma once <nl> <nl> # include " mongo / db / repl / oplog_interface . h " <nl> + # include " mongo / stdx / functional . h " <nl> <nl> namespace mongo { <nl> <nl> - class DBClientConnection ; <nl> + class DBClientBase ; <nl> <nl> namespace repl { <nl> <nl> namespace repl { <nl> <nl> class OplogInterfaceRemote : public OplogInterface { <nl> public : <nl> - explicit OplogInterfaceRemote ( DBClientConnection * conn , const std : : string & collectionName ) ; <nl> + / * * <nl> + * Type of function to return a connection to the sync source . <nl> + * / <nl> + using GetConnectionFn = stdx : : function < DBClientBase * ( ) > ; <nl> + <nl> + OplogInterfaceRemote ( GetConnectionFn getConnection , const std : : string & collectionName ) ; <nl> std : : string toString ( ) const override ; <nl> std : : unique_ptr < OplogInterface : : Iterator > makeIterator ( ) const override ; <nl> <nl> private : <nl> - DBClientConnection * _conn ; <nl> + GetConnectionFn _getConnection ; <nl> std : : string _collectionName ; <nl> } ; <nl> <nl> mmm a / src / mongo / db / repl / rollback_source_impl . cpp <nl> ppp b / src / mongo / db / repl / rollback_source_impl . cpp <nl> <nl> namespace mongo { <nl> namespace repl { <nl> <nl> - RollbackSourceImpl : : RollbackSourceImpl ( DBClientConnection * conn , const std : : string & collectionName ) <nl> - : _conn ( conn ) , _collectionName ( collectionName ) , _oplog ( conn , collectionName ) { } <nl> + RollbackSourceImpl : : RollbackSourceImpl ( GetConnectionFn getConnection , <nl> + const HostAndPort & source , <nl> + const std : : string & collectionName ) <nl> + : _getConnection ( getConnection ) , <nl> + _source ( source ) , <nl> + _collectionName ( collectionName ) , <nl> + _oplog ( getConnection , collectionName ) { } <nl> <nl> const OplogInterface & RollbackSourceImpl : : getOplog ( ) const { <nl> return _oplog ; <nl> const OplogInterface & RollbackSourceImpl : : getOplog ( ) const { <nl> <nl> int RollbackSourceImpl : : getRollbackId ( ) const { <nl> bo info ; <nl> - _conn - > simpleCommand ( " admin " , & info , " replSetGetRBID " ) ; <nl> + _getConnection ( ) - > simpleCommand ( " admin " , & info , " replSetGetRBID " ) ; <nl> return info [ " rbid " ] . numberInt ( ) ; <nl> } <nl> <nl> BSONObj RollbackSourceImpl : : getLastOperation ( ) const { <nl> const Query query = Query ( ) . sort ( BSON ( " $ natural " < < - 1 ) ) ; <nl> - return _conn - > findOne ( _collectionName , query , 0 , QueryOption_SlaveOk ) ; <nl> + return _getConnection ( ) - > findOne ( _collectionName , query , 0 , QueryOption_SlaveOk ) ; <nl> } <nl> <nl> BSONObj RollbackSourceImpl : : findOne ( const NamespaceString & nss , const BSONObj & filter ) const { <nl> - return _conn - > findOne ( nss . toString ( ) , filter , NULL , QueryOption_SlaveOk ) . getOwned ( ) ; <nl> + return _getConnection ( ) - > findOne ( nss . toString ( ) , filter , NULL , QueryOption_SlaveOk ) . getOwned ( ) ; <nl> } <nl> <nl> void RollbackSourceImpl : : copyCollectionFromRemote ( OperationContext * txn , <nl> const NamespaceString & nss ) const { <nl> std : : string errmsg ; <nl> std : : unique_ptr < DBClientConnection > tmpConn ( new DBClientConnection ( ) ) ; <nl> - uassert ( 15908 , <nl> - errmsg , <nl> - tmpConn - > connect ( _conn - > getServerHostAndPort ( ) , errmsg ) & & <nl> - replAuthenticate ( tmpConn . get ( ) ) ) ; <nl> + uassert ( 15908 , errmsg , tmpConn - > connect ( _source , errmsg ) & & replAuthenticate ( tmpConn . get ( ) ) ) ; <nl> <nl> / / cloner owns _conn in unique_ptr <nl> Cloner cloner ; <nl> void RollbackSourceImpl : : copyCollectionFromRemote ( OperationContext * txn , <nl> <nl> StatusWith < BSONObj > RollbackSourceImpl : : getCollectionInfo ( const NamespaceString & nss ) const { <nl> std : : list < BSONObj > info = <nl> - _conn - > getCollectionInfos ( nss . db ( ) . toString ( ) , BSON ( " name " < < nss . coll ( ) ) ) ; <nl> + _getConnection ( ) - > getCollectionInfos ( nss . db ( ) . toString ( ) , BSON ( " name " < < nss . coll ( ) ) ) ; <nl> if ( info . empty ( ) ) { <nl> return StatusWith < BSONObj > ( ErrorCodes : : NoSuchKey , <nl> str : : stream ( ) < < " no collection info found : " < < nss . ns ( ) ) ; <nl> mmm a / src / mongo / db / repl / rollback_source_impl . h <nl> ppp b / src / mongo / db / repl / rollback_source_impl . h <nl> <nl> <nl> # include " mongo / db / repl / oplog_interface_remote . h " <nl> # include " mongo / db / repl / rollback_source . h " <nl> + # include " mongo / stdx / functional . h " <nl> + # include " mongo / util / net / hostandport . h " <nl> <nl> namespace mongo { <nl> <nl> - class DBClientConnection ; <nl> + class DBClientBase ; <nl> <nl> namespace repl { <nl> <nl> namespace repl { <nl> <nl> class RollbackSourceImpl : public RollbackSource { <nl> public : <nl> - explicit RollbackSourceImpl ( DBClientConnection * conn , const std : : string & collectionName ) ; <nl> + / * * <nl> + * Type of function to return a connection to the sync source . <nl> + * / <nl> + using GetConnectionFn = stdx : : function < DBClientBase * ( ) > ; <nl> + <nl> + RollbackSourceImpl ( GetConnectionFn getConnection , <nl> + const HostAndPort & source , <nl> + const std : : string & collectionName ) ; <nl> <nl> const OplogInterface & getOplog ( ) const override ; <nl> <nl> class RollbackSourceImpl : public RollbackSource { <nl> StatusWith < BSONObj > getCollectionInfo ( const NamespaceString & nss ) const override ; <nl> <nl> private : <nl> - DBClientConnection * _conn ; <nl> + GetConnectionFn _getConnection ; <nl> + HostAndPort _source ; <nl> std : : string _collectionName ; <nl> OplogInterfaceRemote _oplog ; <nl> } ; <nl>
|
SERVER - 19307 refactored BackgroundSync producer thread and rollback code .
|
mongodb/mongo
|
0a541ac95cb32c6e97c012e46f4a09e8f58ca4de
|
2015-07-14T13:33:36Z
|
mmm a / cmake / treedata / optional / common / python . txt <nl> ppp b / cmake / treedata / optional / common / python . txt <nl> <nl> xbmc / interfaces / legacy interfaces / legacy # PYTHON <nl> xbmc / interfaces / legacy / wsgi interfaces / legacy / wsgi # PYTHON <nl> xbmc / interfaces / python interfaces / python # PYTHON <nl> - xbmc / interfaces / swig build / swig # PYTHON <nl> + xbmc / interfaces / swig swig # PYTHON <nl>
|
fixed : get rid of additional build / in swig build path
|
xbmc/xbmc
|
09e41c61a613def05384b52bff211e9905c69ce2
|
2017-12-11T16:35:42Z
|
mmm a / documentation / sphinx / source / old - release - notes / release - notes - 520 . rst <nl> ppp b / documentation / sphinx / source / old - release - notes / release - notes - 520 . rst <nl> Fixes <nl> mmm - - <nl> <nl> * A client could fail to connect to a cluster when the cluster was upgraded to a version compatible with the client . This affected upgrades that were using the multi - version client to maintain compatibility with both versions of the cluster . ` ( PR # 637 ) < https : / / github . com / apple / foundationdb / pull / 637 > ` _ <nl> + * Incorrect accounting of incompatible connections led to occasional assertion failures . ` ( PR # 637 ) < https : / / github . com / apple / foundationdb / pull / 637 > ` _ <nl> <nl> 5 . 2 . 6 <nl> = = = = = <nl>
|
Add missing release note .
|
apple/foundationdb
|
06daadaf25f9129cf8b74a42c56c8d21767c3aac
|
2018-08-09T16:09:00Z
|
mmm a / tests / cases / 2xi40 . ll <nl> ppp b / tests / cases / 2xi40 . ll <nl> <nl> ; ModuleID = ' / tmp / tmpe4Pk1F / a . out . bc ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> % struct . pair = type { [ 5 x i8 ] , [ 5 x i8 ] } <nl> <nl> mmm a / tests / cases / 514_ta2 . ll <nl> ppp b / tests / cases / 514_ta2 . ll <nl> <nl> ; ModuleID = ' / tmp / tmpxFUbAg / test_emcc1 . bc ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> % struct . c_s = type { i8 , float , i32 } <nl> <nl> mmm a / tests / cases / aliasbitcast . ll <nl> ppp b / tests / cases / aliasbitcast . ll <nl> <nl> ; ModuleID = ' / tmp / emscripten / tmp / src . cpp . o ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> @ . str = private constant [ 14 x i8 ] c " hello , world ! \ 00 " , align 1 ; [ # uses = 1 ] <nl> <nl> mmm a / tests / cases / atomicrmw . ll <nl> ppp b / tests / cases / atomicrmw . ll <nl> <nl> ; ModuleID = ' tests / hello_world . bc ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> @ . str = private unnamed_addr constant [ 15 x i8 ] c " hello , % d , % d ! \ 0A \ 00 " , align 1 ; [ # uses = 1 type = [ 15 x i8 ] * ] <nl> <nl> mmm a / tests / cases / atomicrmw_dec . ll <nl> ppp b / tests / cases / atomicrmw_dec . ll <nl> <nl> ; ModuleID = ' tests / hello_world . bc ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> @ . str = private unnamed_addr constant [ 15 x i8 ] c " hello , % d , % d ! \ 0A \ 00 " , align 1 ; [ # uses = 1 type = [ 15 x i8 ] * ] <nl> <nl> mmm a / tests / cases / atomicrmw_unaligned . ll <nl> ppp b / tests / cases / atomicrmw_unaligned . ll <nl> <nl> ; ModuleID = ' tests / hello_world . bc ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> @ . str = private unnamed_addr constant [ 15 x i8 ] c " hello , % d , % d ! \ 0A \ 00 " , align 1 ; [ # uses = 1 type = [ 15 x i8 ] * ] <nl> <nl> mmm a / tests / cases / bigdouble . ll <nl> ppp b / tests / cases / bigdouble . ll <nl> <nl> ; ModuleID = ' / tmp / tmpijH2sB / a . out . bc ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> @ . str = private unnamed_addr constant [ 4 x i8 ] c " % f \ 0A \ 00 " , align 1 <nl> <nl> mmm a / tests / cases / boolret_fastcomp . ll <nl> ppp b / tests / cases / boolret_fastcomp . ll <nl> <nl> ; ModuleID = ' tests / hello_world . bc ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> @ . str = private unnamed_addr constant [ 15 x i8 ] c " helloworld % d . \ 0A \ 00 " , align 1 <nl> <nl> mmm a / tests / cases / breakinthemiddle . ll <nl> ppp b / tests / cases / breakinthemiddle . ll <nl> <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> @ . str = private constant [ 15 x i8 ] c " hello , world ! \ 0A \ 00 " , align 1 ; [ # uses = 1 ] <nl> <nl> mmm a / tests / cases / breakinthemiddle2 . ll <nl> ppp b / tests / cases / breakinthemiddle2 . ll <nl> <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> @ . str = private constant [ 15 x i8 ] c " hello , world ! \ 0A \ 00 " , align 1 ; [ # uses = 1 ] <nl> <nl> mmm a / tests / cases / caall . ll <nl> ppp b / tests / cases / caall . ll <nl> <nl> ; ModuleID = ' tests / hello_world . bc ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> @ . str = private unnamed_addr constant [ 15 x i8 ] c " hello , world ! \ 0A \ 00 " , align 1 ; [ # uses = 1 type = [ 15 x i8 ] * ] <nl> <nl> mmm a / tests / cases / callwithstructural64_ta2 . ll <nl> ppp b / tests / cases / callwithstructural64_ta2 . ll <nl> <nl> ; ModuleID = ' foo . bc ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> % ac = type { i8 * , i64 } <nl> <nl> mmm a / tests / cases / callwithstructural_ta2 . ll <nl> ppp b / tests / cases / callwithstructural_ta2 . ll <nl> <nl> ; ModuleID = ' foo . bc ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> % ac = type { i8 * , i32 } <nl> <nl> mmm a / tests / cases / complexphi . ll <nl> ppp b / tests / cases / complexphi . ll <nl> <nl> ; ModuleID = ' / dev / shm / tmp / src . cpp . o ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> @ . str = private unnamed_addr constant [ 15 x i8 ] c " hello , world ! \ 0A \ 00 " , align 1 ; [ # uses = 1 type = [ 15 x i8 ] * ] <nl> @ _dispatchTable = internal global i64 0 <nl> mmm a / tests / cases / ctors_cast . ll <nl> ppp b / tests / cases / ctors_cast . ll <nl> <nl> ; ModuleID = ' / tmp / tmpHcVUBJ / a . out . bc ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> % struct . Other = type { i8 } <nl> <nl> mmm a / tests / cases / dash . ll <nl> ppp b / tests / cases / dash . ll <nl> <nl> ; ModuleID = ' / tmp / tmpqfApGD / a . out . bc ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> @ other - name = alias i32 ( ) * @ main <nl> <nl> mmm a / tests / cases / dollar . ll <nl> ppp b / tests / cases / dollar . ll <nl> <nl> ; ModuleID = ' tests / hello_world . bc ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> @ . str = private unnamed_addr constant [ 15 x i8 ] c " hello , world ! \ 0A \ 00 " , align 1 ; [ # uses = 1 type = [ 15 x i8 ] * ] <nl> <nl> mmm a / tests / cases / emptyalloca . ll <nl> ppp b / tests / cases / emptyalloca . ll <nl> <nl> ; ModuleID = ' / tmp / tmpjSNiky / a . out . bc ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> @ . str = private unnamed_addr constant [ 30 x i8 ] c " Module . print ( ' hello , world ! ' ) \ 00 " , align 1 <nl> <nl> similarity index 86 % <nl> rename from tests / cases / emptyasm_le32 . ll <nl> rename to tests / cases / emptyasm_aue . ll <nl> mmm a / tests / cases / emptyasm_le32 . ll <nl> ppp b / tests / cases / emptyasm_aue . ll <nl> <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> ; ModuleID = ' tests / hello_world . bc ' <nl> <nl> mmm a / tests / cases / entry3 . ll <nl> ppp b / tests / cases / entry3 . ll <nl> <nl> ; ModuleID = ' / tmp / tmpKnA2D3 / a . out . bc ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> @ . str = private unnamed_addr constant [ 11 x i8 ] c " getgid = % d \ 0A \ 00 " , align 1 <nl> @ . str1 = private unnamed_addr constant [ 6 x i8 ] c " f = % d \ 0A \ 00 " , align 1 <nl> mmm a / tests / cases / fptosi . ll <nl> ppp b / tests / cases / fptosi . ll <nl> <nl> ; ModuleID = ' / dev / shm / tmp / src . cpp . o ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> @ . str = private unnamed_addr constant [ 8 x i8 ] c " * % . 3f * \ 0A \ 00 " , align 1 ; [ # uses = 1 type = [ 8 x i8 ] * ] <nl> @ . str2 = private unnamed_addr constant [ 6 x i8 ] c " * % d * \ 0A \ 00 " , align 1 ; [ # uses = 1 type = [ 6 x i8 ] * ] <nl> mmm a / tests / cases / funcptr . ll <nl> ppp b / tests / cases / funcptr . ll <nl> <nl> ; ModuleID = ' tests / hello_world . bc ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> @ . str = private unnamed_addr constant [ 17 x i8 ] c " hello % d world ! \ 0A \ 00 " , align 1 ; [ # uses = 1 type = [ 17 x i8 ] * ] <nl> <nl> mmm a / tests / cases / fuzz6_ta2 . ll <nl> ppp b / tests / cases / fuzz6_ta2 . ll <nl> <nl> ; ModuleID = ' emcc - 0 - basebc . bc ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> % struct . S3 = type { i32 , i32 } <nl> % struct . S1 = type { i32 , i32 , i8 , i16 } <nl> mmm a / tests / cases / gepaddoverflow . ll <nl> ppp b / tests / cases / gepaddoverflow . ll <nl> <nl> ; ModuleID = ' new . o ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> declare i32 @ printf ( i8 * noalias , . . . ) nounwind <nl> <nl> mmm a / tests / cases / i24_mem_ta2 . ll <nl> ppp b / tests / cases / i24_mem_ta2 . ll <nl> <nl> ; ModuleID = ' tests / hello_world . bc ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> @ . str = private unnamed_addr constant [ 6 x i8 ] c " . % x . \ 0A \ 00 " , align 1 ; [ # uses = 1 type = [ 5 x i8 ] * ] <nl> <nl> mmm a / tests / cases / i96_ashr_ta2 . ll <nl> ppp b / tests / cases / i96_ashr_ta2 . ll <nl> <nl> ; ModuleID = ' tests / hello_world . bc ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> @ . str = private unnamed_addr constant [ 23 x i8 ] c " hello . . world ! % x , % x , % x \ 0A \ 00 " , align 1 <nl> <nl> mmm a / tests / cases / i96shiftnon32_ta2 . ll <nl> ppp b / tests / cases / i96shiftnon32_ta2 . ll <nl> <nl> ; ModuleID = ' / tmp / tmpxFUbAg / test_emcc1 . bc ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> % struct . c_s = type { i8 , float , i32 } <nl> <nl> mmm a / tests / cases / inttoptr . ll <nl> ppp b / tests / cases / inttoptr . ll <nl> <nl> ; ModuleID = ' / tmp / emscripten / tmp / src . cpp . o ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> @ . str = private constant [ 14 x i8 ] c " hello , world ! \ 00 " , align 1 ; [ # uses = 1 ] <nl> <nl> mmm a / tests / cases / invokebitcast . ll <nl> ppp b / tests / cases / invokebitcast . ll <nl> <nl> ; ModuleID = ' / dev / shm / tmp / src . cpp . o ' <nl> ; Just test for compilation here <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> % struct . CPU_Regs = type { [ 8 x % union . GenReg32 ] } <nl> % union . GenReg32 = type { [ 1 x i32 ] } <nl> mmm a / tests / cases / invokeundef . ll <nl> ppp b / tests / cases / invokeundef . ll <nl> <nl> ; ModuleID = ' / dev / shm / tmp / src . cpp . o ' <nl> ; Just test for compilation here <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> % struct . CPU_Regs = type { [ 8 x % union . GenReg32 ] } <nl> % union . GenReg32 = type { [ 1 x i32 ] } <nl> mmm a / tests / cases / legalizer_b_ta2 . ll <nl> ppp b / tests / cases / legalizer_b_ta2 . ll <nl> <nl> ; ModuleID = ' tests / hello_world . bc ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> @ globaliz = global [ 300 x i8 ] zeroinitializer <nl> <nl> mmm a / tests / cases / legalizer_ta2 . ll <nl> ppp b / tests / cases / legalizer_ta2 . ll <nl> <nl> ; ModuleID = ' tests / hello_world . bc ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> @ globaliz = global [ 300 x i8 ] zeroinitializer <nl> <nl> mmm a / tests / cases / loadbitcastgep . ll <nl> ppp b / tests / cases / loadbitcastgep . ll <nl> <nl> ; ModuleID = ' / dev / shm / tmp / src . cpp . o ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> % struct . CPU_Regs = type { [ 8 x % union . GenReg32 ] } <nl> % union . GenReg32 = type { [ 1 x i32 ] } <nl> mmm a / tests / cases / muli33_ta2 . ll <nl> ppp b / tests / cases / muli33_ta2 . ll <nl> <nl> ; ModuleID = ' / tmp / tmpt0JpDh / a . out . bc ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> @ . str = private unnamed_addr constant [ 7 x i8 ] c " 20 \ 0A91 \ 0A \ 00 " , align 1 <nl> @ . str1 = private unnamed_addr constant [ 6 x i8 ] c " % u % u \ 00 " , align 1 <nl> mmm a / tests / cases / oob_ta2 . ll <nl> ppp b / tests / cases / oob_ta2 . ll <nl> <nl> ; ModuleID = ' tests / hello_world . bc ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> % structy = type { [ 2 x [ 10 x i8 ] ] } <nl> <nl> mmm a / tests / cases / phi24_ta2 . ll <nl> ppp b / tests / cases / phi24_ta2 . ll <nl> <nl> <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> % union . U4 = type { i32 } <nl> % union . U3 = type { i8 * } <nl> mmm a / tests / cases / phicubed . ll <nl> ppp b / tests / cases / phicubed . ll <nl> <nl> ; ModuleID = ' / dev / shm / tmp / src . cpp . o ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> % struct . worker_args = type { i32 , % struct . worker_args * } <nl> <nl> mmm a / tests / cases / phientryimplicit . ll <nl> ppp b / tests / cases / phientryimplicit . ll <nl> <nl> ; ModuleID = ' tests / hello_world . bc ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> ; Phi nodes can refer to the entry . And the entry might be unnamed , and doesn ' t even have a consistent implicit name ! <nl> <nl> mmm a / tests / cases / phientryimplicitmix . ll <nl> ppp b / tests / cases / phientryimplicitmix . ll <nl> <nl> ; ModuleID = ' tests / hello_world . bc ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> ; Phi nodes can refer to the entry . And the entry might be unnamed , and doesn ' t even have a consistent implicit name ! <nl> <nl> mmm a / tests / cases / phientryimplicitmoar . ll <nl> ppp b / tests / cases / phientryimplicitmoar . ll <nl> <nl> ; ModuleID = ' tests / hello_world . bc ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> @ . str = private unnamed_addr constant [ 15 x i8 ] c " hello , world ! \ 0A \ 00 " , align 1 ; [ # uses = 1 type = [ 15 x i8 ] * ] <nl> @ . str2 = private unnamed_addr constant [ 15 x i8 ] c " hello ! ! world ! \ 0A \ 00 " , align 1 ; [ # uses = 1 type = [ 15 x i8 ] * ] <nl> mmm a / tests / cases / philoop_ta2 . ll <nl> ppp b / tests / cases / philoop_ta2 . ll <nl> <nl> ; ModuleID = ' / tmp / tmpVIBz29 / a . out . bc ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> @ . str = private unnamed_addr constant [ 13 x i8 ] c " 99 \ 0A70 \ 0A26 \ 0A97 \ 0A \ 00 " , align 1 <nl> @ . str1 = private unnamed_addr constant [ 12 x i8 ] c " % u % u % u % u \ 00 " , align 1 <nl> mmm a / tests / cases / phiptrtoint . ll <nl> ppp b / tests / cases / phiptrtoint . ll <nl> <nl> ; ModuleID = ' / tmp / tmpJctwj0 / bug . bc ' <nl> ; just an asm validation check , no output <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> % " class . test : : Processor " = type { i32 , % " class . test : : StateMachine " } <nl> % " class . test : : StateMachine " = type { { i32 , i32 } } <nl> mmm a / tests / cases / phiself . ll <nl> ppp b / tests / cases / phiself . ll <nl> <nl> ; ModuleID = ' / tmp / emscripten_temp / src . cpp . o ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> @ . str = private unnamed_addr constant [ 7 x i8 ] c " cheez \ 0A \ 00 " , align 1 <nl> @ . str1 = private unnamed_addr constant [ 6 x i8 ] c " * % d * \ 0A \ 00 " , align 1 <nl> mmm a / tests / cases / ptrtoi64 . ll <nl> ppp b / tests / cases / ptrtoi64 . ll <nl> <nl> ; pointer to i64 , then to i32 <nl> <nl> ; ModuleID = ' / tmp / emscripten / tmp / src . cpp . o ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> @ . str2 = private constant [ 9 x i8 ] c " * % d , % d * \ 0A \ 00 " , align 1 ; [ # uses = 1 ] <nl> <nl> mmm a / tests / cases / ptrtoint_blockaddr . ll <nl> ppp b / tests / cases / ptrtoint_blockaddr . ll <nl> <nl> ; ModuleID = ' tests / hello_world . bc ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> @ . str = private constant [ 15 x i8 ] c " hello , world ! \ 0A \ 00 " , align 1 ; [ # uses = 1 ] <nl> <nl> mmm a / tests / cases / sillybitcast . ll <nl> ppp b / tests / cases / sillybitcast . ll <nl> <nl> ; ModuleID = ' / tmp / emscripten / tmp / src . cpp . o ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> @ . str = private constant [ 14 x i8 ] c " hello , world ! \ 00 " , align 1 ; [ # uses = 1 ] <nl> <nl> mmm a / tests / cases / sillybitcast2 . ll <nl> ppp b / tests / cases / sillybitcast2 . ll <nl> <nl> ; ModuleID = ' / tmp / emscripten / tmp / src . cpp . o ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> @ . str = private constant [ 14 x i8 ] c " hello , world ! \ 00 " , align 1 ; [ # uses = 1 ] <nl> <nl> mmm a / tests / cases / sillyfuncast . ll <nl> ppp b / tests / cases / sillyfuncast . ll <nl> <nl> ; ModuleID = ' tests / hello_world . bc ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> @ . str = private unnamed_addr constant [ 15 x i8 ] c " hello , world ! \ 0A \ 00 " , align 1 ; [ # uses = 1 type = [ 15 x i8 ] * ] <nl> <nl> mmm a / tests / cases / storebigfloat . ll <nl> ppp b / tests / cases / storebigfloat . ll <nl> <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> @ . str = private unnamed_addr constant [ 15 x i8 ] c " hello , world ! \ 0A \ 00 " , align 1 ; [ # uses = 1 type = [ 15 x i8 ] * ] <nl> <nl> mmm a / tests / cases / storestruct . ll <nl> ppp b / tests / cases / storestruct . ll <nl> <nl> ; ModuleID = ' / dev / shm / tmp / src . cpp . o ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> ; Load and store an entire structure as a whole ( and also load as a whole , extract values and save separately , etc . ) <nl> <nl> mmm a / tests / cases / structinparam . ll <nl> ppp b / tests / cases / structinparam . ll <nl> <nl> ; ModuleID = ' min . bc ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> % ac = type { i8 * , i32 } <nl> <nl> mmm a / tests / cases / structphiparam . ll <nl> ppp b / tests / cases / structphiparam . ll <nl> <nl> ; ModuleID = ' / dev / shm / tmp / src . cpp . o ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> @ . str = private unnamed_addr constant [ 15 x i8 ] c " hello , % d % d ! \ 0A \ 00 " , align 1 ; [ # uses = 1 type = [ 15 x i8 ] * ] <nl> @ _dispatchTable = internal global i64 0 <nl> mmm a / tests / cases / sub_11_0 . ll <nl> ppp b / tests / cases / sub_11_0 . ll <nl> <nl> ; ModuleID = ' tests / hello_world . bc ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> @ . str = private unnamed_addr constant [ 15 x i8 ] c " hello , world ! \ 0A \ 00 " , align 1 ; [ # uses = 1 type = [ 15 x i8 ] * ] <nl> <nl> mmm a / tests / cases / switch64_ta2 . ll <nl> ppp b / tests / cases / switch64_ta2 . ll <nl> <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> @ . str = private constant [ 18 x i8 ] c " hello , world : % d \ 0A \ 00 " , align 1 <nl> <nl> mmm a / tests / cases / switch64b_ta2 . ll <nl> ppp b / tests / cases / switch64b_ta2 . ll <nl> <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> @ . str = private constant [ 18 x i8 ] c " hello , world : % d \ 0A \ 00 " , align 1 <nl> <nl> mmm a / tests / cases / uadd_overflow_ta2 . ll <nl> ppp b / tests / cases / uadd_overflow_ta2 . ll <nl> <nl> ; ModuleID = ' tests / hello_world . bc ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> @ . str2 = private constant [ 9 x i8 ] c " * % d , % d * \ 0A \ 00 " , align 1 ; [ # uses = 1 ] <nl> <nl> mmm a / tests / cases / zeroembedded . ll <nl> ppp b / tests / cases / zeroembedded . ll <nl> <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> % struct . pypy_str = type { i32 , [ 0 x i8 ] } <nl> % struct . pypy_strval = type { i32 , [ 13 x i8 ] } <nl> mmm a / tests / cases / zeroextarg . ll <nl> ppp b / tests / cases / zeroextarg . ll <nl> <nl> ; ModuleID = ' tests / hello_world . bc ' <nl> - target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 128 - n32 " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> @ . str = private unnamed_addr constant [ 15 x i8 ] c " hello , world ! \ 0A \ 00 " , align 1 ; [ # uses = 1 type = [ 15 x i8 ] * ] <nl> <nl> mmm a / tests / embind / build_benchmark <nl> ppp b / tests / embind / build_benchmark <nl> <nl> # ! / bin / bash <nl> - EMCC_LLVM_TARGET = le32 - unknown - nacl . . / . . / emcc - - minify 0 - - bind - - post - js embind . benchmark . js - O2 - - shell - file shell . html - o embind_benchmark . html embind_benchmark . cpp <nl> + EMCC_LLVM_TARGET = asmjs - unknown - emscripten . . / . . / emcc - - minify 0 - - bind - - post - js embind . benchmark . js - O2 - - shell - file shell . html - o embind_benchmark . html embind_benchmark . cpp <nl> mmm a / tests / hello_world . ll <nl> ppp b / tests / hello_world . ll <nl> <nl> ; ModuleID = ' tests / hello_world . bc ' <nl> target datalayout = " e - i1 : 8 : 8 - i8 : 8 : 8 - i16 : 16 : 16 - i32 : 32 : 32 - i64 : 64 : 64 - f32 : 32 : 32 - f64 : 64 : 64 - p : 32 : 32 : 32 - v128 : 32 : 32 " <nl> - target triple = " le32 - unknown - nacl " <nl> + target triple = " asmjs - unknown - emscripten " <nl> <nl> @ . str = private unnamed_addr constant [ 15 x i8 ] c " hello , world ! \ 0A \ 00 " , align 1 ; [ # uses = 1 type = [ 15 x i8 ] * ] <nl> <nl> similarity index 95 % <nl> rename from tests / python / python . le32 . bc <nl> rename to tests / python / python . asmjs - unknown - emscripten . bc <nl> Binary files a / tests / python / python . le32 . bc and b / tests / python / python . asmjs - unknown - emscripten . bc differ <nl> mmm a / tests / test_core . py <nl> ppp b / tests / test_core . py <nl> <nl> from runner import RunnerCore , path_from_root , checked_sanity , test_modes , get_bullet_library <nl> <nl> class T ( RunnerCore ) : # Short name , to make it more fun to use manually on the commandline <nl> - def is_le32 ( self ) : <nl> + def is_emscripten_abi ( self ) : <nl> return not ( ' i386 - pc - linux - gnu ' in COMPILER_OPTS or self . env . get ( ' EMCC_LLVM_TARGET ' ) = = ' i386 - pc - linux - gnu ' ) <nl> <nl> def test_hello_world ( self ) : <nl> def test_sha1 ( self ) : <nl> <nl> def test_cube2md5 ( self ) : <nl> if self . emcc_args = = None : return self . skip ( ' needs emcc ' ) <nl> - if not self . is_le32 ( ) : return self . skip ( ' le32 needed for accurate math ' ) <nl> + if not self . is_emscripten_abi ( ) : return self . skip ( ' asmjs - unknown - emscripten needed for accurate math ' ) <nl> self . emcc_args + = [ ' - - embed - file ' , ' cube2md5 . txt ' ] <nl> shutil . copyfile ( path_from_root ( ' tests ' , ' cube2md5 . txt ' ) , os . path . join ( self . get_dir ( ) , ' cube2md5 . txt ' ) ) <nl> self . do_run ( open ( path_from_root ( ' tests ' , ' cube2md5 . cpp ' ) ) . read ( ) , open ( path_from_root ( ' tests ' , ' cube2md5 . ok ' ) ) . read ( ) ) <nl> def test_unaligned ( self ) : <nl> <nl> # TODO : A version of this with int64s as well <nl> <nl> - if self . is_le32 ( ) : <nl> + if self . is_emscripten_abi ( ) : <nl> return self . skip ( ' LLVM marks the reads of s as fully aligned , making this test invalid ' ) <nl> else : <nl> self . do_run ( src , ' * 12 : 1 : 12 \ n328157500735811 . 0 , 23 , 416012775903557 . 0 , 99 \ n ' ) <nl> def test_align64 ( self ) : <nl> } <nl> ' ' ' <nl> <nl> - if self . is_le32 ( ) : <nl> + if self . is_emscripten_abi ( ) : <nl> self . do_run ( src , ' ' ' 16 , 32 <nl> 0 , 8 , 8 , 8 <nl> 16 , 24 , 24 , 24 <nl> def test_math_hyperbolic ( self ) : <nl> <nl> def test_math_lgamma ( self ) : <nl> if self . emcc_args is None : return self . skip ( ' requires emcc ' ) <nl> - if not self . is_le32 ( ) : return self . skip ( ' le32 needed for accurate math ' ) <nl> + if not self . is_emscripten_abi ( ) : return self . skip ( ' asmjs - unknown - emscripten needed for accurate math ' ) <nl> <nl> test_path = path_from_root ( ' tests ' , ' math ' , ' lgamma ' ) <nl> src , output = ( test_path + s for s in ( ' . in ' , ' . out ' ) ) <nl> def test_pystruct ( self ) : <nl> # Compressed memory . Note that sizeof ( ) does give the fat sizes , however ! <nl> self . do_run ( src , ' * 0 , 0 , 0 , 1 , 2 , 3 , 4 , 5 * \ n * 1 , 0 , 0 * \ n * 0 * \ n0 : 1 , 1 \ n1 : 1 , 1 \ n2 : 1 , 1 \ n * 12 , 20 , 5 * ' ) <nl> else : <nl> - if self . is_le32 ( ) : <nl> + if self . is_emscripten_abi ( ) : <nl> self . do_run ( src , ' * 0 , 0 , 0 , 4 , 8 , 16 , 20 , 24 * \ n * 1 , 0 , 0 * \ n * 0 * \ n0 : 1 , 1 \ n1 : 1 , 1 \ n2 : 1 , 1 \ n * 16 , 24 , 24 * ' ) <nl> else : <nl> self . do_run ( src , ' * 0 , 0 , 0 , 4 , 8 , 12 , 16 , 20 * \ n * 1 , 0 , 0 * \ n * 0 * \ n0 : 1 , 1 \ n1 : 1 , 1 \ n2 : 1 , 1 \ n * 12 , 20 , 20 * ' ) <nl> def test_emscripten_get_compiler_setting ( self ) : <nl> self . do_run ( open ( src ) . read ( ) , open ( output ) . read ( ) . replace ( ' waka ' , EMSCRIPTEN_VERSION ) ) <nl> <nl> def test_inlinejs ( self ) : <nl> - if not self . is_le32 ( ) : return self . skip ( ' le32 needed for inline js ' ) <nl> + if not self . is_emscripten_abi ( ) : return self . skip ( ' asmjs - unknown - emscripten needed for inline js ' ) <nl> if os . environ . get ( ' EMCC_FAST_COMPILER ' ) ! = ' 0 ' : return self . skip ( ' fastcomp only supports EM_ASM ' ) <nl> <nl> test_path = path_from_root ( ' tests ' , ' core ' , ' test_inlinejs ' ) <nl> def test_inlinejs ( self ) : <nl> for i in range ( 1 , 5 ) : assert ( ' comment % d ' % i ) in out <nl> <nl> def test_inlinejs2 ( self ) : <nl> - if not self . is_le32 ( ) : return self . skip ( ' le32 needed for inline js ' ) <nl> + if not self . is_emscripten_abi ( ) : return self . skip ( ' asmjs - unknown - emscripten needed for inline js ' ) <nl> if os . environ . get ( ' EMCC_FAST_COMPILER ' ) ! = ' 0 ' : return self . skip ( ' fastcomp only supports EM_ASM ' ) <nl> <nl> test_path = path_from_root ( ' tests ' , ' core ' , ' test_inlinejs2 ' ) <nl> def test_pack ( self ) : <nl> <nl> def test_varargs ( self ) : <nl> if Settings . QUANTUM_SIZE = = 1 : return self . skip ( ' FIXME : Add support for this ' ) <nl> - if not self . is_le32 ( ) : return self . skip ( ' we do not support all varargs stuff without le32 ' ) <nl> + if not self . is_emscripten_abi ( ) : return self . skip ( ' we do not support all varargs stuff without asmjs - unknown - emscripten ' ) <nl> <nl> test_path = path_from_root ( ' tests ' , ' core ' , ' test_varargs ' ) <nl> src , output = ( test_path + s for s in ( ' . in ' , ' . out ' ) ) <nl> def test_varargs ( self ) : <nl> <nl> def test_varargs_byval ( self ) : <nl> if Settings . USE_TYPED_ARRAYS ! = 2 : return self . skip ( ' FIXME : Add support for this ' ) <nl> - if self . is_le32 ( ) : return self . skip ( ' clang cannot compile this code with that target yet ' ) <nl> + if self . is_emscripten_abi ( ) : return self . skip ( ' clang cannot compile this code with that target yet ' ) <nl> <nl> src = r ' ' ' <nl> # include < stdio . h > <nl> def can_dlfcn ( self ) : <nl> else : <nl> Settings . NAMED_GLOBALS = 1 <nl> <nl> - if not self . is_le32 ( ) : <nl> - self . skip ( ' need le32 for dlfcn support ' ) <nl> + if not self . is_emscripten_abi ( ) : <nl> + self . skip ( ' need asmjs - unknown - emscripten for dlfcn support ' ) <nl> return False <nl> else : <nl> return True <nl> def test_rand ( self ) : <nl> <nl> def test_strtod ( self ) : <nl> if self . emcc_args is None : return self . skip ( ' needs emcc for libc ' ) <nl> - if not self . is_le32 ( ) : return self . skip ( ' le32 needed for accurate math ' ) <nl> + if not self . is_emscripten_abi ( ) : return self . skip ( ' asmjs - unknown - emscripten needed for accurate math ' ) <nl> <nl> src = r ' ' ' <nl> # include < stdio . h > <nl> def test_fnmatch ( self ) : <nl> <nl> def test_sscanf ( self ) : <nl> if self . emcc_args is None : return self . skip ( ' needs emcc for libc ' ) <nl> - if not self . is_le32 ( ) : return self . skip ( ' le32 needed for accurate math ' ) <nl> + if not self . is_emscripten_abi ( ) : return self . skip ( ' asmjs - unknown - emscripten needed for accurate math ' ) <nl> <nl> test_path = path_from_root ( ' tests ' , ' core ' , ' test_sscanf ' ) <nl> src , output = ( test_path + s for s in ( ' . in ' , ' . out ' ) ) <nl> def test_utf ( self ) : <nl> <nl> def test_utf32 ( self ) : <nl> if self . emcc_args is None : return self . skip ( ' need libc for wcslen ( ) ' ) <nl> - if not self . is_le32 ( ) : return self . skip ( ' this test uses inline js , which requires le32 ' ) <nl> + if not self . is_emscripten_abi ( ) : return self . skip ( ' this test uses inline js , which requires asmjs - unknown - emscripten ' ) <nl> <nl> self . do_run ( open ( path_from_root ( ' tests ' , ' utf32 . cpp ' ) ) . read ( ) , ' OK . ' ) <nl> self . do_run ( open ( path_from_root ( ' tests ' , ' utf32 . cpp ' ) ) . read ( ) , ' OK . ' , args = [ ' - fshort - wchar ' ] ) <nl> def process ( filename ) : <nl> <nl> def test_fs_nodefs_rw ( self ) : <nl> if self . emcc_args is None : return self . skip ( ' requires emcc ' ) <nl> - if not self . is_le32 ( ) : return self . skip ( ' le32 needed for inline js ' ) <nl> + if not self . is_emscripten_abi ( ) : return self . skip ( ' asmjs - unknown - emscripten needed for inline js ' ) <nl> src = open ( path_from_root ( ' tests ' , ' fs ' , ' test_nodefs_rw . c ' ) , ' r ' ) . read ( ) <nl> self . do_run ( src , ' success ' , force_c = True , js_engines = [ NODE_JS ] ) <nl> <nl> def test_unistd_access ( self ) : <nl> self . clear ( ) <nl> - if not self . is_le32 ( ) : return self . skip ( ' le32 needed for inline js ' ) <nl> + if not self . is_emscripten_abi ( ) : return self . skip ( ' asmjs - unknown - emscripten needed for inline js ' ) <nl> for fs in [ ' MEMFS ' , ' NODEFS ' ] : <nl> src = open ( path_from_root ( ' tests ' , ' unistd ' , ' access . c ' ) , ' r ' ) . read ( ) <nl> expected = open ( path_from_root ( ' tests ' , ' unistd ' , ' access . out ' ) , ' r ' ) . read ( ) <nl> def test_unistd_access ( self ) : <nl> self . do_run ( src , expected , js_engines = [ NODE_JS ] ) <nl> <nl> def test_unistd_curdir ( self ) : <nl> - if not self . is_le32 ( ) : return self . skip ( ' le32 needed for inline js ' ) <nl> + if not self . is_emscripten_abi ( ) : return self . skip ( ' asmjs - unknown - emscripten needed for inline js ' ) <nl> src = open ( path_from_root ( ' tests ' , ' unistd ' , ' curdir . c ' ) , ' r ' ) . read ( ) <nl> expected = open ( path_from_root ( ' tests ' , ' unistd ' , ' curdir . out ' ) , ' r ' ) . read ( ) <nl> self . do_run ( src , expected ) <nl> def test_unistd_pathconf ( self ) : <nl> <nl> def test_unistd_truncate ( self ) : <nl> self . clear ( ) <nl> - if not self . is_le32 ( ) : return self . skip ( ' le32 needed for inline js ' ) <nl> + if not self . is_emscripten_abi ( ) : return self . skip ( ' asmjs - unknown - emscripten needed for inline js ' ) <nl> for fs in [ ' MEMFS ' , ' NODEFS ' ] : <nl> src = open ( path_from_root ( ' tests ' , ' unistd ' , ' truncate . c ' ) , ' r ' ) . read ( ) <nl> expected = open ( path_from_root ( ' tests ' , ' unistd ' , ' truncate . out ' ) , ' r ' ) . read ( ) <nl> def test_unistd_login ( self ) : <nl> def test_unistd_unlink ( self ) : <nl> self . clear ( ) <nl> if self . emcc_args is None : return self . skip ( ' requires emcc ' ) <nl> - if not self . is_le32 ( ) : return self . skip ( ' le32 needed for inline js ' ) <nl> + if not self . is_emscripten_abi ( ) : return self . skip ( ' asmjs - unknown - emscripten needed for inline js ' ) <nl> for fs in [ ' MEMFS ' , ' NODEFS ' ] : <nl> src = open ( path_from_root ( ' tests ' , ' unistd ' , ' unlink . c ' ) , ' r ' ) . read ( ) <nl> Building . COMPILER_TEST_OPTS + = [ ' - D ' + fs ] <nl> def test_unistd_unlink ( self ) : <nl> <nl> def test_unistd_links ( self ) : <nl> self . clear ( ) <nl> - if not self . is_le32 ( ) : return self . skip ( ' le32 needed for inline js ' ) <nl> + if not self . is_emscripten_abi ( ) : return self . skip ( ' asmjs - unknown - emscripten needed for inline js ' ) <nl> for fs in [ ' MEMFS ' , ' NODEFS ' ] : <nl> if WINDOWS and fs = = ' NODEFS ' : <nl> print > > sys . stderr , ' Skipping NODEFS part of this test for test_unistd_links on Windows , since it would require administrative privileges . ' <nl> def test_unistd_sleep ( self ) : <nl> <nl> def test_unistd_io ( self ) : <nl> self . clear ( ) <nl> - if not self . is_le32 ( ) : return self . skip ( ' le32 needed for inline js ' ) <nl> + if not self . is_emscripten_abi ( ) : return self . skip ( ' asmjs - unknown - emscripten needed for inline js ' ) <nl> if self . run_name = = ' o2 ' : return self . skip ( ' non - asm optimized builds can fail with inline js ' ) <nl> if self . emcc_args is None : return self . skip ( ' requires emcc ' ) <nl> for fs in [ ' MEMFS ' , ' NODEFS ' ] : <nl> def test_unistd_io ( self ) : <nl> <nl> def test_unistd_misc ( self ) : <nl> if self . emcc_args is None : return self . skip ( ' requires emcc ' ) <nl> - if not self . is_le32 ( ) : return self . skip ( ' le32 needed for inline js ' ) <nl> + if not self . is_emscripten_abi ( ) : return self . skip ( ' asmjs - unknown - emscripten needed for inline js ' ) <nl> for fs in [ ' MEMFS ' , ' NODEFS ' ] : <nl> src = open ( path_from_root ( ' tests ' , ' unistd ' , ' misc . c ' ) , ' r ' ) . read ( ) <nl> expected = open ( path_from_root ( ' tests ' , ' unistd ' , ' misc . out ' ) , ' r ' ) . read ( ) <nl> def process ( filename ) : <nl> def test_sqlite ( self ) : <nl> # gcc - O3 - I / home / alon / Dev / emscripten / tests / sqlite - ldl src . c <nl> if self . emcc_args is None : return self . skip ( ' Very slow without ta2 , and we would also need to include dlmalloc manually without emcc ' ) <nl> - if not self . is_le32 ( ) : return self . skip ( ' fails on x86 due to a legalization issue on llvm 3 . 3 ' ) <nl> + if not self . is_emscripten_abi ( ) : return self . skip ( ' fails on x86 due to a legalization issue on llvm 3 . 3 ' ) <nl> if Settings . QUANTUM_SIZE = = 1 : return self . skip ( ' TODO FIXME ' ) <nl> self . banned_js_engines = [ NODE_JS ] # OOM in older node <nl> <nl> def clean ( text ) : <nl> def test_python ( self ) : <nl> if self . emcc_args is None : return self . skip ( ' requires emcc ' ) <nl> if Settings . QUANTUM_SIZE = = 1 : return self . skip ( ' TODO : make this work ' ) <nl> - if not self . is_le32 ( ) : return self . skip ( ' fails on non - le32 ' ) # FIXME <nl> + if not self . is_emscripten_abi ( ) : return self . skip ( ' fails on not asmjs - unknown - emscripten ' ) # FIXME <nl> <nl> # Settings . EXPORTED_FUNCTIONS + = [ ' _PyRun_SimpleStringFlags ' ] # for the demo <nl> <nl> - if self . is_le32 ( ) : <nl> - bitcode = path_from_root ( ' tests ' , ' python ' , ' python . le32 . bc ' ) <nl> + if self . is_emscripten_abi ( ) : <nl> + bitcode = path_from_root ( ' tests ' , ' python ' , ' python . asmjs - unknown - emscripten . bc ' ) <nl> else : <nl> bitcode = path_from_root ( ' tests ' , ' python ' , ' python . small . bc ' ) <nl> <nl> def test_cases ( self ) : <nl> if ' _noasm ' in shortname and Settings . ASM_JS : <nl> print self . skip ( ' case " % s " not relevant for asm . js ' % shortname ) <nl> continue <nl> - if ' _le32 ' in shortname and not self . is_le32 ( ) : <nl> - print self . skip ( ' case " % s " not relevant for non - le32 target ' % shortname ) <nl> + if ' _eua ' in shortname and not self . is_emscripten_abi ( ) : <nl> + print self . skip ( ' case " % s " not relevant for not asmjs - unknown - emscripten target ' % shortname ) <nl> continue <nl> if ' _fastcomp ' in shortname and not os . environ . get ( ' EMCC_FAST_COMPILER ' ) ! = ' 0 ' : <nl> print self . skip ( ' case " % s " not relevant for non - fastcomp ' % shortname ) <nl> mmm a / tests / test_sanity . py <nl> ppp b / tests / test_sanity . py <nl> def test_nostdincxx ( self ) : <nl> try : <nl> old = os . environ . get ( ' EMCC_LLVM_TARGET ' ) or ' ' <nl> for compiler in [ EMCC , EMXX ] : <nl> - for target in [ ' i386 - pc - linux - gnu ' , ' le32 - unknown - nacl ' ] : <nl> + for target in [ ' i386 - pc - linux - gnu ' , ' asmjs - unknown - emscripten ' ] : <nl> print compiler , target <nl> os . environ [ ' EMCC_LLVM_TARGET ' ] = target <nl> out , err = Popen ( [ PYTHON , EMCC , path_from_root ( ' tests ' , ' hello_world . cpp ' ) , ' - v ' ] , stdout = PIPE , stderr = PIPE ) . communicate ( ) <nl>
|
Update the tests to use asmjs - unknown - emscripten .
|
emscripten-core/emscripten
|
377e75950fd04ed2705befe00b0c46f0e88a0cf7
|
2014-02-25T19:58:52Z
|
mmm a / lib / Sema / TypeCheckDeclObjC . cpp <nl> ppp b / lib / Sema / TypeCheckDeclObjC . cpp <nl> Optional < ObjCReason > shouldMarkAsObjC ( const ValueDecl * VD , bool allowImplicit ) { <nl> if ( VD - > getAttrs ( ) . hasAttribute < NSManagedAttr > ( ) ) <nl> return ObjCReason ( ObjCReason : : ExplicitlyNSManaged ) ; <nl> / / A member of an @ objc protocol is implicitly @ objc . <nl> - if ( isMemberOfObjCProtocol ) <nl> + if ( isMemberOfObjCProtocol ) { <nl> + if ( ! VD - > isProtocolRequirement ( ) ) <nl> + return None ; <nl> return ObjCReason ( ObjCReason : : MemberOfObjCProtocol ) ; <nl> + } <nl> <nl> / / A @ nonobjc is not @ objc , even if it is an override of an @ objc , so check <nl> / / for @ nonobjc first . <nl> new file mode 100644 <nl> index 000000000000 . . 576ec0e7cd5d <nl> mmm / dev / null <nl> ppp b / test / attr / attr_objc_typealias_inside_protocol . swift <nl> <nl> + / / RUN : % empty - directory ( % t ) <nl> + / / RUN : % target - swift - frontend - c - enable - objc - interop - parse - as - library % s - o / dev / null - disable - objc - attr - requires - foundation - module - module - name typealias_objc - emit - module - emit - module - path % t / typealias_objc . swiftmodule <nl> + / / RUN : % target - swift - ide - test - skip - deinit = false - print - ast - typechecked - source - filename % s - function - definitions = true - prefer - type - repr = false - print - implicit - attrs = true - explode - pattern - binding - decls = true - disable - objc - attr - requires - foundation - module | % FileCheck % s <nl> + @ objc public protocol P { <nl> + typealias T = ( ) - > Bool <nl> + / / CHECK : typealias T = ( ) - > Bool <nl> + } <nl> \ No newline at end of file <nl>
|
Merge pull request from theblixguy / fix / SR - 10115
|
apple/swift
|
09847e6066babdda321151057679f0e18b1678da
|
2019-03-19T00:37:12Z
|
mmm a / gdbinit <nl> ppp b / gdbinit <nl> define co_status <nl> end <nl> <nl> define ____sw_executor_globals <nl> - if basic_functions_module . zts <nl> - if ! $ tsrm_ls <nl> - set $ tsrm_ls = ts_resource_ex ( 0 , 0 ) <nl> - end <nl> - set $ eg = ( ( zend_executor_globals * ) ( * ( ( void * * * ) $ tsrm_ls ) ) [ executor_globals_id - 1 ] ) <nl> - else <nl> - set $ eg = executor_globals <nl> - end <nl> + set $ eg = php_swoole_get_executor_globals ( ) <nl> end <nl> <nl> define ____sw_print_str <nl> mmm a / swoole_coroutine . cc <nl> ppp b / swoole_coroutine . cc <nl> PHP_METHOD ( swoole_coroutine , disableScheduler ) <nl> { <nl> RETURN_BOOL ( PHPCoroutine : : disable_scheduler ( ) ) ; <nl> } <nl> + <nl> + / * * <nl> + * for gdb <nl> + * / <nl> + zend_executor_globals * php_swoole_get_executor_globals ( ) <nl> + { <nl> + return ( zend_executor_globals * ) & EG ( uninitialized_zval ) ; <nl> + } <nl> mmm a / swoole_coroutine . h <nl> ppp b / swoole_coroutine . h <nl> class PHPCoroutine <nl> } ; <nl> } <nl> <nl> + / * * <nl> + * for gdb <nl> + * / <nl> + zend_executor_globals * php_swoole_get_executor_globals ( ) ; <nl>
|
Add php_swoole_get_executor_globals for gdb debugger ( Missing ELF symbol )
|
swoole/swoole-src
|
ec815288b2b9b0be591c7fe3a21fd14c75ac9c9a
|
2019-10-08T03:11:41Z
|
new file mode 100644 <nl> index 000000000 . . 1cb422080 <nl> mmm / dev / null <nl> ppp b / . travis . yml <nl> <nl> + language : cpp <nl> + os : osx <nl> + osx_image : xcode7 . 2 <nl> + compiler : clang <nl> + install : true <nl> + script : make <nl>
|
add . travis . yml
|
pqrs-org/Karabiner-Elements
|
37cbf8750778ef71b56943892e640329e4cce93b
|
2016-07-11T05:13:36Z
|
mmm a / db / dur . cpp <nl> ppp b / db / dur . cpp <nl> <nl> # include " dur . h " <nl> # include " dur_journal . h " <nl> # include " dur_commitjob . h " <nl> + # include " dur_recover . h " <nl> # include " . . / util / mongoutils / hash . h " <nl> # include " . . / util / mongoutils / str . h " <nl> # include " . . / util / timer . h " <nl> namespace mongo { <nl> / / ( ok to crash after that ) <nl> commitJob . notifyCommitted ( ) ; <nl> <nl> + # if 0 <nl> / / write the noted write intent entries to the data files . <nl> / / this has to come after writing to the journal , obviously . . . <nl> MongoFile : : markAllWritable ( ) ; / / for _DEBUG . normally we don ' t write in a read lock <nl> WRITETODATAFILES ( ) ; <nl> if ( ! dbMutex . isWriteLocked ( ) ) <nl> MongoFile : : unmarkAllWritable ( ) ; <nl> + # else <nl> + RecoveryJob : : get ( ) . processSection ( commitJob . _ab . buf ( ) , commitJob . _ab . len ( ) , false ) ; <nl> + debugValidateMapsMatch ( ) ; <nl> + # endif <nl> <nl> commitJob . reset ( ) ; <nl> <nl> namespace mongo { <nl> void closingFileNotification ( ) { <nl> if ( dbMutex . atLeastReadLocked ( ) ) { <nl> groupCommit ( ) ; <nl> + <nl> + if ( ! inShutdown ( ) ) { <nl> + RecoveryJob : : get ( ) . close ( ) ; <nl> + } <nl> } <nl> else { <nl> assert ( inShutdown ( ) ) ; <nl>
|
Use journal buffer to write to data files phase 1
|
mongodb/mongo
|
175e40aa9252af56c3fef7a7ff85be3abf9f6ba7
|
2010-12-22T02:23:53Z
|
mmm a / stdlib / public / SDK / Foundation / NSStringAPI . swift <nl> ppp b / stdlib / public / SDK / Foundation / NSStringAPI . swift <nl> func _toNSArray < T , U : AnyObject > ( _ a : [ T ] , f : ( T ) - > U ) - > NSArray { <nl> return result <nl> } <nl> <nl> - func _toNSRange ( _ r : Range < String . Index > ) - > NSRange { <nl> - return NSRange ( <nl> - location : r . lowerBound . encodedOffset , <nl> - length : r . upperBound . encodedOffset - r . lowerBound . encodedOffset ) <nl> - } <nl> - <nl> # if ! DEPLOYMENT_RUNTIME_SWIFT <nl> / / We only need this for UnsafeMutablePointer , but there ' s not currently a way <nl> / / to write that constraint . <nl> extension StringProtocol where Index = = String . Index { <nl> return self . _ephemeralString . _bridgeToObjectiveC ( ) <nl> } <nl> <nl> + / / self can be a Substring so we need to subtract / add this offset when <nl> + / / passing _ns to the Foundation APIs . Will be 0 if self is String . <nl> + @ _inlineable <nl> + @ _versioned <nl> + internal var _substringOffset : Int { <nl> + return self . startIndex . encodedOffset <nl> + } <nl> + <nl> / / / Return an ` Index ` corresponding to the given offset in our UTF - 16 <nl> / / / representation . <nl> func _index ( _ utf16Index : Int ) - > Index { <nl> - return Index ( encodedOffset : utf16Index ) <nl> + return Index ( encodedOffset : utf16Index + _substringOffset ) <nl> + } <nl> + <nl> + @ _inlineable <nl> + @ _versioned <nl> + internal func _toRelativeNSRange ( _ r : Range < String . Index > ) - > NSRange { <nl> + return NSRange ( <nl> + location : r . lowerBound . encodedOffset - _substringOffset , <nl> + length : r . upperBound . encodedOffset - r . lowerBound . encodedOffset ) <nl> } <nl> <nl> / / / Return a ` Range < Index > ` corresponding to the given ` NSRange ` of <nl> extension StringProtocol where Index = = String . Index { <nl> return locale ! = nil ? _ns . compare ( <nl> aString , <nl> options : mask , <nl> - range : _toNSRange ( <nl> + range : _toRelativeNSRange ( <nl> range ? ? startIndex . . < endIndex <nl> ) , <nl> locale : locale ? . _bridgeToObjectiveC ( ) <nl> extension StringProtocol where Index = = String . Index { <nl> : range ! = nil ? _ns . compare ( <nl> aString , <nl> options : mask , <nl> - range : _toNSRange ( range ! ) <nl> + range : _toRelativeNSRange ( range ! ) <nl> ) <nl> <nl> : ! mask . isEmpty ? _ns . compare ( aString , options : mask ) <nl> extension StringProtocol where Index = = String . Index { <nl> T : StringProtocol , R : RangeExpression <nl> > ( in range : R , with replacement : T ) - > String where R . Bound = = Index { <nl> return _ns . replacingCharacters ( <nl> - in : _toNSRange ( range . relative ( to : self ) ) , <nl> + in : _toRelativeNSRange ( range . relative ( to : self ) ) , <nl> with : replacement . _ephemeralString ) <nl> } <nl> <nl> extension StringProtocol where Index = = String . Index { <nl> of : target , <nl> with : replacement , <nl> options : options , <nl> - range : _toNSRange ( <nl> + range : _toRelativeNSRange ( <nl> searchRange ? ? startIndex . . < endIndex <nl> ) <nl> ) <nl> extension StringProtocol where Index = = String . Index { <nl> ) where R . Bound = = Index { <nl> let range = range . relative ( to : self ) <nl> _ns . enumerateLinguisticTags ( <nl> - in : _toNSRange ( range ) , <nl> + in : _toRelativeNSRange ( range ) , <nl> scheme : tagScheme . _ephemeralString , <nl> options : opts , <nl> orthography : orthography ! = nil ? orthography ! : nil <nl> extension StringProtocol where Index = = String . Index { <nl> ) - > Void <nl> ) where R . Bound = = Index { <nl> _ns . enumerateSubstrings ( <nl> - in : _toNSRange ( range . relative ( to : self ) ) , options : opts ) { <nl> + in : _toRelativeNSRange ( range . relative ( to : self ) ) , options : opts ) { <nl> var stop_ = false <nl> <nl> body ( $ 0 , <nl> extension StringProtocol where Index = = String . Index { <nl> usedLength : usedBufferCount , <nl> encoding : encoding . rawValue , <nl> options : options , <nl> - range : _toNSRange ( range . relative ( to : self ) ) , <nl> + range : _toRelativeNSRange ( range . relative ( to : self ) ) , <nl> remaining : $ 0 ) <nl> } <nl> } <nl> extension StringProtocol where Index = = String . Index { <nl> contentsEnd in self . _ns . getLineStart ( <nl> start , end : end , <nl> contentsEnd : contentsEnd , <nl> - for : _toNSRange ( range . relative ( to : self ) ) ) <nl> + for : _toRelativeNSRange ( range . relative ( to : self ) ) ) <nl> } <nl> } <nl> } <nl> extension StringProtocol where Index = = String . Index { <nl> contentsEnd in self . _ns . getParagraphStart ( <nl> start , end : end , <nl> contentsEnd : contentsEnd , <nl> - for : _toNSRange ( range . relative ( to : self ) ) ) <nl> + for : _toRelativeNSRange ( range . relative ( to : self ) ) ) <nl> } <nl> } <nl> } <nl> extension StringProtocol where Index = = String . Index { <nl> public func lineRange < <nl> R : RangeExpression <nl> > ( for aRange : R ) - > Range < Index > where R . Bound = = Index { <nl> - return _range ( _ns . lineRange ( for : _toNSRange ( aRange . relative ( to : self ) ) ) ) <nl> + return _range ( _ns . lineRange ( <nl> + for : _toRelativeNSRange ( aRange . relative ( to : self ) ) ) ) <nl> } <nl> <nl> # if ! DEPLOYMENT_RUNTIME_SWIFT <nl> extension StringProtocol where Index = = String . Index { <nl> var nsTokenRanges : NSArray ? <nl> let result = tokenRanges . _withNilOrAddress ( of : & nsTokenRanges ) { <nl> self . _ns . linguisticTags ( <nl> - in : _toNSRange ( range . relative ( to : self ) ) , <nl> + in : _toRelativeNSRange ( range . relative ( to : self ) ) , <nl> scheme : tagScheme . _ephemeralString , <nl> options : opts , <nl> orthography : orthography , <nl> extension StringProtocol where Index = = String . Index { <nl> R : RangeExpression <nl> > ( for aRange : R ) - > Range < Index > where R . Bound = = Index { <nl> return _range ( <nl> - _ns . paragraphRange ( for : _toNSRange ( aRange . relative ( to : self ) ) ) ) <nl> + _ns . paragraphRange ( for : _toRelativeNSRange ( aRange . relative ( to : self ) ) ) ) <nl> } <nl> # endif <nl> <nl> extension StringProtocol where Index = = String . Index { <nl> _ns . rangeOfCharacter ( <nl> from : aSet , <nl> options : mask , <nl> - range : _toNSRange ( <nl> + range : _toRelativeNSRange ( <nl> aRange ? ? startIndex . . < endIndex <nl> ) <nl> ) <nl> extension StringProtocol where Index = = String . Index { <nl> / / and output ranges due ( if nothing else ) to locale changes <nl> return _range ( <nl> _ns . rangeOfComposedCharacterSequences ( <nl> - for : _toNSRange ( range . relative ( to : self ) ) ) ) <nl> + for : _toRelativeNSRange ( range . relative ( to : self ) ) ) ) <nl> } <nl> <nl> / / - ( NSRange ) rangeOfString : ( NSString * ) aString <nl> extension StringProtocol where Index = = String . Index { <nl> locale ! = nil ? _ns . range ( <nl> of : aString , <nl> options : mask , <nl> - range : _toNSRange ( <nl> + range : _toRelativeNSRange ( <nl> searchRange ? ? startIndex . . < endIndex <nl> ) , <nl> locale : locale <nl> ) <nl> : searchRange ! = nil ? _ns . range ( <nl> - of : aString , options : mask , range : _toNSRange ( searchRange ! ) <nl> + of : aString , options : mask , range : _toRelativeNSRange ( searchRange ! ) <nl> ) <nl> : ! mask . isEmpty ? _ns . range ( of : aString , options : mask ) <nl> : _ns . range ( of : aString ) <nl> extension StringProtocol where Index = = String . Index { <nl> @ available ( swift , deprecated : 4 . 0 , <nl> message : " Please use String slicing subscript . " ) <nl> public func substring ( with aRange : Range < Index > ) - > String { <nl> - return _ns . substring ( with : _toNSRange ( aRange ) ) <nl> + return _ns . substring ( with : _toRelativeNSRange ( aRange ) ) <nl> } <nl> } <nl> <nl> new file mode 100644 <nl> index 000000000000 . . 92c9444e2c13 <nl> mmm / dev / null <nl> ppp b / test / stdlib / NSStringAPI + Substring . swift <nl> <nl> + / / RUN : rm - rf % t ; mkdir - p % t <nl> + / / RUN : % target - build - swift % s - o % t / a . out4 - swift - version 4 & & % target - run % t / a . out4 <nl> + / / REQUIRES : executable_test <nl> + <nl> + / / REQUIRES : objc_interop <nl> + <nl> + / / <nl> + / / Tests for the NSString APIs on Substring <nl> + / / <nl> + <nl> + import StdlibUnittest <nl> + <nl> + import Foundation <nl> + <nl> + <nl> + extension String { <nl> + func range ( fromStart : Int , fromEnd : Int ) - > Range < String . Index > { <nl> + return index ( startIndex , offsetBy : fromStart ) . . < <nl> + index ( endIndex , offsetBy : fromEnd ) <nl> + } <nl> + subscript ( fromStart : Int , fromEnd : Int ) - > SubSequence { <nl> + return self [ range ( fromStart : fromStart , fromEnd : fromEnd ) ] <nl> + } <nl> + } <nl> + <nl> + var tests = TestSuite ( " NSStringAPIs / Substring " ) <nl> + <nl> + tests . test ( " range ( of : ) / NilRange " ) { <nl> + let ss = " aabcdd " [ 1 , - 1 ] <nl> + let range = ss . range ( of : " bc " ) <nl> + expectOptionalEqual ( " bc " , range . map { ss [ $ 0 ] } ) <nl> + } <nl> + <nl> + tests . test ( " range ( of : ) / NonNilRange " ) { <nl> + let s = " aabcdd " <nl> + let ss = s [ 1 , - 1 ] <nl> + let searchRange = s . range ( fromStart : 2 , fromEnd : - 2 ) <nl> + let range = ss . range ( of : " bc " , range : searchRange ) <nl> + expectOptionalEqual ( " bc " , range . map { ss [ $ 0 ] } ) <nl> + } <nl> + <nl> + tests . test ( " rangeOfCharacter " ) { <nl> + let ss = " __hello__ " [ 2 , - 2 ] <nl> + let range = ss . rangeOfCharacter ( from : CharacterSet . alphanumerics ) <nl> + expectOptionalEqual ( " h " , range . map { ss [ $ 0 ] } ) <nl> + } <nl> + <nl> + tests . test ( " compare ( _ : options : range : locale : ) / NilRange " ) { <nl> + let needle = " hello " <nl> + let haystack = " __hello__ " [ 2 , - 2 ] <nl> + expectEqual ( . orderedSame , haystack . compare ( needle ) ) <nl> + } <nl> + <nl> + tests . test ( " compare ( _ : options : range : locale : ) / NonNilRange " ) { <nl> + let needle = " hello " <nl> + let haystack = " __hello__ " <nl> + let range = haystack . range ( fromStart : 2 , fromEnd : - 2 ) <nl> + expectEqual ( . orderedSame , haystack [ range ] . compare ( needle , range : range ) ) <nl> + } <nl> + <nl> + tests . test ( " replacingCharacters ( in : with : ) " ) { <nl> + let s = " __hello , world " <nl> + let range = s . range ( fromStart : 2 , fromEnd : - 7 ) <nl> + let expected = " __goodbye , world " <nl> + let replacement = " goodbye " <nl> + expectEqual ( expected , <nl> + s . replacingCharacters ( in : range , with : replacement ) ) <nl> + expectEqual ( expected [ 2 , 0 ] , <nl> + s [ 2 , 0 ] . replacingCharacters ( in : range , with : replacement ) ) <nl> + <nl> + expectEqual ( replacement , <nl> + s . replacingCharacters ( in : s . startIndex . . . , with : replacement ) ) <nl> + expectEqual ( replacement , <nl> + s . replacingCharacters ( in : . . < s . endIndex , with : replacement ) ) <nl> + expectEqual ( expected [ 2 , 0 ] , <nl> + s [ 2 , 0 ] . replacingCharacters ( in : range , with : replacement [ . . . ] ) ) <nl> + } <nl> + <nl> + tests . test ( " replacingOccurrences ( of : with : options : range : ) / NilRange " ) { <nl> + let s = " hello " <nl> + <nl> + expectEqual ( " he11o " , s . replacingOccurrences ( of : " l " , with : " 1 " ) ) <nl> + expectEqual ( " he11o " , s . replacingOccurrences ( of : " l " [ . . . ] , with : " 1 " ) ) <nl> + expectEqual ( " he11o " , s . replacingOccurrences ( of : " l " , with : " 1 " [ . . . ] ) ) <nl> + expectEqual ( " he11o " , s . replacingOccurrences ( of : " l " [ . . . ] , with : " 1 " [ . . . ] ) ) <nl> + <nl> + expectEqual ( " he11o " , <nl> + s [ . . . ] . replacingOccurrences ( of : " l " , with : " 1 " ) ) <nl> + expectEqual ( " he11o " , <nl> + s [ . . . ] . replacingOccurrences ( of : " l " [ . . . ] , with : " 1 " ) ) <nl> + expectEqual ( " he11o " , <nl> + s [ . . . ] . replacingOccurrences ( of : " l " , with : " 1 " [ . . . ] ) ) <nl> + expectEqual ( " he11o " , <nl> + s [ . . . ] . replacingOccurrences ( of : " l " [ . . . ] , with : " 1 " [ . . . ] ) ) <nl> + } <nl> + <nl> + tests . test ( " replacingOccurrences ( of : with : options : range : ) / NonNilRange " ) { <nl> + let s = " hello " <nl> + let r = s . range ( fromStart : 1 , fromEnd : - 2 ) <nl> + <nl> + expectEqual ( " he1lo " , <nl> + s . replacingOccurrences ( of : " l " , with : " 1 " , range : r ) ) <nl> + expectEqual ( " he1lo " , <nl> + s . replacingOccurrences ( of : " l " [ . . . ] , with : " 1 " , range : r ) ) <nl> + expectEqual ( " he1lo " , <nl> + s . replacingOccurrences ( of : " l " , with : " 1 " [ . . . ] , range : r ) ) <nl> + expectEqual ( " he1lo " , <nl> + s . replacingOccurrences ( of : " l " [ . . . ] , with : " 1 " [ . . . ] , range : r ) ) <nl> + <nl> + expectEqual ( " he1lo " , <nl> + s [ . . . ] . replacingOccurrences ( of : " l " , with : " 1 " , range : r ) ) <nl> + expectEqual ( " he1lo " , <nl> + s [ . . . ] . replacingOccurrences ( of : " l " [ . . . ] , with : " 1 " , range : r ) ) <nl> + expectEqual ( " he1lo " , <nl> + s [ . . . ] . replacingOccurrences ( of : " l " , with : " 1 " [ . . . ] , range : r ) ) <nl> + expectEqual ( " he1lo " , <nl> + s [ . . . ] . replacingOccurrences ( of : " l " [ . . . ] , with : " 1 " [ . . . ] , range : r ) ) <nl> + <nl> + let ss = s [ 1 , - 1 ] <nl> + expectEqual ( " e1l " , <nl> + ss . replacingOccurrences ( of : " l " , with : " 1 " , range : r ) ) <nl> + expectEqual ( " e1l " , <nl> + ss . replacingOccurrences ( of : " l " [ . . . ] , with : " 1 " , range : r ) ) <nl> + expectEqual ( " e1l " , <nl> + ss . replacingOccurrences ( of : " l " , with : " 1 " [ . . . ] , range : r ) ) <nl> + expectEqual ( " e1l " , <nl> + ss . replacingOccurrences ( of : " l " [ . . . ] , with : " 1 " [ . . . ] , range : r ) ) <nl> + } <nl> + <nl> + tests . test ( " substring ( with : ) " ) { <nl> + let s = " hello , world " <nl> + let r = s . range ( fromStart : 7 , fromEnd : 0 ) <nl> + expectEqual ( " world " , s . substring ( with : r ) ) <nl> + expectEqual ( " world " , s [ . . . ] . substring ( with : r ) ) <nl> + expectEqual ( " world " , s [ 1 , 0 ] . substring ( with : r ) ) <nl> + } <nl> + <nl> + tests . test ( " substring ( with : ) / SubscriptEquivalence " ) { <nl> + let s = " hello , world " <nl> + let r = s . range ( fromStart : 7 , fromEnd : 0 ) <nl> + expectEqual ( s [ r ] , s . substring ( with : r ) ) <nl> + expectEqual ( s [ . . . ] [ r ] , s [ . . . ] . substring ( with : r ) ) <nl> + expectEqual ( s [ 1 , 0 ] [ r ] , s [ 1 , 0 ] . substring ( with : r ) ) <nl> + } <nl> + <nl> + runAllTests ( ) <nl> mmm a / test / stdlib / NSStringAPI . swift <nl> ppp b / test / stdlib / NSStringAPI . swift <nl> <nl> - / / RUN : % target - run - simple - swift - swift - version 3 <nl> + / / RUN : % target - run - simple - swift <nl> / / REQUIRES : executable_test <nl> <nl> / / REQUIRES : objc_interop <nl> NSStringAPIs . test ( " rangeOfComposedCharacterSequences ( for : ) " ) { <nl> for : s . index ( s . startIndex , offsetBy : 8 ) . . < s . index ( s . startIndex , offsetBy : 10 ) ) ] ) <nl> } <nl> <nl> - func toIntRange ( <nl> - _ string : String , _ maybeRange : Range < String . Index > ? <nl> - ) - > Range < Int > ? { <nl> + func toIntRange < <nl> + S : StringProtocol <nl> + > ( <nl> + _ string : S , _ maybeRange : Range < String . Index > ? <nl> + ) - > Range < Int > ? where S . Index = = String . Index , S . IndexDistance = = Int { <nl> guard let range = maybeRange else { return nil } <nl> <nl> return <nl>
|
Merge pull request from moiseev / ns - substring
|
apple/swift
|
920e42f51f43f4a435d324e89f247520d70cffce
|
2017-09-28T05:58:27Z
|
mmm a / typings / internal - ambient . d . ts <nl> ppp b / typings / internal - ambient . d . ts <nl> declare namespace NodeJS { <nl> } <nl> } <nl> <nl> - declare module NodeJS { <nl> + declare module NodeJS { <nl> interface Global { <nl> require : NodeRequire ; <nl> module : NodeModule ; <nl> interface ResizeObserverEntry { <nl> / / https : / / github . com / microsoft / TypeScript / pull / 38232 <nl> <nl> interface WeakRef < T extends object > { <nl> - readonly [ Symbol . toStringTag ] : " WeakRef " ; <nl> + readonly [ Symbol . toStringTag ] : ' WeakRef ' ; <nl> <nl> / * * <nl> * Returns the WeakRef instance ' s target object , or undefined if the target object has been <nl> interface WeakRefConstructor { <nl> declare var WeakRef : WeakRefConstructor ; <nl> <nl> interface FinalizationRegistry { <nl> - readonly [ Symbol . toStringTag ] : " FinalizationRegistry " ; <nl> + readonly [ Symbol . toStringTag ] : ' FinalizationRegistry ' ; <nl> <nl> / * * <nl> * Registers an object with the registry . <nl>
|
chore : a few style fixes for internal - ambient . d . ts ( )
|
electron/electron
|
2c52d5fe427971f139acb0c7ae30c8800ebd4262
|
2020-11-05T22:13:02Z
|
mmm a / PowerEditor / installer / nativeLang / bengali . xml <nl> ppp b / PowerEditor / installer / nativeLang / bengali . xml <nl> <nl> < ? xml version = " 1 . 0 " encoding = " utf - 8 " ? > <nl> < ! - - <nl> - : : Arabic language file for Notepad + + : : <nl> + : : Bengali language file for Notepad + + : : <nl> <nl> * * created By : - Dhairya Parekh * * <nl> Email - d . parekh93 @ hotmail . com <nl>
|
Update bengali . xml
|
notepad-plus-plus/notepad-plus-plus
|
e5493a7210ab2b2023a5abe2f587c4e6c05b5c3a
|
2015-10-09T18:23:52Z
|
mmm a / include / swift / SIL / SILBuilder . h <nl> ppp b / include / swift / SIL / SILBuilder . h <nl> class SILBuilder { <nl> getSILDebugLocation ( Loc ) , text . toStringRef ( Out ) , encoding , F ) ) ; <nl> } <nl> <nl> + LoadInst * createTrivialLoadOr ( SILLocation Loc , SILValue LV , <nl> + LoadOwnershipQualifier Qualifier ) { <nl> + if ( LV - > getType ( ) . isTrivial ( getModule ( ) ) ) { <nl> + return createLoad ( Loc , LV , LoadOwnershipQualifier : : Trivial ) ; <nl> + } <nl> + return createLoad ( Loc , LV , Qualifier ) ; <nl> + } <nl> + <nl> LoadInst * createLoad ( SILLocation Loc , SILValue LV , <nl> LoadOwnershipQualifier Qualifier ) { <nl> assert ( ( Qualifier ! = LoadOwnershipQualifier : : Unqualified ) | | <nl> class SILBuilder { <nl> BeginBorrowInst ( getSILDebugLocation ( Loc ) , LV ) ) ; <nl> } <nl> <nl> + / / / Utility function that returns a trivial store if the stored type is <nl> + / / / trivial and a \ p Qualifier store if the stored type is non - trivial . <nl> + StoreInst * createTrivialStoreOr ( SILLocation Loc , SILValue Src , <nl> + SILValue DestAddr , <nl> + StoreOwnershipQualifier Qualifier ) { <nl> + if ( Src - > getType ( ) . isTrivial ( getModule ( ) ) ) { <nl> + return createStore ( Loc , Src , DestAddr , StoreOwnershipQualifier : : Trivial ) ; <nl> + } <nl> + return createStore ( Loc , Src , DestAddr , Qualifier ) ; <nl> + } <nl> + <nl> StoreInst * createStore ( SILLocation Loc , SILValue Src , SILValue DestAddr , <nl> StoreOwnershipQualifier Qualifier ) { <nl> assert ( ( Qualifier ! = StoreOwnershipQualifier : : Unqualified ) | | <nl> mmm a / include / swift / SIL / SILValue . h <nl> ppp b / include / swift / SIL / SILValue . h <nl> class alignas ( 8 ) ValueBase : public SILAllocated < ValueBase > { <nl> / / / otherwise . <nl> inline Operand * getSingleUse ( ) const ; <nl> <nl> + template < class T > <nl> + inline T * getSingleUserOfType ( ) ; <nl> + <nl> / / / Pretty - print the value . <nl> void dump ( ) const ; <nl> void print ( raw_ostream & OS ) const ; <nl> inline Operand * ValueBase : : getSingleUse ( ) const { <nl> return Op ; <nl> } <nl> <nl> + template < class T > <nl> + inline T * ValueBase : : getSingleUserOfType ( ) { <nl> + T * Result = nullptr ; <nl> + for ( auto * Op : getUses ( ) ) { <nl> + if ( auto * Tmp = dyn_cast < T > ( Op - > getUser ( ) ) ) { <nl> + if ( Result ) <nl> + return nullptr ; <nl> + Result = Tmp ; <nl> + } <nl> + } <nl> + return Result ; <nl> + } <nl> + <nl> / / / A constant - size list of the operands of an instruction . <nl> template < unsigned N > class FixedOperandList { <nl> Operand Buffer [ N ] ; <nl>
|
Merge pull request from gottesmm / some_convenience_apis
|
apple/swift
|
88aa00e7de9c4bfd72e38f5b20f51079bc785339
|
2017-07-14T00:04:57Z
|
mmm a / ios / sdk / WeexSDK / Sources / Model / WXSDKInstance . h <nl> ppp b / ios / sdk / WeexSDK / Sources / Model / WXSDKInstance . h <nl> typedef NS_ENUM ( NSInteger , WXErrorCode ) { / / error . code <nl> / * * <nl> * the info stored by user . <nl> * / <nl> - @ property ( nonatomic , strong ) NSDictionary * userInfo ; <nl> + @ property ( nonatomic , strong ) NSMutableDictionary * userInfo ; <nl> <nl> / * * <nl> * Renders weex view with bundle url . <nl>
|
* [ ios ] change variable type .
|
apache/incubator-weex
|
68fe1c28069eac2e8579002bbfa558b53ac3a166
|
2016-09-12T06:53:49Z
|
mmm a / src / mongo / s / catalog / replset / SConscript <nl> ppp b / src / mongo / s / catalog / replset / SConscript <nl> env . Library ( <nl> ' catalog_manager_replica_set . cpp ' , <nl> ] , <nl> LIBDEPS = [ <nl> - ' $ BUILD_DIR / mongo / client / fetcher ' , <nl> - ' $ BUILD_DIR / mongo / db / query / lite_parsed_query ' , <nl> - ' $ BUILD_DIR / mongo / executor / task_executor_interface ' , <nl> ' $ BUILD_DIR / mongo / s / catalog / catalog_manager ' , <nl> ' $ BUILD_DIR / mongo / s / catalog / dist_lock_manager ' , <nl> ' $ BUILD_DIR / mongo / s / client / sharding_client ' , <nl> mmm a / src / mongo / s / catalog / replset / catalog_manager_replica_set . cpp <nl> ppp b / src / mongo / s / catalog / replset / catalog_manager_replica_set . cpp <nl> <nl> # include " mongo / bson / bsonobjbuilder . h " <nl> # include " mongo / bson / util / bson_extract . h " <nl> # include " mongo / client / dbclientinterface . h " <nl> - # include " mongo / client / query_fetcher . h " <nl> # include " mongo / client / read_preference . h " <nl> - # include " mongo / client / remote_command_runner . h " <nl> # include " mongo / client / remote_command_targeter . h " <nl> # include " mongo / db / commands . h " <nl> # include " mongo / db / namespace_string . h " <nl> - # include " mongo / executor / task_executor . h " <nl> # include " mongo / rpc / get_status_from_command_result . h " <nl> # include " mongo / s / catalog / dist_lock_manager . h " <nl> # include " mongo / s / catalog / type_collection . h " <nl> + # include " mongo / s / catalog / type_chunk . h " <nl> # include " mongo / s / catalog / type_database . h " <nl> # include " mongo / s / catalog / type_settings . h " <nl> # include " mongo / s / catalog / type_shard . h " <nl> <nl> <nl> namespace mongo { <nl> <nl> - using executor : : TaskExecutor ; <nl> - using RemoteCommandCallbackArgs = TaskExecutor : : RemoteCommandCallbackArgs ; <nl> - <nl> using std : : set ; <nl> using std : : string ; <nl> using std : : unique_ptr ; <nl> namespace { <nl> const ReadPreferenceSetting kConfigWriteSelector ( ReadPreference : : PrimaryOnly , TagSet { } ) ; <nl> const ReadPreferenceSetting kConfigReadSelector ( ReadPreference : : SecondaryOnly , TagSet { } ) ; <nl> <nl> - const Seconds kConfigCommandTimeout { 30 } ; <nl> const int kNotMasterNumRetries = 3 ; <nl> const Milliseconds kNotMasterRetryInterval { 500 } ; <nl> <nl> namespace { <nl> return readHost . getStatus ( ) ; <nl> } <nl> <nl> - auto findStatus = _find ( readHost . getValue ( ) , <nl> - NamespaceString ( DatabaseType : : ConfigNS ) , <nl> - BSON ( DatabaseType : : name ( dbName ) ) , <nl> - 1 ) ; <nl> + auto findStatus = grid . shardRegistry ( ) - > exhaustiveFind ( <nl> + readHost . getValue ( ) , <nl> + NamespaceString ( DatabaseType : : ConfigNS ) , <nl> + BSON ( DatabaseType : : name ( dbName ) ) , <nl> + 1 ) ; <nl> + <nl> if ( ! findStatus . isOK ( ) ) { <nl> return findStatus . getStatus ( ) ; <nl> } <nl> namespace { <nl> return readHostStatus . getStatus ( ) ; <nl> } <nl> <nl> - auto statusFind = _find ( readHostStatus . getValue ( ) , <nl> - NamespaceString ( CollectionType : : ConfigNS ) , <nl> - BSON ( CollectionType : : fullNs ( collNs ) ) , <nl> - 1 ) ; <nl> + auto statusFind = grid . shardRegistry ( ) - > exhaustiveFind ( <nl> + readHostStatus . getValue ( ) , <nl> + NamespaceString ( CollectionType : : ConfigNS ) , <nl> + BSON ( CollectionType : : fullNs ( collNs ) ) , <nl> + 1 ) ; <nl> + <nl> if ( ! statusFind . isOK ( ) ) { <nl> return statusFind . getStatus ( ) ; <nl> } <nl> namespace { <nl> return readHost . getStatus ( ) ; <nl> } <nl> <nl> - auto findStatus = _find ( readHost . getValue ( ) , <nl> - NamespaceString ( SettingsType : : ConfigNS ) , <nl> - BSON ( SettingsType : : key ( key ) ) , <nl> - 1 ) ; <nl> + auto findStatus = grid . shardRegistry ( ) - > exhaustiveFind ( <nl> + readHost . getValue ( ) , <nl> + NamespaceString ( SettingsType : : ConfigNS ) , <nl> + BSON ( SettingsType : : key ( key ) ) , <nl> + 1 ) ; <nl> + <nl> if ( ! findStatus . isOK ( ) ) { <nl> return findStatus . getStatus ( ) ; <nl> } <nl> namespace { <nl> return readHostStatus . getStatus ( ) ; <nl> } <nl> <nl> - auto findStatus = _find ( readHostStatus . getValue ( ) , <nl> - NamespaceString ( ChunkType : : ConfigNS ) , <nl> - query . obj , <nl> - boost : : none ) ; / / no limit <nl> + auto findStatus = grid . shardRegistry ( ) - > exhaustiveFind ( readHostStatus . getValue ( ) , <nl> + NamespaceString ( ChunkType : : ConfigNS ) , <nl> + query . obj , <nl> + boost : : none ) ; / / no limit <nl> if ( ! findStatus . isOK ( ) ) { <nl> return findStatus . getStatus ( ) ; <nl> } <nl> namespace { <nl> return readHost . getStatus ( ) ; <nl> } <nl> <nl> - auto findStatus = _find ( readHost . getValue ( ) , <nl> - NamespaceString ( ShardType : : ConfigNS ) , <nl> - BSONObj ( ) , / / no query filter <nl> - boost : : none ) ; / / no limit <nl> + auto findStatus = grid . shardRegistry ( ) - > exhaustiveFind ( readHost . getValue ( ) , <nl> + NamespaceString ( ShardType : : ConfigNS ) , <nl> + BSONObj ( ) , / / no query filter <nl> + boost : : none ) ; / / no limit <nl> if ( ! findStatus . isOK ( ) ) { <nl> return findStatus . getStatus ( ) ; <nl> } <nl> namespace { <nl> return Command : : appendCommandStatus ( * result , target . getStatus ( ) ) ; <nl> } <nl> <nl> - auto response = _runCommand ( target . getValue ( ) , dbname , cmdObj ) ; <nl> + auto response = grid . shardRegistry ( ) - > runCommand ( target . getValue ( ) , dbname , cmdObj ) ; <nl> if ( ! response . isOK ( ) ) { <nl> return Command : : appendCommandStatus ( * result , response . getStatus ( ) ) ; <nl> } <nl> namespace { <nl> return Command : : appendCommandStatus ( * result , target . getStatus ( ) ) ; <nl> } <nl> <nl> - auto resultStatus = _runCommand ( target . getValue ( ) , dbname , cmdObj ) ; <nl> + auto resultStatus = grid . shardRegistry ( ) - > runCommand ( target . getValue ( ) , dbname , cmdObj ) ; <nl> if ( ! resultStatus . isOK ( ) ) { <nl> return Command : : appendCommandStatus ( * result , resultStatus . getStatus ( ) ) ; <nl> } <nl> namespace { <nl> return ; <nl> } <nl> <nl> - auto resultStatus = _runCommand ( target . getValue ( ) , <nl> - batchRequest . getNSS ( ) . db ( ) . toString ( ) , <nl> - batchRequest . toBSON ( ) ) ; <nl> + auto resultStatus = grid . shardRegistry ( ) - > runCommand ( target . getValue ( ) , <nl> + batchRequest . getNSS ( ) . db ( ) . toString ( ) , <nl> + batchRequest . toBSON ( ) ) ; <nl> + <nl> if ( ! resultStatus . isOK ( ) ) { <nl> _toBatchError ( resultStatus . getStatus ( ) , batchResponse ) ; <nl> return ; <nl> namespace { <nl> _toBatchError ( notMasterStatus , batchResponse ) ; <nl> } <nl> <nl> - StatusWith < vector < BSONObj > > CatalogManagerReplicaSet : : _find ( const HostAndPort & host , <nl> - const NamespaceString & nss , <nl> - const BSONObj & query , <nl> - boost : : optional < int > limit ) { <nl> - <nl> - / / If for some reason the callback never gets invoked , we will return this status <nl> - Status status = Status ( ErrorCodes : : InternalError , " Internal error running find command " ) ; <nl> - vector < BSONObj > results ; <nl> - <nl> - auto fetcherCallback = [ & status , & results ] ( const QueryFetcher : : BatchDataStatus & dataStatus , <nl> - Fetcher : : NextAction * nextAction ) { <nl> - <nl> - / / Throw out any accumulated results on error <nl> - if ( ! dataStatus . isOK ( ) ) { <nl> - status = dataStatus . getStatus ( ) ; <nl> - results . clear ( ) ; <nl> - return ; <nl> - } <nl> - <nl> - auto & data = dataStatus . getValue ( ) ; <nl> - for ( const BSONObj & doc : data . documents ) { <nl> - results . push_back ( std : : move ( doc . getOwned ( ) ) ) ; <nl> - } <nl> - <nl> - status = Status : : OK ( ) ; <nl> - } ; <nl> - <nl> - unique_ptr < LiteParsedQuery > findCmd ( <nl> - fassertStatusOK ( 28688 , LiteParsedQuery : : makeAsFindCmd ( nss , query , std : : move ( limit ) ) ) ) ; <nl> - <nl> - QueryFetcher fetcher ( grid . shardRegistry ( ) - > getExecutor ( ) , <nl> - host , <nl> - nss , <nl> - findCmd - > asFindCommand ( ) , <nl> - fetcherCallback ) ; <nl> - <nl> - Status scheduleStatus = fetcher . schedule ( ) ; <nl> - if ( ! scheduleStatus . isOK ( ) ) { <nl> - return scheduleStatus ; <nl> - } <nl> - <nl> - fetcher . wait ( ) ; <nl> - <nl> - if ( ! status . isOK ( ) ) { <nl> - return status ; <nl> - } <nl> - <nl> - return results ; <nl> - } <nl> - <nl> - StatusWith < BSONObj > CatalogManagerReplicaSet : : _runCommand ( const HostAndPort & host , <nl> - const std : : string & dbName , <nl> - const BSONObj & cmdObj ) { <nl> - <nl> - TaskExecutor * exec = grid . shardRegistry ( ) - > getExecutor ( ) ; <nl> - <nl> - StatusWith < RemoteCommandResponse > responseStatus = <nl> - Status ( ErrorCodes : : InternalError , " Internal error running command " ) ; <nl> - <nl> - RemoteCommandRequest request ( host , dbName , cmdObj , kConfigCommandTimeout ) ; <nl> - auto callStatus = <nl> - exec - > scheduleRemoteCommand ( request , <nl> - [ & responseStatus ] ( const RemoteCommandCallbackArgs & args ) { <nl> - <nl> - responseStatus = args . response ; <nl> - } ) ; <nl> - <nl> - if ( ! callStatus . isOK ( ) ) { <nl> - return callStatus . getStatus ( ) ; <nl> - } <nl> - <nl> - / / Block until the command is carried out <nl> - exec - > wait ( callStatus . getValue ( ) ) ; <nl> - <nl> - if ( ! responseStatus . isOK ( ) ) { <nl> - return responseStatus . getStatus ( ) ; <nl> - } <nl> - <nl> - return responseStatus . getValue ( ) . data ; <nl> - } <nl> - <nl> } / / namespace mongo <nl> mmm a / src / mongo / s / catalog / replset / catalog_manager_replica_set . h <nl> ppp b / src / mongo / s / catalog / replset / catalog_manager_replica_set . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include < boost / optional . hpp > <nl> # include < memory > <nl> # include < mutex > <nl> # include < string > <nl> <nl> <nl> namespace mongo { <nl> <nl> - struct HostAndPort ; <nl> - class NamespaceString ; <nl> - <nl> / * * <nl> * Implements the catalog manager for talking to replica set config servers . <nl> * / <nl> namespace mongo { <nl> DistLockManager * getDistLockManager ( ) override ; <nl> <nl> private : <nl> - / * * <nl> - * Executes ' find ' command against the specified host and fetches * all * the results that <nl> - * the host will return until there are no more or until an error is returned . <nl> - * <nl> - * Returns either the complete set of results or an error , never partial results . <nl> - * / <nl> - StatusWith < std : : vector < BSONObj > > _find ( const HostAndPort & host , <nl> - const NamespaceString & nss , <nl> - const BSONObj & query , <nl> - boost : : optional < int > limit ) ; <nl> - <nl> - / * * <nl> - * Runs a command against the specified host and returns the result . <nl> - * / <nl> - StatusWith < BSONObj > _runCommand ( const HostAndPort & host , <nl> - const std : : string & dbName , <nl> - const BSONObj & cmdObj ) ; <nl> <nl> / / Config server connection string <nl> ConnectionString _configServerConnectionString ; <nl> mmm a / src / mongo / s / client / SConscript <nl> ppp b / src / mongo / s / client / SConscript <nl> env . Library ( <nl> ] , <nl> LIBDEPS = [ <nl> ' $ BUILD_DIR / mongo / client / clientdriver ' , <nl> + ' $ BUILD_DIR / mongo / client / fetcher ' , <nl> ' $ BUILD_DIR / mongo / client / remote_command_runner_impl ' , <nl> ' $ BUILD_DIR / mongo / client / remote_command_targeter ' , <nl> ' $ BUILD_DIR / mongo / s / catalog / catalog_manager ' , <nl> mmm a / src / mongo / s / client / shard_registry . cpp <nl> ppp b / src / mongo / s / client / shard_registry . cpp <nl> <nl> # include " mongo / s / client / shard_registry . h " <nl> <nl> # include " mongo / client / connection_string . h " <nl> + # include " mongo / client / query_fetcher . h " <nl> # include " mongo / client / remote_command_runner_impl . h " <nl> # include " mongo / client / remote_command_targeter . h " <nl> # include " mongo / client / remote_command_targeter_factory . h " <nl> namespace mongo { <nl> <nl> using std : : shared_ptr ; <nl> using std : : string ; <nl> + using std : : unique_ptr ; <nl> using std : : vector ; <nl> <nl> + using executor : : TaskExecutor ; <nl> + using RemoteCommandCallbackArgs = TaskExecutor : : RemoteCommandCallbackArgs ; <nl> + <nl> + namespace { <nl> + const Seconds kConfigCommandTimeout { 30 } ; <nl> + } / / unnamed namespace <nl> + <nl> ShardRegistry : : ShardRegistry ( std : : unique_ptr < RemoteCommandTargeterFactory > targeterFactory , <nl> std : : unique_ptr < RemoteCommandRunner > commandRunner , <nl> std : : unique_ptr < executor : : TaskExecutor > executor , <nl> namespace mongo { <nl> return nullptr ; <nl> } <nl> <nl> + StatusWith < std : : vector < BSONObj > > ShardRegistry : : exhaustiveFind ( const HostAndPort & host , <nl> + const NamespaceString & nss , <nl> + const BSONObj & query , <nl> + boost : : optional < int > limit ) { <nl> + / / If for some reason the callback never gets invoked , we will return this status <nl> + Status status = Status ( ErrorCodes : : InternalError , " Internal error running find command " ) ; <nl> + vector < BSONObj > results ; <nl> + <nl> + auto fetcherCallback = [ & status , & results ] ( const QueryFetcher : : BatchDataStatus & dataStatus , <nl> + Fetcher : : NextAction * nextAction ) { <nl> + <nl> + / / Throw out any accumulated results on error <nl> + if ( ! dataStatus . isOK ( ) ) { <nl> + status = dataStatus . getStatus ( ) ; <nl> + results . clear ( ) ; <nl> + return ; <nl> + } <nl> + <nl> + auto & data = dataStatus . getValue ( ) ; <nl> + for ( const BSONObj & doc : data . documents ) { <nl> + results . push_back ( std : : move ( doc . getOwned ( ) ) ) ; <nl> + } <nl> + <nl> + status = Status : : OK ( ) ; <nl> + } ; <nl> + <nl> + unique_ptr < LiteParsedQuery > findCmd ( <nl> + fassertStatusOK ( 28688 , LiteParsedQuery : : makeAsFindCmd ( nss , query , std : : move ( limit ) ) ) ) ; <nl> + <nl> + QueryFetcher fetcher ( _executor . get ( ) , <nl> + host , <nl> + nss , <nl> + findCmd - > asFindCommand ( ) , <nl> + fetcherCallback ) ; <nl> + <nl> + Status scheduleStatus = fetcher . schedule ( ) ; <nl> + if ( ! scheduleStatus . isOK ( ) ) { <nl> + return scheduleStatus ; <nl> + } <nl> + <nl> + fetcher . wait ( ) ; <nl> + <nl> + if ( ! status . isOK ( ) ) { <nl> + return status ; <nl> + } <nl> + <nl> + return results ; <nl> + } <nl> + <nl> + StatusWith < BSONObj > ShardRegistry : : runCommand ( const HostAndPort & host , <nl> + const std : : string & dbName , <nl> + const BSONObj & cmdObj ) { <nl> + StatusWith < RemoteCommandResponse > responseStatus = <nl> + Status ( ErrorCodes : : InternalError , " Internal error running command " ) ; <nl> + <nl> + RemoteCommandRequest request ( host , dbName , cmdObj , kConfigCommandTimeout ) ; <nl> + auto callStatus = _executor - > scheduleRemoteCommand ( request , <nl> + [ & responseStatus ] ( const RemoteCommandCallbackArgs & args ) { <nl> + responseStatus = args . response ; <nl> + } ) ; <nl> + <nl> + if ( ! callStatus . isOK ( ) ) { <nl> + return callStatus . getStatus ( ) ; <nl> + } <nl> + <nl> + / / Block until the command is carried out <nl> + _executor - > wait ( callStatus . getValue ( ) ) ; <nl> + <nl> + if ( ! responseStatus . isOK ( ) ) { <nl> + return responseStatus . getStatus ( ) ; <nl> + } <nl> + <nl> + return responseStatus . getValue ( ) . data ; <nl> + } <nl> + <nl> } / / namespace mongo <nl> mmm a / src / mongo / s / client / shard_registry . h <nl> ppp b / src / mongo / s / client / shard_registry . h <nl> <nl> <nl> # pragma once <nl> <nl> + # include < boost / optional . hpp > <nl> # include < memory > <nl> # include < mutex > <nl> # include < string > <nl> namespace mongo { <nl> <nl> class BSONObjBuilder ; <nl> class CatalogManager ; <nl> + class HostAndPort ; <nl> + class NamespaceString ; <nl> class RemoteCommandRunner ; <nl> class RemoteCommandTargeterFactory ; <nl> class Shard ; <nl> class ShardType ; <nl> <nl> + template < typename T > class StatusWith ; <nl> + <nl> namespace executor { <nl> <nl> class TaskExecutor ; <nl> namespace executor { <nl> <nl> void toBSON ( BSONObjBuilder * result ) ; <nl> <nl> + / * * <nl> + * Executes ' find ' command against the specified host and fetches * all * the results that <nl> + * the host will return until there are no more or until an error is returned . <nl> + * <nl> + * Returns either the complete set of results or an error , never partial results . <nl> + * <nl> + * Note : should never be used outside of CatalogManagerReplicaSet or DistLockCatalogImpl . <nl> + * / <nl> + StatusWith < std : : vector < BSONObj > > exhaustiveFind ( const HostAndPort & host , <nl> + const NamespaceString & nss , <nl> + const BSONObj & query , <nl> + boost : : optional < int > limit ) ; <nl> + <nl> + / * * <nl> + * Runs a command against the specified host and returns the result . <nl> + * / <nl> + StatusWith < BSONObj > runCommand ( const HostAndPort & host , <nl> + const std : : string & dbName , <nl> + const BSONObj & cmdObj ) ; <nl> + <nl> private : <nl> typedef std : : map < ShardId , std : : shared_ptr < Shard > > ShardMap ; <nl> <nl>
|
SERVER - 18589 Refactor find and runCommand from CatalogManagerRS
|
mongodb/mongo
|
1effdbaec08661985bd987f4ef96d82e049e0563
|
2015-06-19T15:28:19Z
|
mmm a / include / swift / AST / Expr . h <nl> ppp b / include / swift / AST / Expr . h <nl> class ErrorExpr : public Expr { <nl> / / / can help us preserve the context of the code completion position . <nl> class CodeCompletionExpr : public Expr { <nl> SourceRange Range ; <nl> - bool Activated ; <nl> <nl> public : <nl> - CodeCompletionExpr ( SourceRange Range , Type Ty = Type ( ) ) : <nl> - Expr ( ExprKind : : CodeCompletion , / * Implicit = * / true , Ty ) , <nl> - Range ( Range ) { <nl> - Activated = false ; <nl> - } <nl> + CodeCompletionExpr ( SourceRange Range , Type Ty = Type ( ) ) <nl> + : Expr ( ExprKind : : CodeCompletion , / * Implicit = * / true , Ty ) , Range ( Range ) { } <nl> <nl> SourceRange getSourceRange ( ) const { return Range ; } <nl> <nl> - bool isActivated ( ) const { return Activated ; } <nl> - void setActivated ( ) { Activated = true ; } <nl> - <nl> static bool classof ( const Expr * E ) { <nl> return E - > getKind ( ) = = ExprKind : : CodeCompletion ; <nl> } <nl> mmm a / lib / IDE / CodeCompletion . cpp <nl> ppp b / lib / IDE / CodeCompletion . cpp <nl> calculateTypeRelationForDecl ( const Decl * D , Type ExpectedType , <nl> bool UseFuncResultType = true ) { <nl> auto VD = dyn_cast < ValueDecl > ( D ) ; <nl> auto DC = D - > getDeclContext ( ) ; <nl> - if ( ! VD ) <nl> + if ( ! VD | | ! VD - > hasInterfaceType ( ) ) <nl> return CodeCompletionResult : : ExpectedTypeRelation : : Unrelated ; <nl> <nl> if ( auto FD = dyn_cast < AbstractFunctionDecl > ( VD ) ) { <nl> static bool isTopLevelContext ( const DeclContext * DC ) { <nl> static Type getReturnTypeFromContext ( const DeclContext * DC ) { <nl> if ( auto FD = dyn_cast < AbstractFunctionDecl > ( DC ) ) { <nl> if ( FD - > hasInterfaceType ( ) ) { <nl> - if ( auto FT = FD - > getInterfaceType ( ) - > getAs < FunctionType > ( ) ) { <nl> + auto Ty = FD - > getInterfaceType ( ) ; <nl> + if ( FD - > getDeclContext ( ) - > isTypeContext ( ) ) <nl> + Ty = FD - > getMethodInterfaceType ( ) ; <nl> + if ( auto FT = Ty - > getAs < AnyFunctionType > ( ) ) <nl> return FT - > getResult ( ) ; <nl> - } <nl> } <nl> - } else if ( auto CE = dyn_cast < AbstractClosureExpr > ( DC ) ) { <nl> - if ( CE - > getType ( ) ) { <nl> - return CE - > getResultType ( ) ; <nl> + } else if ( auto ACE = dyn_cast < AbstractClosureExpr > ( DC ) ) { <nl> + if ( ACE - > getType ( ) ) <nl> + return ACE - > getResultType ( ) ; <nl> + if ( auto CE = dyn_cast < ClosureExpr > ( ACE ) ) { <nl> + if ( CE - > hasExplicitResultType ( ) ) <nl> + return const_cast < ClosureExpr * > ( CE ) <nl> + - > getExplicitResultTypeLoc ( ) <nl> + . getType ( ) ; <nl> } <nl> } <nl> return Type ( ) ; <nl> class CompletionLookup final : public swift : : VisibleDeclConsumer { <nl> using FunctionParams = ArrayRef < AnyFunctionType : : Param > ; <nl> <nl> static bool <nl> - collectPossibleParamLists ( DeclContext & DC , CallExpr * callExpr , <nl> + collectPossibleParamLists ( DeclContext & DC , ApplyExpr * callExpr , <nl> SmallVectorImpl < FunctionParams > & candidates ) { <nl> auto * fnExpr = callExpr - > getFn ( ) ; <nl> <nl> class CompletionLookup final : public swift : : VisibleDeclConsumer { <nl> if ( ! tuple ) <nl> return false ; <nl> <nl> - for ( unsigned i = 0 , n = tuple - > getNumElements ( ) ; i ! = n ; + + i ) { <nl> - if ( isa < CodeCompletionExpr > ( tuple - > getElement ( i ) ) ) { <nl> - HasName = ! tuple - > getElementName ( i ) . empty ( ) ; <nl> - Position = i ; <nl> - return true ; <nl> - } <nl> - } <nl> auto & SM = DC . getASTContext ( ) . SourceMgr ; <nl> for ( unsigned i = 0 , n = tuple - > getNumElements ( ) ; i ! = n ; + + i ) { <nl> if ( SM . isBeforeInBuffer ( tuple - > getElement ( i ) - > getEndLoc ( ) , <nl> CCExpr - > getStartLoc ( ) ) ) <nl> continue ; <nl> - HasName = ! tuple - > getElementName ( i ) . empty ( ) ; <nl> + HasName = tuple - > getElementNameLoc ( i ) . isValid ( ) ; <nl> Position = i ; <nl> return true ; <nl> } <nl> class CompletionLookup final : public swift : : VisibleDeclConsumer { <nl> } <nl> <nl> static bool <nl> - collectArgumentExpectation ( DeclContext & DC , CallExpr * CallE , Expr * CCExpr , <nl> + collectArgumentExpectation ( DeclContext & DC , ApplyExpr * CallE , Expr * CCExpr , <nl> std : : vector < Type > & ExpectedTypes , <nl> std : : vector < StringRef > & ExpectedNames ) { <nl> / / Collect parameter lists for possible func decls . <nl> class CompletionLookup final : public swift : : VisibleDeclConsumer { <nl> if ( ! getPositionInArgs ( DC , CallE - > getArg ( ) , CCExpr , Position , HasName ) ) <nl> return false ; <nl> <nl> - / / Collect possible types at the position . <nl> + / / Collect possible types ( or labels ) at the position . <nl> { <nl> + bool MayNeedName = <nl> + ! HasName & & isa < CallExpr > ( CallE ) & & ! CallE - > isImplicit ( ) ; <nl> SmallPtrSet < TypeBase * , 4 > seenTypes ; <nl> SmallPtrSet < Identifier , 4 > seenNames ; <nl> for ( auto Params : Candidates ) { <nl> if ( Position > = Params . size ( ) ) <nl> continue ; <nl> const auto & Param = Params [ Position ] ; <nl> - if ( Param . hasLabel ( ) & & ! HasName ) { <nl> + if ( Param . hasLabel ( ) & & MayNeedName ) { <nl> if ( seenNames . insert ( Param . getLabel ( ) ) . second ) <nl> ExpectedNames . push_back ( Param . getLabel ( ) . str ( ) ) ; <nl> } else { <nl> namespace { <nl> class ExprParentFinder : public ASTWalker { <nl> friend class CodeCompletionTypeContextAnalyzer ; <nl> Expr * ChildExpr ; <nl> - llvm : : function_ref < bool ( ASTNode ) > Predicate ; <nl> + llvm : : function_ref < bool ( ParentTy ) > Predicate ; <nl> <nl> bool arePositionsSame ( Expr * E1 , Expr * E2 ) { <nl> return E1 - > getSourceRange ( ) . Start = = E2 - > getSourceRange ( ) . Start & & <nl> namespace { <nl> } <nl> <nl> public : <nl> - llvm : : SmallVector < ASTNode , 5 > Ancestors ; <nl> - ASTNode ParentClosest ; <nl> - ASTNode ParentFarthest ; <nl> + llvm : : SmallVector < ParentTy , 5 > Ancestors ; <nl> + ParentTy ParentClosest ; <nl> + ParentTy ParentFarthest ; <nl> ExprParentFinder ( Expr * ChildExpr , <nl> - llvm : : function_ref < bool ( ASTNode ) > Predicate ) : <nl> + llvm : : function_ref < bool ( ParentTy ) > Predicate ) : <nl> ChildExpr ( ChildExpr ) , Predicate ( Predicate ) { } <nl> <nl> std : : pair < bool , Expr * > walkToExprPre ( Expr * E ) override { <nl> namespace { <nl> Ancestors . pop_back ( ) ; <nl> return true ; <nl> } <nl> + <nl> + std : : pair < bool , Pattern * > walkToPatternPre ( Pattern * P ) override { <nl> + if ( Predicate ( P ) ) <nl> + Ancestors . push_back ( P ) ; <nl> + return { true , P } ; <nl> + } <nl> + <nl> + Pattern * walkToPatternPost ( Pattern * P ) override { <nl> + if ( Predicate ( P ) ) <nl> + Ancestors . pop_back ( ) ; <nl> + return P ; <nl> + } <nl> } ; <nl> } / / end anonymous namespace <nl> <nl> class CodeCompletionTypeContextAnalyzer { <nl> public : <nl> CodeCompletionTypeContextAnalyzer ( DeclContext * DC , Expr * ParsedExpr ) : DC ( DC ) , <nl> ParsedExpr ( ParsedExpr ) , SM ( DC - > getASTContext ( ) . SourceMgr ) , <nl> - Context ( DC - > getASTContext ( ) ) , Finder ( ParsedExpr , [ ] ( ASTNode Node ) { <nl> - if ( auto E = Node . dyn_cast < Expr * > ( ) ) { <nl> + Context ( DC - > getASTContext ( ) ) , <nl> + Finder ( ParsedExpr , [ ] ( ASTWalker : : ParentTy Node ) { <nl> + if ( auto E = Node . getAsExpr ( ) ) { <nl> switch ( E - > getKind ( ) ) { <nl> case ExprKind : : Call : <nl> + case ExprKind : : Binary : <nl> + case ExprKind : : PrefixUnary : <nl> case ExprKind : : Assign : <nl> return true ; <nl> default : <nl> return false ; <nl> - } <nl> - } else if ( auto S = Node . dyn_cast < Stmt * > ( ) ) { <nl> + } <nl> + } else if ( auto S = Node . getAsStmt ( ) ) { <nl> switch ( S - > getKind ( ) ) { <nl> case StmtKind : : Return : <nl> case StmtKind : : ForEach : <nl> class CodeCompletionTypeContextAnalyzer { <nl> default : <nl> return false ; <nl> } <nl> - } else if ( auto D = Node . dyn_cast < Decl * > ( ) ) { <nl> + } else if ( auto D = Node . getAsDecl ( ) ) { <nl> switch ( D - > getKind ( ) ) { <nl> case DeclKind : : PatternBinding : <nl> return true ; <nl> default : <nl> return false ; <nl> } <nl> + } else if ( auto P = Node . getAsPattern ( ) ) { <nl> + switch ( P - > getKind ( ) ) { <nl> + case PatternKind : : Expr : <nl> + return true ; <nl> + default : <nl> + return false ; <nl> + } <nl> } else <nl> return false ; <nl> - } ) { } <nl> + } ) { } <nl> <nl> void analyzeExpr ( Expr * Parent , llvm : : function_ref < void ( Type ) > Callback , <nl> SmallVectorImpl < StringRef > & PossibleNames ) { <nl> switch ( Parent - > getKind ( ) ) { <nl> - case ExprKind : : Call : { <nl> + case ExprKind : : Call : <nl> + case ExprKind : : Binary : <nl> + case ExprKind : : PrefixUnary : { <nl> std : : vector < Type > PotentialTypes ; <nl> std : : vector < StringRef > ExpectedNames ; <nl> CompletionLookup : : collectArgumentExpectation ( <nl> - * DC , cast < CallExpr > ( Parent ) , ParsedExpr , PotentialTypes , <nl> + * DC , cast < ApplyExpr > ( Parent ) , ParsedExpr , PotentialTypes , <nl> ExpectedNames ) ; <nl> for ( Type Ty : PotentialTypes ) <nl> Callback ( Ty ) ; <nl> class CodeCompletionTypeContextAnalyzer { <nl> break ; <nl> } <nl> default : <nl> - llvm_unreachable ( " Unhandled expression kinds . " ) ; <nl> + llvm_unreachable ( " Unhandled expression kind . " ) ; <nl> } <nl> } <nl> <nl> class CodeCompletionTypeContextAnalyzer { <nl> } <nl> break ; <nl> default : <nl> - llvm_unreachable ( " Unhandled statement kinds . " ) ; <nl> + llvm_unreachable ( " Unhandled statement kind . " ) ; <nl> } <nl> } <nl> <nl> class CodeCompletionTypeContextAnalyzer { <nl> break ; <nl> } <nl> default : <nl> - llvm_unreachable ( " Unhandled decl kinds . " ) ; <nl> + llvm_unreachable ( " Unhandled decl kind . " ) ; <nl> + } <nl> + } <nl> + <nl> + void analyzePattern ( Pattern * P , llvm : : function_ref < void ( Type ) > Callback ) { <nl> + switch ( P - > getKind ( ) ) { <nl> + case PatternKind : : Expr : { <nl> + auto ExprPat = cast < ExprPattern > ( P ) ; <nl> + if ( auto D = ExprPat - > getMatchVar ( ) ) { <nl> + if ( D - > hasInterfaceType ( ) ) <nl> + Callback ( D - > getInterfaceType ( ) ) ; <nl> + } <nl> + break ; <nl> + } <nl> + default : <nl> + llvm_unreachable ( " Unhandled pattern kind . " ) ; <nl> } <nl> } <nl> <nl> class CodeCompletionTypeContextAnalyzer { <nl> <nl> for ( auto It = Finder . Ancestors . rbegin ( ) ; It ! = Finder . Ancestors . rend ( ) ; <nl> + + It ) { <nl> - if ( auto Parent = It - > dyn_cast < Expr * > ( ) ) { <nl> + if ( auto Parent = It - > getAsExpr ( ) ) { <nl> analyzeExpr ( Parent , Callback , PossibleNames ) ; <nl> - } else if ( auto Parent = It - > dyn_cast < Stmt * > ( ) ) { <nl> + } else if ( auto Parent = It - > getAsStmt ( ) ) { <nl> analyzeStmt ( Parent , Callback ) ; <nl> - } else if ( auto Parent = It - > dyn_cast < Decl * > ( ) ) { <nl> + } else if ( auto Parent = It - > getAsDecl ( ) ) { <nl> analyzeDecl ( Parent , Callback ) ; <nl> + } else if ( auto Parent = It - > getAsPattern ( ) ) { <nl> + analyzePattern ( Parent , Callback ) ; <nl> } <nl> if ( ! PossibleTypes . empty ( ) | | ! PossibleNames . empty ( ) ) <nl> return true ; <nl> void CodeCompletionCallbacksImpl : : doneParsing ( ) { <nl> case CompletionKind : : UnresolvedMember : { <nl> Lookup . setHaveDot ( SourceLoc ( ) ) ; <nl> SmallVector < Type , 1 > PossibleTypes ; <nl> - ExprParentFinder Walker ( UnresolvedExpr , [ & ] ( ASTNode Node ) { <nl> - return Node . is < Expr * > ( ) ; <nl> + ExprParentFinder Walker ( UnresolvedExpr , [ & ] ( ASTWalker : : ParentTy Node ) { <nl> + return Node . getAsExpr ( ) ; <nl> } ) ; <nl> CurDeclContext - > walkContext ( Walker ) ; <nl> bool Success = false ; <nl> - if ( auto PE = Walker . ParentFarthest . get < Expr * > ( ) ) { <nl> + if ( auto PE = Walker . ParentFarthest . getAsExpr ( ) ) { <nl> prepareForRetypechecking ( PE ) ; <nl> Success = typeCheckUnresolvedExpr ( * CurDeclContext , UnresolvedExpr , PE , <nl> PossibleTypes ) ; <nl> void CodeCompletionCallbacksImpl : : doneParsing ( ) { <nl> <nl> case CompletionKind : : ReturnStmtExpr : { <nl> SourceLoc Loc = P . Context . SourceMgr . getCodeCompletionLoc ( ) ; <nl> - if ( auto FD = dyn_cast < AbstractFunctionDecl > ( CurDeclContext ) ) { <nl> - if ( auto FT = FD - > getInterfaceType ( ) - > getAs < FunctionType > ( ) ) { <nl> - Lookup . setExpectedTypes ( FT - > getResult ( ) ) ; <nl> - } <nl> - } <nl> + Lookup . setExpectedTypes ( getReturnTypeFromContext ( CurDeclContext ) ) ; <nl> Lookup . getValueCompletionsInDeclContext ( Loc ) ; <nl> break ; <nl> } <nl> mmm a / lib / Parse / ParseExpr . cpp <nl> ppp b / lib / Parse / ParseExpr . cpp <nl> ParserResult < Expr > Parser : : parseExprUnary ( Diag < > Message , bool isExprBasic ) { <nl> } <nl> <nl> ParserResult < Expr > SubExpr = parseExprUnary ( Message , isExprBasic ) ; <nl> - if ( SubExpr . hasCodeCompletion ( ) ) <nl> - return makeParserCodeCompletionResult < Expr > ( ) ; <nl> + ParserStatus Status = SubExpr ; <nl> if ( SubExpr . isNull ( ) ) <nl> - return nullptr ; <nl> + return Status ; <nl> <nl> / / We are sure we can create a prefix prefix operator expr now . <nl> UnaryContext . setCreateSyntax ( SyntaxKind : : PrefixOperatorExpr ) ; <nl> ParserResult < Expr > Parser : : parseExprUnary ( Diag < > Message , bool isExprBasic ) { <nl> if ( auto * LE = dyn_cast < NumberLiteralExpr > ( SubExpr . get ( ) ) ) { <nl> if ( Operator - > hasName ( ) & & Operator - > getName ( ) . getBaseName ( ) = = " - " ) { <nl> LE - > setNegative ( Operator - > getLoc ( ) ) ; <nl> - return makeParserResult ( LE ) ; <nl> + return makeParserResult ( Status , LE ) ; <nl> } <nl> } <nl> <nl> - return makeParserResult ( new ( Context ) PrefixUnaryExpr ( <nl> - Operator , formUnaryArgument ( Context , SubExpr . get ( ) ) ) ) ; <nl> + return makeParserResult ( <nl> + Status , new ( Context ) PrefixUnaryExpr ( <nl> + Operator , formUnaryArgument ( Context , SubExpr . get ( ) ) ) ) ; <nl> } <nl> <nl> / / / expr - keypath - swift : <nl> ParserResult < Expr > Parser : : parseExprPrimary ( Diag < > ID , bool isExprBasic ) { <nl> rParenLoc , <nl> trailingClosure , <nl> SyntaxKind : : FunctionCallArgumentList ) ; <nl> - if ( status . isError ( ) ) <nl> - return nullptr ; <nl> - <nl> SyntaxContext - > createNodeInPlace ( SyntaxKind : : FunctionCallExpr ) ; <nl> return makeParserResult ( <nl> status , <nl> mmm a / lib / Parse / ParsePattern . cpp <nl> ppp b / lib / Parse / ParsePattern . cpp <nl> ParserResult < Pattern > Parser : : parseMatchingPattern ( bool isExprBasic ) { <nl> / / disambiguate . <nl> ParserResult < Expr > subExpr = <nl> parseExprImpl ( diag : : expected_pattern , isExprBasic ) ; <nl> - if ( subExpr . hasCodeCompletion ( ) ) <nl> - return makeParserCodeCompletionStatus ( ) ; <nl> + ParserStatus status = subExpr ; <nl> if ( subExpr . isNull ( ) ) <nl> - return nullptr ; <nl> + return status ; <nl> <nl> if ( SyntaxContext - > isEnabled ( ) ) { <nl> if ( auto UPES = PatternCtx . popIf < UnresolvedPatternExprSyntax > ( ) ) { <nl> ParserResult < Pattern > Parser : : parseMatchingPattern ( bool isExprBasic ) { <nl> / / obvious pattern , which will come back wrapped in an immediate <nl> / / UnresolvedPatternExpr . Transform this now to simplify later code . <nl> if ( auto * UPE = dyn_cast < UnresolvedPatternExpr > ( subExpr . get ( ) ) ) <nl> - return makeParserResult ( UPE - > getSubPattern ( ) ) ; <nl> + return makeParserResult ( status , UPE - > getSubPattern ( ) ) ; <nl> <nl> - return makeParserResult ( new ( Context ) ExprPattern ( subExpr . get ( ) ) ) ; <nl> + return makeParserResult ( status , new ( Context ) ExprPattern ( subExpr . get ( ) ) ) ; <nl> } <nl> <nl> ParserResult < Pattern > Parser : : parseMatchingPatternAsLetOrVar ( bool isLet , <nl> mmm a / lib / Sema / CSGen . cpp <nl> ppp b / lib / Sema / CSGen . cpp <nl> namespace { <nl> } <nl> <nl> virtual Type visitCodeCompletionExpr ( CodeCompletionExpr * E ) { <nl> - if ( ! E - > isActivated ( ) ) <nl> - return Type ( ) ; <nl> - <nl> CS . Options | = ConstraintSystemFlags : : SuppressDiagnostics ; <nl> return CS . createTypeVariable ( CS . getConstraintLocator ( E ) , <nl> TVO_CanBindToLValue ) ; <nl> mmm a / lib / Sema / TypeCheckConstraints . cpp <nl> ppp b / lib / Sema / TypeCheckConstraints . cpp <nl> bool TypeChecker : : typeCheckCompletionSequence ( Expr * & expr , DeclContext * DC ) { <nl> / / Ensure the output expression is up to date . <nl> assert ( exprAsBinOp = = expr & & isa < BinaryExpr > ( expr ) & & " found wrong expr ? " ) ; <nl> <nl> - / / Add type variable for the code - completion expression . <nl> - CCE - > setActivated ( ) ; <nl> - <nl> if ( auto generated = CS . generateConstraints ( expr ) ) { <nl> expr = generated ; <nl> } else { <nl> mmm a / test / IDE / complete_call_arg . swift <nl> ppp b / test / IDE / complete_call_arg . swift <nl> <nl> / / RUN : % target - swift - ide - test - code - completion - source - filename % s - code - completion - token = FORCED_IUO | % FileCheck % s - check - prefix = MEMBEROF_IUO <nl> <nl> / / RUN : % target - swift - ide - test - code - completion - source - filename % s - code - completion - token = GENERIC_TO_GENERIC | % FileCheck % s - check - prefix = GENERIC_TO_GENERIC <nl> + / / RUN : % target - swift - ide - test - code - completion - source - filename % s - code - completion - token = NESTED_CLOSURE | % FileCheck % s - check - prefix = NESTED_CLOSURE <nl> <nl> var i1 = 1 <nl> var i2 = 2 <nl> class Bar { <nl> / / MEMBEROF_IUO : Decl [ InstanceVar ] / CurrNominal : x [ # Int # ] ; name = x <nl> / / MEMBEROF_IUO : End completions <nl> } <nl> + <nl> + func curry < T1 , T2 , R > ( _ f : @ escaping ( T1 , T2 ) - > R ) - > ( T1 ) - > ( T2 ) - > R { <nl> + return { t1 in { t2 in f ( # ^ NESTED_CLOSURE ^ # , t2 ) } } <nl> + / / NESTED_CLOSURE : Begin completions <nl> + / / FIXME : Should be ' / TypeRelation [ Invalid ] : t2 [ # T2 # ] ' <nl> + / / NESTED_CLOSURE : Decl [ LocalVar ] / Local : t2 ; name = t2 <nl> + / / NESTED_CLOSURE : Decl [ LocalVar ] / Local : t1 [ # T1 # ] ; name = t1 <nl> + } <nl> mmm a / test / IDE / complete_dynamic_lookup . swift <nl> ppp b / test / IDE / complete_dynamic_lookup . swift <nl> func testAnyObject11_ ( _ dl : AnyObject ) { <nl> dl . returnsObjcClass ! ( # ^ DL_FUNC_NAME_PAREN_1 ^ # <nl> } <nl> / / DL_FUNC_NAME_PAREN_1 : Begin completions <nl> - / / DL_FUNC_NAME_PAREN_1 - DAG : Pattern / CurrModule : [ ' ( ' ] { # Int # } [ ' ) ' ] [ # TopLevelObjcClass # ] { { ; name = . + $ } } <nl> + / / DL_FUNC_NAME_PAREN_1 - DAG : Pattern / CurrModule : [ ' ( ' ] { # ( i ) : Int # } [ ' ) ' ] [ # TopLevelObjcClass # ] { { ; name = . + $ } } <nl> / / DL_FUNC_NAME_PAREN_1 : End completions <nl> <nl> func testAnyObject12 ( _ dl : AnyObject ) { <nl> mmm a / test / IDE / complete_enum_elements . swift <nl> ppp b / test / IDE / complete_enum_elements . swift <nl> <nl> / / RUN : % FileCheck % s - check - prefix = FOO_ENUM_DOT < % t . enum . txt <nl> <nl> / / RUN : % target - swift - ide - test - code - completion - source - filename % s - code - completion - token = ENUM_SW_IN_PATTERN_1 > % t . enum . txt <nl> - / / RUN : % FileCheck % s - check - prefix = WITH_GLOBAL_RESULTS < % t . enum . txt <nl> + / / RUN : % FileCheck % s - check - prefix = WITH_GLOBAL_RESULTS_INVALID < % t . enum . txt <nl> / / RUN : % FileCheck % s - check - prefix = ENUM_SW_IN_PATTERN_1 < % t . enum . txt <nl> <nl> / / RUN : % target - swift - ide - test - code - completion - source - filename % s - code - completion - token = ENUM_SW_IN_PATTERN_2 > % t . enum . txt <nl> func freeFunc ( ) { } <nl> / / WITH_GLOBAL_RESULTS : Decl [ FreeFunction ] / CurrModule : freeFunc ( ) [ # Void # ] { { ; name = . + $ } } <nl> / / WITH_GLOBAL_RESULTS : End completions <nl> <nl> + / / WITH_GLOBAL_RESULTS_INVALID : Begin completions <nl> + / / WITH_GLOBAL_RESULTS_INVALID : Decl [ FreeFunction ] / CurrModule / NotRecommended / TypeRelation [ Invalid ] : freeFunc ( ) [ # Void # ] { { ; name = . + $ } } <nl> + / / WITH_GLOBAL_RESULTS_INVALID : End completions <nl> + <nl> / / = = = mmm Complete enum elements in ' switch ' . <nl> <nl> func testSwitch1 ( e : FooEnum ) { <nl> mmm a / test / IDE / complete_expr_postfix_begin . swift <nl> ppp b / test / IDE / complete_expr_postfix_begin . swift <nl> <nl> / / RUN : % target - swift - ide - test - code - completion - source - filename % s - code - completion - token = GENERIC_TYPEALIAS_2 | % FileCheck % s - check - prefix = MY_ALIAS_2 <nl> <nl> / / RUN : % target - swift - ide - test - code - completion - source - filename % s - code - completion - token = IN_FOR_EACH_1 | % FileCheck % s - check - prefix = IN_FOR_EACH_1 <nl> - / / RUN : % target - swift - ide - test - code - completion - source - filename % s - code - completion - token = IN_FOR_EACH_2 | % FileCheck % s - check - prefix = IN_FOR_EACH_1 <nl> + / / RUN : % target - swift - ide - test - code - completion - source - filename % s - code - completion - token = IN_FOR_EACH_2 | % FileCheck % s - check - prefix = IN_FOR_EACH_2 <nl> / / RUN : % target - swift - ide - test - code - completion - source - filename % s - code - completion - token = IN_FOR_EACH_3 | % FileCheck % s - check - prefix = IN_FOR_EACH_3 <nl> / / RUN : % target - swift - ide - test - code - completion - source - filename % s - code - completion - token = IN_FOR_EACH_4 | % FileCheck % s - check - prefix = IN_FOR_EACH_3 <nl> / / RUN : % target - swift - ide - test - code - completion - source - filename % s - code - completion - token = IN_FOR_EACH_5 | % FileCheck % s - check - prefix = IN_FOR_EACH_1 <nl> func testInForEach2 ( arg : Int ) { <nl> let inBody = 3 <nl> } <nl> let after = 4 <nl> + / / IN_FOR_EACH_2 - NOT : Decl [ LocalVar ] <nl> + / / IN_FOR_EACH_2 : Decl [ LocalVar ] / Local / TypeRelation [ Identical ] : local [ # Int # ] ; <nl> + / / FIXME : shouldn ' t show ' after ' here . <nl> + / / IN_FOR_EACH_2 : Decl [ LocalVar ] / Local / TypeRelation [ Identical ] : after [ # Int # ] ; <nl> + / / IN_FOR_EACH_2 : Decl [ LocalVar ] / Local / TypeRelation [ Identical ] : arg [ # Int # ] ; <nl> + / / IN_FOR_EACH_2 - NOT : Decl [ LocalVar ] <nl> } <nl> func testInForEach3 ( arg : Int ) { <nl> let local = 2 <nl> new file mode 100644 <nl> index 000000000000 . . e717f6811c37 <nl> mmm / dev / null <nl> ppp b / test / IDE / complete_operator_operand . swift <nl> <nl> + / / RUN : % target - swift - ide - test - code - completion - source - filename % s - code - completion - token = BINARY_RHS_1 | % FileCheck % s - check - prefix = BINARY_RHS_1 <nl> + / / RUN : % target - swift - ide - test - code - completion - source - filename % s - code - completion - token = BINARY_RHS_2 | % FileCheck % s - check - prefix = BINARY_RHS_2 <nl> + / / RUN : % target - swift - ide - test - code - completion - source - filename % s - code - completion - token = PREFIX_1 | % FileCheck % s - check - prefix = PREFIX_1 <nl> + <nl> + infix operator < - - > <nl> + prefix operator - - > <nl> + <nl> + class C1 { } <nl> + class C2 { } <nl> + func < - - > ( lhs : C1 , rhs : C2 ) - > Bool { } <nl> + func < - - > ( lhs : C2 , rhs : C1 ) - > Bool { } <nl> + <nl> + func test_binary1 ( c1 : C1 , c2 : C2 ) { <nl> + _ = c1 < - - > # ^ BINARY_RHS_1 ^ # <nl> + / / BINARY_RHS_1 : Begin completion <nl> + / / BINARY_RHS_1 - NOT : Decl [ LocalVar ] / Local / TypeRelation [ Identical ] : c1 [ # C1 # ] ; name = c1 <nl> + / / BINARY_RHS_1 - DAG : Decl [ LocalVar ] / Local / TypeRelation [ Identical ] : c2 [ # C2 # ] ; name = c2 <nl> + <nl> + _ = c2 < - - > # ^ BINARY_RHS_2 ^ # <nl> + / / BINARY_RHS_2 : Begin completion <nl> + / / BINARY_RHS_2 - NOT : Decl [ LocalVar ] / Local / TypeRelation [ Identical ] : c2 [ # C2 # ] ; name = c2 <nl> + / / BINARY_RHS_2 - DAG : Decl [ LocalVar ] / Local / TypeRelation [ Identical ] : c1 [ # C1 # ] ; name = c1 <nl> + } <nl> + <nl> + prefix func - - > ( operand : C1 ) - > Bool { } <nl> + prefix func - - > ( operand : C2 ) - > Bool { } <nl> + <nl> + func test_prefix1 ( c1 : C1 , c2 : C2 ) { <nl> + _ = - - > # ^ PREFIX_1 ^ # <nl> + / / PREFIX_1 : Begin completion <nl> + / / PREFIX_1 - DAG : Decl [ LocalVar ] / Local / TypeRelation [ Identical ] : c1 [ # C1 # ] ; name = c1 <nl> + / / PREFIX_1 - DAG : Decl [ LocalVar ] / Local / TypeRelation [ Identical ] : c2 [ # C2 # ] ; name = c2 <nl> + } <nl> mmm a / test / IDE / complete_pattern . swift <nl> ppp b / test / IDE / complete_pattern . swift <nl> <nl> / / RUN : % target - swift - ide - test - code - completion - source - filename % s - code - completion - token = MULTI_PATTERN_3 | % FileCheck % s - check - prefix = MULTI_PATTERN_3 <nl> / / RUN : % target - swift - ide - test - code - completion - source - filename % s - code - completion - token = MULTI_PATTERN_4 | % FileCheck % s - check - prefix = MULTI_PATTERN_4 <nl> <nl> + / / RUN : % target - swift - ide - test - code - completion - source - filename % s - code - completion - token = CC_IN_PATTERN_1 | % FileCheck % s - check - prefix = CC_IN_PATTERN_1 <nl> + <nl> <nl> / / = = = mmm Helper types that are used in this test <nl> <nl> func test_multiple_patterns4 ( x : Int ) { <nl> / / MULTI_PATTERN_4 - DAG : Decl [ LocalVar ] / Local : x [ # Int # ] { { ; name = . + $ } } <nl> / / MULTI_PATTERN_4 : End completions <nl> <nl> + enum IntHolder { <nl> + case hold ( Int ) <nl> + } <nl> + func ident ( int : Int ) - > Int { return int } <nl> + func ident ( double : Double ) - > Int { return Double } <nl> + <nl> + func test_cc_in_pattern ( subject : IntHolder , i1 : Int ) { <nl> + switch subject { <nl> + case . hold ( # ^ CC_IN_PATTERN_1 ^ # ) : <nl> + ( ) <nl> + } <nl> + } <nl> + <nl> + / / CC_IN_PATTERN_1 : Begin completions <nl> + / / CC_IN_PATTERN_1 - DAG : Decl [ LocalVar ] / Local / TypeRelation [ Identical ] : i1 [ # Int # ] ; name = i1 <nl> + / / CC_IN_PATTERN_1 : End completions <nl> mmm a / test / IDE / complete_return . swift <nl> ppp b / test / IDE / complete_return . swift <nl> <nl> / / RUN : % target - swift - ide - test - code - completion - source - filename % s - code - completion - token = RETURN_TR1 | % FileCheck % s - check - prefix = RETURN_TR1 <nl> / / RUN : % target - swift - ide - test - code - completion - source - filename % s - code - completion - token = RETURN_TR2 | % FileCheck % s - check - prefix = RETURN_TR2 <nl> / / RUN : % target - swift - ide - test - code - completion - source - filename % s - code - completion - token = RETURN_TR3 | % FileCheck % s - check - prefix = RETURN_TR3 <nl> + / / RUN : % target - swift - ide - test - code - completion - source - filename % s - code - completion - token = RETURN_TR1_METHOD | % FileCheck % s - check - prefix = RETURN_TR1 <nl> + / / RUN : % target - swift - ide - test - code - completion - source - filename % s - code - completion - token = RETURN_TR2_METHOD | % FileCheck % s - check - prefix = RETURN_TR2 <nl> + / / RUN : % target - swift - ide - test - code - completion - source - filename % s - code - completion - token = RETURN_TR3_METHOD | % FileCheck % s - check - prefix = RETURN_TR3 <nl> + / / RUN : % target - swift - ide - test - code - completion - source - filename % s - code - completion - token = RETURN_TR1_STATICMETHOD | % FileCheck % s - check - prefix = RETURN_TR1 <nl> + / / RUN : % target - swift - ide - test - code - completion - source - filename % s - code - completion - token = RETURN_TR2_STATICMETHOD | % FileCheck % s - check - prefix = RETURN_TR2 <nl> + / / RUN : % target - swift - ide - test - code - completion - source - filename % s - code - completion - token = RETURN_TR3_STATICMETHOD | % FileCheck % s - check - prefix = RETURN_TR3 <nl> + / / RUN : % target - swift - ide - test - code - completion - source - filename % s - code - completion - token = RETURN_TR1_CLOSURE | % FileCheck % s - check - prefix = RETURN_TR1 <nl> + / / RUN : % target - swift - ide - test - code - completion - source - filename % s - code - completion - token = RETURN_TR2_CLOSURE | % FileCheck % s - check - prefix = RETURN_TR2 <nl> + / / RUN : % target - swift - ide - test - code - completion - source - filename % s - code - completion - token = RETURN_TR3_CLOSURE | % FileCheck % s - check - prefix = RETURN_TR3 <nl> <nl> struct FooStruct { <nl> var instanceVar : Int <nl> func testTR3 ( _ g : Gen ) - > Int ? { <nl> / / RETURN_TR3 - DAG : Decl [ InstanceMethod ] / CurrNominal : InternalStringOpGen ( ) [ # String ? # ] { { ; name = . + $ } } <nl> / / RETURN_TR3 - DAG : Decl [ InstanceMethod ] / CurrNominal / NotRecommended / TypeRelation [ Invalid ] : InternalIntTaker ( { # ( i1 ) : Int # } , { # i2 : Int # } ) [ # Void # ] { { ; name = . + $ } } <nl> / / RETURN_TR3 - DAG : Decl [ InstanceMethod ] / CurrNominal / NotRecommended / TypeRelation [ Invalid ] : InternalStringTaker ( { # ( s1 ) : String # } , { # s2 : String # } ) [ # Void # ] { { ; name = . + $ } } <nl> + <nl> + struct TestStruct { <nl> + func testTR1_method ( ) - > Int ? { <nl> + var i : Int <nl> + var oi : Int ? <nl> + var fs : FooStruct <nl> + return # ^ RETURN_TR1_METHOD ^ # <nl> + } <nl> + func testTR2_method ( _ g : Gen ) - > Int ? { <nl> + return g . # ^ RETURN_TR2_METHOD ^ # <nl> + } <nl> + func testTR3_method ( _ g : Gen ) - > Int ? { <nl> + return g . IG . # ^ RETURN_TR3_METHOD ^ # <nl> + } <nl> + <nl> + static func testTR1_static ( ) - > Int ? { <nl> + var i : Int <nl> + var oi : Int ? <nl> + var fs : FooStruct <nl> + return # ^ RETURN_TR1_STATICMETHOD ^ # <nl> + } <nl> + static func testTR2_static ( _ g : Gen ) - > Int ? { <nl> + return g . # ^ RETURN_TR2_STATICMETHOD ^ # <nl> + } <nl> + static func testTR3_static ( _ g : Gen ) - > Int ? { <nl> + return g . IG . # ^ RETURN_TR3_STATICMETHOD ^ # <nl> + } <nl> + } <nl> + <nl> + func testClosures ( _ g : Gen ) { <nl> + var i : Int <nl> + var oi : Int ? <nl> + var fs : FooStruct <nl> + <nl> + _ = { ( ) - > Int ? in <nl> + return # ^ RETURN_TR1_CLOSURE ^ # <nl> + } <nl> + _ = { ( ) - > Int ? in <nl> + return g . # ^ RETURN_TR2_CLOSURE ^ # <nl> + } <nl> + _ = { ( ) - > Int ? in <nl> + return g . IG . # ^ RETURN_TR3_CLOSURE ^ # <nl> + } <nl> + } <nl>
|
Merge remote - tracking branch ' origin / master ' into master - next
|
apple/swift
|
1109997bea15ea8276a7f9f301eb1c7ebd307fd7
|
2018-08-10T02:09:13Z
|
mmm a / BUILD <nl> ppp b / BUILD <nl> cc_library ( <nl> " src / core / channel / census_filter . h " , <nl> " src / core / channel / channel_args . h " , <nl> " src / core / channel / channel_stack . h " , <nl> - " src / core / channel / child_channel . h " , <nl> " src / core / channel / client_channel . h " , <nl> - " src / core / channel / client_setup . h " , <nl> " src / core / channel / connected_channel . h " , <nl> " src / core / channel / context . h " , <nl> " src / core / channel / http_client_filter . h " , <nl> " src / core / channel / http_server_filter . h " , <nl> " src / core / channel / noop_filter . h " , <nl> + " src / core / client_config / client_config . h " , <nl> + " src / core / client_config / connector . h " , <nl> + " src / core / client_config / lb_policies / pick_first . h " , <nl> + " src / core / client_config / lb_policy . h " , <nl> + " src / core / client_config / resolver . h " , <nl> + " src / core / client_config / resolver_factory . h " , <nl> + " src / core / client_config / resolver_registry . h " , <nl> + " src / core / client_config / resolvers / dns_resolver . h " , <nl> + " src / core / client_config / resolvers / unix_resolver_posix . h " , <nl> + " src / core / client_config / subchannel . h " , <nl> + " src / core / client_config / subchannel_factory . h " , <nl> + " src / core / client_config / uri_parser . h " , <nl> " src / core / compression / message_compress . h " , <nl> " src / core / debug / trace . h " , <nl> " src / core / iomgr / alarm . h " , <nl> cc_library ( <nl> " src / core / surface / byte_buffer_queue . h " , <nl> " src / core / surface / call . h " , <nl> " src / core / surface / channel . h " , <nl> - " src / core / surface / client . h " , <nl> " src / core / surface / completion_queue . h " , <nl> " src / core / surface / event_string . h " , <nl> " src / core / surface / init . h " , <nl> cc_library ( <nl> " src / core / transport / chttp2 / timeout_encoding . h " , <nl> " src / core / transport / chttp2 / varint . h " , <nl> " src / core / transport / chttp2_transport . h " , <nl> + " src / core / transport / connectivity_state . h " , <nl> " src / core / transport / metadata . h " , <nl> " src / core / transport / stream_op . h " , <nl> " src / core / transport / transport . h " , <nl> cc_library ( <nl> " src / core / census / grpc_context . c " , <nl> " src / core / channel / channel_args . c " , <nl> " src / core / channel / channel_stack . c " , <nl> - " src / core / channel / child_channel . c " , <nl> " src / core / channel / client_channel . c " , <nl> - " src / core / channel / client_setup . c " , <nl> " src / core / channel / connected_channel . c " , <nl> " src / core / channel / http_client_filter . c " , <nl> " src / core / channel / http_server_filter . c " , <nl> " src / core / channel / noop_filter . c " , <nl> + " src / core / client_config / client_config . c " , <nl> + " src / core / client_config / connector . c " , <nl> + " src / core / client_config / lb_policies / pick_first . c " , <nl> + " src / core / client_config / lb_policy . c " , <nl> + " src / core / client_config / resolver . c " , <nl> + " src / core / client_config / resolver_factory . c " , <nl> + " src / core / client_config / resolver_registry . c " , <nl> + " src / core / client_config / resolvers / dns_resolver . c " , <nl> + " src / core / client_config / resolvers / unix_resolver_posix . c " , <nl> + " src / core / client_config / subchannel . c " , <nl> + " src / core / client_config / subchannel_factory . c " , <nl> + " src / core / client_config / uri_parser . c " , <nl> " src / core / compression / algorithm . c " , <nl> " src / core / compression / message_compress . c " , <nl> " src / core / debug / trace . c " , <nl> cc_library ( <nl> " src / core / surface / call_log_batch . c " , <nl> " src / core / surface / channel . c " , <nl> " src / core / surface / channel_create . c " , <nl> - " src / core / surface / client . c " , <nl> " src / core / surface / completion_queue . c " , <nl> " src / core / surface / event_string . c " , <nl> " src / core / surface / init . c " , <nl> cc_library ( <nl> " src / core / transport / chttp2 / varint . c " , <nl> " src / core / transport / chttp2 / writing . c " , <nl> " src / core / transport / chttp2_transport . c " , <nl> + " src / core / transport / connectivity_state . c " , <nl> " src / core / transport / metadata . c " , <nl> " src / core / transport / stream_op . c " , <nl> " src / core / transport / transport . c " , <nl> cc_library ( <nl> " src / core / channel / census_filter . h " , <nl> " src / core / channel / channel_args . h " , <nl> " src / core / channel / channel_stack . h " , <nl> - " src / core / channel / child_channel . h " , <nl> " src / core / channel / client_channel . h " , <nl> - " src / core / channel / client_setup . h " , <nl> " src / core / channel / connected_channel . h " , <nl> " src / core / channel / context . h " , <nl> " src / core / channel / http_client_filter . h " , <nl> " src / core / channel / http_server_filter . h " , <nl> " src / core / channel / noop_filter . h " , <nl> + " src / core / client_config / client_config . h " , <nl> + " src / core / client_config / connector . h " , <nl> + " src / core / client_config / lb_policies / pick_first . h " , <nl> + " src / core / client_config / lb_policy . h " , <nl> + " src / core / client_config / resolver . h " , <nl> + " src / core / client_config / resolver_factory . h " , <nl> + " src / core / client_config / resolver_registry . h " , <nl> + " src / core / client_config / resolvers / dns_resolver . h " , <nl> + " src / core / client_config / resolvers / unix_resolver_posix . h " , <nl> + " src / core / client_config / subchannel . h " , <nl> + " src / core / client_config / subchannel_factory . h " , <nl> + " src / core / client_config / uri_parser . h " , <nl> " src / core / compression / message_compress . h " , <nl> " src / core / debug / trace . h " , <nl> " src / core / iomgr / alarm . h " , <nl> cc_library ( <nl> " src / core / surface / byte_buffer_queue . h " , <nl> " src / core / surface / call . h " , <nl> " src / core / surface / channel . h " , <nl> - " src / core / surface / client . h " , <nl> " src / core / surface / completion_queue . h " , <nl> " src / core / surface / event_string . h " , <nl> " src / core / surface / init . h " , <nl> cc_library ( <nl> " src / core / transport / chttp2 / timeout_encoding . h " , <nl> " src / core / transport / chttp2 / varint . h " , <nl> " src / core / transport / chttp2_transport . h " , <nl> + " src / core / transport / connectivity_state . h " , <nl> " src / core / transport / metadata . h " , <nl> " src / core / transport / stream_op . h " , <nl> " src / core / transport / transport . h " , <nl> cc_library ( <nl> " src / core / census / grpc_context . c " , <nl> " src / core / channel / channel_args . c " , <nl> " src / core / channel / channel_stack . c " , <nl> - " src / core / channel / child_channel . c " , <nl> " src / core / channel / client_channel . c " , <nl> - " src / core / channel / client_setup . c " , <nl> " src / core / channel / connected_channel . c " , <nl> " src / core / channel / http_client_filter . c " , <nl> " src / core / channel / http_server_filter . c " , <nl> " src / core / channel / noop_filter . c " , <nl> + " src / core / client_config / client_config . c " , <nl> + " src / core / client_config / connector . c " , <nl> + " src / core / client_config / lb_policies / pick_first . c " , <nl> + " src / core / client_config / lb_policy . c " , <nl> + " src / core / client_config / resolver . c " , <nl> + " src / core / client_config / resolver_factory . c " , <nl> + " src / core / client_config / resolver_registry . c " , <nl> + " src / core / client_config / resolvers / dns_resolver . c " , <nl> + " src / core / client_config / resolvers / unix_resolver_posix . c " , <nl> + " src / core / client_config / subchannel . c " , <nl> + " src / core / client_config / subchannel_factory . c " , <nl> + " src / core / client_config / uri_parser . c " , <nl> " src / core / compression / algorithm . c " , <nl> " src / core / compression / message_compress . c " , <nl> " src / core / debug / trace . c " , <nl> cc_library ( <nl> " src / core / surface / call_log_batch . c " , <nl> " src / core / surface / channel . c " , <nl> " src / core / surface / channel_create . c " , <nl> - " src / core / surface / client . c " , <nl> " src / core / surface / completion_queue . c " , <nl> " src / core / surface / event_string . c " , <nl> " src / core / surface / init . c " , <nl> cc_library ( <nl> " src / core / transport / chttp2 / varint . c " , <nl> " src / core / transport / chttp2 / writing . c " , <nl> " src / core / transport / chttp2_transport . c " , <nl> + " src / core / transport / connectivity_state . c " , <nl> " src / core / transport / metadata . c " , <nl> " src / core / transport / stream_op . c " , <nl> " src / core / transport / transport . c " , <nl> objc_library ( <nl> " src / core / census / grpc_context . c " , <nl> " src / core / channel / channel_args . c " , <nl> " src / core / channel / channel_stack . c " , <nl> - " src / core / channel / child_channel . c " , <nl> " src / core / channel / client_channel . c " , <nl> - " src / core / channel / client_setup . c " , <nl> " src / core / channel / connected_channel . c " , <nl> " src / core / channel / http_client_filter . c " , <nl> " src / core / channel / http_server_filter . c " , <nl> " src / core / channel / noop_filter . c " , <nl> + " src / core / client_config / client_config . c " , <nl> + " src / core / client_config / connector . c " , <nl> + " src / core / client_config / lb_policies / pick_first . c " , <nl> + " src / core / client_config / lb_policy . c " , <nl> + " src / core / client_config / resolver . c " , <nl> + " src / core / client_config / resolver_factory . c " , <nl> + " src / core / client_config / resolver_registry . c " , <nl> + " src / core / client_config / resolvers / dns_resolver . c " , <nl> + " src / core / client_config / resolvers / unix_resolver_posix . c " , <nl> + " src / core / client_config / subchannel . c " , <nl> + " src / core / client_config / subchannel_factory . c " , <nl> + " src / core / client_config / uri_parser . c " , <nl> " src / core / compression / algorithm . c " , <nl> " src / core / compression / message_compress . c " , <nl> " src / core / debug / trace . c " , <nl> objc_library ( <nl> " src / core / surface / call_log_batch . c " , <nl> " src / core / surface / channel . c " , <nl> " src / core / surface / channel_create . c " , <nl> - " src / core / surface / client . c " , <nl> " src / core / surface / completion_queue . c " , <nl> " src / core / surface / event_string . c " , <nl> " src / core / surface / init . c " , <nl> objc_library ( <nl> " src / core / transport / chttp2 / varint . c " , <nl> " src / core / transport / chttp2 / writing . c " , <nl> " src / core / transport / chttp2_transport . c " , <nl> + " src / core / transport / connectivity_state . c " , <nl> " src / core / transport / metadata . c " , <nl> " src / core / transport / stream_op . c " , <nl> " src / core / transport / transport . c " , <nl> objc_library ( <nl> " src / core / channel / census_filter . h " , <nl> " src / core / channel / channel_args . h " , <nl> " src / core / channel / channel_stack . h " , <nl> - " src / core / channel / child_channel . h " , <nl> " src / core / channel / client_channel . h " , <nl> - " src / core / channel / client_setup . h " , <nl> " src / core / channel / connected_channel . h " , <nl> " src / core / channel / context . h " , <nl> " src / core / channel / http_client_filter . h " , <nl> " src / core / channel / http_server_filter . h " , <nl> " src / core / channel / noop_filter . h " , <nl> + " src / core / client_config / client_config . h " , <nl> + " src / core / client_config / connector . h " , <nl> + " src / core / client_config / lb_policies / pick_first . h " , <nl> + " src / core / client_config / lb_policy . h " , <nl> + " src / core / client_config / resolver . h " , <nl> + " src / core / client_config / resolver_factory . h " , <nl> + " src / core / client_config / resolver_registry . h " , <nl> + " src / core / client_config / resolvers / dns_resolver . h " , <nl> + " src / core / client_config / resolvers / unix_resolver_posix . h " , <nl> + " src / core / client_config / subchannel . h " , <nl> + " src / core / client_config / subchannel_factory . h " , <nl> + " src / core / client_config / uri_parser . h " , <nl> " src / core / compression / message_compress . h " , <nl> " src / core / debug / trace . h " , <nl> " src / core / iomgr / alarm . h " , <nl> objc_library ( <nl> " src / core / surface / byte_buffer_queue . h " , <nl> " src / core / surface / call . h " , <nl> " src / core / surface / channel . h " , <nl> - " src / core / surface / client . h " , <nl> " src / core / surface / completion_queue . h " , <nl> " src / core / surface / event_string . h " , <nl> " src / core / surface / init . h " , <nl> objc_library ( <nl> " src / core / transport / chttp2 / timeout_encoding . h " , <nl> " src / core / transport / chttp2 / varint . h " , <nl> " src / core / transport / chttp2_transport . h " , <nl> + " src / core / transport / connectivity_state . h " , <nl> " src / core / transport / metadata . h " , <nl> " src / core / transport / stream_op . h " , <nl> " src / core / transport / transport . h " , <nl> mmm a / Makefile <nl> ppp b / Makefile <nl> timeout_encoding_test : $ ( BINDIR ) / $ ( CONFIG ) / timeout_encoding_test <nl> timers_test : $ ( BINDIR ) / $ ( CONFIG ) / timers_test <nl> transport_metadata_test : $ ( BINDIR ) / $ ( CONFIG ) / transport_metadata_test <nl> transport_security_test : $ ( BINDIR ) / $ ( CONFIG ) / transport_security_test <nl> + uri_parser_test : $ ( BINDIR ) / $ ( CONFIG ) / uri_parser_test <nl> async_end2end_test : $ ( BINDIR ) / $ ( CONFIG ) / async_end2end_test <nl> async_streaming_ping_pong_test : $ ( BINDIR ) / $ ( CONFIG ) / async_streaming_ping_pong_test <nl> async_unary_ping_pong_test : $ ( BINDIR ) / $ ( CONFIG ) / async_unary_ping_pong_test <nl> privatelibs_cxx : $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc + + _test_config . a $ ( LIBDIR ) / $ ( CONFIG <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 ) / chttp2_status_conversion_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_stream_encoder_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_stream_map_test $ ( BINDIR ) / $ ( CONFIG ) / dualstack_socket_test $ ( BINDIR ) / $ ( CONFIG ) / fd_conservation_posix_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_auth_context_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_security_connector_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 ) / multiple_server_queues_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_flags_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_flags_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_flags_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_fullstack_with_poll_bad_hostname_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_cancel_after_accept_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_cancel_after_accept_and_writes_closed_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_cancel_after_invoke_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_cancel_before_invoke_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_cancel_in_a_vacuum_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_census_simple_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_disappearing_server_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_early_server_shutdown_finishes_inflight_calls_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_early_server_shutdown_finishes_tags_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_empty_batch_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_graceful_server_shutdown_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_invoke_large_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_max_concurrent_streams_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_max_message_length_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_no_op_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_ping_pong_streaming_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_registered_call_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_request_response_with_binary_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_request_response_with_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_request_response_with_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_request_response_with_payload_and_call_creds_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_request_response_with_trailing_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_request_with_flags_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_request_with_large_metadata_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_request_with_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_server_finishes_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_simple_delayed_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_simple_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_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_flags_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_fullstack_with_poll_bad_hostname_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_cancel_after_accept_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_cancel_after_accept_and_writes_closed_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_cancel_after_invoke_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_cancel_before_invoke_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_cancel_in_a_vacuum_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_census_simple_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_disappearing_server_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_early_server_shutdown_finishes_inflight_calls_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_early_server_shutdown_finishes_tags_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_empty_batch_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_graceful_server_shutdown_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_invoke_large_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_max_concurrent_streams_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_max_message_length_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_no_op_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_ping_pong_streaming_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_registered_call_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_request_response_with_binary_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_request_response_with_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_request_response_with_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_request_response_with_payload_and_call_creds_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_request_response_with_trailing_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_request_with_flags_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_request_with_large_metadata_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_request_with_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_server_finishes_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_simple_delayed_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_simple_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_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_flags_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_flags_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_flags_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_flags_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_flags_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_flags_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_fullstack_with_poll_bad_hostname_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_cancel_after_accept_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_cancel_after_accept_and_writes_closed_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_cancel_after_invoke_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_cancel_before_invoke_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_cancel_in_a_vacuum_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_census_simple_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_disappearing_server_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_early_server_shutdown_finishes_inflight_calls_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_early_server_shutdown_finishes_tags_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_empty_batch_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_graceful_server_shutdown_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_invoke_large_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_max_concurrent_streams_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_max_message_length_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_no_op_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_ping_pong_streaming_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_registered_call_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_request_response_with_binary_metadata_and_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_request_response_with_metadata_and_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_request_response_with_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_request_response_with_trailing_metadata_and_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_request_with_flags_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_request_with_large_metadata_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_request_with_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_server_finishes_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_simple_delayed_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_simple_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_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_flags_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_flags_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_flags_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 $ ( BINDIR ) / $ ( CONFIG ) / connection_prefix_bad_client_test $ ( BINDIR ) / $ ( CONFIG ) / initial_settings_frame_bad_client_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 ) / chttp2_status_conversion_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_stream_encoder_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_stream_map_test $ ( BINDIR ) / $ ( CONFIG ) / dualstack_socket_test $ ( BINDIR ) / $ ( CONFIG ) / fd_conservation_posix_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_auth_context_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_security_connector_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 ) / multiple_server_queues_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 ) / uri_parser_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_flags_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_flags_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_flags_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_fullstack_with_poll_bad_hostname_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_cancel_after_accept_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_cancel_after_accept_and_writes_closed_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_cancel_after_invoke_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_cancel_before_invoke_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_cancel_in_a_vacuum_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_census_simple_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_disappearing_server_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_early_server_shutdown_finishes_inflight_calls_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_early_server_shutdown_finishes_tags_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_empty_batch_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_graceful_server_shutdown_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_invoke_large_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_max_concurrent_streams_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_max_message_length_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_no_op_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_ping_pong_streaming_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_registered_call_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_request_response_with_binary_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_request_response_with_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_request_response_with_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_request_response_with_payload_and_call_creds_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_request_response_with_trailing_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_request_with_flags_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_request_with_large_metadata_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_request_with_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_server_finishes_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_simple_delayed_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_simple_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_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_flags_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_fullstack_with_poll_bad_hostname_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_cancel_after_accept_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_cancel_after_accept_and_writes_closed_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_cancel_after_invoke_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_cancel_before_invoke_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_cancel_in_a_vacuum_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_census_simple_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_disappearing_server_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_early_server_shutdown_finishes_inflight_calls_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_early_server_shutdown_finishes_tags_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_empty_batch_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_graceful_server_shutdown_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_invoke_large_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_max_concurrent_streams_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_max_message_length_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_no_op_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_ping_pong_streaming_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_registered_call_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_request_response_with_binary_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_request_response_with_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_request_response_with_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_request_response_with_payload_and_call_creds_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_request_response_with_trailing_metadata_and_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_request_with_flags_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_request_with_large_metadata_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_request_with_payload_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_server_finishes_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_simple_delayed_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_simple_request_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_simple_ssl_fullstack_with_poll_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_flags_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_flags_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_flags_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_flags_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_flags_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_flags_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_fullstack_with_poll_bad_hostname_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_cancel_after_accept_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_cancel_after_accept_and_writes_closed_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_cancel_after_invoke_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_cancel_before_invoke_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_cancel_in_a_vacuum_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_census_simple_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_disappearing_server_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_early_server_shutdown_finishes_inflight_calls_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_early_server_shutdown_finishes_tags_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_empty_batch_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_graceful_server_shutdown_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_invoke_large_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_max_concurrent_streams_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_max_message_length_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_no_op_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_ping_pong_streaming_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_registered_call_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_request_response_with_binary_metadata_and_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_request_response_with_metadata_and_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_request_response_with_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_request_response_with_trailing_metadata_and_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_request_with_flags_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_request_with_large_metadata_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_request_with_payload_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_server_finishes_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_simple_delayed_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_simple_request_unsecure_test $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fullstack_with_poll_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_flags_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_flags_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_flags_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 $ ( BINDIR ) / $ ( CONFIG ) / connection_prefix_bad_client_test $ ( BINDIR ) / $ ( CONFIG ) / initial_settings_frame_bad_client_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 ) / client_crash_test $ ( BINDIR ) / $ ( CONFIG ) / client_crash_test_server $ ( BINDIR ) / $ ( CONFIG ) / credentials_test $ ( BINDIR ) / $ ( CONFIG ) / cxx_byte_buffer_test $ ( BINDIR ) / $ ( CONFIG ) / cxx_slice_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 ) / qps_interarrival_test $ ( BINDIR ) / $ ( CONFIG ) / qps_test $ ( BINDIR ) / $ ( CONFIG ) / qps_test_openloop $ ( BINDIR ) / $ ( CONFIG ) / secure_auth_context_test $ ( BINDIR ) / $ ( CONFIG ) / server_crash_test $ ( BINDIR ) / $ ( CONFIG ) / server_crash_test_client $ ( 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 ) / transport_metadata_test | | ( echo test transport_metadata_test failed ; exit 1 ) <nl> $ ( E ) " [ RUN ] Testing transport_security_test " <nl> $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / transport_security_test | | ( echo test transport_security_test failed ; exit 1 ) <nl> + $ ( E ) " [ RUN ] Testing uri_parser_test " <nl> + $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / uri_parser_test | | ( echo test uri_parser_test failed ; exit 1 ) <nl> $ ( E ) " [ RUN ] Testing chttp2_fake_security_bad_hostname_test " <nl> $ ( Q ) $ ( BINDIR ) / $ ( CONFIG ) / chttp2_fake_security_bad_hostname_test | | ( echo test chttp2_fake_security_bad_hostname_test failed ; exit 1 ) <nl> $ ( E ) " [ RUN ] Testing chttp2_fake_security_cancel_after_accept_test " <nl> LIBGRPC_SRC = \ <nl> src / core / census / grpc_context . c \ <nl> src / core / channel / channel_args . c \ <nl> src / core / channel / channel_stack . c \ <nl> - src / core / channel / child_channel . c \ <nl> src / core / channel / client_channel . c \ <nl> - src / core / channel / client_setup . c \ <nl> src / core / channel / connected_channel . c \ <nl> src / core / channel / http_client_filter . c \ <nl> src / core / channel / http_server_filter . c \ <nl> src / core / channel / noop_filter . c \ <nl> + src / core / client_config / client_config . c \ <nl> + src / core / client_config / connector . c \ <nl> + src / core / client_config / lb_policies / pick_first . c \ <nl> + src / core / client_config / lb_policy . c \ <nl> + src / core / client_config / resolver . c \ <nl> + src / core / client_config / resolver_factory . c \ <nl> + src / core / client_config / resolver_registry . c \ <nl> + src / core / client_config / resolvers / dns_resolver . c \ <nl> + src / core / client_config / resolvers / unix_resolver_posix . c \ <nl> + src / core / client_config / subchannel . c \ <nl> + src / core / client_config / subchannel_factory . c \ <nl> + src / core / client_config / uri_parser . c \ <nl> src / core / compression / algorithm . c \ <nl> src / core / compression / message_compress . c \ <nl> src / core / debug / trace . c \ <nl> LIBGRPC_SRC = \ <nl> src / core / surface / call_log_batch . c \ <nl> src / core / surface / channel . c \ <nl> src / core / surface / channel_create . c \ <nl> - src / core / surface / client . c \ <nl> src / core / surface / completion_queue . c \ <nl> src / core / surface / event_string . c \ <nl> src / core / surface / init . c \ <nl> LIBGRPC_SRC = \ <nl> src / core / transport / chttp2 / varint . c \ <nl> src / core / transport / chttp2 / writing . c \ <nl> src / core / transport / chttp2_transport . c \ <nl> + src / core / transport / connectivity_state . c \ <nl> src / core / transport / metadata . c \ <nl> src / core / transport / stream_op . c \ <nl> src / core / transport / transport . c \ <nl> LIBGRPC_UNSECURE_SRC = \ <nl> src / core / census / grpc_context . c \ <nl> src / core / channel / channel_args . c \ <nl> src / core / channel / channel_stack . c \ <nl> - src / core / channel / child_channel . c \ <nl> src / core / channel / client_channel . c \ <nl> - src / core / channel / client_setup . c \ <nl> src / core / channel / connected_channel . c \ <nl> src / core / channel / http_client_filter . c \ <nl> src / core / channel / http_server_filter . c \ <nl> src / core / channel / noop_filter . c \ <nl> + src / core / client_config / client_config . c \ <nl> + src / core / client_config / connector . c \ <nl> + src / core / client_config / lb_policies / pick_first . c \ <nl> + src / core / client_config / lb_policy . c \ <nl> + src / core / client_config / resolver . c \ <nl> + src / core / client_config / resolver_factory . c \ <nl> + src / core / client_config / resolver_registry . c \ <nl> + src / core / client_config / resolvers / dns_resolver . c \ <nl> + src / core / client_config / resolvers / unix_resolver_posix . c \ <nl> + src / core / client_config / subchannel . c \ <nl> + src / core / client_config / subchannel_factory . c \ <nl> + src / core / client_config / uri_parser . c \ <nl> src / core / compression / algorithm . c \ <nl> src / core / compression / message_compress . c \ <nl> src / core / debug / trace . c \ <nl> LIBGRPC_UNSECURE_SRC = \ <nl> src / core / surface / call_log_batch . c \ <nl> src / core / surface / channel . c \ <nl> src / core / surface / channel_create . c \ <nl> - src / core / surface / client . c \ <nl> src / core / surface / completion_queue . c \ <nl> src / core / surface / event_string . c \ <nl> src / core / surface / init . c \ <nl> LIBGRPC_UNSECURE_SRC = \ <nl> src / core / transport / chttp2 / varint . c \ <nl> src / core / transport / chttp2 / writing . c \ <nl> src / core / transport / chttp2_transport . c \ <nl> + src / core / transport / connectivity_state . c \ <nl> src / core / transport / metadata . c \ <nl> src / core / transport / stream_op . c \ <nl> src / core / transport / transport . c \ <nl> endif <nl> endif <nl> <nl> <nl> + URI_PARSER_TEST_SRC = \ <nl> + test / core / client_config / uri_parser_test . c \ <nl> + <nl> + URI_PARSER_TEST_OBJS = $ ( addprefix $ ( OBJDIR ) / $ ( CONFIG ) / , $ ( addsuffix . o , $ ( basename $ ( URI_PARSER_TEST_SRC ) ) ) ) <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 ) / uri_parser_test : openssl_dep_error <nl> + <nl> + else <nl> + <nl> + $ ( BINDIR ) / $ ( CONFIG ) / uri_parser_test : $ ( URI_PARSER_TEST_OBJS ) $ ( 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 ) $ ( URI_PARSER_TEST_OBJS ) $ ( 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 ) / uri_parser_test <nl> + <nl> + endif <nl> + <nl> + $ ( OBJDIR ) / $ ( CONFIG ) / test / core / client_config / uri_parser_test . o : $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgrpc . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr_test_util . a $ ( LIBDIR ) / $ ( CONFIG ) / libgpr . a <nl> + deps_uri_parser_test : $ ( URI_PARSER_TEST_OBJS : . o = . dep ) <nl> + <nl> + ifneq ( $ ( NO_SECURE ) , true ) <nl> + ifneq ( $ ( NO_DEPS ) , true ) <nl> + - include $ ( URI_PARSER_TEST_OBJS : . o = . dep ) <nl> + endif <nl> + endif <nl> + <nl> + <nl> ASYNC_END2END_TEST_SRC = \ <nl> test / cpp / end2end / async_end2end_test . cc \ <nl> <nl> mmm a / build . json <nl> ppp b / build . json <nl> <nl> " src / core / channel / census_filter . h " , <nl> " src / core / channel / channel_args . h " , <nl> " src / core / channel / channel_stack . h " , <nl> - " src / core / channel / child_channel . h " , <nl> " src / core / channel / client_channel . h " , <nl> - " src / core / channel / client_setup . h " , <nl> " src / core / channel / connected_channel . h " , <nl> " src / core / channel / context . h " , <nl> " src / core / channel / http_client_filter . h " , <nl> " src / core / channel / http_server_filter . h " , <nl> " src / core / channel / noop_filter . h " , <nl> + " src / core / client_config / client_config . h " , <nl> + " src / core / client_config / connector . h " , <nl> + " src / core / client_config / lb_policies / pick_first . h " , <nl> + " src / core / client_config / lb_policy . h " , <nl> + " src / core / client_config / resolver . h " , <nl> + " src / core / client_config / resolver_factory . h " , <nl> + " src / core / client_config / resolver_registry . h " , <nl> + " src / core / client_config / resolvers / dns_resolver . h " , <nl> + " src / core / client_config / resolvers / unix_resolver_posix . h " , <nl> + " src / core / client_config / subchannel . h " , <nl> + " src / core / client_config / subchannel_factory . h " , <nl> + " src / core / client_config / uri_parser . h " , <nl> " src / core / compression / message_compress . h " , <nl> " src / core / debug / trace . h " , <nl> " src / core / iomgr / alarm . h " , <nl> <nl> " src / core / surface / byte_buffer_queue . h " , <nl> " src / core / surface / call . h " , <nl> " src / core / surface / channel . h " , <nl> - " src / core / surface / client . h " , <nl> " src / core / surface / completion_queue . h " , <nl> " src / core / surface / event_string . h " , <nl> " src / core / surface / init . h " , <nl> <nl> " src / core / transport / chttp2 / timeout_encoding . h " , <nl> " src / core / transport / chttp2 / varint . h " , <nl> " src / core / transport / chttp2_transport . h " , <nl> + " src / core / transport / connectivity_state . h " , <nl> " src / core / transport / metadata . h " , <nl> " src / core / transport / stream_op . h " , <nl> " src / core / transport / transport . h " , <nl> <nl> " src / core / census / grpc_context . c " , <nl> " src / core / channel / channel_args . c " , <nl> " src / core / channel / channel_stack . c " , <nl> - " src / core / channel / child_channel . c " , <nl> " src / core / channel / client_channel . c " , <nl> - " src / core / channel / client_setup . c " , <nl> " src / core / channel / connected_channel . c " , <nl> " src / core / channel / http_client_filter . c " , <nl> " src / core / channel / http_server_filter . c " , <nl> " src / core / channel / noop_filter . c " , <nl> + " src / core / client_config / client_config . c " , <nl> + " src / core / client_config / connector . c " , <nl> + " src / core / client_config / lb_policies / pick_first . c " , <nl> + " src / core / client_config / lb_policy . c " , <nl> + " src / core / client_config / resolver . c " , <nl> + " src / core / client_config / resolver_factory . c " , <nl> + " src / core / client_config / resolver_registry . c " , <nl> + " src / core / client_config / resolvers / dns_resolver . c " , <nl> + " src / core / client_config / resolvers / unix_resolver_posix . c " , <nl> + " src / core / client_config / subchannel . c " , <nl> + " src / core / client_config / subchannel_factory . c " , <nl> + " src / core / client_config / uri_parser . c " , <nl> " src / core / compression / algorithm . c " , <nl> " src / core / compression / message_compress . c " , <nl> " src / core / debug / trace . c " , <nl> <nl> " src / core / surface / call_log_batch . c " , <nl> " src / core / surface / channel . c " , <nl> " src / core / surface / channel_create . c " , <nl> - " src / core / surface / client . c " , <nl> " src / core / surface / completion_queue . c " , <nl> " src / core / surface / event_string . c " , <nl> " src / core / surface / init . c " , <nl> <nl> " src / core / transport / chttp2 / varint . c " , <nl> " src / core / transport / chttp2 / writing . c " , <nl> " src / core / transport / chttp2_transport . c " , <nl> + " src / core / transport / connectivity_state . c " , <nl> " src / core / transport / metadata . c " , <nl> " src / core / transport / stream_op . c " , <nl> " src / core / transport / transport . c " , <nl> <nl> " gpr " <nl> ] <nl> } , <nl> + { <nl> + " name " : " uri_parser_test " , <nl> + " build " : " test " , <nl> + " language " : " c " , <nl> + " src " : [ <nl> + " test / core / client_config / uri_parser_test . c " <nl> + ] , <nl> + " deps " : [ <nl> + " grpc_test_util " , <nl> + " grpc " , <nl> + " gpr_test_util " , <nl> + " gpr " <nl> + ] <nl> + } , <nl> { <nl> " name " : " async_end2end_test " , <nl> " build " : " test " , <nl> mmm a / gRPC . podspec <nl> ppp b / gRPC . podspec <nl> Pod : : Spec . new do | s | <nl> ' src / core / channel / census_filter . h ' , <nl> ' src / core / channel / channel_args . h ' , <nl> ' src / core / channel / channel_stack . h ' , <nl> - ' src / core / channel / child_channel . h ' , <nl> ' src / core / channel / client_channel . h ' , <nl> - ' src / core / channel / client_setup . h ' , <nl> ' src / core / channel / connected_channel . h ' , <nl> ' src / core / channel / context . h ' , <nl> ' src / core / channel / http_client_filter . h ' , <nl> ' src / core / channel / http_server_filter . h ' , <nl> ' src / core / channel / noop_filter . h ' , <nl> + ' src / core / client_config / client_config . h ' , <nl> + ' src / core / client_config / connector . h ' , <nl> + ' src / core / client_config / lb_policies / pick_first . h ' , <nl> + ' src / core / client_config / lb_policy . h ' , <nl> + ' src / core / client_config / resolver . h ' , <nl> + ' src / core / client_config / resolver_factory . h ' , <nl> + ' src / core / client_config / resolver_registry . h ' , <nl> + ' src / core / client_config / resolvers / dns_resolver . h ' , <nl> + ' src / core / client_config / resolvers / unix_resolver_posix . h ' , <nl> + ' src / core / client_config / subchannel . h ' , <nl> + ' src / core / client_config / subchannel_factory . h ' , <nl> + ' src / core / client_config / uri_parser . h ' , <nl> ' src / core / compression / message_compress . h ' , <nl> ' src / core / debug / trace . h ' , <nl> ' src / core / iomgr / alarm . h ' , <nl> Pod : : Spec . new do | s | <nl> ' src / core / surface / byte_buffer_queue . h ' , <nl> ' src / core / surface / call . h ' , <nl> ' src / core / surface / channel . h ' , <nl> - ' src / core / surface / client . h ' , <nl> ' src / core / surface / completion_queue . h ' , <nl> ' src / core / surface / event_string . h ' , <nl> ' src / core / surface / init . h ' , <nl> Pod : : Spec . new do | s | <nl> ' src / core / transport / chttp2 / timeout_encoding . h ' , <nl> ' src / core / transport / chttp2 / varint . h ' , <nl> ' src / core / transport / chttp2_transport . h ' , <nl> + ' src / core / transport / connectivity_state . h ' , <nl> ' src / core / transport / metadata . h ' , <nl> ' src / core / transport / stream_op . h ' , <nl> ' src / core / transport / transport . h ' , <nl> Pod : : Spec . new do | s | <nl> ' src / core / census / grpc_context . c ' , <nl> ' src / core / channel / channel_args . c ' , <nl> ' src / core / channel / channel_stack . c ' , <nl> - ' src / core / channel / child_channel . c ' , <nl> ' src / core / channel / client_channel . c ' , <nl> - ' src / core / channel / client_setup . c ' , <nl> ' src / core / channel / connected_channel . c ' , <nl> ' src / core / channel / http_client_filter . c ' , <nl> ' src / core / channel / http_server_filter . c ' , <nl> ' src / core / channel / noop_filter . c ' , <nl> + ' src / core / client_config / client_config . c ' , <nl> + ' src / core / client_config / connector . c ' , <nl> + ' src / core / client_config / lb_policies / pick_first . c ' , <nl> + ' src / core / client_config / lb_policy . c ' , <nl> + ' src / core / client_config / resolver . c ' , <nl> + ' src / core / client_config / resolver_factory . c ' , <nl> + ' src / core / client_config / resolver_registry . c ' , <nl> + ' src / core / client_config / resolvers / dns_resolver . c ' , <nl> + ' src / core / client_config / resolvers / unix_resolver_posix . c ' , <nl> + ' src / core / client_config / subchannel . c ' , <nl> + ' src / core / client_config / subchannel_factory . c ' , <nl> + ' src / core / client_config / uri_parser . c ' , <nl> ' src / core / compression / algorithm . c ' , <nl> ' src / core / compression / message_compress . c ' , <nl> ' src / core / debug / trace . c ' , <nl> Pod : : Spec . new do | s | <nl> ' src / core / surface / call_log_batch . c ' , <nl> ' src / core / surface / channel . c ' , <nl> ' src / core / surface / channel_create . c ' , <nl> - ' src / core / surface / client . c ' , <nl> ' src / core / surface / completion_queue . c ' , <nl> ' src / core / surface / event_string . c ' , <nl> ' src / core / surface / init . c ' , <nl> Pod : : Spec . new do | s | <nl> ' src / core / transport / chttp2 / varint . c ' , <nl> ' src / core / transport / chttp2 / writing . c ' , <nl> ' src / core / transport / chttp2_transport . c ' , <nl> + ' src / core / transport / connectivity_state . c ' , <nl> ' src / core / transport / metadata . c ' , <nl> ' src / core / transport / stream_op . c ' , <nl> ' src / core / transport / transport . c ' , <nl> Pod : : Spec . new do | s | <nl> ' src / core / channel / census_filter . h ' , <nl> ' src / core / channel / channel_args . h ' , <nl> ' src / core / channel / channel_stack . h ' , <nl> - ' src / core / channel / child_channel . h ' , <nl> ' src / core / channel / client_channel . h ' , <nl> - ' src / core / channel / client_setup . h ' , <nl> ' src / core / channel / connected_channel . h ' , <nl> ' src / core / channel / context . h ' , <nl> ' src / core / channel / http_client_filter . h ' , <nl> ' src / core / channel / http_server_filter . h ' , <nl> ' src / core / channel / noop_filter . h ' , <nl> + ' src / core / client_config / client_config . h ' , <nl> + ' src / core / client_config / connector . h ' , <nl> + ' src / core / client_config / lb_policies / pick_first . h ' , <nl> + ' src / core / client_config / lb_policy . h ' , <nl> + ' src / core / client_config / resolver . h ' , <nl> + ' src / core / client_config / resolver_factory . h ' , <nl> + ' src / core / client_config / resolver_registry . h ' , <nl> + ' src / core / client_config / resolvers / dns_resolver . h ' , <nl> + ' src / core / client_config / resolvers / unix_resolver_posix . h ' , <nl> + ' src / core / client_config / subchannel . h ' , <nl> + ' src / core / client_config / subchannel_factory . h ' , <nl> + ' src / core / client_config / uri_parser . h ' , <nl> ' src / core / compression / message_compress . h ' , <nl> ' src / core / debug / trace . h ' , <nl> ' src / core / iomgr / alarm . h ' , <nl> Pod : : Spec . new do | s | <nl> ' src / core / surface / byte_buffer_queue . h ' , <nl> ' src / core / surface / call . h ' , <nl> ' src / core / surface / channel . h ' , <nl> - ' src / core / surface / client . h ' , <nl> ' src / core / surface / completion_queue . h ' , <nl> ' src / core / surface / event_string . h ' , <nl> ' src / core / surface / init . h ' , <nl> Pod : : Spec . new do | s | <nl> ' src / core / transport / chttp2 / timeout_encoding . h ' , <nl> ' src / core / transport / chttp2 / varint . h ' , <nl> ' src / core / transport / chttp2_transport . h ' , <nl> + ' src / core / transport / connectivity_state . h ' , <nl> ' src / core / transport / metadata . h ' , <nl> ' src / core / transport / stream_op . h ' , <nl> ' src / core / transport / transport . h ' , <nl> mmm a / include / grpc / grpc . h <nl> ppp b / include / grpc / grpc . h <nl> typedef struct { <nl> # define GRPC_ARG_HTTP2_INITIAL_SEQUENCE_NUMBER \ <nl> " grpc . http2 . initial_sequence_number " <nl> <nl> + / * * Connectivity state of a channel . * / <nl> + typedef enum { <nl> + / * * channel is idle * / <nl> + GRPC_CHANNEL_IDLE , <nl> + / * * channel is connecting * / <nl> + GRPC_CHANNEL_CONNECTING , <nl> + / * * channel is ready for work * / <nl> + GRPC_CHANNEL_READY , <nl> + / * * channel has seen a failure but expects to recover * / <nl> + GRPC_CHANNEL_TRANSIENT_FAILURE , <nl> + / * * channel has seen a failure that it cannot recover from * / <nl> + GRPC_CHANNEL_FATAL_FAILURE <nl> + } grpc_connectivity_state ; <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> void grpc_channel_destroy ( grpc_channel * channel ) ; <nl> has been made . * / <nl> <nl> / * Called by clients to cancel an RPC on the server . <nl> - Can be called multiple times , from any thread . <nl> + Can be called multiple times , from any thread . <nl> THREAD - SAFETY grpc_call_cancel and grpc_call_cancel_with_status <nl> are thread - safe , and can be called at any point before grpc_call_destroy <nl> is called . * / <nl> grpc_call_error grpc_call_cancel_with_status ( grpc_call * call , <nl> grpc_status_code status , <nl> const char * description ) ; <nl> <nl> - / * Destroy a call . <nl> + / * Destroy a call . <nl> THREAD SAFETY : grpc_call_destroy is thread - compatible * / <nl> void grpc_call_destroy ( grpc_call * call ) ; <nl> <nl> mmm a / include / grpc / support / atm_win32 . h <nl> ppp b / include / grpc / support / atm_win32 . h <nl> <nl> / * Win32 variant of atm_platform . h * / <nl> # include < grpc / support / port_platform . h > <nl> <nl> - # include < windows . h > <nl> - <nl> typedef gpr_intptr gpr_atm ; <nl> <nl> # define gpr_atm_full_barrier MemoryBarrier <nl> mmm a / include / grpc / support / log_win32 . h <nl> ppp b / include / grpc / support / log_win32 . h <nl> <nl> # ifndef GRPC_SUPPORT_LOG_WIN32_H <nl> # define GRPC_SUPPORT_LOG_WIN32_H <nl> <nl> - # include < windows . h > <nl> - <nl> # ifdef __cplusplus <nl> extern " C " { <nl> # endif <nl> mmm a / include / grpc / support / port_platform . h <nl> ppp b / include / grpc / support / port_platform . h <nl> <nl> # ifndef GRPC_SUPPORT_PORT_PLATFORM_H <nl> # define GRPC_SUPPORT_PORT_PLATFORM_H <nl> <nl> + / * Get windows . h included everywhere ( we need it ) * / <nl> + # if defined ( _WIN64 ) | | defined ( WIN64 ) | | defined ( _WIN32 ) | | defined ( WIN32 ) <nl> + # ifndef WIN32_LEAN_AND_MEAN <nl> + # define GRPC_WIN32_LEAN_AND_MEAN_WAS_NOT_DEFINED <nl> + # define WIN32_LEAN_AND_MEAN <nl> + # endif / * WIN32_LEAN_AND_MEAN * / <nl> + <nl> + # ifndef NOMINMAX <nl> + # define GRPC_NOMINMX_WAS_NOT_DEFINED <nl> + # define NOMINMAX <nl> + # endif / * NOMINMAX * / <nl> + <nl> + # if defined ( _WIN32_WINNT ) <nl> + # if _WIN32_WINNT < 0x0600 <nl> + # undef _WIN32_WINNT <nl> + # define _WIN32_WINNT 0x0600 <nl> + # endif / * _WIN32_WINNT < 0x0600 * / <nl> + # endif / * defined ( _WIN32_WINNT ) * / <nl> + <nl> + # include < windows . h > <nl> + <nl> + # ifdef GRPC_WIN32_LEAN_AND_MEAN_WAS_NOT_DEFINED <nl> + # undef GRPC_WIN32_LEAN_AND_MEAN_WAS_NOT_DEFINED <nl> + # undef WIN32_LEAN_AND_MEAN <nl> + # endif / * GRPC_WIN32_LEAN_AND_MEAN_WAS_NOT_DEFINED * / <nl> + <nl> + # ifdef GRPC_NOMINMAX_WAS_NOT_DEFINED <nl> + # undef GRPC_NOMINMAX_WAS_NOT_DEFINED <nl> + # undef NOMINMAX <nl> + # endif / * GRPC_WIN32_LEAN_AND_MEAN_WAS_NOT_DEFINED * / <nl> + # endif / * defined ( _WIN64 ) | | defined ( WIN64 ) | | defined ( _WIN32 ) | | defined ( WIN32 ) * / <nl> + <nl> / * Override this file with one for your platform if you need to redefine <nl> things . * / <nl> <nl> mmm a / include / grpc / support / sync_win32 . h <nl> ppp b / include / grpc / support / sync_win32 . h <nl> <nl> <nl> # include < grpc / support / sync_generic . h > <nl> <nl> - # include < windows . h > <nl> - <nl> typedef struct { <nl> CRITICAL_SECTION cs ; / * Not an SRWLock until Vista is unsupported * / <nl> int locked ; <nl> mmm a / src / core / channel / census_filter . c <nl> ppp b / src / core / channel / census_filter . c <nl> static void extract_and_annotate_method_tag ( grpc_stream_op_buffer * sopb , <nl> } <nl> } <nl> <nl> - static void client_mutate_op ( grpc_call_element * elem , grpc_transport_op * op ) { <nl> + static void client_mutate_op ( grpc_call_element * elem , <nl> + grpc_transport_stream_op * op ) { <nl> call_data * calld = elem - > call_data ; <nl> channel_data * chand = elem - > channel_data ; <nl> if ( op - > send_ops ) { <nl> static void client_mutate_op ( grpc_call_element * elem , grpc_transport_op * op ) { <nl> } <nl> <nl> static void client_start_transport_op ( grpc_call_element * elem , <nl> - grpc_transport_op * op ) { <nl> + grpc_transport_stream_op * op ) { <nl> call_data * calld = elem - > call_data ; <nl> GPR_ASSERT ( ( calld - > op_id . upper ! = 0 ) | | ( calld - > op_id . lower ! = 0 ) ) ; <nl> client_mutate_op ( elem , op ) ; <nl> static void server_on_done_recv ( void * ptr , int success ) { <nl> calld - > on_done_recv ( calld - > recv_user_data , success ) ; <nl> } <nl> <nl> - static void server_mutate_op ( grpc_call_element * elem , grpc_transport_op * op ) { <nl> + static void server_mutate_op ( grpc_call_element * elem , <nl> + grpc_transport_stream_op * op ) { <nl> call_data * calld = elem - > call_data ; <nl> if ( op - > recv_ops ) { <nl> / * substitute our callback for the op callback * / <nl> static void server_mutate_op ( grpc_call_element * elem , grpc_transport_op * op ) { <nl> } <nl> <nl> static void server_start_transport_op ( grpc_call_element * elem , <nl> - grpc_transport_op * op ) { <nl> + grpc_transport_stream_op * op ) { <nl> call_data * calld = elem - > call_data ; <nl> GPR_ASSERT ( ( calld - > op_id . upper ! = 0 ) | | ( calld - > op_id . lower ! = 0 ) ) ; <nl> server_mutate_op ( elem , op ) ; <nl> static void channel_op ( grpc_channel_element * elem , <nl> <nl> static void client_init_call_elem ( grpc_call_element * elem , <nl> const void * server_transport_data , <nl> - grpc_transport_op * initial_op ) { <nl> + grpc_transport_stream_op * initial_op ) { <nl> call_data * d = elem - > call_data ; <nl> GPR_ASSERT ( d ! = NULL ) ; <nl> init_rpc_stats ( & d - > stats ) ; <nl> static void client_destroy_call_elem ( grpc_call_element * elem ) { <nl> <nl> static void server_init_call_elem ( grpc_call_element * elem , <nl> const void * server_transport_data , <nl> - grpc_transport_op * initial_op ) { <nl> + grpc_transport_stream_op * initial_op ) { <nl> call_data * d = elem - > call_data ; <nl> GPR_ASSERT ( d ! = NULL ) ; <nl> init_rpc_stats ( & d - > stats ) ; <nl> static void destroy_channel_elem ( grpc_channel_element * elem ) { <nl> } <nl> <nl> const grpc_channel_filter grpc_client_census_filter = { <nl> - client_start_transport_op , channel_op , sizeof ( call_data ) , <nl> - client_init_call_elem , client_destroy_call_elem , sizeof ( channel_data ) , <nl> - init_channel_elem , destroy_channel_elem , " census - client " } ; <nl> + client_start_transport_op , <nl> + channel_op , <nl> + sizeof ( call_data ) , <nl> + client_init_call_elem , <nl> + client_destroy_call_elem , <nl> + sizeof ( channel_data ) , <nl> + init_channel_elem , <nl> + destroy_channel_elem , <nl> + " census - client " } ; <nl> <nl> const grpc_channel_filter grpc_server_census_filter = { <nl> - server_start_transport_op , channel_op , sizeof ( call_data ) , <nl> - server_init_call_elem , server_destroy_call_elem , sizeof ( channel_data ) , <nl> - init_channel_elem , destroy_channel_elem , " census - server " } ; <nl> + server_start_transport_op , <nl> + channel_op , <nl> + sizeof ( call_data ) , <nl> + server_init_call_elem , <nl> + server_destroy_call_elem , <nl> + sizeof ( channel_data ) , <nl> + init_channel_elem , <nl> + destroy_channel_elem , <nl> + " census - server " } ; <nl> mmm a / src / core / channel / channel_args . c <nl> ppp b / src / core / channel / channel_args . c <nl> static grpc_arg copy_arg ( const grpc_arg * src ) { <nl> } <nl> <nl> grpc_channel_args * grpc_channel_args_copy_and_add ( const grpc_channel_args * src , <nl> - const grpc_arg * to_add ) { <nl> + const grpc_arg * to_add , <nl> + size_t num_to_add ) { <nl> grpc_channel_args * dst = gpr_malloc ( sizeof ( grpc_channel_args ) ) ; <nl> size_t i ; <nl> size_t src_num_args = ( src = = NULL ) ? 0 : src - > num_args ; <nl> grpc_channel_args * grpc_channel_args_copy_and_add ( const grpc_channel_args * src , <nl> dst - > args = NULL ; <nl> return dst ; <nl> } <nl> - dst - > num_args = src_num_args + ( ( to_add = = NULL ) ? 0 : 1 ) ; <nl> + dst - > num_args = src_num_args + num_to_add ; <nl> dst - > args = gpr_malloc ( sizeof ( grpc_arg ) * dst - > num_args ) ; <nl> for ( i = 0 ; i < src_num_args ; i + + ) { <nl> dst - > args [ i ] = copy_arg ( & src - > args [ i ] ) ; <nl> } <nl> - if ( to_add ! = NULL ) dst - > args [ src_num_args ] = copy_arg ( to_add ) ; <nl> + for ( i = 0 ; i < num_to_add ; i + + ) { <nl> + dst - > args [ i + src_num_args ] = copy_arg ( & to_add [ i ] ) ; <nl> + } <nl> return dst ; <nl> } <nl> <nl> grpc_channel_args * grpc_channel_args_copy ( const grpc_channel_args * src ) { <nl> - return grpc_channel_args_copy_and_add ( src , NULL ) ; <nl> + return grpc_channel_args_copy_and_add ( src , NULL , 0 ) ; <nl> + } <nl> + <nl> + grpc_channel_args * grpc_channel_args_merge ( const grpc_channel_args * a , <nl> + const grpc_channel_args * b ) { <nl> + return grpc_channel_args_copy_and_add ( a , b - > args , b - > num_args ) ; <nl> } <nl> <nl> void grpc_channel_args_destroy ( grpc_channel_args * a ) { <nl> grpc_compression_level grpc_channel_args_get_compression_level ( <nl> return GRPC_COMPRESS_LEVEL_NONE ; <nl> } <nl> <nl> - void grpc_channel_args_set_compression_level ( <nl> - grpc_channel_args * * a , grpc_compression_level level ) { <nl> + void grpc_channel_args_set_compression_level ( grpc_channel_args * * a , <nl> + grpc_compression_level level ) { <nl> grpc_arg tmp ; <nl> tmp . type = GRPC_ARG_INTEGER ; <nl> tmp . key = GRPC_COMPRESSION_LEVEL_ARG ; <nl> tmp . value . integer = level ; <nl> - * a = grpc_channel_args_copy_and_add ( * a , & tmp ) ; <nl> + * a = grpc_channel_args_copy_and_add ( * a , & tmp , 1 ) ; <nl> } <nl> mmm a / src / core / channel / channel_args . h <nl> ppp b / src / core / channel / channel_args . h <nl> grpc_channel_args * grpc_channel_args_copy ( const grpc_channel_args * src ) ; <nl> / * * Copy some arguments and add the to_add parameter in the end . <nl> If to_add is NULL , it is equivalent to call grpc_channel_args_copy . * / <nl> grpc_channel_args * grpc_channel_args_copy_and_add ( const grpc_channel_args * src , <nl> - const grpc_arg * to_add ) ; <nl> + const grpc_arg * to_add , <nl> + size_t num_to_add ) ; <nl> + <nl> + / * * Copy args from a then args from b into a new channel args * / <nl> + grpc_channel_args * grpc_channel_args_merge ( const grpc_channel_args * a , <nl> + const grpc_channel_args * b ) ; <nl> <nl> / * * Destroy arguments created by grpc_channel_args_copy * / <nl> void grpc_channel_args_destroy ( grpc_channel_args * a ) ; <nl> grpc_compression_level grpc_channel_args_get_compression_level ( <nl> <nl> / * * Sets the compression level in \ a a to \ a level . Setting it to <nl> * GRPC_COMPRESS_LEVEL_NONE disables compression for the channel . * / <nl> - void grpc_channel_args_set_compression_level ( <nl> - grpc_channel_args * * a , grpc_compression_level level ) ; <nl> + void grpc_channel_args_set_compression_level ( grpc_channel_args * * a , <nl> + grpc_compression_level level ) ; <nl> <nl> - # endif / * GRPC_INTERNAL_CORE_CHANNEL_CHANNEL_ARGS_H * / <nl> + # endif / * GRPC_INTERNAL_CORE_CHANNEL_CHANNEL_ARGS_H * / <nl> mmm a / src / core / channel / channel_stack . c <nl> ppp b / src / core / channel / channel_stack . c <nl> grpc_call_element * grpc_call_stack_element ( grpc_call_stack * call_stack , <nl> } <nl> <nl> void grpc_channel_stack_init ( const grpc_channel_filter * * filters , <nl> - size_t filter_count , const grpc_channel_args * args , <nl> + size_t filter_count , grpc_channel * master , <nl> + const grpc_channel_args * args , <nl> grpc_mdctx * metadata_context , <nl> grpc_channel_stack * stack ) { <nl> size_t call_size = <nl> void grpc_channel_stack_init ( const grpc_channel_filter * * filters , <nl> for ( i = 0 ; i < filter_count ; i + + ) { <nl> elems [ i ] . filter = filters [ i ] ; <nl> elems [ i ] . channel_data = user_data ; <nl> - elems [ i ] . filter - > init_channel_elem ( & elems [ i ] , args , metadata_context , <nl> - i = = 0 , i = = ( filter_count - 1 ) ) ; <nl> + elems [ i ] . filter - > init_channel_elem ( & elems [ i ] , master , args , <nl> + metadata_context , i = = 0 , <nl> + i = = ( filter_count - 1 ) ) ; <nl> user_data + = ROUND_UP_TO_ALIGNMENT_SIZE ( filters [ i ] - > sizeof_channel_data ) ; <nl> call_size + = ROUND_UP_TO_ALIGNMENT_SIZE ( filters [ i ] - > sizeof_call_data ) ; <nl> } <nl> void grpc_channel_stack_destroy ( grpc_channel_stack * stack ) { <nl> <nl> void grpc_call_stack_init ( grpc_channel_stack * channel_stack , <nl> const void * transport_server_data , <nl> - grpc_transport_op * initial_op , <nl> + grpc_transport_stream_op * initial_op , <nl> grpc_call_stack * call_stack ) { <nl> grpc_channel_element * channel_elems = CHANNEL_ELEMS_FROM_STACK ( channel_stack ) ; <nl> size_t count = channel_stack - > count ; <nl> void grpc_call_stack_destroy ( grpc_call_stack * stack ) { <nl> } <nl> } <nl> <nl> - void grpc_call_next_op ( grpc_call_element * elem , grpc_transport_op * op ) { <nl> + void grpc_call_next_op ( grpc_call_element * elem , grpc_transport_stream_op * op ) { <nl> grpc_call_element * next_elem = elem + 1 ; <nl> - next_elem - > filter - > start_transport_op ( next_elem , op ) ; <nl> + next_elem - > filter - > start_transport_stream_op ( next_elem , op ) ; <nl> } <nl> <nl> - void grpc_channel_next_op ( grpc_channel_element * elem , grpc_channel_op * op ) { <nl> - grpc_channel_element * next_elem = elem + op - > dir ; <nl> - next_elem - > filter - > channel_op ( next_elem , elem , op ) ; <nl> + void grpc_channel_next_op ( grpc_channel_element * elem , grpc_transport_op * op ) { <nl> + grpc_channel_element * next_elem = elem + 1 ; <nl> + next_elem - > filter - > start_transport_op ( next_elem , op ) ; <nl> } <nl> <nl> grpc_channel_stack * grpc_channel_stack_from_top_element ( <nl> grpc_call_stack * grpc_call_stack_from_top_element ( grpc_call_element * elem ) { <nl> } <nl> <nl> void grpc_call_element_send_cancel ( grpc_call_element * cur_elem ) { <nl> - grpc_transport_op op ; <nl> + grpc_transport_stream_op op ; <nl> memset ( & op , 0 , sizeof ( op ) ) ; <nl> op . cancel_with_status = GRPC_STATUS_CANCELLED ; <nl> grpc_call_next_op ( cur_elem , & op ) ; <nl> mmm a / src / core / channel / channel_stack . h <nl> ppp b / src / core / channel / channel_stack . h <nl> <nl> typedef struct grpc_channel_element grpc_channel_element ; <nl> typedef struct grpc_call_element grpc_call_element ; <nl> <nl> - / * The direction of the call . <nl> - The values of the enums ( 1 , - 1 ) matter here - they are used to increment <nl> - or decrement a pointer to find the next element to call * / <nl> - typedef enum { GRPC_CALL_DOWN = 1 , GRPC_CALL_UP = - 1 } grpc_call_dir ; <nl> - <nl> - typedef enum { <nl> - / * send a goaway message to remote channels indicating that we are going <nl> - to disconnect in the future * / <nl> - GRPC_CHANNEL_GOAWAY , <nl> - / * disconnect any underlying transports * / <nl> - GRPC_CHANNEL_DISCONNECT , <nl> - / * transport received a new call * / <nl> - GRPC_ACCEPT_CALL , <nl> - / * an underlying transport was closed * / <nl> - GRPC_TRANSPORT_CLOSED , <nl> - / * an underlying transport is about to be closed * / <nl> - GRPC_TRANSPORT_GOAWAY <nl> - } grpc_channel_op_type ; <nl> - <nl> - / * A single filterable operation to be performed on a channel * / <nl> - typedef struct { <nl> - / * The type of operation we ' re performing * / <nl> - grpc_channel_op_type type ; <nl> - / * The directionality of this call - is it bubbling up the stack , or down ? * / <nl> - grpc_call_dir dir ; <nl> - <nl> - / * Argument data , matching up with grpc_channel_op_type names * / <nl> - union { <nl> - struct { <nl> - grpc_transport * transport ; <nl> - const void * transport_server_data ; <nl> - } accept_call ; <nl> - struct { <nl> - grpc_status_code status ; <nl> - gpr_slice message ; <nl> - } goaway ; <nl> - } data ; <nl> - } grpc_channel_op ; <nl> - <nl> / * Channel filters specify : <nl> 1 . the amount of memory needed in the channel & call ( via the sizeof_XXX <nl> members ) <nl> typedef struct { <nl> typedef struct { <nl> / * Called to eg . send / receive data on a call . <nl> See grpc_call_next_op on how to call the next element in the stack * / <nl> - void ( * start_transport_op ) ( grpc_call_element * elem , grpc_transport_op * op ) ; <nl> + void ( * start_transport_stream_op ) ( grpc_call_element * elem , <nl> + grpc_transport_stream_op * op ) ; <nl> / * Called to handle channel level operations - e . g . new calls , or transport <nl> closure . <nl> See grpc_channel_next_op on how to call the next element in the stack * / <nl> - void ( * channel_op ) ( grpc_channel_element * elem , <nl> - grpc_channel_element * from_elem , grpc_channel_op * op ) ; <nl> + void ( * start_transport_op ) ( grpc_channel_element * elem , grpc_transport_op * op ) ; <nl> <nl> / * sizeof ( per call data ) * / <nl> size_t sizeof_call_data ; <nl> typedef struct { <nl> argument . * / <nl> void ( * init_call_elem ) ( grpc_call_element * elem , <nl> const void * server_transport_data , <nl> - grpc_transport_op * initial_op ) ; <nl> + grpc_transport_stream_op * initial_op ) ; <nl> / * Destroy per call data . <nl> The filter does not need to do any chaining * / <nl> void ( * destroy_call_elem ) ( grpc_call_element * elem ) ; <nl> typedef struct { <nl> is_first , is_last designate this elements position in the stack , and are <nl> useful for asserting correct configuration by upper layer code . <nl> The filter does not need to do any chaining * / <nl> - void ( * init_channel_elem ) ( grpc_channel_element * elem , <nl> + void ( * init_channel_elem ) ( grpc_channel_element * elem , grpc_channel * master , <nl> const grpc_channel_args * args , <nl> grpc_mdctx * metadata_context , int is_first , <nl> int is_last ) ; <nl> size_t grpc_channel_stack_size ( const grpc_channel_filter * * filters , <nl> size_t filter_count ) ; <nl> / * Initialize a channel stack given some filters * / <nl> void grpc_channel_stack_init ( const grpc_channel_filter * * filters , <nl> - size_t filter_count , const grpc_channel_args * args , <nl> + size_t filter_count , grpc_channel * master , <nl> + const grpc_channel_args * args , <nl> grpc_mdctx * metadata_context , <nl> grpc_channel_stack * stack ) ; <nl> / * Destroy a channel stack * / <nl> void grpc_channel_stack_destroy ( grpc_channel_stack * stack ) ; <nl> server . * / <nl> void grpc_call_stack_init ( grpc_channel_stack * channel_stack , <nl> const void * transport_server_data , <nl> - grpc_transport_op * initial_op , <nl> + grpc_transport_stream_op * initial_op , <nl> grpc_call_stack * call_stack ) ; <nl> / * Destroy a call stack * / <nl> void grpc_call_stack_destroy ( grpc_call_stack * stack ) ; <nl> <nl> / * Call the next operation in a call stack * / <nl> - void grpc_call_next_op ( grpc_call_element * elem , grpc_transport_op * op ) ; <nl> + void grpc_call_next_op ( grpc_call_element * elem , grpc_transport_stream_op * op ) ; <nl> / * Call the next operation ( depending on call directionality ) in a channel <nl> stack * / <nl> - void grpc_channel_next_op ( grpc_channel_element * elem , grpc_channel_op * op ) ; <nl> + void grpc_channel_next_op ( grpc_channel_element * elem , grpc_transport_op * op ) ; <nl> <nl> / * Given the top element of a channel stack , get the channel stack itself * / <nl> grpc_channel_stack * grpc_channel_stack_from_top_element ( <nl> grpc_channel_stack * grpc_channel_stack_from_top_element ( <nl> grpc_call_stack * grpc_call_stack_from_top_element ( grpc_call_element * elem ) ; <nl> <nl> void grpc_call_log_op ( char * file , int line , gpr_log_severity severity , <nl> - grpc_call_element * elem , grpc_transport_op * op ) ; <nl> + grpc_call_element * elem , grpc_transport_stream_op * op ) ; <nl> <nl> void grpc_call_element_send_cancel ( grpc_call_element * cur_elem ) ; <nl> <nl> deleted file mode 100644 <nl> index 6690265d750 . . 00000000000 <nl> mmm a / src / core / channel / child_channel . c <nl> ppp / dev / null <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 " src / core / channel / child_channel . h " <nl> - # include " src / core / iomgr / iomgr . h " <nl> - # include < grpc / support / alloc . h > <nl> - <nl> - / * Link back filter : passes up calls to the client channel , pushes down calls <nl> - down * / <nl> - <nl> - static void maybe_destroy_channel ( grpc_child_channel * channel ) ; <nl> - <nl> - typedef struct { <nl> - gpr_mu mu ; <nl> - gpr_cv cv ; <nl> - grpc_channel_element * back ; <nl> - / * # of active calls on the channel * / <nl> - gpr_uint32 active_calls ; <nl> - / * has grpc_child_channel_destroy been called ? * / <nl> - gpr_uint8 destroyed ; <nl> - / * has the transport reported itself disconnected ? * / <nl> - gpr_uint8 disconnected ; <nl> - / * are we calling ' back ' - our parent channel * / <nl> - gpr_uint8 calling_back ; <nl> - / * have we or our parent sent goaway yet ? - dup suppression * / <nl> - gpr_uint8 sent_goaway ; <nl> - / * are we currently sending farewell ( in this file : goaway + disconnect ) * / <nl> - gpr_uint8 sending_farewell ; <nl> - / * have we sent farewell ( goaway + disconnect ) * / <nl> - gpr_uint8 sent_farewell ; <nl> - <nl> - grpc_iomgr_closure finally_destroy_channel_closure ; <nl> - grpc_iomgr_closure send_farewells_closure ; <nl> - } lb_channel_data ; <nl> - <nl> - typedef struct { grpc_child_channel * channel ; } lb_call_data ; <nl> - <nl> - static void lb_start_transport_op ( grpc_call_element * elem , <nl> - grpc_transport_op * op ) { <nl> - grpc_call_next_op ( elem , op ) ; <nl> - } <nl> - <nl> - / * Currently we assume all channel operations should just be pushed up . * / <nl> - static void lb_channel_op ( grpc_channel_element * elem , <nl> - grpc_channel_element * from_elem , <nl> - grpc_channel_op * op ) { <nl> - lb_channel_data * chand = elem - > channel_data ; <nl> - grpc_channel_element * back ; <nl> - int calling_back = 0 ; <nl> - <nl> - switch ( op - > dir ) { <nl> - case GRPC_CALL_UP : <nl> - gpr_mu_lock ( & chand - > mu ) ; <nl> - back = chand - > back ; <nl> - if ( back ) { <nl> - chand - > calling_back + + ; <nl> - calling_back = 1 ; <nl> - } <nl> - gpr_mu_unlock ( & chand - > mu ) ; <nl> - if ( back ) { <nl> - back - > filter - > channel_op ( chand - > back , elem , op ) ; <nl> - } else if ( op - > type = = GRPC_TRANSPORT_GOAWAY ) { <nl> - gpr_slice_unref ( op - > data . goaway . message ) ; <nl> - } <nl> - break ; <nl> - case GRPC_CALL_DOWN : <nl> - grpc_channel_next_op ( elem , op ) ; <nl> - break ; <nl> - } <nl> - <nl> - gpr_mu_lock ( & chand - > mu ) ; <nl> - switch ( op - > type ) { <nl> - case GRPC_TRANSPORT_CLOSED : <nl> - chand - > disconnected = 1 ; <nl> - maybe_destroy_channel ( grpc_channel_stack_from_top_element ( elem ) ) ; <nl> - break ; <nl> - case GRPC_CHANNEL_GOAWAY : <nl> - chand - > sent_goaway = 1 ; <nl> - break ; <nl> - case GRPC_CHANNEL_DISCONNECT : <nl> - case GRPC_TRANSPORT_GOAWAY : <nl> - case GRPC_ACCEPT_CALL : <nl> - break ; <nl> - } <nl> - <nl> - if ( calling_back ) { <nl> - chand - > calling_back - - ; <nl> - gpr_cv_signal ( & chand - > cv ) ; <nl> - maybe_destroy_channel ( grpc_channel_stack_from_top_element ( elem ) ) ; <nl> - } <nl> - gpr_mu_unlock ( & chand - > mu ) ; <nl> - } <nl> - <nl> - / * Constructor for call_data * / <nl> - static void lb_init_call_elem ( grpc_call_element * elem , <nl> - const void * server_transport_data , <nl> - grpc_transport_op * initial_op ) { } <nl> - <nl> - / * Destructor for call_data * / <nl> - static void lb_destroy_call_elem ( grpc_call_element * elem ) { } <nl> - <nl> - / * Constructor for channel_data * / <nl> - static void lb_init_channel_elem ( grpc_channel_element * elem , <nl> - const grpc_channel_args * args , <nl> - grpc_mdctx * metadata_context , int is_first , <nl> - int is_last ) { <nl> - lb_channel_data * chand = elem - > channel_data ; <nl> - GPR_ASSERT ( is_first ) ; <nl> - GPR_ASSERT ( ! is_last ) ; <nl> - gpr_mu_init ( & chand - > mu ) ; <nl> - gpr_cv_init ( & chand - > cv ) ; <nl> - chand - > back = NULL ; <nl> - chand - > destroyed = 0 ; <nl> - chand - > disconnected = 0 ; <nl> - chand - > active_calls = 0 ; <nl> - chand - > sent_goaway = 0 ; <nl> - chand - > calling_back = 0 ; <nl> - chand - > sending_farewell = 0 ; <nl> - chand - > sent_farewell = 0 ; <nl> - } <nl> - <nl> - / * Destructor for channel_data * / <nl> - static void lb_destroy_channel_elem ( grpc_channel_element * elem ) { <nl> - lb_channel_data * chand = elem - > channel_data ; <nl> - gpr_mu_destroy ( & chand - > mu ) ; <nl> - gpr_cv_destroy ( & chand - > cv ) ; <nl> - } <nl> - <nl> - const grpc_channel_filter grpc_child_channel_top_filter = { <nl> - lb_start_transport_op , lb_channel_op , <nl> - sizeof ( lb_call_data ) , lb_init_call_elem , lb_destroy_call_elem , <nl> - sizeof ( lb_channel_data ) , lb_init_channel_elem , lb_destroy_channel_elem , <nl> - " child - channel " , <nl> - } ; <nl> - <nl> - / * grpc_child_channel proper * / <nl> - <nl> - # define LINK_BACK_ELEM_FROM_CHANNEL ( channel ) \ <nl> - grpc_channel_stack_element ( ( channel ) , 0 ) <nl> - <nl> - # define LINK_BACK_ELEM_FROM_CALL ( call ) grpc_call_stack_element ( ( call ) , 0 ) <nl> - <nl> - static void finally_destroy_channel ( void * c , int success ) { <nl> - / * ignore success or not . . . this is a destruction callback and will only <nl> - happen once - the only purpose here is to release resources * / <nl> - grpc_child_channel * channel = c ; <nl> - lb_channel_data * chand = LINK_BACK_ELEM_FROM_CHANNEL ( channel ) - > channel_data ; <nl> - / * wait for the initiator to leave the mutex * / <nl> - gpr_mu_lock ( & chand - > mu ) ; <nl> - gpr_mu_unlock ( & chand - > mu ) ; <nl> - grpc_channel_stack_destroy ( channel ) ; <nl> - gpr_free ( channel ) ; <nl> - } <nl> - <nl> - static void send_farewells ( void * c , int success ) { <nl> - grpc_child_channel * channel = c ; <nl> - grpc_channel_element * lbelem = LINK_BACK_ELEM_FROM_CHANNEL ( channel ) ; <nl> - lb_channel_data * chand = lbelem - > channel_data ; <nl> - int send_goaway ; <nl> - grpc_channel_op op ; <nl> - <nl> - gpr_mu_lock ( & chand - > mu ) ; <nl> - send_goaway = ! chand - > sent_goaway ; <nl> - chand - > sent_goaway = 1 ; <nl> - gpr_mu_unlock ( & chand - > mu ) ; <nl> - <nl> - if ( send_goaway ) { <nl> - op . type = GRPC_CHANNEL_GOAWAY ; <nl> - op . dir = GRPC_CALL_DOWN ; <nl> - op . data . goaway . status = GRPC_STATUS_OK ; <nl> - op . data . goaway . message = gpr_slice_from_copied_string ( " Client disconnect " ) ; <nl> - grpc_channel_next_op ( lbelem , & op ) ; <nl> - } <nl> - <nl> - op . type = GRPC_CHANNEL_DISCONNECT ; <nl> - op . dir = GRPC_CALL_DOWN ; <nl> - grpc_channel_next_op ( lbelem , & op ) ; <nl> - <nl> - gpr_mu_lock ( & chand - > mu ) ; <nl> - chand - > sending_farewell = 0 ; <nl> - chand - > sent_farewell = 1 ; <nl> - maybe_destroy_channel ( channel ) ; <nl> - gpr_mu_unlock ( & chand - > mu ) ; <nl> - } <nl> - <nl> - static void maybe_destroy_channel ( grpc_child_channel * channel ) { <nl> - lb_channel_data * chand = LINK_BACK_ELEM_FROM_CHANNEL ( channel ) - > channel_data ; <nl> - if ( chand - > destroyed & & chand - > disconnected & & chand - > active_calls = = 0 & & <nl> - ! chand - > sending_farewell & & ! chand - > calling_back ) { <nl> - chand - > finally_destroy_channel_closure . cb = finally_destroy_channel ; <nl> - chand - > finally_destroy_channel_closure . cb_arg = channel ; <nl> - grpc_iomgr_add_callback ( & chand - > finally_destroy_channel_closure ) ; <nl> - } else if ( chand - > destroyed & & ! chand - > disconnected & & <nl> - chand - > active_calls = = 0 & & ! chand - > sending_farewell & & <nl> - ! chand - > sent_farewell ) { <nl> - chand - > sending_farewell = 1 ; <nl> - chand - > send_farewells_closure . cb = send_farewells ; <nl> - chand - > send_farewells_closure . cb_arg = channel ; <nl> - grpc_iomgr_add_callback ( & chand - > send_farewells_closure ) ; <nl> - } <nl> - } <nl> - <nl> - grpc_child_channel * grpc_child_channel_create ( <nl> - grpc_channel_element * parent , const grpc_channel_filter * * filters , <nl> - size_t filter_count , const grpc_channel_args * args , <nl> - grpc_mdctx * metadata_context ) { <nl> - grpc_channel_stack * stk = <nl> - gpr_malloc ( grpc_channel_stack_size ( filters , filter_count ) ) ; <nl> - lb_channel_data * lb ; <nl> - <nl> - grpc_channel_stack_init ( filters , filter_count , args , metadata_context , stk ) ; <nl> - <nl> - lb = LINK_BACK_ELEM_FROM_CHANNEL ( stk ) - > channel_data ; <nl> - gpr_mu_lock ( & lb - > mu ) ; <nl> - lb - > back = parent ; <nl> - gpr_mu_unlock ( & lb - > mu ) ; <nl> - <nl> - return stk ; <nl> - } <nl> - <nl> - void grpc_child_channel_destroy ( grpc_child_channel * channel , <nl> - int wait_for_callbacks ) { <nl> - grpc_channel_element * lbelem = LINK_BACK_ELEM_FROM_CHANNEL ( channel ) ; <nl> - lb_channel_data * chand = lbelem - > channel_data ; <nl> - <nl> - gpr_mu_lock ( & chand - > mu ) ; <nl> - while ( wait_for_callbacks & & chand - > calling_back ) { <nl> - gpr_cv_wait ( & chand - > cv , & chand - > mu , gpr_inf_future ) ; <nl> - } <nl> - <nl> - chand - > back = NULL ; <nl> - chand - > destroyed = 1 ; <nl> - maybe_destroy_channel ( channel ) ; <nl> - gpr_mu_unlock ( & chand - > mu ) ; <nl> - } <nl> - <nl> - void grpc_child_channel_handle_op ( grpc_child_channel * channel , <nl> - grpc_channel_op * op ) { <nl> - grpc_channel_next_op ( LINK_BACK_ELEM_FROM_CHANNEL ( channel ) , op ) ; <nl> - } <nl> - <nl> - grpc_child_call * grpc_child_channel_create_call ( grpc_child_channel * channel , <nl> - grpc_call_element * parent , <nl> - grpc_transport_op * initial_op ) { <nl> - grpc_call_stack * stk = gpr_malloc ( ( channel ) - > call_stack_size ) ; <nl> - grpc_call_element * lbelem ; <nl> - lb_call_data * lbcalld ; <nl> - lb_channel_data * lbchand ; <nl> - <nl> - grpc_call_stack_init ( channel , NULL , initial_op , stk ) ; <nl> - lbelem = LINK_BACK_ELEM_FROM_CALL ( stk ) ; <nl> - lbchand = lbelem - > channel_data ; <nl> - lbcalld = lbelem - > call_data ; <nl> - lbcalld - > channel = channel ; <nl> - <nl> - gpr_mu_lock ( & lbchand - > mu ) ; <nl> - lbchand - > active_calls + + ; <nl> - gpr_mu_unlock ( & lbchand - > mu ) ; <nl> - <nl> - return stk ; <nl> - } <nl> - <nl> - void grpc_child_call_destroy ( grpc_child_call * call ) { <nl> - grpc_call_element * lbelem = LINK_BACK_ELEM_FROM_CALL ( call ) ; <nl> - lb_call_data * calld = lbelem - > call_data ; <nl> - lb_channel_data * chand = lbelem - > channel_data ; <nl> - grpc_child_channel * channel = calld - > channel ; <nl> - grpc_call_stack_destroy ( call ) ; <nl> - gpr_free ( call ) ; <nl> - gpr_mu_lock ( & chand - > mu ) ; <nl> - chand - > active_calls - - ; <nl> - maybe_destroy_channel ( channel ) ; <nl> - gpr_mu_unlock ( & chand - > mu ) ; <nl> - } <nl> - <nl> - grpc_call_element * grpc_child_call_get_top_element ( grpc_child_call * call ) { <nl> - return LINK_BACK_ELEM_FROM_CALL ( call ) ; <nl> - } <nl> mmm a / src / core / channel / client_channel . c <nl> ppp b / src / core / channel / client_channel . c <nl> <nl> # include " src / core / channel / client_channel . h " <nl> <nl> # include < stdio . h > <nl> + # include < string . h > <nl> <nl> # include " src / core / channel / channel_args . h " <nl> - # include " src / core / channel / child_channel . h " <nl> # include " src / core / channel / connected_channel . h " <nl> + # include " src / core / surface / channel . h " <nl> # include " src / core / iomgr / iomgr . h " <nl> # include " src / core / iomgr / pollset_set . h " <nl> # include " src / core / support / string . h " <nl> + # include " src / core / transport / connectivity_state . h " <nl> # include < grpc / support / alloc . h > <nl> # include < grpc / support / log . h > <nl> # include < grpc / support / sync . h > <nl> <nl> typedef struct call_data call_data ; <nl> <nl> typedef struct { <nl> - / * protects children , child_count , child_capacity , active_child , <nl> - transport_setup_initiated <nl> - does not protect channel stacks held by children <nl> - transport_setup is assumed to be set once during construction * / <nl> - gpr_mu mu ; <nl> - <nl> - / * the sending child ( may be null ) * / <nl> - grpc_child_channel * active_child ; <nl> + / * * metadata context for this channel * / <nl> grpc_mdctx * mdctx ; <nl> - <nl> - / * calls waiting for a channel to be ready * / <nl> - call_data * * waiting_children ; <nl> - size_t waiting_child_count ; <nl> - size_t waiting_child_capacity ; <nl> - <nl> - / * transport setup for this channel * / <nl> - grpc_transport_setup * transport_setup ; <nl> - int transport_setup_initiated ; <nl> - <nl> - grpc_channel_args * args ; <nl> + / * * resolver for this channel * / <nl> + grpc_resolver * resolver ; <nl> + / * * master channel - the grpc_channel instance that ultimately owns <nl> + this channel_data via its channel stack . <nl> + We occasionally use this to bump the refcount on the master channel <nl> + to keep ourselves alive through an asynchronous operation . * / <nl> + grpc_channel * master ; <nl> + <nl> + / * * mutex protecting client configuration , including all <nl> + variables below in this data structure * / <nl> + gpr_mu mu_config ; <nl> + / * * currently active load balancer - guarded by mu_config * / <nl> + grpc_lb_policy * lb_policy ; <nl> + / * * incoming configuration - set by resolver . next <nl> + guarded by mu_config * / <nl> + grpc_client_config * incoming_configuration ; <nl> + / * * a list of closures that are all waiting for config to come in * / <nl> + grpc_iomgr_closure * waiting_for_config_closures ; <nl> + / * * resolver callback * / <nl> + grpc_iomgr_closure on_config_changed ; <nl> + / * * connectivity state being tracked * / <nl> + grpc_connectivity_state_tracker state_tracker ; <nl> } channel_data ; <nl> <nl> typedef enum { <nl> CALL_CREATED , <nl> - CALL_WAITING , <nl> + CALL_WAITING_FOR_SEND , <nl> + CALL_WAITING_FOR_CONFIG , <nl> + CALL_WAITING_FOR_PICK , <nl> + CALL_WAITING_FOR_CALL , <nl> CALL_ACTIVE , <nl> CALL_CANCELLED <nl> } call_state ; <nl> struct call_data { <nl> / * owning element * / <nl> grpc_call_element * elem ; <nl> <nl> + gpr_mu mu_state ; <nl> + <nl> call_state state ; <nl> gpr_timespec deadline ; <nl> - union { <nl> - struct { <nl> - / * our child call stack * / <nl> - grpc_child_call * child_call ; <nl> - } active ; <nl> - grpc_transport_op waiting_op ; <nl> - struct { <nl> - grpc_linked_mdelem status ; <nl> - grpc_linked_mdelem details ; <nl> - } cancelled ; <nl> - } s ; <nl> + grpc_subchannel * picked_channel ; <nl> + grpc_iomgr_closure async_setup_task ; <nl> + grpc_transport_stream_op waiting_op ; <nl> + / * our child call stack * / <nl> + grpc_subchannel_call * subchannel_call ; <nl> + grpc_linked_mdelem status ; <nl> + grpc_linked_mdelem details ; <nl> } ; <nl> <nl> - static int prepare_activate ( grpc_call_element * elem , <nl> - grpc_child_channel * on_child ) { <nl> - call_data * calld = elem - > call_data ; <nl> - channel_data * chand = elem - > channel_data ; <nl> - if ( calld - > state = = CALL_CANCELLED ) return 0 ; <nl> - <nl> - / * no more access to calld - > s . waiting allowed * / <nl> - GPR_ASSERT ( calld - > state = = CALL_WAITING ) ; <nl> - <nl> - if ( calld - > s . waiting_op . bind_pollset ) { <nl> - grpc_transport_setup_del_interested_party ( chand - > transport_setup , <nl> - calld - > s . waiting_op . bind_pollset ) ; <nl> - } <nl> - <nl> - calld - > state = CALL_ACTIVE ; <nl> - <nl> - / * create a child call * / <nl> - / * TODO ( ctiller ) : pass the waiting op down here * / <nl> - calld - > s . active . child_call = <nl> - grpc_child_channel_create_call ( on_child , elem , NULL ) ; <nl> - <nl> - return 1 ; <nl> - } <nl> - <nl> - static void complete_activate ( grpc_call_element * elem , grpc_transport_op * op ) { <nl> - call_data * calld = elem - > call_data ; <nl> - grpc_call_element * child_elem = <nl> - grpc_child_call_get_top_element ( calld - > s . active . child_call ) ; <nl> - <nl> - GPR_ASSERT ( calld - > state = = CALL_ACTIVE ) ; <nl> - <nl> - / * continue the start call down the stack , this nees to happen after metadata <nl> - are flushed * / <nl> - child_elem - > filter - > start_transport_op ( child_elem , op ) ; <nl> - } <nl> - <nl> - static void remove_waiting_child ( channel_data * chand , call_data * calld ) { <nl> - size_t new_count ; <nl> - size_t i ; <nl> - for ( i = 0 , new_count = 0 ; i < chand - > waiting_child_count ; i + + ) { <nl> - if ( chand - > waiting_children [ i ] = = calld ) { <nl> - grpc_transport_setup_del_interested_party ( <nl> - chand - > transport_setup , calld - > s . waiting_op . bind_pollset ) ; <nl> - continue ; <nl> - } <nl> - chand - > waiting_children [ new_count + + ] = chand - > waiting_children [ i ] ; <nl> - } <nl> - GPR_ASSERT ( new_count = = chand - > waiting_child_count - 1 | | <nl> - new_count = = chand - > waiting_child_count ) ; <nl> - chand - > waiting_child_count = new_count ; <nl> - } <nl> + static grpc_iomgr_closure * merge_into_waiting_op ( <nl> + grpc_call_element * elem , <nl> + grpc_transport_stream_op * new_op ) GRPC_MUST_USE_RESULT ; <nl> <nl> static void handle_op_after_cancellation ( grpc_call_element * elem , <nl> - grpc_transport_op * op ) { <nl> + grpc_transport_stream_op * op ) { <nl> call_data * calld = elem - > call_data ; <nl> channel_data * chand = elem - > channel_data ; <nl> if ( op - > send_ops ) { <nl> static void handle_op_after_cancellation ( grpc_call_element * elem , <nl> char status [ GPR_LTOA_MIN_BUFSIZE ] ; <nl> grpc_metadata_batch mdb ; <nl> gpr_ltoa ( GRPC_STATUS_CANCELLED , status ) ; <nl> - calld - > s . cancelled . status . md = <nl> + calld - > status . md = <nl> grpc_mdelem_from_strings ( chand - > mdctx , " grpc - status " , status ) ; <nl> - calld - > s . cancelled . details . md = <nl> + calld - > details . md = <nl> grpc_mdelem_from_strings ( chand - > mdctx , " grpc - message " , " Cancelled " ) ; <nl> - calld - > s . cancelled . status . prev = calld - > s . cancelled . details . next = NULL ; <nl> - calld - > s . cancelled . status . next = & calld - > s . cancelled . details ; <nl> - calld - > s . cancelled . details . prev = & calld - > s . cancelled . status ; <nl> - mdb . list . head = & calld - > s . cancelled . status ; <nl> - mdb . list . tail = & calld - > s . cancelled . details ; <nl> + calld - > status . prev = calld - > details . next = NULL ; <nl> + calld - > status . next = & calld - > details ; <nl> + calld - > details . prev = & calld - > status ; <nl> + mdb . list . head = & calld - > status ; <nl> + mdb . list . tail = & calld - > details ; <nl> mdb . garbage . head = mdb . garbage . tail = NULL ; <nl> mdb . deadline = gpr_inf_future ; <nl> grpc_sopb_add_metadata ( op - > recv_ops , mdb ) ; <nl> static void handle_op_after_cancellation ( grpc_call_element * elem , <nl> } <nl> } <nl> <nl> - static void cc_start_transport_op ( grpc_call_element * elem , <nl> - grpc_transport_op * op ) { <nl> + typedef struct { <nl> + grpc_iomgr_closure closure ; <nl> + grpc_call_element * elem ; <nl> + } waiting_call ; <nl> + <nl> + static void perform_transport_stream_op ( grpc_call_element * elem , <nl> + grpc_transport_stream_op * op , <nl> + int continuation ) ; <nl> + <nl> + static void continue_with_pick ( void * arg , int iomgr_success ) { <nl> + waiting_call * wc = arg ; <nl> + call_data * calld = wc - > elem - > call_data ; <nl> + perform_transport_stream_op ( wc - > elem , & calld - > waiting_op , 1 ) ; <nl> + gpr_free ( wc ) ; <nl> + } <nl> + <nl> + static void add_to_lb_policy_wait_queue_locked_state_config ( <nl> + grpc_call_element * elem ) { <nl> + channel_data * chand = elem - > channel_data ; <nl> + waiting_call * wc = gpr_malloc ( sizeof ( * wc ) ) ; <nl> + grpc_iomgr_closure_init ( & wc - > closure , continue_with_pick , wc ) ; <nl> + wc - > elem = elem ; <nl> + wc - > closure . next = chand - > waiting_for_config_closures ; <nl> + chand - > waiting_for_config_closures = & wc - > closure ; <nl> + } <nl> + <nl> + static int is_empty ( void * p , int len ) { <nl> + char * ptr = p ; <nl> + int i ; <nl> + for ( i = 0 ; i < len ; i + + ) { <nl> + if ( ptr [ i ] ! = 0 ) return 0 ; <nl> + } <nl> + return 1 ; <nl> + } <nl> + <nl> + static void started_call ( void * arg , int iomgr_success ) { <nl> + call_data * calld = arg ; <nl> + grpc_transport_stream_op op ; <nl> + int have_waiting ; <nl> + <nl> + gpr_mu_lock ( & calld - > mu_state ) ; <nl> + if ( calld - > state = = CALL_CANCELLED & & calld - > subchannel_call ! = NULL ) { <nl> + memset ( & op , 0 , sizeof ( op ) ) ; <nl> + op . cancel_with_status = GRPC_STATUS_CANCELLED ; <nl> + gpr_mu_unlock ( & calld - > mu_state ) ; <nl> + grpc_subchannel_call_process_op ( calld - > subchannel_call , & op ) ; <nl> + } else if ( calld - > state = = CALL_WAITING_FOR_CALL ) { <nl> + have_waiting = ! is_empty ( & calld - > waiting_op , sizeof ( calld - > waiting_op ) ) ; <nl> + if ( calld - > subchannel_call ! = NULL ) { <nl> + calld - > state = CALL_ACTIVE ; <nl> + gpr_mu_unlock ( & calld - > mu_state ) ; <nl> + if ( have_waiting ) { <nl> + grpc_subchannel_call_process_op ( calld - > subchannel_call , <nl> + & calld - > waiting_op ) ; <nl> + } <nl> + } else { <nl> + calld - > state = CALL_CANCELLED ; <nl> + gpr_mu_unlock ( & calld - > mu_state ) ; <nl> + if ( have_waiting ) { <nl> + handle_op_after_cancellation ( calld - > elem , & calld - > waiting_op ) ; <nl> + } <nl> + } <nl> + } else { <nl> + GPR_ASSERT ( calld - > state = = CALL_CANCELLED ) ; <nl> + gpr_mu_unlock ( & calld - > mu_state ) ; <nl> + } <nl> + } <nl> + <nl> + static void picked_target ( void * arg , int iomgr_success ) { <nl> + call_data * calld = arg ; <nl> + grpc_pollset * pollset ; <nl> + <nl> + if ( calld - > picked_channel = = NULL ) { <nl> + / * treat this like a cancellation * / <nl> + calld - > waiting_op . cancel_with_status = GRPC_STATUS_UNAVAILABLE ; <nl> + perform_transport_stream_op ( calld - > elem , & calld - > waiting_op , 1 ) ; <nl> + } else { <nl> + gpr_mu_lock ( & calld - > mu_state ) ; <nl> + if ( calld - > state = = CALL_CANCELLED ) { <nl> + gpr_mu_unlock ( & calld - > mu_state ) ; <nl> + handle_op_after_cancellation ( calld - > elem , & calld - > waiting_op ) ; <nl> + } else { <nl> + GPR_ASSERT ( calld - > state = = CALL_WAITING_FOR_PICK ) ; <nl> + calld - > state = CALL_WAITING_FOR_CALL ; <nl> + pollset = calld - > waiting_op . bind_pollset ; <nl> + gpr_mu_unlock ( & calld - > mu_state ) ; <nl> + grpc_iomgr_closure_init ( & calld - > async_setup_task , started_call , calld ) ; <nl> + grpc_subchannel_create_call ( calld - > picked_channel , pollset , <nl> + & calld - > subchannel_call , <nl> + & calld - > async_setup_task ) ; <nl> + } <nl> + } <nl> + } <nl> + <nl> + static void pick_target ( grpc_lb_policy * lb_policy , call_data * calld ) { <nl> + grpc_metadata_batch * initial_metadata ; <nl> + grpc_transport_stream_op * op = & calld - > waiting_op ; <nl> + <nl> + GPR_ASSERT ( op - > bind_pollset ) ; <nl> + GPR_ASSERT ( op - > send_ops ) ; <nl> + GPR_ASSERT ( op - > send_ops - > nops > = 1 ) ; <nl> + GPR_ASSERT ( op - > send_ops - > ops [ 0 ] . type = = GRPC_OP_METADATA ) ; <nl> + initial_metadata = & op - > send_ops - > ops [ 0 ] . data . metadata ; <nl> + <nl> + grpc_iomgr_closure_init ( & calld - > async_setup_task , picked_target , calld ) ; <nl> + grpc_lb_policy_pick ( lb_policy , op - > bind_pollset , initial_metadata , <nl> + & calld - > picked_channel , & calld - > async_setup_task ) ; <nl> + } <nl> + <nl> + static grpc_iomgr_closure * merge_into_waiting_op ( <nl> + grpc_call_element * elem , grpc_transport_stream_op * new_op ) { <nl> + call_data * calld = elem - > call_data ; <nl> + grpc_iomgr_closure * consumed_op = NULL ; <nl> + grpc_transport_stream_op * waiting_op = & calld - > waiting_op ; <nl> + GPR_ASSERT ( ( waiting_op - > send_ops ! = NULL ) + ( new_op - > send_ops ! = NULL ) < = 1 ) ; <nl> + GPR_ASSERT ( ( waiting_op - > recv_ops ! = NULL ) + ( new_op - > recv_ops ! = NULL ) < = 1 ) ; <nl> + if ( new_op - > send_ops ! = NULL ) { <nl> + waiting_op - > send_ops = new_op - > send_ops ; <nl> + waiting_op - > is_last_send = new_op - > is_last_send ; <nl> + waiting_op - > on_done_send = new_op - > on_done_send ; <nl> + } <nl> + if ( new_op - > recv_ops ! = NULL ) { <nl> + waiting_op - > recv_ops = new_op - > recv_ops ; <nl> + waiting_op - > recv_state = new_op - > recv_state ; <nl> + waiting_op - > on_done_recv = new_op - > on_done_recv ; <nl> + } <nl> + if ( new_op - > on_consumed ! = NULL ) { <nl> + if ( waiting_op - > on_consumed ! = NULL ) { <nl> + consumed_op = waiting_op - > on_consumed ; <nl> + } <nl> + waiting_op - > on_consumed = new_op - > on_consumed ; <nl> + } <nl> + if ( new_op - > cancel_with_status ! = GRPC_STATUS_OK ) { <nl> + waiting_op - > cancel_with_status = new_op - > cancel_with_status ; <nl> + } <nl> + return consumed_op ; <nl> + } <nl> + <nl> + static void perform_transport_stream_op ( grpc_call_element * elem , <nl> + grpc_transport_stream_op * op , <nl> + int continuation ) { <nl> call_data * calld = elem - > call_data ; <nl> channel_data * chand = elem - > channel_data ; <nl> - grpc_call_element * child_elem ; <nl> - grpc_transport_op waiting_op ; <nl> + grpc_subchannel_call * subchannel_call ; <nl> + grpc_lb_policy * lb_policy ; <nl> + grpc_transport_stream_op op2 ; <nl> + grpc_iomgr_closure * consumed_op = NULL ; <nl> GPR_ASSERT ( elem - > filter = = & grpc_client_channel_filter ) ; <nl> GRPC_CALL_LOG_OP ( GPR_INFO , elem , op ) ; <nl> <nl> - gpr_mu_lock ( & chand - > mu ) ; <nl> + gpr_mu_lock ( & calld - > mu_state ) ; <nl> switch ( calld - > state ) { <nl> case CALL_ACTIVE : <nl> - child_elem = grpc_child_call_get_top_element ( calld - > s . active . child_call ) ; <nl> - gpr_mu_unlock ( & chand - > mu ) ; <nl> - child_elem - > filter - > start_transport_op ( child_elem , op ) ; <nl> + GPR_ASSERT ( ! continuation ) ; <nl> + subchannel_call = calld - > subchannel_call ; <nl> + gpr_mu_unlock ( & calld - > mu_state ) ; <nl> + grpc_subchannel_call_process_op ( subchannel_call , op ) ; <nl> break ; <nl> - case CALL_CREATED : <nl> - if ( op - > cancel_with_status ! = GRPC_STATUS_OK ) { <nl> - calld - > state = CALL_CANCELLED ; <nl> - gpr_mu_unlock ( & chand - > mu ) ; <nl> - handle_op_after_cancellation ( elem , op ) ; <nl> - } else { <nl> - calld - > state = CALL_WAITING ; <nl> - calld - > s . waiting_op . bind_pollset = NULL ; <nl> - if ( chand - > active_child ) { <nl> - / * channel is connected - use the connected stack * / <nl> - if ( prepare_activate ( elem , chand - > active_child ) ) { <nl> - gpr_mu_unlock ( & chand - > mu ) ; <nl> - / * activate the request ( pass it down ) outside the lock * / <nl> - complete_activate ( elem , op ) ; <nl> - } else { <nl> - gpr_mu_unlock ( & chand - > mu ) ; <nl> + case CALL_CANCELLED : <nl> + gpr_mu_unlock ( & calld - > mu_state ) ; <nl> + handle_op_after_cancellation ( elem , op ) ; <nl> + break ; <nl> + case CALL_WAITING_FOR_SEND : <nl> + GPR_ASSERT ( ! continuation ) ; <nl> + consumed_op = merge_into_waiting_op ( elem , op ) ; <nl> + if ( ! calld - > waiting_op . send_ops & & <nl> + calld - > waiting_op . cancel_with_status = = GRPC_STATUS_OK ) { <nl> + gpr_mu_unlock ( & calld - > mu_state ) ; <nl> + break ; <nl> + } <nl> + * op = calld - > waiting_op ; <nl> + memset ( & calld - > waiting_op , 0 , sizeof ( calld - > waiting_op ) ) ; <nl> + continuation = 1 ; <nl> + / * fall through * / <nl> + case CALL_WAITING_FOR_CONFIG : <nl> + case CALL_WAITING_FOR_PICK : <nl> + case CALL_WAITING_FOR_CALL : <nl> + if ( ! continuation ) { <nl> + if ( op - > cancel_with_status ! = GRPC_STATUS_OK ) { <nl> + calld - > state = CALL_CANCELLED ; <nl> + op2 = calld - > waiting_op ; <nl> + memset ( & calld - > waiting_op , 0 , sizeof ( calld - > waiting_op ) ) ; <nl> + if ( op - > on_consumed ) { <nl> + calld - > waiting_op . on_consumed = op - > on_consumed ; <nl> + op - > on_consumed = NULL ; <nl> + } else if ( op2 . on_consumed ) { <nl> + calld - > waiting_op . on_consumed = op2 . on_consumed ; <nl> + op2 . on_consumed = NULL ; <nl> } <nl> + gpr_mu_unlock ( & calld - > mu_state ) ; <nl> + handle_op_after_cancellation ( elem , op ) ; <nl> + handle_op_after_cancellation ( elem , & op2 ) ; <nl> } else { <nl> - / * check to see if we should initiate a connection ( if we ' re not <nl> - already ) , <nl> - but don ' t do so until outside the lock to avoid re - entrancy <nl> - problems if <nl> - the callback is immediate * / <nl> - int initiate_transport_setup = 0 ; <nl> - if ( ! chand - > transport_setup_initiated ) { <nl> - chand - > transport_setup_initiated = 1 ; <nl> - initiate_transport_setup = 1 ; <nl> - } <nl> - / * add this call to the waiting set to be resumed once we have a child <nl> - channel stack , growing the waiting set if needed * / <nl> - if ( chand - > waiting_child_count = = chand - > waiting_child_capacity ) { <nl> - chand - > waiting_child_capacity = <nl> - GPR_MAX ( chand - > waiting_child_capacity * 2 , 8 ) ; <nl> - chand - > waiting_children = gpr_realloc ( <nl> - chand - > waiting_children , <nl> - chand - > waiting_child_capacity * sizeof ( call_data * ) ) ; <nl> - } <nl> - calld - > s . waiting_op = * op ; <nl> - chand - > waiting_children [ chand - > waiting_child_count + + ] = calld ; <nl> - grpc_transport_setup_add_interested_party ( chand - > transport_setup , <nl> - op - > bind_pollset ) ; <nl> - gpr_mu_unlock ( & chand - > mu ) ; <nl> - <nl> - / * finally initiate transport setup if needed * / <nl> - if ( initiate_transport_setup ) { <nl> - grpc_transport_setup_initiate ( chand - > transport_setup ) ; <nl> - } <nl> + consumed_op = merge_into_waiting_op ( elem , op ) ; <nl> + gpr_mu_unlock ( & calld - > mu_state ) ; <nl> } <nl> + break ; <nl> } <nl> - break ; <nl> - case CALL_WAITING : <nl> + / * fall through * / <nl> + case CALL_CREATED : <nl> if ( op - > cancel_with_status ! = GRPC_STATUS_OK ) { <nl> - waiting_op = calld - > s . waiting_op ; <nl> - remove_waiting_child ( chand , calld ) ; <nl> calld - > state = CALL_CANCELLED ; <nl> - gpr_mu_unlock ( & chand - > mu ) ; <nl> - handle_op_after_cancellation ( elem , & waiting_op ) ; <nl> + gpr_mu_unlock ( & calld - > mu_state ) ; <nl> handle_op_after_cancellation ( elem , op ) ; <nl> } else { <nl> - GPR_ASSERT ( ( calld - > s . waiting_op . send_ops = = NULL ) ! = <nl> - ( op - > send_ops = = NULL ) ) ; <nl> - GPR_ASSERT ( ( calld - > s . waiting_op . recv_ops = = NULL ) ! = <nl> - ( op - > recv_ops = = NULL ) ) ; <nl> - if ( op - > send_ops ) { <nl> - calld - > s . waiting_op . send_ops = op - > send_ops ; <nl> - calld - > s . waiting_op . is_last_send = op - > is_last_send ; <nl> - calld - > s . waiting_op . on_done_send = op - > on_done_send ; <nl> - } <nl> - if ( op - > recv_ops ) { <nl> - calld - > s . waiting_op . recv_ops = op - > recv_ops ; <nl> - calld - > s . waiting_op . recv_state = op - > recv_state ; <nl> - calld - > s . waiting_op . on_done_recv = op - > on_done_recv ; <nl> - } <nl> - gpr_mu_unlock ( & chand - > mu ) ; <nl> - if ( op - > on_consumed ) { <nl> - op - > on_consumed - > cb ( op - > on_consumed - > cb_arg , 0 ) ; <nl> + calld - > waiting_op = * op ; <nl> + <nl> + if ( op - > send_ops = = NULL ) { <nl> + / * need to have some send ops before we can select the <nl> + lb target * / <nl> + calld - > state = CALL_WAITING_FOR_SEND ; <nl> + gpr_mu_unlock ( & calld - > mu_state ) ; <nl> + } else { <nl> + gpr_mu_lock ( & chand - > mu_config ) ; <nl> + lb_policy = chand - > lb_policy ; <nl> + if ( lb_policy ) { <nl> + GRPC_LB_POLICY_REF ( lb_policy , " pick " ) ; <nl> + gpr_mu_unlock ( & chand - > mu_config ) ; <nl> + calld - > state = CALL_WAITING_FOR_PICK ; <nl> + gpr_mu_unlock ( & calld - > mu_state ) ; <nl> + <nl> + pick_target ( lb_policy , calld ) ; <nl> + <nl> + GRPC_LB_POLICY_UNREF ( lb_policy , " pick " ) ; <nl> + } else if ( chand - > resolver ! = NULL ) { <nl> + calld - > state = CALL_WAITING_FOR_CONFIG ; <nl> + add_to_lb_policy_wait_queue_locked_state_config ( elem ) ; <nl> + gpr_mu_unlock ( & chand - > mu_config ) ; <nl> + gpr_mu_unlock ( & calld - > mu_state ) ; <nl> + } else { <nl> + calld - > state = CALL_CANCELLED ; <nl> + gpr_mu_unlock ( & chand - > mu_config ) ; <nl> + gpr_mu_unlock ( & calld - > mu_state ) ; <nl> + handle_op_after_cancellation ( elem , op ) ; <nl> + } <nl> } <nl> } <nl> break ; <nl> - case CALL_CANCELLED : <nl> - gpr_mu_unlock ( & chand - > mu ) ; <nl> - handle_op_after_cancellation ( elem , op ) ; <nl> - break ; <nl> } <nl> + <nl> + if ( consumed_op ! = NULL ) { <nl> + consumed_op - > cb ( consumed_op - > cb_arg , 1 ) ; <nl> + } <nl> + } <nl> + <nl> + static void cc_start_transport_stream_op ( grpc_call_element * elem , <nl> + grpc_transport_stream_op * op ) { <nl> + perform_transport_stream_op ( elem , op , 0 ) ; <nl> + } <nl> + <nl> + static void cc_on_config_changed ( void * arg , int iomgr_success ) { <nl> + channel_data * chand = arg ; <nl> + grpc_lb_policy * lb_policy = NULL ; <nl> + grpc_lb_policy * old_lb_policy ; <nl> + grpc_resolver * old_resolver ; <nl> + grpc_iomgr_closure * wakeup_closures = NULL ; <nl> + <nl> + if ( chand - > incoming_configuration ! = NULL ) { <nl> + lb_policy = grpc_client_config_get_lb_policy ( chand - > incoming_configuration ) ; <nl> + GRPC_LB_POLICY_REF ( lb_policy , " channel " ) ; <nl> + <nl> + grpc_client_config_unref ( chand - > incoming_configuration ) ; <nl> + } <nl> + <nl> + chand - > incoming_configuration = NULL ; <nl> + <nl> + gpr_mu_lock ( & chand - > mu_config ) ; <nl> + old_lb_policy = chand - > lb_policy ; <nl> + chand - > lb_policy = lb_policy ; <nl> + if ( lb_policy ! = NULL | | chand - > resolver = = NULL / * disconnected * / ) { <nl> + wakeup_closures = chand - > waiting_for_config_closures ; <nl> + chand - > waiting_for_config_closures = NULL ; <nl> + } <nl> + gpr_mu_unlock ( & chand - > mu_config ) ; <nl> + <nl> + if ( old_lb_policy ) { <nl> + GRPC_LB_POLICY_UNREF ( old_lb_policy , " channel " ) ; <nl> + } <nl> + <nl> + gpr_mu_lock ( & chand - > mu_config ) ; <nl> + if ( iomgr_success & & chand - > resolver ) { <nl> + grpc_resolver * resolver = chand - > resolver ; <nl> + GRPC_RESOLVER_REF ( resolver , " channel - next " ) ; <nl> + gpr_mu_unlock ( & chand - > mu_config ) ; <nl> + GRPC_CHANNEL_INTERNAL_REF ( chand - > master , " resolver " ) ; <nl> + grpc_resolver_next ( chand - > resolver , & chand - > incoming_configuration , <nl> + & chand - > on_config_changed ) ; <nl> + GRPC_RESOLVER_UNREF ( resolver , " channel - next " ) ; <nl> + } else { <nl> + old_resolver = chand - > resolver ; <nl> + chand - > resolver = NULL ; <nl> + grpc_connectivity_state_set ( & chand - > state_tracker , <nl> + GRPC_CHANNEL_FATAL_FAILURE ) ; <nl> + gpr_mu_unlock ( & chand - > mu_config ) ; <nl> + if ( old_resolver ! = NULL ) { <nl> + grpc_resolver_shutdown ( old_resolver ) ; <nl> + GRPC_RESOLVER_UNREF ( old_resolver , " channel " ) ; <nl> + } <nl> + } <nl> + <nl> + while ( wakeup_closures ) { <nl> + grpc_iomgr_closure * next = wakeup_closures - > next ; <nl> + grpc_iomgr_add_callback ( wakeup_closures ) ; <nl> + wakeup_closures = next ; <nl> + } <nl> + <nl> + GRPC_CHANNEL_INTERNAL_UNREF ( chand - > master , " resolver " ) ; <nl> } <nl> <nl> - static void channel_op ( grpc_channel_element * elem , <nl> - grpc_channel_element * from_elem , grpc_channel_op * op ) { <nl> + static void cc_start_transport_op ( grpc_channel_element * elem , <nl> + grpc_transport_op * op ) { <nl> + grpc_lb_policy * lb_policy = NULL ; <nl> channel_data * chand = elem - > channel_data ; <nl> - grpc_child_channel * child_channel ; <nl> - grpc_channel_op rop ; <nl> - GPR_ASSERT ( elem - > filter = = & grpc_client_channel_filter ) ; <nl> + grpc_resolver * destroy_resolver = NULL ; <nl> + grpc_iomgr_closure * on_consumed = op - > on_consumed ; <nl> + op - > on_consumed = NULL ; <nl> + <nl> + GPR_ASSERT ( op - > set_accept_stream = = NULL ) ; <nl> + GPR_ASSERT ( op - > bind_pollset = = NULL ) ; <nl> + <nl> + gpr_mu_lock ( & chand - > mu_config ) ; <nl> + if ( op - > on_connectivity_state_change ! = NULL ) { <nl> + grpc_connectivity_state_notify_on_state_change ( <nl> + & chand - > state_tracker , op - > connectivity_state , <nl> + op - > on_connectivity_state_change ) ; <nl> + op - > on_connectivity_state_change = NULL ; <nl> + op - > connectivity_state = NULL ; <nl> + } <nl> <nl> - switch ( op - > type ) { <nl> - case GRPC_CHANNEL_GOAWAY : <nl> - / * sending goaway : clear out the active child on the way through * / <nl> - gpr_mu_lock ( & chand - > mu ) ; <nl> - child_channel = chand - > active_child ; <nl> - chand - > active_child = NULL ; <nl> - gpr_mu_unlock ( & chand - > mu ) ; <nl> - if ( child_channel ) { <nl> - grpc_child_channel_handle_op ( child_channel , op ) ; <nl> - grpc_child_channel_destroy ( child_channel , 1 ) ; <nl> - } else { <nl> - gpr_slice_unref ( op - > data . goaway . message ) ; <nl> - } <nl> - break ; <nl> - case GRPC_CHANNEL_DISCONNECT : <nl> - / * sending disconnect : clear out the active child on the way through * / <nl> - gpr_mu_lock ( & chand - > mu ) ; <nl> - child_channel = chand - > active_child ; <nl> - chand - > active_child = NULL ; <nl> - gpr_mu_unlock ( & chand - > mu ) ; <nl> - if ( child_channel ) { <nl> - grpc_child_channel_destroy ( child_channel , 1 ) ; <nl> - } <nl> - / * fake a transport closed to satisfy the refcounting in client * / <nl> - rop . type = GRPC_TRANSPORT_CLOSED ; <nl> - rop . dir = GRPC_CALL_UP ; <nl> - grpc_channel_next_op ( elem , & rop ) ; <nl> - break ; <nl> - case GRPC_TRANSPORT_GOAWAY : <nl> - / * receiving goaway : if it ' s from our active child , drop the active child ; <nl> - in all cases consume the event here * / <nl> - gpr_mu_lock ( & chand - > mu ) ; <nl> - child_channel = grpc_channel_stack_from_top_element ( from_elem ) ; <nl> - if ( child_channel = = chand - > active_child ) { <nl> - chand - > active_child = NULL ; <nl> - } else { <nl> - child_channel = NULL ; <nl> - } <nl> - gpr_mu_unlock ( & chand - > mu ) ; <nl> - if ( child_channel ) { <nl> - grpc_child_channel_destroy ( child_channel , 0 ) ; <nl> - } <nl> - gpr_slice_unref ( op - > data . goaway . message ) ; <nl> - break ; <nl> - case GRPC_TRANSPORT_CLOSED : <nl> - / * receiving disconnect : if it ' s from our active child , drop the active <nl> - child ; in all cases consume the event here * / <nl> - gpr_mu_lock ( & chand - > mu ) ; <nl> - child_channel = grpc_channel_stack_from_top_element ( from_elem ) ; <nl> - if ( child_channel = = chand - > active_child ) { <nl> - chand - > active_child = NULL ; <nl> - } else { <nl> - child_channel = NULL ; <nl> - } <nl> - gpr_mu_unlock ( & chand - > mu ) ; <nl> - if ( child_channel ) { <nl> - grpc_child_channel_destroy ( child_channel , 0 ) ; <nl> - } <nl> - break ; <nl> - default : <nl> - switch ( op - > dir ) { <nl> - case GRPC_CALL_UP : <nl> - grpc_channel_next_op ( elem , op ) ; <nl> - break ; <nl> - case GRPC_CALL_DOWN : <nl> - gpr_log ( GPR_ERROR , " unhandled channel op : % d " , op - > type ) ; <nl> - abort ( ) ; <nl> - break ; <nl> - } <nl> - break ; <nl> + if ( op - > disconnect & & chand - > resolver ! = NULL ) { <nl> + grpc_connectivity_state_set ( & chand - > state_tracker , <nl> + GRPC_CHANNEL_FATAL_FAILURE ) ; <nl> + destroy_resolver = chand - > resolver ; <nl> + chand - > resolver = NULL ; <nl> + if ( chand - > lb_policy ! = NULL ) { <nl> + grpc_lb_policy_shutdown ( chand - > lb_policy ) ; <nl> + } <nl> + } <nl> + <nl> + if ( ! is_empty ( op , sizeof ( * op ) ) ) { <nl> + lb_policy = chand - > lb_policy ; <nl> + if ( lb_policy ) { <nl> + GRPC_LB_POLICY_REF ( lb_policy , " broadcast " ) ; <nl> + } <nl> + } <nl> + gpr_mu_unlock ( & chand - > mu_config ) ; <nl> + <nl> + if ( destroy_resolver ) { <nl> + grpc_resolver_shutdown ( destroy_resolver ) ; <nl> + GRPC_RESOLVER_UNREF ( destroy_resolver , " channel " ) ; <nl> + } <nl> + <nl> + if ( lb_policy ) { <nl> + grpc_lb_policy_broadcast ( lb_policy , op ) ; <nl> + GRPC_LB_POLICY_UNREF ( lb_policy , " broadcast " ) ; <nl> + } <nl> + <nl> + if ( on_consumed ) { <nl> + grpc_iomgr_add_callback ( on_consumed ) ; <nl> } <nl> } <nl> <nl> / * Constructor for call_data * / <nl> static void init_call_elem ( grpc_call_element * elem , <nl> const void * server_transport_data , <nl> - grpc_transport_op * initial_op ) { <nl> + grpc_transport_stream_op * initial_op ) { <nl> call_data * calld = elem - > call_data ; <nl> <nl> / * TODO ( ctiller ) : is there something useful we can do here ? * / <nl> static void init_call_elem ( grpc_call_element * elem , <nl> <nl> GPR_ASSERT ( elem - > filter = = & grpc_client_channel_filter ) ; <nl> GPR_ASSERT ( server_transport_data = = NULL ) ; <nl> + gpr_mu_init ( & calld - > mu_state ) ; <nl> calld - > elem = elem ; <nl> calld - > state = CALL_CREATED ; <nl> calld - > deadline = gpr_inf_future ; <nl> static void init_call_elem ( grpc_call_element * elem , <nl> / * Destructor for call_data * / <nl> static void destroy_call_elem ( grpc_call_element * elem ) { <nl> call_data * calld = elem - > call_data ; <nl> - channel_data * chand = elem - > channel_data ; <nl> + grpc_subchannel_call * subchannel_call ; <nl> <nl> / * if the call got activated , we need to destroy the child stack also , and <nl> remove it from the in - flight requests tracked by the child_entry we <nl> picked * / <nl> - gpr_mu_lock ( & chand - > mu ) ; <nl> + gpr_mu_lock ( & calld - > mu_state ) ; <nl> switch ( calld - > state ) { <nl> case CALL_ACTIVE : <nl> - gpr_mu_unlock ( & chand - > mu ) ; <nl> - grpc_child_call_destroy ( calld - > s . active . child_call ) ; <nl> + subchannel_call = calld - > subchannel_call ; <nl> + gpr_mu_unlock ( & calld - > mu_state ) ; <nl> + GRPC_SUBCHANNEL_CALL_UNREF ( subchannel_call , " client_channel " ) ; <nl> break ; <nl> - case CALL_WAITING : <nl> - remove_waiting_child ( chand , calld ) ; <nl> - gpr_mu_unlock ( & chand - > mu ) ; <nl> + case CALL_CREATED : <nl> + case CALL_CANCELLED : <nl> + gpr_mu_unlock ( & calld - > mu_state ) ; <nl> break ; <nl> - default : <nl> - gpr_mu_unlock ( & chand - > mu ) ; <nl> + case CALL_WAITING_FOR_PICK : <nl> + case CALL_WAITING_FOR_CONFIG : <nl> + case CALL_WAITING_FOR_CALL : <nl> + case CALL_WAITING_FOR_SEND : <nl> + gpr_log ( GPR_ERROR , " should never reach here " ) ; <nl> + abort ( ) ; <nl> break ; <nl> } <nl> - GPR_ASSERT ( calld - > state ! = CALL_WAITING ) ; <nl> } <nl> <nl> / * Constructor for channel_data * / <nl> - static void init_channel_elem ( grpc_channel_element * elem , <nl> + static void init_channel_elem ( grpc_channel_element * elem , grpc_channel * master , <nl> const grpc_channel_args * args , <nl> grpc_mdctx * metadata_context , int is_first , <nl> int is_last ) { <nl> channel_data * chand = elem - > channel_data ; <nl> <nl> - GPR_ASSERT ( ! is_first ) ; <nl> + memset ( chand , 0 , sizeof ( * chand ) ) ; <nl> + <nl> GPR_ASSERT ( is_last ) ; <nl> GPR_ASSERT ( elem - > filter = = & grpc_client_channel_filter ) ; <nl> <nl> - gpr_mu_init ( & chand - > mu ) ; <nl> - chand - > active_child = NULL ; <nl> - chand - > waiting_children = NULL ; <nl> - chand - > waiting_child_count = 0 ; <nl> - chand - > waiting_child_capacity = 0 ; <nl> - chand - > transport_setup = NULL ; <nl> - chand - > transport_setup_initiated = 0 ; <nl> - chand - > args = grpc_channel_args_copy ( args ) ; <nl> + gpr_mu_init ( & chand - > mu_config ) ; <nl> chand - > mdctx = metadata_context ; <nl> + chand - > master = master ; <nl> + grpc_iomgr_closure_init ( & chand - > on_config_changed , cc_on_config_changed , <nl> + chand ) ; <nl> + <nl> + grpc_connectivity_state_init ( & chand - > state_tracker , GRPC_CHANNEL_IDLE ) ; <nl> } <nl> <nl> / * Destructor for channel_data * / <nl> static void destroy_channel_elem ( grpc_channel_element * elem ) { <nl> channel_data * chand = elem - > channel_data ; <nl> <nl> - grpc_transport_setup_cancel ( chand - > transport_setup ) ; <nl> - <nl> - if ( chand - > active_child ) { <nl> - grpc_child_channel_destroy ( chand - > active_child , 1 ) ; <nl> - chand - > active_child = NULL ; <nl> + if ( chand - > resolver ! = NULL ) { <nl> + grpc_resolver_shutdown ( chand - > resolver ) ; <nl> + GRPC_RESOLVER_UNREF ( chand - > resolver , " channel " ) ; <nl> } <nl> - <nl> - grpc_channel_args_destroy ( chand - > args ) ; <nl> - <nl> - gpr_mu_destroy ( & chand - > mu ) ; <nl> - GPR_ASSERT ( chand - > waiting_child_count = = 0 ) ; <nl> - gpr_free ( chand - > waiting_children ) ; <nl> + if ( chand - > lb_policy ! = NULL ) { <nl> + GRPC_LB_POLICY_UNREF ( chand - > lb_policy , " channel " ) ; <nl> + } <nl> + gpr_mu_destroy ( & chand - > mu_config ) ; <nl> } <nl> <nl> const grpc_channel_filter grpc_client_channel_filter = { <nl> - cc_start_transport_op , channel_op , sizeof ( call_data ) , <nl> - init_call_elem , destroy_call_elem , sizeof ( channel_data ) , <nl> - init_channel_elem , destroy_channel_elem , " client - channel " , <nl> + cc_start_transport_stream_op , <nl> + cc_start_transport_op , <nl> + sizeof ( call_data ) , <nl> + init_call_elem , <nl> + destroy_call_elem , <nl> + sizeof ( channel_data ) , <nl> + init_channel_elem , <nl> + destroy_channel_elem , <nl> + " client - channel " , <nl> } ; <nl> <nl> - grpc_transport_setup_result grpc_client_channel_transport_setup_complete ( <nl> - grpc_channel_stack * channel_stack , grpc_transport * transport , <nl> - grpc_channel_filter const * * channel_filters , size_t num_channel_filters , <nl> - grpc_mdctx * mdctx ) { <nl> - / * we just got a new transport : lets create a child channel stack for it * / <nl> - grpc_channel_element * elem = grpc_channel_stack_last_element ( channel_stack ) ; <nl> - channel_data * chand = elem - > channel_data ; <nl> - size_t num_child_filters = 2 + num_channel_filters ; <nl> - grpc_channel_filter const * * child_filters ; <nl> - grpc_transport_setup_result result ; <nl> - grpc_child_channel * old_active = NULL ; <nl> - call_data * * waiting_children ; <nl> - size_t waiting_child_count ; <nl> - size_t i ; <nl> - grpc_transport_op * call_ops ; <nl> - <nl> - / * build the child filter stack * / <nl> - child_filters = gpr_malloc ( sizeof ( grpc_channel_filter * ) * num_child_filters ) ; <nl> - / * we always need a link back filter to get back to the connected channel * / <nl> - child_filters [ 0 ] = & grpc_child_channel_top_filter ; <nl> - for ( i = 0 ; i < num_channel_filters ; i + + ) { <nl> - child_filters [ i + 1 ] = channel_filters [ i ] ; <nl> - } <nl> - / * and we always need a connected channel to talk to the transport * / <nl> - child_filters [ num_child_filters - 1 ] = & grpc_connected_channel_filter ; <nl> - <nl> - GPR_ASSERT ( elem - > filter = = & grpc_client_channel_filter ) ; <nl> - <nl> - / * BEGIN LOCKING CHANNEL * / <nl> - gpr_mu_lock ( & chand - > mu ) ; <nl> - chand - > transport_setup_initiated = 0 ; <nl> - <nl> - if ( chand - > active_child ) { <nl> - old_active = chand - > active_child ; <nl> - } <nl> - chand - > active_child = grpc_child_channel_create ( <nl> - elem , child_filters , num_child_filters , chand - > args , mdctx ) ; <nl> - result = <nl> - grpc_connected_channel_bind_transport ( chand - > active_child , transport ) ; <nl> - <nl> - / * capture the waiting children - we ' ll activate them outside the lock <nl> - to avoid re - entrancy problems * / <nl> - waiting_children = chand - > waiting_children ; <nl> - waiting_child_count = chand - > waiting_child_count ; <nl> - / * bumping up inflight_requests here avoids taking a lock per rpc below * / <nl> - <nl> - chand - > waiting_children = NULL ; <nl> - chand - > waiting_child_count = 0 ; <nl> - chand - > waiting_child_capacity = 0 ; <nl> - <nl> - call_ops = gpr_malloc ( sizeof ( * call_ops ) * waiting_child_count ) ; <nl> - <nl> - for ( i = 0 ; i < waiting_child_count ; i + + ) { <nl> - call_ops [ i ] = waiting_children [ i ] - > s . waiting_op ; <nl> - if ( ! prepare_activate ( waiting_children [ i ] - > elem , chand - > active_child ) ) { <nl> - waiting_children [ i ] = NULL ; <nl> - grpc_transport_op_finish_with_failure ( & call_ops [ i ] ) ; <nl> - } <nl> - } <nl> - <nl> - / * END LOCKING CHANNEL * / <nl> - gpr_mu_unlock ( & chand - > mu ) ; <nl> - <nl> - / * activate any pending operations - this is safe to do as we guarantee one <nl> - and only one write operation per request at the surface api - if we lose <nl> - that guarantee we need to do some curly locking here * / <nl> - for ( i = 0 ; i < waiting_child_count ; i + + ) { <nl> - if ( waiting_children [ i ] ) { <nl> - complete_activate ( waiting_children [ i ] - > elem , & call_ops [ i ] ) ; <nl> - } <nl> - } <nl> - gpr_free ( waiting_children ) ; <nl> - gpr_free ( call_ops ) ; <nl> - gpr_free ( child_filters ) ; <nl> - <nl> - if ( old_active ) { <nl> - grpc_child_channel_destroy ( old_active , 1 ) ; <nl> - } <nl> - <nl> - return result ; <nl> - } <nl> - <nl> - void grpc_client_channel_set_transport_setup ( grpc_channel_stack * channel_stack , <nl> - grpc_transport_setup * setup ) { <nl> + void grpc_client_channel_set_resolver ( grpc_channel_stack * channel_stack , <nl> + grpc_resolver * resolver ) { <nl> / * post construction initialization : set the transport setup pointer * / <nl> grpc_channel_element * elem = grpc_channel_stack_last_element ( channel_stack ) ; <nl> channel_data * chand = elem - > channel_data ; <nl> - GPR_ASSERT ( ! chand - > transport_setup ) ; <nl> - chand - > transport_setup = setup ; <nl> + GPR_ASSERT ( ! chand - > resolver ) ; <nl> + chand - > resolver = resolver ; <nl> + GRPC_CHANNEL_INTERNAL_REF ( chand - > master , " resolver " ) ; <nl> + GRPC_RESOLVER_REF ( resolver , " channel " ) ; <nl> + grpc_resolver_next ( resolver , & chand - > incoming_configuration , <nl> + & chand - > on_config_changed ) ; <nl> } <nl> mmm a / src / core / channel / client_channel . h <nl> ppp b / src / core / channel / client_channel . h <nl> <nl> # define GRPC_INTERNAL_CORE_CHANNEL_CLIENT_CHANNEL_H <nl> <nl> # include " src / core / channel / channel_stack . h " <nl> + # include " src / core / client_config / resolver . h " <nl> <nl> / * A client channel is a channel that begins disconnected , and can connect <nl> to some endpoint on demand . If that endpoint disconnects , it will be <nl> extern const grpc_channel_filter grpc_client_channel_filter ; <nl> / * post - construction initializer to let the client channel know which <nl> transport setup it should cancel upon destruction , or initiate when it needs <nl> a connection * / <nl> - void grpc_client_channel_set_transport_setup ( grpc_channel_stack * channel_stack , <nl> - grpc_transport_setup * setup ) ; <nl> + void grpc_client_channel_set_resolver ( grpc_channel_stack * channel_stack , <nl> + grpc_resolver * resolver ) ; <nl> <nl> - / * grpc_transport_setup_callback for binding new transports into a client <nl> - channel - user_data should be the channel stack containing the client <nl> - channel * / <nl> - grpc_transport_setup_result grpc_client_channel_transport_setup_complete ( <nl> - grpc_channel_stack * channel_stack , grpc_transport * transport , <nl> - grpc_channel_filter const * * channel_filters , size_t num_channel_filters , <nl> - grpc_mdctx * mdctx ) ; <nl> - <nl> - # endif / * GRPC_INTERNAL_CORE_CHANNEL_CLIENT_CHANNEL_H * / <nl> + # endif / * GRPC_INTERNAL_CORE_CHANNEL_CLIENT_CHANNEL_H * / <nl> deleted file mode 100644 <nl> index 5be8fa66e99 . . 00000000000 <nl> mmm a / src / core / channel / client_setup . c <nl> ppp / dev / null <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 " src / core / channel / client_setup . h " <nl> - # include " src / core / channel / channel_args . h " <nl> - # include " src / core / channel / channel_stack . h " <nl> - # include " src / core / iomgr / alarm . h " <nl> - # include < grpc / support / alloc . h > <nl> - # include < grpc / support / log . h > <nl> - # include < grpc / support / time . h > <nl> - <nl> - struct grpc_client_setup { <nl> - grpc_transport_setup base ; / * must be first * / <nl> - void ( * initiate ) ( void * user_data , grpc_client_setup_request * request ) ; <nl> - void ( * done ) ( void * user_data ) ; <nl> - void * user_data ; <nl> - grpc_channel_args * args ; <nl> - grpc_mdctx * mdctx ; <nl> - grpc_alarm backoff_alarm ; <nl> - gpr_timespec current_backoff_interval ; <nl> - int in_alarm ; <nl> - int in_cb ; <nl> - int cancelled ; <nl> - <nl> - gpr_mu mu ; <nl> - gpr_cv cv ; <nl> - grpc_client_setup_request * active_request ; <nl> - int refs ; <nl> - / * * The set of pollsets that are currently interested in this <nl> - connection being established * / <nl> - grpc_pollset_set interested_parties ; <nl> - } ; <nl> - <nl> - struct grpc_client_setup_request { <nl> - / * pointer back to the setup object * / <nl> - grpc_client_setup * setup ; <nl> - gpr_timespec deadline ; <nl> - } ; <nl> - <nl> - gpr_timespec grpc_client_setup_request_deadline ( grpc_client_setup_request * r ) { <nl> - return r - > deadline ; <nl> - } <nl> - <nl> - grpc_pollset_set * grpc_client_setup_get_interested_parties ( <nl> - grpc_client_setup_request * r ) { <nl> - return & r - > setup - > interested_parties ; <nl> - } <nl> - <nl> - static void destroy_setup ( grpc_client_setup * s ) { <nl> - gpr_mu_destroy ( & s - > mu ) ; <nl> - gpr_cv_destroy ( & s - > cv ) ; <nl> - s - > done ( s - > user_data ) ; <nl> - grpc_channel_args_destroy ( s - > args ) ; <nl> - grpc_pollset_set_destroy ( & s - > interested_parties ) ; <nl> - gpr_free ( s ) ; <nl> - } <nl> - <nl> - static void destroy_request ( grpc_client_setup_request * r ) { gpr_free ( r ) ; } <nl> - <nl> - / * initiate handshaking * / <nl> - static void setup_initiate ( grpc_transport_setup * sp ) { <nl> - grpc_client_setup * s = ( grpc_client_setup * ) sp ; <nl> - grpc_client_setup_request * r = gpr_malloc ( sizeof ( grpc_client_setup_request ) ) ; <nl> - int in_alarm = 0 ; <nl> - <nl> - r - > setup = s ; <nl> - r - > deadline = gpr_time_add ( gpr_now ( ) , gpr_time_from_seconds ( 60 ) ) ; <nl> - <nl> - gpr_mu_lock ( & s - > mu ) ; <nl> - GPR_ASSERT ( s - > refs > 0 ) ; <nl> - / * there might be more than one request outstanding if the caller calls <nl> - initiate in some kind of rapid - fire way : we try to connect each time , <nl> - and keep track of the latest request ( which is the only one that gets <nl> - to finish ) * / <nl> - if ( ! s - > in_alarm ) { <nl> - s - > active_request = r ; <nl> - s - > refs + + ; <nl> - } else { <nl> - / * TODO ( klempner ) : Maybe do something more clever here * / <nl> - in_alarm = 1 ; <nl> - } <nl> - gpr_mu_unlock ( & s - > mu ) ; <nl> - <nl> - if ( ! in_alarm ) { <nl> - s - > initiate ( s - > user_data , r ) ; <nl> - } else { <nl> - destroy_request ( r ) ; <nl> - } <nl> - } <nl> - <nl> - / * * implementation of add_interested_party for setup vtable * / <nl> - static void setup_add_interested_party ( grpc_transport_setup * sp , <nl> - grpc_pollset * pollset ) { <nl> - grpc_client_setup * s = ( grpc_client_setup * ) sp ; <nl> - <nl> - gpr_mu_lock ( & s - > mu ) ; <nl> - grpc_pollset_set_add_pollset ( & s - > interested_parties , pollset ) ; <nl> - gpr_mu_unlock ( & s - > mu ) ; <nl> - } <nl> - <nl> - / * * implementation of del_interested_party for setup vtable * / <nl> - static void setup_del_interested_party ( grpc_transport_setup * sp , <nl> - grpc_pollset * pollset ) { <nl> - grpc_client_setup * s = ( grpc_client_setup * ) sp ; <nl> - <nl> - gpr_mu_lock ( & s - > mu ) ; <nl> - grpc_pollset_set_del_pollset ( & s - > interested_parties , pollset ) ; <nl> - gpr_mu_unlock ( & s - > mu ) ; <nl> - } <nl> - <nl> - / * cancel handshaking : cancel all requests , and shutdown ( the caller promises <nl> - not to initiate again ) * / <nl> - static void setup_cancel ( grpc_transport_setup * sp ) { <nl> - grpc_client_setup * s = ( grpc_client_setup * ) sp ; <nl> - int cancel_alarm = 0 ; <nl> - <nl> - gpr_mu_lock ( & s - > mu ) ; <nl> - s - > cancelled = 1 ; <nl> - while ( s - > in_cb ) { <nl> - gpr_cv_wait ( & s - > cv , & s - > mu , gpr_inf_future ) ; <nl> - } <nl> - <nl> - GPR_ASSERT ( s - > refs > 0 ) ; <nl> - / * effectively cancels the current request ( if any ) * / <nl> - s - > active_request = NULL ; <nl> - if ( s - > in_alarm ) { <nl> - cancel_alarm = 1 ; <nl> - } <nl> - if ( - - s - > refs = = 0 ) { <nl> - gpr_mu_unlock ( & s - > mu ) ; <nl> - destroy_setup ( s ) ; <nl> - } else { <nl> - gpr_mu_unlock ( & s - > mu ) ; <nl> - } <nl> - if ( cancel_alarm ) { <nl> - grpc_alarm_cancel ( & s - > backoff_alarm ) ; <nl> - } <nl> - } <nl> - <nl> - int grpc_client_setup_cb_begin ( grpc_client_setup_request * r , <nl> - const char * reason ) { <nl> - gpr_mu_lock ( & r - > setup - > mu ) ; <nl> - if ( r - > setup - > cancelled ) { <nl> - gpr_mu_unlock ( & r - > setup - > mu ) ; <nl> - return 0 ; <nl> - } <nl> - r - > setup - > in_cb + + ; <nl> - gpr_mu_unlock ( & r - > setup - > mu ) ; <nl> - return 1 ; <nl> - } <nl> - <nl> - void grpc_client_setup_cb_end ( grpc_client_setup_request * r , <nl> - const char * reason ) { <nl> - gpr_mu_lock ( & r - > setup - > mu ) ; <nl> - r - > setup - > in_cb - - ; <nl> - if ( r - > setup - > cancelled ) gpr_cv_signal ( & r - > setup - > cv ) ; <nl> - gpr_mu_unlock ( & r - > setup - > mu ) ; <nl> - } <nl> - <nl> - / * vtable for transport setup * / <nl> - static const grpc_transport_setup_vtable setup_vtable = { <nl> - setup_initiate , setup_add_interested_party , setup_del_interested_party , <nl> - setup_cancel } ; <nl> - <nl> - void grpc_client_setup_create_and_attach ( <nl> - grpc_channel_stack * newly_minted_channel , const grpc_channel_args * args , <nl> - grpc_mdctx * mdctx , <nl> - void ( * initiate ) ( void * user_data , grpc_client_setup_request * request ) , <nl> - void ( * done ) ( void * user_data ) , void * user_data ) { <nl> - grpc_client_setup * s = gpr_malloc ( sizeof ( grpc_client_setup ) ) ; <nl> - <nl> - s - > base . vtable = & setup_vtable ; <nl> - gpr_mu_init ( & s - > mu ) ; <nl> - gpr_cv_init ( & s - > cv ) ; <nl> - s - > refs = 1 ; <nl> - s - > mdctx = mdctx ; <nl> - s - > initiate = initiate ; <nl> - s - > done = done ; <nl> - s - > user_data = user_data ; <nl> - s - > active_request = NULL ; <nl> - s - > args = grpc_channel_args_copy ( args ) ; <nl> - s - > current_backoff_interval = gpr_time_from_micros ( 1000000 ) ; <nl> - s - > in_alarm = 0 ; <nl> - s - > in_cb = 0 ; <nl> - s - > cancelled = 0 ; <nl> - grpc_pollset_set_init ( & s - > interested_parties ) ; <nl> - <nl> - grpc_client_channel_set_transport_setup ( newly_minted_channel , & s - > base ) ; <nl> - } <nl> - <nl> - int grpc_client_setup_request_should_continue ( grpc_client_setup_request * r , <nl> - const char * reason ) { <nl> - int result ; <nl> - if ( gpr_time_cmp ( gpr_now ( ) , r - > deadline ) > 0 ) { <nl> - result = 0 ; <nl> - } else { <nl> - gpr_mu_lock ( & r - > setup - > mu ) ; <nl> - result = r - > setup - > active_request = = r ; <nl> - gpr_mu_unlock ( & r - > setup - > mu ) ; <nl> - } <nl> - return result ; <nl> - } <nl> - <nl> - static void backoff_alarm_done ( void * arg / * grpc_client_setup_request * / , <nl> - int success ) { <nl> - grpc_client_setup_request * r = arg ; <nl> - grpc_client_setup * s = r - > setup ; <nl> - / * Handle status cancelled ? * / <nl> - gpr_mu_lock ( & s - > mu ) ; <nl> - s - > in_alarm = 0 ; <nl> - if ( s - > active_request ! = NULL | | ! success ) { <nl> - if ( 0 = = - - s - > refs ) { <nl> - gpr_mu_unlock ( & s - > mu ) ; <nl> - destroy_setup ( s ) ; <nl> - destroy_request ( r ) ; <nl> - return ; <nl> - } else { <nl> - gpr_mu_unlock ( & s - > mu ) ; <nl> - destroy_request ( r ) ; <nl> - return ; <nl> - } <nl> - } <nl> - s - > active_request = r ; <nl> - gpr_mu_unlock ( & s - > mu ) ; <nl> - s - > initiate ( s - > user_data , r ) ; <nl> - } <nl> - <nl> - void grpc_client_setup_request_finish ( grpc_client_setup_request * r , <nl> - int was_successful ) { <nl> - int retry = ! was_successful ; <nl> - grpc_client_setup * s = r - > setup ; <nl> - <nl> - gpr_mu_lock ( & s - > mu ) ; <nl> - if ( s - > active_request = = r ) { <nl> - s - > active_request = NULL ; <nl> - } else { <nl> - retry = 0 ; <nl> - } <nl> - <nl> - if ( ! retry & & 0 = = - - s - > refs ) { <nl> - gpr_mu_unlock ( & s - > mu ) ; <nl> - destroy_setup ( s ) ; <nl> - destroy_request ( r ) ; <nl> - } else if ( retry ) { <nl> - / * TODO ( klempner ) : Replace these values with further consideration . 2x is <nl> - probably too aggressive of a backoff . * / <nl> - gpr_timespec max_backoff = gpr_time_from_minutes ( 2 ) ; <nl> - gpr_timespec now = gpr_now ( ) ; <nl> - gpr_timespec deadline = gpr_time_add ( s - > current_backoff_interval , now ) ; <nl> - GPR_ASSERT ( ! s - > in_alarm ) ; <nl> - s - > in_alarm = 1 ; <nl> - grpc_alarm_init ( & s - > backoff_alarm , deadline , backoff_alarm_done , r , now ) ; <nl> - s - > current_backoff_interval = <nl> - gpr_time_add ( s - > current_backoff_interval , s - > current_backoff_interval ) ; <nl> - if ( gpr_time_cmp ( s - > current_backoff_interval , max_backoff ) > 0 ) { <nl> - s - > current_backoff_interval = max_backoff ; <nl> - } <nl> - gpr_mu_unlock ( & s - > mu ) ; <nl> - } else { <nl> - gpr_mu_unlock ( & s - > mu ) ; <nl> - destroy_request ( r ) ; <nl> - } <nl> - } <nl> - <nl> - const grpc_channel_args * grpc_client_setup_get_channel_args ( <nl> - grpc_client_setup_request * r ) { <nl> - return r - > setup - > args ; <nl> - } <nl> - <nl> - grpc_mdctx * grpc_client_setup_get_mdctx ( grpc_client_setup_request * r ) { <nl> - return r - > setup - > mdctx ; <nl> - } <nl> deleted file mode 100644 <nl> index 7d40338840b . . 00000000000 <nl> mmm a / src / core / channel / client_setup . h <nl> ppp / dev / null <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_INTERNAL_CORE_CHANNEL_CLIENT_SETUP_H <nl> - # define GRPC_INTERNAL_CORE_CHANNEL_CLIENT_SETUP_H <nl> - <nl> - # include " src / core / channel / client_channel . h " <nl> - # include " src / core / transport / metadata . h " <nl> - # include < grpc / support / time . h > <nl> - <nl> - / * Convenience API ' s to simplify transport setup * / <nl> - <nl> - typedef struct grpc_client_setup grpc_client_setup ; <nl> - typedef struct grpc_client_setup_request grpc_client_setup_request ; <nl> - <nl> - void grpc_client_setup_create_and_attach ( <nl> - grpc_channel_stack * newly_minted_channel , const grpc_channel_args * args , <nl> - grpc_mdctx * mdctx , <nl> - void ( * initiate ) ( void * user_data , grpc_client_setup_request * request ) , <nl> - void ( * done ) ( void * user_data ) , void * user_data ) ; <nl> - <nl> - / * Check that r is the active request : needs to be performed at each callback . <nl> - If this races , we ' ll have two connection attempts running at once and the <nl> - old one will get cleaned up in due course , which is fine . * / <nl> - int grpc_client_setup_request_should_continue ( grpc_client_setup_request * r , <nl> - const char * reason ) ; <nl> - void grpc_client_setup_request_finish ( grpc_client_setup_request * r , <nl> - int was_successful ) ; <nl> - const grpc_channel_args * grpc_client_setup_get_channel_args ( <nl> - grpc_client_setup_request * r ) ; <nl> - <nl> - / * Call before calling back into the setup listener , and call only if <nl> - this function returns 1 . If it returns 1 , also promise to call <nl> - grpc_client_setup_cb_end * / <nl> - int grpc_client_setup_cb_begin ( grpc_client_setup_request * r , <nl> - const char * reason ) ; <nl> - void grpc_client_setup_cb_end ( grpc_client_setup_request * r , const char * reason ) ; <nl> - <nl> - / * Get the deadline for a request passed in to initiate . Implementations should <nl> - make a best effort to honor this deadline . * / <nl> - gpr_timespec grpc_client_setup_request_deadline ( grpc_client_setup_request * r ) ; <nl> - grpc_pollset_set * grpc_client_setup_get_interested_parties ( <nl> - grpc_client_setup_request * r ) ; <nl> - <nl> - grpc_mdctx * grpc_client_setup_get_mdctx ( grpc_client_setup_request * r ) ; <nl> - <nl> - # endif / * GRPC_INTERNAL_CORE_CHANNEL_CLIENT_SETUP_H * / <nl> mmm a / src / core / channel / connected_channel . c <nl> ppp b / src / core / channel / connected_channel . c <nl> typedef struct connected_channel_call_data { void * unused ; } call_data ; <nl> <nl> / * Intercept a call operation and either push it directly up or translate it <nl> into transport stream operations * / <nl> - static void con_start_transport_op ( grpc_call_element * elem , <nl> - grpc_transport_op * op ) { <nl> + static void con_start_transport_stream_op ( grpc_call_element * elem , <nl> + grpc_transport_stream_op * op ) { <nl> call_data * calld = elem - > call_data ; <nl> channel_data * chand = elem - > channel_data ; <nl> GPR_ASSERT ( elem - > filter = = & grpc_connected_channel_filter ) ; <nl> GRPC_CALL_LOG_OP ( GPR_INFO , elem , op ) ; <nl> <nl> - grpc_transport_perform_op ( chand - > transport , <nl> - TRANSPORT_STREAM_FROM_CALL_DATA ( calld ) , op ) ; <nl> + grpc_transport_perform_stream_op ( chand - > transport , <nl> + TRANSPORT_STREAM_FROM_CALL_DATA ( calld ) , op ) ; <nl> } <nl> <nl> - / * Currently we assume all channel operations should just be pushed up . * / <nl> - static void channel_op ( grpc_channel_element * elem , <nl> - grpc_channel_element * from_elem , grpc_channel_op * op ) { <nl> + static void con_start_transport_op ( grpc_channel_element * elem , <nl> + grpc_transport_op * op ) { <nl> channel_data * chand = elem - > channel_data ; <nl> - GPR_ASSERT ( elem - > filter = = & grpc_connected_channel_filter ) ; <nl> - <nl> - switch ( op - > type ) { <nl> - case GRPC_CHANNEL_GOAWAY : <nl> - grpc_transport_goaway ( chand - > transport , op - > data . goaway . status , <nl> - op - > data . goaway . message ) ; <nl> - break ; <nl> - case GRPC_CHANNEL_DISCONNECT : <nl> - grpc_transport_close ( chand - > transport ) ; <nl> - break ; <nl> - default : <nl> - GPR_ASSERT ( op - > dir = = GRPC_CALL_UP ) ; <nl> - grpc_channel_next_op ( elem , op ) ; <nl> - break ; <nl> - } <nl> + grpc_transport_perform_op ( chand - > transport , op ) ; <nl> } <nl> <nl> / * Constructor for call_data * / <nl> static void init_call_elem ( grpc_call_element * elem , <nl> const void * server_transport_data , <nl> - grpc_transport_op * initial_op ) { <nl> + grpc_transport_stream_op * initial_op ) { <nl> call_data * calld = elem - > call_data ; <nl> channel_data * chand = elem - > channel_data ; <nl> int r ; <nl> static void destroy_call_elem ( grpc_call_element * elem ) { <nl> } <nl> <nl> / * Constructor for channel_data * / <nl> - static void init_channel_elem ( grpc_channel_element * elem , <nl> + static void init_channel_elem ( grpc_channel_element * elem , grpc_channel * master , <nl> const grpc_channel_args * args , grpc_mdctx * mdctx , <nl> int is_first , int is_last ) { <nl> channel_data * cd = ( channel_data * ) elem - > channel_data ; <nl> - GPR_ASSERT ( ! is_first ) ; <nl> GPR_ASSERT ( is_last ) ; <nl> GPR_ASSERT ( elem - > filter = = & grpc_connected_channel_filter ) ; <nl> cd - > transport = NULL ; <nl> static void destroy_channel_elem ( grpc_channel_element * elem ) { <nl> } <nl> <nl> const grpc_channel_filter grpc_connected_channel_filter = { <nl> - con_start_transport_op , channel_op , sizeof ( call_data ) , init_call_elem , <nl> - destroy_call_elem , sizeof ( channel_data ) , init_channel_elem , <nl> - destroy_channel_elem , " connected " , <nl> + con_start_transport_stream_op , <nl> + con_start_transport_op , <nl> + sizeof ( call_data ) , <nl> + init_call_elem , <nl> + destroy_call_elem , <nl> + sizeof ( channel_data ) , <nl> + init_channel_elem , <nl> + destroy_channel_elem , <nl> + " connected " , <nl> } ; <nl> <nl> - / * Transport callback to accept a new stream . . . calls up to handle it * / <nl> - static void accept_stream ( void * user_data , grpc_transport * transport , <nl> - const void * transport_server_data ) { <nl> - grpc_channel_element * elem = user_data ; <nl> - channel_data * chand = elem - > channel_data ; <nl> - grpc_channel_op op ; <nl> - <nl> - GPR_ASSERT ( elem - > filter = = & grpc_connected_channel_filter ) ; <nl> - GPR_ASSERT ( chand - > transport = = transport ) ; <nl> - <nl> - op . type = GRPC_ACCEPT_CALL ; <nl> - op . dir = GRPC_CALL_UP ; <nl> - op . data . accept_call . transport = transport ; <nl> - op . data . accept_call . transport_server_data = transport_server_data ; <nl> - channel_op ( elem , NULL , & op ) ; <nl> - } <nl> - <nl> - static void transport_goaway ( void * user_data , grpc_transport * transport , <nl> - grpc_status_code status , gpr_slice debug ) { <nl> - / * transport got goaway = = > call up and handle it * / <nl> - grpc_channel_element * elem = user_data ; <nl> - channel_data * chand = elem - > channel_data ; <nl> - grpc_channel_op op ; <nl> - <nl> - GPR_ASSERT ( elem - > filter = = & grpc_connected_channel_filter ) ; <nl> - GPR_ASSERT ( chand - > transport = = transport ) ; <nl> - <nl> - op . type = GRPC_TRANSPORT_GOAWAY ; <nl> - op . dir = GRPC_CALL_UP ; <nl> - op . data . goaway . status = status ; <nl> - op . data . goaway . message = debug ; <nl> - channel_op ( elem , NULL , & op ) ; <nl> - } <nl> - <nl> - static void transport_closed ( void * user_data , grpc_transport * transport ) { <nl> - / * transport was closed = = > call up and handle it * / <nl> - grpc_channel_element * elem = user_data ; <nl> - channel_data * chand = elem - > channel_data ; <nl> - grpc_channel_op op ; <nl> - <nl> - GPR_ASSERT ( elem - > filter = = & grpc_connected_channel_filter ) ; <nl> - GPR_ASSERT ( chand - > transport = = transport ) ; <nl> - <nl> - op . type = GRPC_TRANSPORT_CLOSED ; <nl> - op . dir = GRPC_CALL_UP ; <nl> - channel_op ( elem , NULL , & op ) ; <nl> - } <nl> - <nl> - const grpc_transport_callbacks connected_channel_transport_callbacks = { <nl> - accept_stream , transport_goaway , transport_closed , <nl> - } ; <nl> - <nl> - grpc_transport_setup_result grpc_connected_channel_bind_transport ( <nl> - grpc_channel_stack * channel_stack , grpc_transport * transport ) { <nl> + void grpc_connected_channel_bind_transport ( grpc_channel_stack * channel_stack , <nl> + grpc_transport * transport ) { <nl> / * Assumes that the connected channel filter is always the last filter <nl> in a channel stack * / <nl> grpc_channel_element * elem = grpc_channel_stack_last_element ( channel_stack ) ; <nl> channel_data * cd = ( channel_data * ) elem - > channel_data ; <nl> - grpc_transport_setup_result ret ; <nl> GPR_ASSERT ( elem - > filter = = & grpc_connected_channel_filter ) ; <nl> GPR_ASSERT ( cd - > transport = = NULL ) ; <nl> cd - > transport = transport ; <nl> grpc_transport_setup_result grpc_connected_channel_bind_transport ( <nl> the last call element , and the last call element MUST be the connected <nl> channel . * / <nl> channel_stack - > call_stack_size + = grpc_transport_stream_size ( transport ) ; <nl> - <nl> - ret . user_data = elem ; <nl> - ret . callbacks = & connected_channel_transport_callbacks ; <nl> - return ret ; <nl> } <nl> mmm a / src / core / channel / connected_channel . h <nl> ppp b / src / core / channel / connected_channel . h <nl> extern const grpc_channel_filter grpc_connected_channel_filter ; <nl> <nl> / * Post construction fixup : set the transport in the connected channel . <nl> Must be called before any call stack using this filter is used . * / <nl> - grpc_transport_setup_result grpc_connected_channel_bind_transport ( <nl> - grpc_channel_stack * channel_stack , grpc_transport * transport ) ; <nl> + void grpc_connected_channel_bind_transport ( grpc_channel_stack * channel_stack , <nl> + grpc_transport * transport ) ; <nl> <nl> - # endif / * GRPC_INTERNAL_CORE_CHANNEL_CONNECTED_CHANNEL_H * / <nl> + # endif / * GRPC_INTERNAL_CORE_CHANNEL_CONNECTED_CHANNEL_H * / <nl> mmm a / src / core / channel / http_client_filter . c <nl> ppp b / src / core / channel / http_client_filter . c <nl> static void hc_on_recv ( void * user_data , int success ) { <nl> calld - > on_done_recv - > cb ( calld - > on_done_recv - > cb_arg , success ) ; <nl> } <nl> <nl> - static void hc_mutate_op ( grpc_call_element * elem , grpc_transport_op * op ) { <nl> + static void hc_mutate_op ( grpc_call_element * elem , <nl> + grpc_transport_stream_op * op ) { <nl> / * grab pointers to our data from the call element * / <nl> call_data * calld = elem - > call_data ; <nl> channel_data * channeld = elem - > channel_data ; <nl> static void hc_mutate_op ( grpc_call_element * elem , grpc_transport_op * op ) { <nl> } <nl> <nl> static void hc_start_transport_op ( grpc_call_element * elem , <nl> - grpc_transport_op * op ) { <nl> + grpc_transport_stream_op * op ) { <nl> GRPC_CALL_LOG_OP ( GPR_INFO , elem , op ) ; <nl> hc_mutate_op ( elem , op ) ; <nl> grpc_call_next_op ( elem , op ) ; <nl> } <nl> <nl> - / * Called on special channel events , such as disconnection or new incoming <nl> - calls on the server * / <nl> - static void channel_op ( grpc_channel_element * elem , <nl> - grpc_channel_element * from_elem , grpc_channel_op * op ) { <nl> - / * grab pointers to our data from the channel element * / <nl> - channel_data * channeld = elem - > channel_data ; <nl> - <nl> - ignore_unused ( channeld ) ; <nl> - <nl> - switch ( op - > type ) { <nl> - default : <nl> - / * pass control up or down the stack depending on op - > dir * / <nl> - grpc_channel_next_op ( elem , op ) ; <nl> - break ; <nl> - } <nl> - } <nl> - <nl> / * Constructor for call_data * / <nl> static void init_call_elem ( grpc_call_element * elem , <nl> const void * server_transport_data , <nl> - grpc_transport_op * initial_op ) { <nl> + grpc_transport_stream_op * initial_op ) { <nl> call_data * calld = elem - > call_data ; <nl> calld - > sent_initial_metadata = 0 ; <nl> calld - > got_initial_metadata = 0 ; <nl> static const char * scheme_from_args ( const grpc_channel_args * args ) { <nl> } <nl> <nl> / * Constructor for channel_data * / <nl> - static void init_channel_elem ( grpc_channel_element * elem , <nl> + static void init_channel_elem ( grpc_channel_element * elem , grpc_channel * master , <nl> const grpc_channel_args * args , grpc_mdctx * mdctx , <nl> int is_first , int is_last ) { <nl> / * grab pointers to our data from the channel element * / <nl> static void init_channel_elem ( grpc_channel_element * elem , <nl> / * The first and the last filters tend to be implemented differently to <nl> handle the case that there ' s no ' next ' filter to call on the up or down <nl> path * / <nl> - GPR_ASSERT ( ! is_first ) ; <nl> GPR_ASSERT ( ! is_last ) ; <nl> <nl> / * initialize members * / <nl> static void destroy_channel_elem ( grpc_channel_element * elem ) { <nl> } <nl> <nl> const grpc_channel_filter grpc_http_client_filter = { <nl> - hc_start_transport_op , channel_op , sizeof ( call_data ) , init_call_elem , <nl> - destroy_call_elem , sizeof ( channel_data ) , init_channel_elem , <nl> - destroy_channel_elem , " http - client " } ; <nl> + hc_start_transport_op , grpc_channel_next_op , sizeof ( call_data ) , <nl> + init_call_elem , destroy_call_elem , sizeof ( channel_data ) , <nl> + init_channel_elem , destroy_channel_elem , " http - client " } ; <nl> mmm a / src / core / channel / http_server_filter . c <nl> ppp b / src / core / channel / http_server_filter . c <nl> typedef struct channel_data { <nl> grpc_mdctx * mdctx ; <nl> } channel_data ; <nl> <nl> - / * used to silence ' variable not used ' warnings * / <nl> - static void ignore_unused ( void * ignored ) { } <nl> - <nl> static grpc_mdelem * server_filter ( void * user_data , grpc_mdelem * md ) { <nl> grpc_call_element * elem = user_data ; <nl> channel_data * channeld = elem - > channel_data ; <nl> static void hs_on_recv ( void * user_data , int success ) { <nl> calld - > on_done_recv - > cb ( calld - > on_done_recv - > cb_arg , success ) ; <nl> } <nl> <nl> - static void hs_mutate_op ( grpc_call_element * elem , grpc_transport_op * op ) { <nl> + static void hs_mutate_op ( grpc_call_element * elem , <nl> + grpc_transport_stream_op * op ) { <nl> / * grab pointers to our data from the call element * / <nl> call_data * calld = elem - > call_data ; <nl> channel_data * channeld = elem - > channel_data ; <nl> static void hs_mutate_op ( grpc_call_element * elem , grpc_transport_op * op ) { <nl> } <nl> <nl> static void hs_start_transport_op ( grpc_call_element * elem , <nl> - grpc_transport_op * op ) { <nl> + grpc_transport_stream_op * op ) { <nl> GRPC_CALL_LOG_OP ( GPR_INFO , elem , op ) ; <nl> hs_mutate_op ( elem , op ) ; <nl> grpc_call_next_op ( elem , op ) ; <nl> } <nl> <nl> - / * Called on special channel events , such as disconnection or new incoming <nl> - calls on the server * / <nl> - static void channel_op ( grpc_channel_element * elem , <nl> - grpc_channel_element * from_elem , grpc_channel_op * op ) { <nl> - / * grab pointers to our data from the channel element * / <nl> - channel_data * channeld = elem - > channel_data ; <nl> - <nl> - ignore_unused ( channeld ) ; <nl> - <nl> - switch ( op - > type ) { <nl> - default : <nl> - / * pass control up or down the stack depending on op - > dir * / <nl> - grpc_channel_next_op ( elem , op ) ; <nl> - break ; <nl> - } <nl> - } <nl> - <nl> / * Constructor for call_data * / <nl> static void init_call_elem ( grpc_call_element * elem , <nl> const void * server_transport_data , <nl> - grpc_transport_op * initial_op ) { <nl> + grpc_transport_stream_op * initial_op ) { <nl> / * grab pointers to our data from the call element * / <nl> call_data * calld = elem - > call_data ; <nl> / * initialize members * / <nl> static void init_call_elem ( grpc_call_element * elem , <nl> static void destroy_call_elem ( grpc_call_element * elem ) { } <nl> <nl> / * Constructor for channel_data * / <nl> - static void init_channel_elem ( grpc_channel_element * elem , <nl> + static void init_channel_elem ( grpc_channel_element * elem , grpc_channel * master , <nl> const grpc_channel_args * args , grpc_mdctx * mdctx , <nl> int is_first , int is_last ) { <nl> / * grab pointers to our data from the channel element * / <nl> static void destroy_channel_elem ( grpc_channel_element * elem ) { <nl> } <nl> <nl> const grpc_channel_filter grpc_http_server_filter = { <nl> - hs_start_transport_op , channel_op , sizeof ( call_data ) , init_call_elem , <nl> - destroy_call_elem , sizeof ( channel_data ) , init_channel_elem , <nl> - destroy_channel_elem , " http - server " } ; <nl> + hs_start_transport_op , grpc_channel_next_op , sizeof ( call_data ) , <nl> + init_call_elem , destroy_call_elem , sizeof ( channel_data ) , <nl> + init_channel_elem , destroy_channel_elem , " http - server " } ; <nl> mmm a / src / core / channel / noop_filter . c <nl> ppp b / src / core / channel / noop_filter . c <nl> typedef struct channel_data { <nl> / * used to silence ' variable not used ' warnings * / <nl> static void ignore_unused ( void * ignored ) { } <nl> <nl> - static void noop_mutate_op ( grpc_call_element * elem , grpc_transport_op * op ) { <nl> + static void noop_mutate_op ( grpc_call_element * elem , <nl> + grpc_transport_stream_op * op ) { <nl> / * grab pointers to our data from the call element * / <nl> call_data * calld = elem - > call_data ; <nl> channel_data * channeld = elem - > channel_data ; <nl> static void noop_mutate_op ( grpc_call_element * elem , grpc_transport_op * op ) { <nl> - a network event ( or similar ) from below , to receive something <nl> op contains type and call direction information , in addition to the data <nl> that is being sent or received . * / <nl> - static void noop_start_transport_op ( grpc_call_element * elem , <nl> - grpc_transport_op * op ) { <nl> + static void noop_start_transport_stream_op ( grpc_call_element * elem , <nl> + grpc_transport_stream_op * op ) { <nl> noop_mutate_op ( elem , op ) ; <nl> <nl> / * pass control down the stack * / <nl> grpc_call_next_op ( elem , op ) ; <nl> } <nl> <nl> - / * Called on special channel events , such as disconnection or new incoming <nl> - calls on the server * / <nl> - static void channel_op ( grpc_channel_element * elem , <nl> - grpc_channel_element * from_elem , grpc_channel_op * op ) { <nl> - / * grab pointers to our data from the channel element * / <nl> - channel_data * channeld = elem - > channel_data ; <nl> - <nl> - ignore_unused ( channeld ) ; <nl> - <nl> - switch ( op - > type ) { <nl> - default : <nl> - / * pass control up or down the stack depending on op - > dir * / <nl> - grpc_channel_next_op ( elem , op ) ; <nl> - break ; <nl> - } <nl> - } <nl> - <nl> / * Constructor for call_data * / <nl> static void init_call_elem ( grpc_call_element * elem , <nl> const void * server_transport_data , <nl> - grpc_transport_op * initial_op ) { <nl> + grpc_transport_stream_op * initial_op ) { <nl> / * grab pointers to our data from the call element * / <nl> call_data * calld = elem - > call_data ; <nl> channel_data * channeld = elem - > channel_data ; <nl> static void destroy_call_elem ( grpc_call_element * elem ) { <nl> } <nl> <nl> / * Constructor for channel_data * / <nl> - static void init_channel_elem ( grpc_channel_element * elem , <nl> + static void init_channel_elem ( grpc_channel_element * elem , grpc_channel * master , <nl> const grpc_channel_args * args , grpc_mdctx * mdctx , <nl> int is_first , int is_last ) { <nl> / * grab pointers to our data from the channel element * / <nl> static void destroy_channel_elem ( grpc_channel_element * elem ) { <nl> ignore_unused ( channeld ) ; <nl> } <nl> <nl> - const grpc_channel_filter grpc_no_op_filter = { <nl> - noop_start_transport_op , channel_op , sizeof ( call_data ) , init_call_elem , <nl> - destroy_call_elem , sizeof ( channel_data ) , init_channel_elem , <nl> - destroy_channel_elem , " no - op " } ; <nl> + const grpc_channel_filter grpc_no_op_filter = { noop_start_transport_stream_op , <nl> + grpc_channel_next_op , <nl> + sizeof ( call_data ) , <nl> + init_call_elem , <nl> + destroy_call_elem , <nl> + sizeof ( channel_data ) , <nl> + init_channel_elem , <nl> + destroy_channel_elem , <nl> + " no - op " } ; <nl> new file mode 100644 <nl> index 00000000000 . . d7aed272233 <nl> mmm / dev / null <nl> ppp b / src / core / client_config / README . md <nl> <nl> + Client Configuration Support for GRPC <nl> + = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + <nl> + This library provides high level configuration machinery to construct client <nl> + channels and load balance between them . <nl> + <nl> + Each grpc_channel is created with a grpc_resolver . It is the resolver ' s duty <nl> + to resolve a name into configuration data for the channel . Such configuration <nl> + data might include : <nl> + <nl> + - a list of ( ip , port ) addresses to connect to <nl> + - a load balancing policy to decide which server to send a request to <nl> + - a set of filters to mutate outgoing requests ( say , by adding metadata ) <nl> + <nl> + The resolver provides this data as a stream of grpc_client_config objects to <nl> + the channel . We represent configuration as a stream so that it can be changed <nl> + by the resolver during execution , by reacting to external events ( such as a <nl> + new configuration file being pushed to some store ) . <nl> + <nl> + <nl> + Load Balancing <nl> + mmmmmmmmmmmm - - <nl> + <nl> + Load balancing configuration is provided by a grpc_lb_policy object , stored as <nl> + part of grpc_client_config . <nl> + <nl> + A load balancing policies primary job is to pick a target server given only the <nl> + initial metadata for a request . It does this by providing a grpc_subchannel <nl> + object to the owning channel . <nl> + <nl> + <nl> + Sub - Channels <nl> + mmmmmmmmmmmm <nl> + <nl> + A sub - channel provides a connection to a server for a client channel . It has a <nl> + connectivity state like a regular channel , and so can be connected or <nl> + disconnected . This connectivity state can be used to inform load balancing <nl> + decisions ( for example , by avoiding disconnected backends ) . <nl> + <nl> + Configured sub - channels are fully setup to participate in the grpc data plane . <nl> + Their behavior is specified by a set of grpc channel filters defined at their <nl> + construction . To customize this behavior , resolvers build grpc_subchannel_factory <nl> + objects , which use the decorator pattern to customize construction arguments for <nl> + concrete grpc_subchannel instances . <nl> + <nl> + <nl> + Naming for GRPC <nl> + = = = = = = = = = = = = = = = <nl> + <nl> + Names in GRPC are represented by a URI . <nl> + <nl> + The following schemes are currently supported : <nl> + <nl> + dns : / / / host : port - dns schemes are currently supported so long as authority is <nl> + empty ( authority based dns resolution is expected in a future <nl> + release ) <nl> + <nl> + unix : path - the unix scheme is used to create and connect to unix domain <nl> + sockets - the authority must be empty , and the path represents <nl> + the absolute or relative path to the desired socket <nl> new file mode 100644 <nl> index 00000000000 . . 44538241485 <nl> mmm / dev / null <nl> ppp b / src / core / client_config / client_config . 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 " src / core / client_config / client_config . h " <nl> + <nl> + # include < string . h > <nl> + <nl> + # include < grpc / support / alloc . h > <nl> + <nl> + struct grpc_client_config { <nl> + gpr_refcount refs ; <nl> + grpc_lb_policy * lb_policy ; <nl> + } ; <nl> + <nl> + grpc_client_config * grpc_client_config_create ( ) { <nl> + grpc_client_config * c = gpr_malloc ( sizeof ( * c ) ) ; <nl> + memset ( c , 0 , sizeof ( * c ) ) ; <nl> + gpr_ref_init ( & c - > refs , 1 ) ; <nl> + return c ; <nl> + } <nl> + <nl> + void grpc_client_config_ref ( grpc_client_config * c ) { gpr_ref ( & c - > refs ) ; } <nl> + <nl> + void grpc_client_config_unref ( grpc_client_config * c ) { <nl> + if ( gpr_unref ( & c - > refs ) ) { <nl> + GRPC_LB_POLICY_UNREF ( c - > lb_policy , " client_config " ) ; <nl> + gpr_free ( c ) ; <nl> + } <nl> + } <nl> + <nl> + void grpc_client_config_set_lb_policy ( grpc_client_config * c , <nl> + grpc_lb_policy * lb_policy ) { <nl> + if ( lb_policy ) { <nl> + GRPC_LB_POLICY_REF ( lb_policy , " client_config " ) ; <nl> + } <nl> + if ( c - > lb_policy ) { <nl> + GRPC_LB_POLICY_UNREF ( c - > lb_policy , " client_config " ) ; <nl> + } <nl> + c - > lb_policy = lb_policy ; <nl> + } <nl> + <nl> + grpc_lb_policy * grpc_client_config_get_lb_policy ( grpc_client_config * c ) { <nl> + return c - > lb_policy ; <nl> + } <nl> new file mode 100644 <nl> index 00000000000 . . 47612da42cf <nl> mmm / dev / null <nl> ppp b / src / core / client_config / client_config . 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_INTERNAL_CORE_CLIENT_CONFIG_CLIENT_CONFIG_H <nl> + # define GRPC_INTERNAL_CORE_CLIENT_CONFIG_CLIENT_CONFIG_H <nl> + <nl> + # include " src / core / client_config / lb_policy . h " <nl> + <nl> + / * * Total configuration for a client . Provided , and updated , by <nl> + grpc_resolver * / <nl> + typedef struct grpc_client_config grpc_client_config ; <nl> + <nl> + grpc_client_config * grpc_client_config_create ( ) ; <nl> + void grpc_client_config_ref ( grpc_client_config * client_config ) ; <nl> + void grpc_client_config_unref ( grpc_client_config * client_config ) ; <nl> + <nl> + void grpc_client_config_set_lb_policy ( grpc_client_config * client_config , <nl> + grpc_lb_policy * lb_policy ) ; <nl> + grpc_lb_policy * grpc_client_config_get_lb_policy ( <nl> + grpc_client_config * client_config ) ; <nl> + <nl> + # endif / * GRPC_INTERNAL_CORE_CLIENT_CONFIG_CLIENT_CONFIG_H * / <nl> new file mode 100644 <nl> index 00000000000 . . a8cd5fc1490 <nl> mmm / dev / null <nl> ppp b / src / core / client_config / connector . 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 " src / core / client_config / connector . h " <nl> + <nl> + void grpc_connector_ref ( grpc_connector * connector ) { <nl> + connector - > vtable - > ref ( connector ) ; <nl> + } <nl> + <nl> + void grpc_connector_unref ( grpc_connector * connector ) { <nl> + connector - > vtable - > unref ( connector ) ; <nl> + } <nl> + <nl> + void grpc_connector_connect ( grpc_connector * connector , <nl> + const grpc_connect_in_args * in_args , <nl> + grpc_connect_out_args * out_args , <nl> + grpc_iomgr_closure * notify ) { <nl> + connector - > vtable - > connect ( connector , in_args , out_args , notify ) ; <nl> + } <nl> new file mode 100644 <nl> index 00000000000 . . edcb10a36ec <nl> mmm / dev / null <nl> ppp b / src / core / client_config / connector . 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_INTERNAL_CORE_CLIENT_CONFIG_CONNECTOR_H <nl> + # define GRPC_INTERNAL_CORE_CLIENT_CONFIG_CONNECTOR_H <nl> + <nl> + # include " src / core / channel / channel_stack . h " <nl> + # include " src / core / iomgr / sockaddr . h " <nl> + # include " src / core / transport / transport . h " <nl> + <nl> + typedef struct grpc_connector grpc_connector ; <nl> + typedef struct grpc_connector_vtable grpc_connector_vtable ; <nl> + <nl> + struct grpc_connector { <nl> + const grpc_connector_vtable * vtable ; <nl> + } ; <nl> + <nl> + typedef struct { <nl> + / * * set of pollsets interested in this connection * / <nl> + grpc_pollset_set * interested_parties ; <nl> + / * * address to connect to * / <nl> + const struct sockaddr * addr ; <nl> + int addr_len ; <nl> + / * * deadline for connection * / <nl> + gpr_timespec deadline ; <nl> + / * * channel arguments ( to be passed to transport ) * / <nl> + const grpc_channel_args * channel_args ; <nl> + / * * metadata context * / <nl> + grpc_mdctx * metadata_context ; <nl> + } grpc_connect_in_args ; <nl> + <nl> + typedef struct { <nl> + / * * the connected transport * / <nl> + grpc_transport * transport ; <nl> + / * * any additional filters ( owned by the caller of connect ) * / <nl> + const grpc_channel_filter * * filters ; <nl> + size_t num_filters ; <nl> + } grpc_connect_out_args ; <nl> + <nl> + struct grpc_connector_vtable { <nl> + void ( * ref ) ( grpc_connector * connector ) ; <nl> + void ( * unref ) ( grpc_connector * connector ) ; <nl> + void ( * connect ) ( grpc_connector * connector , <nl> + const grpc_connect_in_args * in_args , <nl> + grpc_connect_out_args * out_args , grpc_iomgr_closure * notify ) ; <nl> + } ; <nl> + <nl> + void grpc_connector_ref ( grpc_connector * connector ) ; <nl> + void grpc_connector_unref ( grpc_connector * connector ) ; <nl> + void grpc_connector_connect ( grpc_connector * connector , <nl> + const grpc_connect_in_args * in_args , <nl> + grpc_connect_out_args * out_args , <nl> + grpc_iomgr_closure * notify ) ; <nl> + <nl> + # endif <nl> new file mode 100644 <nl> index 00000000000 . . 73da624aff7 <nl> mmm / dev / null <nl> ppp b / src / core / client_config / lb_policies / pick_first . 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 " src / core / client_config / lb_policies / pick_first . h " <nl> + <nl> + # include < string . h > <nl> + <nl> + # include < grpc / support / alloc . h > <nl> + # include " src / core / transport / connectivity_state . h " <nl> + <nl> + typedef struct pending_pick { <nl> + struct pending_pick * next ; <nl> + grpc_pollset * pollset ; <nl> + grpc_subchannel * * target ; <nl> + grpc_iomgr_closure * on_complete ; <nl> + } pending_pick ; <nl> + <nl> + typedef struct { <nl> + / * * base policy : must be first * / <nl> + grpc_lb_policy base ; <nl> + / * * all our subchannels * / <nl> + grpc_subchannel * * subchannels ; <nl> + size_t num_subchannels ; <nl> + <nl> + grpc_iomgr_closure connectivity_changed ; <nl> + <nl> + / * * mutex protecting remaining members * / <nl> + gpr_mu mu ; <nl> + / * * the selected channel <nl> + TODO ( ctiller ) : this should be atomically set so we don ' t <nl> + need to take a mutex in the common case * / <nl> + grpc_subchannel * selected ; <nl> + / * * have we started picking ? * / <nl> + int started_picking ; <nl> + / * * which subchannel are we watching ? * / <nl> + size_t checking_subchannel ; <nl> + / * * what is the connectivity of that channel ? * / <nl> + grpc_connectivity_state checking_connectivity ; <nl> + / * * list of picks that are waiting on connectivity * / <nl> + pending_pick * pending_picks ; <nl> + <nl> + / * * our connectivity state tracker * / <nl> + grpc_connectivity_state_tracker state_tracker ; <nl> + } pick_first_lb_policy ; <nl> + <nl> + void pf_destroy ( grpc_lb_policy * pol ) { <nl> + pick_first_lb_policy * p = ( pick_first_lb_policy * ) pol ; <nl> + size_t i ; <nl> + for ( i = 0 ; i < p - > num_subchannels ; i + + ) { <nl> + GRPC_SUBCHANNEL_UNREF ( p - > subchannels [ i ] , " pick_first " ) ; <nl> + } <nl> + gpr_free ( p - > subchannels ) ; <nl> + gpr_mu_destroy ( & p - > mu ) ; <nl> + gpr_free ( p ) ; <nl> + } <nl> + <nl> + void pf_shutdown ( grpc_lb_policy * pol ) { <nl> + pick_first_lb_policy * p = ( pick_first_lb_policy * ) pol ; <nl> + pending_pick * pp ; <nl> + gpr_mu_lock ( & p - > mu ) ; <nl> + while ( ( pp = p - > pending_picks ) ) { <nl> + p - > pending_picks = pp - > next ; <nl> + * pp - > target = NULL ; <nl> + grpc_iomgr_add_delayed_callback ( pp - > on_complete , 0 ) ; <nl> + gpr_free ( pp ) ; <nl> + } <nl> + gpr_mu_unlock ( & p - > mu ) ; <nl> + } <nl> + <nl> + void pf_pick ( grpc_lb_policy * pol , grpc_pollset * pollset , <nl> + grpc_metadata_batch * initial_metadata , grpc_subchannel * * target , <nl> + grpc_iomgr_closure * on_complete ) { <nl> + pick_first_lb_policy * p = ( pick_first_lb_policy * ) pol ; <nl> + pending_pick * pp ; <nl> + gpr_mu_lock ( & p - > mu ) ; <nl> + if ( p - > selected ) { <nl> + gpr_mu_unlock ( & p - > mu ) ; <nl> + * target = p - > selected ; <nl> + on_complete - > cb ( on_complete - > cb_arg , 1 ) ; <nl> + } else { <nl> + if ( ! p - > started_picking ) { <nl> + p - > started_picking = 1 ; <nl> + p - > checking_subchannel = 0 ; <nl> + p - > checking_connectivity = GRPC_CHANNEL_IDLE ; <nl> + GRPC_LB_POLICY_REF ( pol , " pick_first_connectivity " ) ; <nl> + grpc_subchannel_notify_on_state_change ( <nl> + p - > subchannels [ p - > checking_subchannel ] , & p - > checking_connectivity , <nl> + & p - > connectivity_changed ) ; <nl> + } <nl> + grpc_subchannel_add_interested_party ( p - > subchannels [ p - > checking_subchannel ] , <nl> + pollset ) ; <nl> + pp = gpr_malloc ( sizeof ( * pp ) ) ; <nl> + pp - > next = p - > pending_picks ; <nl> + pp - > pollset = pollset ; <nl> + pp - > target = target ; <nl> + pp - > on_complete = on_complete ; <nl> + p - > pending_picks = pp ; <nl> + gpr_mu_unlock ( & p - > mu ) ; <nl> + } <nl> + } <nl> + <nl> + static void del_interested_parties_locked ( pick_first_lb_policy * p ) { <nl> + pending_pick * pp ; <nl> + for ( pp = p - > pending_picks ; pp ; pp = pp - > next ) { <nl> + grpc_subchannel_del_interested_party ( p - > subchannels [ p - > checking_subchannel ] , <nl> + pp - > pollset ) ; <nl> + } <nl> + } <nl> + <nl> + static void add_interested_parties_locked ( pick_first_lb_policy * p ) { <nl> + pending_pick * pp ; <nl> + for ( pp = p - > pending_picks ; pp ; pp = pp - > next ) { <nl> + grpc_subchannel_add_interested_party ( p - > subchannels [ p - > checking_subchannel ] , <nl> + pp - > pollset ) ; <nl> + } <nl> + } <nl> + <nl> + static void pf_connectivity_changed ( void * arg , int iomgr_success ) { <nl> + pick_first_lb_policy * p = arg ; <nl> + pending_pick * pp ; <nl> + int unref = 0 ; <nl> + <nl> + gpr_mu_lock ( & p - > mu ) ; <nl> + loop : <nl> + switch ( p - > checking_connectivity ) { <nl> + case GRPC_CHANNEL_READY : <nl> + p - > selected = p - > subchannels [ p - > checking_subchannel ] ; <nl> + while ( ( pp = p - > pending_picks ) ) { <nl> + p - > pending_picks = pp - > next ; <nl> + * pp - > target = p - > selected ; <nl> + grpc_subchannel_del_interested_party ( p - > selected , pp - > pollset ) ; <nl> + grpc_iomgr_add_delayed_callback ( pp - > on_complete , 1 ) ; <nl> + gpr_free ( pp ) ; <nl> + } <nl> + unref = 1 ; <nl> + break ; <nl> + case GRPC_CHANNEL_TRANSIENT_FAILURE : <nl> + del_interested_parties_locked ( p ) ; <nl> + p - > checking_subchannel = <nl> + ( p - > checking_subchannel + 1 ) % p - > num_subchannels ; <nl> + p - > checking_connectivity = grpc_subchannel_check_connectivity ( <nl> + p - > subchannels [ p - > checking_subchannel ] ) ; <nl> + add_interested_parties_locked ( p ) ; <nl> + goto loop ; <nl> + case GRPC_CHANNEL_CONNECTING : <nl> + case GRPC_CHANNEL_IDLE : <nl> + grpc_subchannel_notify_on_state_change ( <nl> + p - > subchannels [ p - > checking_subchannel ] , & p - > checking_connectivity , <nl> + & p - > connectivity_changed ) ; <nl> + break ; <nl> + case GRPC_CHANNEL_FATAL_FAILURE : <nl> + del_interested_parties_locked ( p ) ; <nl> + GPR_SWAP ( grpc_subchannel * , p - > subchannels [ p - > checking_subchannel ] , <nl> + p - > subchannels [ p - > num_subchannels - 1 ] ) ; <nl> + p - > num_subchannels - - ; <nl> + GRPC_SUBCHANNEL_UNREF ( p - > subchannels [ p - > num_subchannels ] , " pick_first " ) ; <nl> + if ( p - > num_subchannels = = 0 ) { <nl> + while ( ( pp = p - > pending_picks ) ) { <nl> + p - > pending_picks = pp - > next ; <nl> + * pp - > target = NULL ; <nl> + grpc_iomgr_add_delayed_callback ( pp - > on_complete , 1 ) ; <nl> + gpr_free ( pp ) ; <nl> + } <nl> + unref = 1 ; <nl> + } else { <nl> + p - > checking_subchannel % = p - > num_subchannels ; <nl> + p - > checking_connectivity = grpc_subchannel_check_connectivity ( <nl> + p - > subchannels [ p - > checking_subchannel ] ) ; <nl> + add_interested_parties_locked ( p ) ; <nl> + goto loop ; <nl> + } <nl> + } <nl> + gpr_mu_unlock ( & p - > mu ) ; <nl> + <nl> + if ( unref ) { <nl> + GRPC_LB_POLICY_UNREF ( & p - > base , " pick_first_connectivity " ) ; <nl> + } <nl> + } <nl> + <nl> + static void pf_broadcast ( grpc_lb_policy * pol , grpc_transport_op * op ) { <nl> + pick_first_lb_policy * p = ( pick_first_lb_policy * ) pol ; <nl> + size_t i ; <nl> + size_t n ; <nl> + grpc_subchannel * * subchannels ; <nl> + <nl> + gpr_mu_lock ( & p - > mu ) ; <nl> + n = p - > num_subchannels ; <nl> + subchannels = gpr_malloc ( n * sizeof ( * subchannels ) ) ; <nl> + for ( i = 0 ; i < n ; i + + ) { <nl> + subchannels [ i ] = p - > subchannels [ i ] ; <nl> + GRPC_SUBCHANNEL_REF ( subchannels [ i ] , " pf_broadcast " ) ; <nl> + } <nl> + gpr_mu_unlock ( & p - > mu ) ; <nl> + <nl> + for ( i = 0 ; i < n ; i + + ) { <nl> + grpc_subchannel_process_transport_op ( subchannels [ i ] , op ) ; <nl> + GRPC_SUBCHANNEL_UNREF ( subchannels [ i ] , " pf_broadcast " ) ; <nl> + } <nl> + gpr_free ( subchannels ) ; <nl> + } <nl> + <nl> + static grpc_connectivity_state pf_check_connectivity ( grpc_lb_policy * pol ) { <nl> + pick_first_lb_policy * p = ( pick_first_lb_policy * ) pol ; <nl> + grpc_connectivity_state st ; <nl> + gpr_mu_lock ( & p - > mu ) ; <nl> + st = grpc_connectivity_state_check ( & p - > state_tracker ) ; <nl> + gpr_mu_unlock ( & p - > mu ) ; <nl> + return st ; <nl> + } <nl> + <nl> + static void pf_notify_on_state_change ( grpc_lb_policy * pol , <nl> + grpc_connectivity_state * current , <nl> + grpc_iomgr_closure * notify ) { <nl> + pick_first_lb_policy * p = ( pick_first_lb_policy * ) pol ; <nl> + gpr_mu_lock ( & p - > mu ) ; <nl> + grpc_connectivity_state_notify_on_state_change ( & p - > state_tracker , current , <nl> + notify ) ; <nl> + gpr_mu_unlock ( & p - > mu ) ; <nl> + } <nl> + <nl> + static const grpc_lb_policy_vtable pick_first_lb_policy_vtable = { <nl> + pf_destroy , pf_shutdown , pf_pick , <nl> + pf_broadcast , pf_check_connectivity , pf_notify_on_state_change } ; <nl> + <nl> + grpc_lb_policy * grpc_create_pick_first_lb_policy ( grpc_subchannel * * subchannels , <nl> + size_t num_subchannels ) { <nl> + pick_first_lb_policy * p = gpr_malloc ( sizeof ( * p ) ) ; <nl> + GPR_ASSERT ( num_subchannels ) ; <nl> + memset ( p , 0 , sizeof ( * p ) ) ; <nl> + grpc_lb_policy_init ( & p - > base , & pick_first_lb_policy_vtable ) ; <nl> + p - > subchannels = gpr_malloc ( sizeof ( grpc_subchannel * ) * num_subchannels ) ; <nl> + p - > num_subchannels = num_subchannels ; <nl> + memcpy ( p - > subchannels , subchannels , <nl> + sizeof ( grpc_subchannel * ) * num_subchannels ) ; <nl> + grpc_iomgr_closure_init ( & p - > connectivity_changed , pf_connectivity_changed , p ) ; <nl> + gpr_mu_init ( & p - > mu ) ; <nl> + return & p - > base ; <nl> + } <nl> similarity index 83 % <nl> rename from src / core / surface / client . h <nl> rename to src / core / client_config / lb_policies / pick_first . h <nl> mmm a / src / core / surface / client . h <nl> ppp b / src / core / client_config / lb_policies / pick_first . h <nl> <nl> * <nl> * / <nl> <nl> - # ifndef GRPC_INTERNAL_CORE_SURFACE_CLIENT_H <nl> - # define GRPC_INTERNAL_CORE_SURFACE_CLIENT_H <nl> + # ifndef GRPC_INTERNAL_CORE_CLIENT_CONFIG_PICK_FIRST_H <nl> + # define GRPC_INTERNAL_CORE_CLIENT_CONFIG_PICK_FIRST_H <nl> <nl> - # include " src / core / channel / channel_stack . h " <nl> + # include " src / core / client_config / lb_policy . h " <nl> <nl> - extern const grpc_channel_filter grpc_client_surface_filter ; <nl> + grpc_lb_policy * grpc_create_pick_first_lb_policy ( grpc_subchannel * * subchannels , <nl> + size_t num_subchannels ) ; <nl> <nl> - # endif / * GRPC_INTERNAL_CORE_SURFACE_CLIENT_H * / <nl> + # endif <nl> new file mode 100644 <nl> index 00000000000 . . 6d1c788742b <nl> mmm / dev / null <nl> ppp b / src / core / client_config / lb_policy . 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 " src / core / client_config / lb_policy . h " <nl> + <nl> + void grpc_lb_policy_init ( grpc_lb_policy * policy , <nl> + const grpc_lb_policy_vtable * vtable ) { <nl> + policy - > vtable = vtable ; <nl> + gpr_ref_init ( & policy - > refs , 1 ) ; <nl> + } <nl> + <nl> + # ifdef GRPC_LB_POLICY_REFCOUNT_DEBUG <nl> + void grpc_lb_policy_ref ( grpc_lb_policy * policy , const char * file , int line , <nl> + const char * reason ) { <nl> + gpr_log ( file , line , GPR_LOG_SEVERITY_DEBUG , " LB_POLICY : % p ref % d - > % d % s " , <nl> + policy , ( int ) policy - > refs . count , ( int ) policy - > refs . count + 1 , reason ) ; <nl> + # else <nl> + void grpc_lb_policy_ref ( grpc_lb_policy * policy ) { <nl> + # endif <nl> + gpr_ref ( & policy - > refs ) ; <nl> + } <nl> + <nl> + # ifdef GRPC_LB_POLICY_REFCOUNT_DEBUG <nl> + void grpc_lb_policy_unref ( grpc_lb_policy * policy , const char * file , int line , <nl> + const char * reason ) { <nl> + gpr_log ( file , line , GPR_LOG_SEVERITY_DEBUG , " LB_POLICY : % p unref % d - > % d % s " , <nl> + policy , ( int ) policy - > refs . count , ( int ) policy - > refs . count - 1 , reason ) ; <nl> + # else <nl> + void grpc_lb_policy_unref ( grpc_lb_policy * policy ) { <nl> + # endif <nl> + if ( gpr_unref ( & policy - > refs ) ) { <nl> + policy - > vtable - > destroy ( policy ) ; <nl> + } <nl> + } <nl> + <nl> + void grpc_lb_policy_shutdown ( grpc_lb_policy * policy ) { <nl> + policy - > vtable - > shutdown ( policy ) ; <nl> + } <nl> + <nl> + void grpc_lb_policy_pick ( grpc_lb_policy * policy , grpc_pollset * pollset , <nl> + grpc_metadata_batch * initial_metadata , <nl> + grpc_subchannel * * target , <nl> + grpc_iomgr_closure * on_complete ) { <nl> + policy - > vtable - > pick ( policy , pollset , initial_metadata , target , on_complete ) ; <nl> + } <nl> + <nl> + void grpc_lb_policy_broadcast ( grpc_lb_policy * policy , grpc_transport_op * op ) { <nl> + policy - > vtable - > broadcast ( policy , op ) ; <nl> + } <nl> new file mode 100644 <nl> index 00000000000 . . a468f761cc9 <nl> mmm / dev / null <nl> ppp b / src / core / client_config / lb_policy . 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_INTERNAL_CORE_CLIENT_CONFIG_LB_POLICY_H <nl> + # define GRPC_INTERNAL_CORE_CLIENT_CONFIG_LB_POLICY_H <nl> + <nl> + # include " src / core / client_config / subchannel . h " <nl> + <nl> + / * * A load balancing policy : specified by a vtable and a struct ( which <nl> + is expected to be extended to contain some parameters ) * / <nl> + typedef struct grpc_lb_policy grpc_lb_policy ; <nl> + typedef struct grpc_lb_policy_vtable grpc_lb_policy_vtable ; <nl> + <nl> + typedef void ( * grpc_lb_completion ) ( void * cb_arg , grpc_subchannel * subchannel , <nl> + grpc_status_code status , const char * errmsg ) ; <nl> + <nl> + struct grpc_lb_policy { <nl> + const grpc_lb_policy_vtable * vtable ; <nl> + gpr_refcount refs ; <nl> + } ; <nl> + <nl> + struct grpc_lb_policy_vtable { <nl> + void ( * destroy ) ( grpc_lb_policy * policy ) ; <nl> + <nl> + void ( * shutdown ) ( grpc_lb_policy * policy ) ; <nl> + <nl> + / * * implement grpc_lb_policy_pick * / <nl> + void ( * pick ) ( grpc_lb_policy * policy , grpc_pollset * pollset , <nl> + grpc_metadata_batch * initial_metadata , grpc_subchannel * * target , <nl> + grpc_iomgr_closure * on_complete ) ; <nl> + <nl> + / * * broadcast a transport op to all subchannels * / <nl> + void ( * broadcast ) ( grpc_lb_policy * policy , grpc_transport_op * op ) ; <nl> + <nl> + / * * check the current connectivity of the lb_policy * / <nl> + grpc_connectivity_state ( * check_connectivity ) ( grpc_lb_policy * policy ) ; <nl> + <nl> + / * * call notify when the connectivity state of a channel changes from * state . <nl> + Updates * state with the new state of the policy * / <nl> + void ( * notify_on_state_change ) ( grpc_lb_policy * policy , <nl> + grpc_connectivity_state * state , <nl> + grpc_iomgr_closure * closure ) ; <nl> + } ; <nl> + <nl> + # ifdef GRPC_LB_POLICY_REFCOUNT_DEBUG <nl> + # define GRPC_LB_POLICY_REF ( p , r ) \ <nl> + grpc_lb_policy_ref ( ( p ) , __FILE__ , __LINE__ , ( r ) ) <nl> + # define GRPC_LB_POLICY_UNREF ( p , r ) \ <nl> + grpc_lb_policy_unref ( ( p ) , __FILE__ , __LINE__ , ( r ) ) <nl> + void grpc_lb_policy_ref ( grpc_lb_policy * policy , const char * file , int line , <nl> + const char * reason ) ; <nl> + void grpc_lb_policy_unref ( grpc_lb_policy * policy , const char * file , int line , <nl> + const char * reason ) ; <nl> + # else <nl> + # define GRPC_LB_POLICY_REF ( p , r ) grpc_lb_policy_ref ( ( p ) ) <nl> + # define GRPC_LB_POLICY_UNREF ( p , r ) grpc_lb_policy_unref ( ( p ) ) <nl> + void grpc_lb_policy_ref ( grpc_lb_policy * policy ) ; <nl> + void grpc_lb_policy_unref ( grpc_lb_policy * policy ) ; <nl> + # endif <nl> + <nl> + / * * called by concrete implementations to initialize the base struct * / <nl> + void grpc_lb_policy_init ( grpc_lb_policy * policy , <nl> + const grpc_lb_policy_vtable * vtable ) ; <nl> + <nl> + / * * Start shutting down ( fail any pending picks ) * / <nl> + void grpc_lb_policy_shutdown ( grpc_lb_policy * policy ) ; <nl> + <nl> + / * * Given initial metadata in \ a initial_metadata , find an appropriate <nl> + target for this rpc , and ' return ' it by calling \ a on_complete after setting <nl> + \ a target . <nl> + Picking can be asynchronous . Any IO should be done under \ a pollset . * / <nl> + void grpc_lb_policy_pick ( grpc_lb_policy * policy , grpc_pollset * pollset , <nl> + grpc_metadata_batch * initial_metadata , <nl> + grpc_subchannel * * target , <nl> + grpc_iomgr_closure * on_complete ) ; <nl> + <nl> + void grpc_lb_policy_broadcast ( grpc_lb_policy * policy , grpc_transport_op * op ) ; <nl> + <nl> + # endif / * GRPC_INTERNAL_CORE_CONFIG_LB_POLICY_H * / <nl> new file mode 100644 <nl> index 00000000000 . . 91e42bb6844 <nl> mmm / dev / null <nl> ppp b / src / core / client_config / resolver . 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 " src / core / client_config / resolver . h " <nl> + <nl> + void grpc_resolver_init ( grpc_resolver * resolver , <nl> + const grpc_resolver_vtable * vtable ) { <nl> + resolver - > vtable = vtable ; <nl> + gpr_ref_init ( & resolver - > refs , 1 ) ; <nl> + } <nl> + <nl> + # ifdef GRPC_RESOLVER_REFCOUNT_DEBUG <nl> + void grpc_resolver_ref ( grpc_resolver * resolver , const char * file , int line , <nl> + const char * reason ) { <nl> + gpr_log ( file , line , GPR_LOG_SEVERITY_DEBUG , " RESOLVER : % p ref % d - > % d % s " , <nl> + resolver , ( int ) resolver - > refs . count , ( int ) resolver - > refs . count + 1 , <nl> + reason ) ; <nl> + # else <nl> + void grpc_resolver_ref ( grpc_resolver * resolver ) { <nl> + # endif <nl> + gpr_ref ( & resolver - > refs ) ; <nl> + } <nl> + <nl> + # ifdef GRPC_RESOLVER_REFCOUNT_DEBUG <nl> + void grpc_resolver_unref ( grpc_resolver * resolver , const char * file , int line , <nl> + const char * reason ) { <nl> + gpr_log ( file , line , GPR_LOG_SEVERITY_DEBUG , " RESOLVER : % p unref % d - > % d % s " , <nl> + resolver , ( int ) resolver - > refs . count , ( int ) resolver - > refs . count - 1 , <nl> + reason ) ; <nl> + # else <nl> + void grpc_resolver_unref ( grpc_resolver * resolver ) { <nl> + # endif <nl> + if ( gpr_unref ( & resolver - > refs ) ) { <nl> + resolver - > vtable - > destroy ( resolver ) ; <nl> + } <nl> + } <nl> + <nl> + void grpc_resolver_shutdown ( grpc_resolver * resolver ) { <nl> + resolver - > vtable - > shutdown ( resolver ) ; <nl> + } <nl> + <nl> + void grpc_resolver_channel_saw_error ( grpc_resolver * resolver , <nl> + struct sockaddr * failing_address , <nl> + int failing_address_len ) { <nl> + resolver - > vtable - > channel_saw_error ( resolver , failing_address , <nl> + failing_address_len ) ; <nl> + } <nl> + <nl> + void grpc_resolver_next ( grpc_resolver * resolver , <nl> + grpc_client_config * * target_config , <nl> + grpc_iomgr_closure * on_complete ) { <nl> + resolver - > vtable - > next ( resolver , target_config , on_complete ) ; <nl> + } <nl> new file mode 100644 <nl> index 00000000000 . . 8ad87d789b5 <nl> mmm / dev / null <nl> ppp b / src / core / client_config / resolver . 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_INTERNAL_CORE_CLIENT_CONFIG_RESOLVER_H <nl> + # define GRPC_INTERNAL_CORE_CLIENT_CONFIG_RESOLVER_H <nl> + <nl> + # include " src / core / client_config / client_config . h " <nl> + # include " src / core / iomgr / iomgr . h " <nl> + # include " src / core / iomgr / sockaddr . h " <nl> + <nl> + typedef struct grpc_resolver grpc_resolver ; <nl> + typedef struct grpc_resolver_vtable grpc_resolver_vtable ; <nl> + <nl> + / * * grpc_resolver provides grpc_client_config objects to grpc_channel <nl> + objects * / <nl> + struct grpc_resolver { <nl> + const grpc_resolver_vtable * vtable ; <nl> + gpr_refcount refs ; <nl> + } ; <nl> + <nl> + struct grpc_resolver_vtable { <nl> + void ( * destroy ) ( grpc_resolver * resolver ) ; <nl> + void ( * shutdown ) ( grpc_resolver * resolver ) ; <nl> + void ( * channel_saw_error ) ( grpc_resolver * resolver , <nl> + struct sockaddr * failing_address , <nl> + int failing_address_len ) ; <nl> + void ( * next ) ( grpc_resolver * resolver , grpc_client_config * * target_config , <nl> + grpc_iomgr_closure * on_complete ) ; <nl> + } ; <nl> + <nl> + # ifdef GRPC_RESOLVER_REFCOUNT_DEBUG <nl> + # define GRPC_RESOLVER_REF ( p , r ) grpc_resolver_ref ( ( p ) , __FILE__ , __LINE__ , ( r ) ) <nl> + # define GRPC_RESOLVER_UNREF ( p , r ) \ <nl> + grpc_resolver_unref ( ( p ) , __FILE__ , __LINE__ , ( r ) ) <nl> + void grpc_resolver_ref ( grpc_resolver * policy , const char * file , int line , <nl> + const char * reason ) ; <nl> + void grpc_resolver_unref ( grpc_resolver * policy , const char * file , int line , <nl> + const char * reason ) ; <nl> + # else <nl> + # define GRPC_RESOLVER_REF ( p , r ) grpc_resolver_ref ( ( p ) ) <nl> + # define GRPC_RESOLVER_UNREF ( p , r ) grpc_resolver_unref ( ( p ) ) <nl> + void grpc_resolver_ref ( grpc_resolver * policy ) ; <nl> + void grpc_resolver_unref ( grpc_resolver * policy ) ; <nl> + # endif <nl> + <nl> + void grpc_resolver_init ( grpc_resolver * resolver , <nl> + const grpc_resolver_vtable * vtable ) ; <nl> + <nl> + void grpc_resolver_shutdown ( grpc_resolver * resolver ) ; <nl> + <nl> + / * * Notification that the channel has seen an error on some address . <nl> + Can be used as a hint that re - resolution is desirable soon . * / <nl> + void grpc_resolver_channel_saw_error ( grpc_resolver * resolver , <nl> + struct sockaddr * failing_address , <nl> + int failing_address_len ) ; <nl> + <nl> + / * * Get the next client config . Called by the channel to fetch a new <nl> + configuration . Expected to set * target_config with a new configuration , <nl> + and then schedule on_complete for execution . <nl> + <nl> + If resolution is fatally broken , set * target_config to NULL and <nl> + schedule on_complete . * / <nl> + void grpc_resolver_next ( grpc_resolver * resolver , <nl> + grpc_client_config * * target_config , <nl> + grpc_iomgr_closure * on_complete ) ; <nl> + <nl> + # endif / * GRPC_INTERNAL_CORE_CONFIG_RESOLVER_H * / <nl> new file mode 100644 <nl> index 00000000000 . . 6721977e21a <nl> mmm / dev / null <nl> ppp b / src / core / client_config / resolver_factory . 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 " src / core / client_config / resolver_factory . h " <nl> + <nl> + void grpc_resolver_factory_ref ( grpc_resolver_factory * factory ) { <nl> + factory - > vtable - > ref ( factory ) ; <nl> + } <nl> + <nl> + void grpc_resolver_factory_unref ( grpc_resolver_factory * factory ) { <nl> + factory - > vtable - > unref ( factory ) ; <nl> + } <nl> + <nl> + / * * Create a resolver instance for a name * / <nl> + grpc_resolver * grpc_resolver_factory_create_resolver ( <nl> + grpc_resolver_factory * factory , grpc_uri * uri , <nl> + grpc_subchannel_factory * subchannel_factory ) { <nl> + if ( ! factory ) return NULL ; <nl> + return factory - > vtable - > create_resolver ( factory , uri , subchannel_factory ) ; <nl> + } <nl> new file mode 100644 <nl> index 00000000000 . . c5d85499c6e <nl> mmm / dev / null <nl> ppp b / src / core / client_config / resolver_factory . 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_INTERNAL_CORE_CLIENT_CONFIG_RESOLVER_FACTORY_H <nl> + # define GRPC_INTERNAL_CORE_CLIENT_CONFIG_RESOLVER_FACTORY_H <nl> + <nl> + # include " src / core / client_config / resolver . h " <nl> + # include " src / core / client_config / subchannel_factory . h " <nl> + # include " src / core / client_config / uri_parser . h " <nl> + <nl> + typedef struct grpc_resolver_factory grpc_resolver_factory ; <nl> + typedef struct grpc_resolver_factory_vtable grpc_resolver_factory_vtable ; <nl> + <nl> + / * * grpc_resolver provides grpc_client_config objects to grpc_channel <nl> + objects * / <nl> + struct grpc_resolver_factory { <nl> + const grpc_resolver_factory_vtable * vtable ; <nl> + } ; <nl> + <nl> + struct grpc_resolver_factory_vtable { <nl> + void ( * ref ) ( grpc_resolver_factory * factory ) ; <nl> + void ( * unref ) ( grpc_resolver_factory * factory ) ; <nl> + <nl> + grpc_resolver * ( * create_resolver ) ( <nl> + grpc_resolver_factory * factory , grpc_uri * uri , <nl> + grpc_subchannel_factory * subchannel_factory ) ; <nl> + } ; <nl> + <nl> + void grpc_resolver_factory_ref ( grpc_resolver_factory * resolver ) ; <nl> + void grpc_resolver_factory_unref ( grpc_resolver_factory * resolver ) ; <nl> + <nl> + / * * Create a resolver instance for a name * / <nl> + grpc_resolver * grpc_resolver_factory_create_resolver ( <nl> + grpc_resolver_factory * factory , grpc_uri * uri , <nl> + grpc_subchannel_factory * subchannel_factory ) ; <nl> + <nl> + # endif / * GRPC_INTERNAL_CORE_CONFIG_RESOLVER_FACTORY_H * / <nl> new file mode 100644 <nl> index 00000000000 . . 16be2da9940 <nl> mmm / dev / null <nl> ppp b / src / core / client_config / resolver_registry . 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 " src / core / client_config / resolver_registry . h " <nl> + <nl> + # include < string . h > <nl> + <nl> + # include < grpc / support / alloc . h > <nl> + # include < grpc / support / log . h > <nl> + # include < grpc / support / string_util . h > <nl> + <nl> + # define MAX_RESOLVERS 10 <nl> + <nl> + typedef struct { <nl> + char * scheme ; <nl> + grpc_resolver_factory * factory ; <nl> + } registered_resolver ; <nl> + <nl> + static registered_resolver g_all_of_the_resolvers [ MAX_RESOLVERS ] ; <nl> + static int g_number_of_resolvers = 0 ; <nl> + <nl> + static char * g_default_resolver_scheme ; <nl> + <nl> + void grpc_resolver_registry_init ( const char * default_resolver_scheme ) { <nl> + g_number_of_resolvers = 0 ; <nl> + g_default_resolver_scheme = gpr_strdup ( default_resolver_scheme ) ; <nl> + } <nl> + <nl> + void grpc_resolver_registry_shutdown ( void ) { <nl> + int i ; <nl> + for ( i = 0 ; i < g_number_of_resolvers ; i + + ) { <nl> + gpr_free ( g_all_of_the_resolvers [ i ] . scheme ) ; <nl> + grpc_resolver_factory_unref ( g_all_of_the_resolvers [ i ] . factory ) ; <nl> + } <nl> + gpr_free ( g_default_resolver_scheme ) ; <nl> + } <nl> + <nl> + void grpc_register_resolver_type ( const char * scheme , <nl> + grpc_resolver_factory * factory ) { <nl> + int i ; <nl> + for ( i = 0 ; i < g_number_of_resolvers ; i + + ) { <nl> + GPR_ASSERT ( 0 ! = strcmp ( scheme , g_all_of_the_resolvers [ i ] . scheme ) ) ; <nl> + } <nl> + GPR_ASSERT ( g_number_of_resolvers ! = MAX_RESOLVERS ) ; <nl> + g_all_of_the_resolvers [ g_number_of_resolvers ] . scheme = gpr_strdup ( scheme ) ; <nl> + grpc_resolver_factory_ref ( factory ) ; <nl> + g_all_of_the_resolvers [ g_number_of_resolvers ] . factory = factory ; <nl> + g_number_of_resolvers + + ; <nl> + } <nl> + <nl> + static grpc_resolver_factory * lookup_factory ( grpc_uri * uri ) { <nl> + int i ; <nl> + <nl> + / * handling NULL uri ' s here simplifies grpc_resolver_create * / <nl> + if ( ! uri ) return NULL ; <nl> + <nl> + for ( i = 0 ; i < g_number_of_resolvers ; i + + ) { <nl> + if ( 0 = = strcmp ( uri - > scheme , g_all_of_the_resolvers [ i ] . scheme ) ) { <nl> + return g_all_of_the_resolvers [ i ] . factory ; <nl> + } <nl> + } <nl> + <nl> + return NULL ; <nl> + } <nl> + <nl> + grpc_resolver * grpc_resolver_create ( <nl> + const char * name , grpc_subchannel_factory * subchannel_factory ) { <nl> + grpc_uri * uri ; <nl> + char * tmp ; <nl> + grpc_resolver_factory * factory = NULL ; <nl> + grpc_resolver * resolver ; <nl> + <nl> + uri = grpc_uri_parse ( name , 1 ) ; <nl> + factory = lookup_factory ( uri ) ; <nl> + if ( factory = = NULL & & g_default_resolver_scheme ! = NULL ) { <nl> + grpc_uri_destroy ( uri ) ; <nl> + gpr_asprintf ( & tmp , " % s % s " , g_default_resolver_scheme , name ) ; <nl> + uri = grpc_uri_parse ( tmp , 1 ) ; <nl> + factory = lookup_factory ( uri ) ; <nl> + if ( factory = = NULL ) { <nl> + grpc_uri_destroy ( grpc_uri_parse ( name , 0 ) ) ; <nl> + grpc_uri_destroy ( grpc_uri_parse ( tmp , 0 ) ) ; <nl> + gpr_log ( GPR_ERROR , " don ' t know how to resolve ' % s ' or ' % s ' " , name , tmp ) ; <nl> + } <nl> + gpr_free ( tmp ) ; <nl> + } else if ( factory = = NULL ) { <nl> + grpc_uri_destroy ( grpc_uri_parse ( name , 0 ) ) ; <nl> + gpr_log ( GPR_ERROR , " don ' t know how to resolve ' % s ' " , name ) ; <nl> + } <nl> + resolver = <nl> + grpc_resolver_factory_create_resolver ( factory , uri , subchannel_factory ) ; <nl> + grpc_uri_destroy ( uri ) ; <nl> + return resolver ; <nl> + } <nl> new file mode 100644 <nl> index 00000000000 . . 31aa47620ab <nl> mmm / dev / null <nl> ppp b / src / core / client_config / resolver_registry . 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_INTERNAL_CORE_CLIENT_CONFIG_RESOLVER_REGISTRY_H <nl> + # define GRPC_INTERNAL_CORE_CLIENT_CONFIG_RESOLVER_REGISTRY_H <nl> + <nl> + # include " src / core / client_config / resolver_factory . h " <nl> + <nl> + void grpc_resolver_registry_init ( const char * default_prefix ) ; <nl> + void grpc_resolver_registry_shutdown ( void ) ; <nl> + <nl> + / * * Register a resolver type . <nl> + URI ' s of \ a scheme will be resolved with the given resolver . <nl> + If \ a priority is greater than zero , then the resolver will be eligible <nl> + to resolve names that are passed in with no scheme . Higher priority <nl> + resolvers will be tried before lower priority schemes . * / <nl> + void grpc_register_resolver_type ( const char * scheme , <nl> + grpc_resolver_factory * factory ) ; <nl> + <nl> + / * * Create a resolver given \ a name . <nl> + First tries to parse \ a name as a URI . If this succeeds , tries <nl> + to locate a registered resolver factory based on the URI scheme . <nl> + If parsing or location fails , prefixes default_prefix from <nl> + grpc_resolver_registry_init to name , and tries again ( if default_prefix <nl> + was not NULL ) . <nl> + If a resolver factory was found , use it to instantiate a resolver and <nl> + return it . <nl> + If a resolver factory was not found , return NULL . * / <nl> + grpc_resolver * grpc_resolver_create ( <nl> + const char * name , grpc_subchannel_factory * subchannel_factory ) ; <nl> + <nl> + # endif / * GRPC_INTERNAL_CORE_CLIENT_CONFIG_RESOLVER_REGISTRY_H * / <nl> new file mode 100644 <nl> index 00000000000 . . ac401bc4d35 <nl> mmm / dev / null <nl> ppp b / src / core / client_config / resolvers / dns_resolver . 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 " src / core / client_config / resolvers / dns_resolver . h " <nl> + <nl> + # include < string . h > <nl> + <nl> + # include < grpc / support / alloc . h > <nl> + # include < grpc / support / string_util . h > <nl> + <nl> + # include " src / core / client_config / lb_policies / pick_first . h " <nl> + # include " src / core / iomgr / resolve_address . h " <nl> + # include " src / core / support / string . h " <nl> + <nl> + typedef struct { <nl> + / * * base class : must be first * / <nl> + grpc_resolver base ; <nl> + / * * refcount * / <nl> + gpr_refcount refs ; <nl> + / * * name to resolve * / <nl> + char * name ; <nl> + / * * default port to use * / <nl> + char * default_port ; <nl> + / * * subchannel factory * / <nl> + grpc_subchannel_factory * subchannel_factory ; <nl> + / * * load balancing policy factory * / <nl> + grpc_lb_policy * ( * lb_policy_factory ) ( grpc_subchannel * * subchannels , <nl> + size_t num_subchannels ) ; <nl> + <nl> + / * * mutex guarding the rest of the state * / <nl> + gpr_mu mu ; <nl> + / * * are we currently resolving ? * / <nl> + int resolving ; <nl> + / * * which version of resolved_config have we published ? * / <nl> + int published_version ; <nl> + / * * which version of resolved_config is current ? * / <nl> + int resolved_version ; <nl> + / * * pending next completion , or NULL * / <nl> + grpc_iomgr_closure * next_completion ; <nl> + / * * target config address for next completion * / <nl> + grpc_client_config * * target_config ; <nl> + / * * current ( fully resolved ) config * / <nl> + grpc_client_config * resolved_config ; <nl> + } dns_resolver ; <nl> + <nl> + static void dns_destroy ( grpc_resolver * r ) ; <nl> + <nl> + static void dns_start_resolving_locked ( dns_resolver * r ) ; <nl> + static void dns_maybe_finish_next_locked ( dns_resolver * r ) ; <nl> + <nl> + static void dns_shutdown ( grpc_resolver * r ) ; <nl> + static void dns_channel_saw_error ( grpc_resolver * r , <nl> + struct sockaddr * failing_address , <nl> + int failing_address_len ) ; <nl> + static void dns_next ( grpc_resolver * r , grpc_client_config * * target_config , <nl> + grpc_iomgr_closure * on_complete ) ; <nl> + <nl> + static const grpc_resolver_vtable dns_resolver_vtable = { <nl> + dns_destroy , dns_shutdown , dns_channel_saw_error , dns_next } ; <nl> + <nl> + static void dns_shutdown ( grpc_resolver * resolver ) { <nl> + dns_resolver * r = ( dns_resolver * ) resolver ; <nl> + gpr_mu_lock ( & r - > mu ) ; <nl> + if ( r - > next_completion ! = NULL ) { <nl> + * r - > target_config = NULL ; <nl> + grpc_iomgr_add_callback ( r - > next_completion ) ; <nl> + r - > next_completion = NULL ; <nl> + } <nl> + gpr_mu_unlock ( & r - > mu ) ; <nl> + } <nl> + <nl> + static void dns_channel_saw_error ( grpc_resolver * resolver , struct sockaddr * sa , <nl> + int len ) { <nl> + dns_resolver * r = ( dns_resolver * ) resolver ; <nl> + gpr_mu_lock ( & r - > mu ) ; <nl> + if ( ! r - > resolving ) { <nl> + dns_start_resolving_locked ( r ) ; <nl> + } <nl> + gpr_mu_unlock ( & r - > mu ) ; <nl> + } <nl> + <nl> + static void dns_next ( grpc_resolver * resolver , <nl> + grpc_client_config * * target_config , <nl> + grpc_iomgr_closure * on_complete ) { <nl> + dns_resolver * r = ( dns_resolver * ) resolver ; <nl> + gpr_mu_lock ( & r - > mu ) ; <nl> + GPR_ASSERT ( ! r - > next_completion ) ; <nl> + r - > next_completion = on_complete ; <nl> + r - > target_config = target_config ; <nl> + if ( r - > resolved_version = = 0 & & ! r - > resolving ) { <nl> + dns_start_resolving_locked ( r ) ; <nl> + } else { <nl> + dns_maybe_finish_next_locked ( r ) ; <nl> + } <nl> + gpr_mu_unlock ( & r - > mu ) ; <nl> + } <nl> + <nl> + static void dns_on_resolved ( void * arg , grpc_resolved_addresses * addresses ) { <nl> + dns_resolver * r = arg ; <nl> + grpc_client_config * config = NULL ; <nl> + grpc_subchannel * * subchannels ; <nl> + grpc_subchannel_args args ; <nl> + grpc_lb_policy * lb_policy ; <nl> + size_t i ; <nl> + if ( addresses ) { <nl> + config = grpc_client_config_create ( ) ; <nl> + subchannels = gpr_malloc ( sizeof ( grpc_subchannel * ) * addresses - > naddrs ) ; <nl> + for ( i = 0 ; i < addresses - > naddrs ; i + + ) { <nl> + memset ( & args , 0 , sizeof ( args ) ) ; <nl> + args . addr = ( struct sockaddr * ) ( addresses - > addrs [ i ] . addr ) ; <nl> + args . addr_len = addresses - > addrs [ i ] . len ; <nl> + subchannels [ i ] = grpc_subchannel_factory_create_subchannel ( <nl> + r - > subchannel_factory , & args ) ; <nl> + } <nl> + lb_policy = r - > lb_policy_factory ( subchannels , addresses - > naddrs ) ; <nl> + grpc_client_config_set_lb_policy ( config , lb_policy ) ; <nl> + GRPC_LB_POLICY_UNREF ( lb_policy , " construction " ) ; <nl> + grpc_resolved_addresses_destroy ( addresses ) ; <nl> + gpr_free ( subchannels ) ; <nl> + } <nl> + gpr_mu_lock ( & r - > mu ) ; <nl> + GPR_ASSERT ( r - > resolving ) ; <nl> + r - > resolving = 0 ; <nl> + if ( r - > resolved_config ) { <nl> + grpc_client_config_unref ( r - > resolved_config ) ; <nl> + } <nl> + r - > resolved_config = config ; <nl> + r - > resolved_version + + ; <nl> + dns_maybe_finish_next_locked ( r ) ; <nl> + gpr_mu_unlock ( & r - > mu ) ; <nl> + <nl> + GRPC_RESOLVER_UNREF ( & r - > base , " dns - resolving " ) ; <nl> + } <nl> + <nl> + static void dns_start_resolving_locked ( dns_resolver * r ) { <nl> + GRPC_RESOLVER_REF ( & r - > base , " dns - resolving " ) ; <nl> + GPR_ASSERT ( ! r - > resolving ) ; <nl> + r - > resolving = 1 ; <nl> + grpc_resolve_address ( r - > name , r - > default_port , dns_on_resolved , r ) ; <nl> + } <nl> + <nl> + static void dns_maybe_finish_next_locked ( dns_resolver * r ) { <nl> + if ( r - > next_completion ! = NULL & & <nl> + r - > resolved_version ! = r - > published_version ) { <nl> + * r - > target_config = r - > resolved_config ; <nl> + if ( r - > resolved_config ) { <nl> + grpc_client_config_ref ( r - > resolved_config ) ; <nl> + } <nl> + grpc_iomgr_add_callback ( r - > next_completion ) ; <nl> + r - > next_completion = NULL ; <nl> + r - > published_version = r - > resolved_version ; <nl> + } <nl> + } <nl> + <nl> + static void dns_destroy ( grpc_resolver * gr ) { <nl> + dns_resolver * r = ( dns_resolver * ) gr ; <nl> + gpr_mu_destroy ( & r - > mu ) ; <nl> + if ( r - > resolved_config ) { <nl> + grpc_client_config_unref ( r - > resolved_config ) ; <nl> + } <nl> + grpc_subchannel_factory_unref ( r - > subchannel_factory ) ; <nl> + gpr_free ( r - > name ) ; <nl> + gpr_free ( r - > default_port ) ; <nl> + gpr_free ( r ) ; <nl> + } <nl> + <nl> + static grpc_resolver * dns_create ( <nl> + grpc_uri * uri , const char * default_port , <nl> + grpc_lb_policy * ( * lb_policy_factory ) ( grpc_subchannel * * subchannels , <nl> + size_t num_subchannels ) , <nl> + grpc_subchannel_factory * subchannel_factory ) { <nl> + dns_resolver * r ; <nl> + const char * path = uri - > path ; <nl> + <nl> + if ( 0 ! = strcmp ( uri - > authority , " " ) ) { <nl> + gpr_log ( GPR_ERROR , " authority based uri ' s not supported " ) ; <nl> + return NULL ; <nl> + } <nl> + <nl> + if ( path [ 0 ] = = ' / ' ) + + path ; <nl> + <nl> + r = gpr_malloc ( sizeof ( dns_resolver ) ) ; <nl> + memset ( r , 0 , sizeof ( * r ) ) ; <nl> + gpr_ref_init ( & r - > refs , 1 ) ; <nl> + gpr_mu_init ( & r - > mu ) ; <nl> + grpc_resolver_init ( & r - > base , & dns_resolver_vtable ) ; <nl> + r - > name = gpr_strdup ( path ) ; <nl> + r - > default_port = gpr_strdup ( default_port ) ; <nl> + r - > subchannel_factory = subchannel_factory ; <nl> + r - > lb_policy_factory = lb_policy_factory ; <nl> + grpc_subchannel_factory_ref ( subchannel_factory ) ; <nl> + return & r - > base ; <nl> + } <nl> + <nl> + / * <nl> + * FACTORY <nl> + * / <nl> + <nl> + static void dns_factory_ref ( grpc_resolver_factory * factory ) { } <nl> + <nl> + static void dns_factory_unref ( grpc_resolver_factory * factory ) { } <nl> + <nl> + static grpc_resolver * dns_factory_create_resolver ( <nl> + grpc_resolver_factory * factory , grpc_uri * uri , <nl> + grpc_subchannel_factory * subchannel_factory ) { <nl> + return dns_create ( uri , " https " , grpc_create_pick_first_lb_policy , <nl> + subchannel_factory ) ; <nl> + } <nl> + <nl> + static const grpc_resolver_factory_vtable dns_factory_vtable = { <nl> + dns_factory_ref , dns_factory_unref , dns_factory_create_resolver } ; <nl> + static grpc_resolver_factory dns_resolver_factory = { & dns_factory_vtable } ; <nl> + <nl> + grpc_resolver_factory * grpc_dns_resolver_factory_create ( ) { <nl> + return & dns_resolver_factory ; <nl> + } <nl> new file mode 100644 <nl> index 00000000000 . . a3ef3161a63 <nl> mmm / dev / null <nl> ppp b / src / core / client_config / resolvers / dns_resolver . 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_INTERNAL_CORE_CLIENT_CONFIG_RESOLVERS_DNS_RESOLVER_H <nl> + # define GRPC_INTERNAL_CORE_CLIENT_CONFIG_RESOLVERS_DNS_RESOLVER_H <nl> + <nl> + # include " src / core / client_config / resolver_factory . h " <nl> + <nl> + / * * Create a dns resolver factory * / <nl> + grpc_resolver_factory * grpc_dns_resolver_factory_create ( void ) ; <nl> + <nl> + # endif / * GRPC_INTERNAL_CORE_CLIENT_CONFIG_RESOLVERS_DNS_RESOLVER_H * / <nl> new file mode 100644 <nl> index 00000000000 . . be515d26897 <nl> mmm / dev / null <nl> ppp b / src / core / client_config / resolvers / unix_resolver_posix . 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 < grpc / support / port_platform . h > <nl> + # ifdef GPR_POSIX_SOCKET <nl> + <nl> + # include " src / core / client_config / resolvers / unix_resolver_posix . h " <nl> + <nl> + # include < string . h > <nl> + # include < sys / un . h > <nl> + <nl> + # include < grpc / support / alloc . h > <nl> + # include < grpc / support / string_util . h > <nl> + <nl> + # include " src / core / client_config / lb_policies / pick_first . h " <nl> + # include " src / core / iomgr / resolve_address . h " <nl> + # include " src / core / support / string . h " <nl> + <nl> + typedef struct { <nl> + / * * base class : must be first * / <nl> + grpc_resolver base ; <nl> + / * * refcount * / <nl> + gpr_refcount refs ; <nl> + / * * subchannel factory * / <nl> + grpc_subchannel_factory * subchannel_factory ; <nl> + / * * load balancing policy factory * / <nl> + grpc_lb_policy * ( * lb_policy_factory ) ( grpc_subchannel * * subchannels , <nl> + size_t num_subchannels ) ; <nl> + <nl> + / * * the address that we ' ve ' resolved ' * / <nl> + struct sockaddr_un addr ; <nl> + int addr_len ; <nl> + <nl> + / * * mutex guarding the rest of the state * / <nl> + gpr_mu mu ; <nl> + / * * have we published ? * / <nl> + int published ; <nl> + / * * pending next completion , or NULL * / <nl> + grpc_iomgr_closure * next_completion ; <nl> + / * * target config address for next completion * / <nl> + grpc_client_config * * target_config ; <nl> + } unix_resolver ; <nl> + <nl> + static void unix_destroy ( grpc_resolver * r ) ; <nl> + <nl> + static void unix_maybe_finish_next_locked ( unix_resolver * r ) ; <nl> + <nl> + static void unix_shutdown ( grpc_resolver * r ) ; <nl> + static void unix_channel_saw_error ( grpc_resolver * r , <nl> + struct sockaddr * failing_address , <nl> + int failing_address_len ) ; <nl> + static void unix_next ( grpc_resolver * r , grpc_client_config * * target_config , <nl> + grpc_iomgr_closure * on_complete ) ; <nl> + <nl> + static const grpc_resolver_vtable unix_resolver_vtable = { <nl> + unix_destroy , unix_shutdown , unix_channel_saw_error , unix_next } ; <nl> + <nl> + static void unix_shutdown ( grpc_resolver * resolver ) { <nl> + unix_resolver * r = ( unix_resolver * ) resolver ; <nl> + gpr_mu_lock ( & r - > mu ) ; <nl> + if ( r - > next_completion ! = NULL ) { <nl> + * r - > target_config = NULL ; <nl> + / * TODO ( ctiller ) : add delayed callback * / <nl> + grpc_iomgr_add_callback ( r - > next_completion ) ; <nl> + r - > next_completion = NULL ; <nl> + } <nl> + gpr_mu_unlock ( & r - > mu ) ; <nl> + } <nl> + <nl> + static void unix_channel_saw_error ( grpc_resolver * resolver , struct sockaddr * sa , <nl> + int len ) { } <nl> + <nl> + static void unix_next ( grpc_resolver * resolver , <nl> + grpc_client_config * * target_config , <nl> + grpc_iomgr_closure * on_complete ) { <nl> + unix_resolver * r = ( unix_resolver * ) resolver ; <nl> + gpr_mu_lock ( & r - > mu ) ; <nl> + GPR_ASSERT ( ! r - > next_completion ) ; <nl> + r - > next_completion = on_complete ; <nl> + r - > target_config = target_config ; <nl> + unix_maybe_finish_next_locked ( r ) ; <nl> + gpr_mu_unlock ( & r - > mu ) ; <nl> + } <nl> + <nl> + static void unix_maybe_finish_next_locked ( unix_resolver * r ) { <nl> + grpc_client_config * cfg ; <nl> + grpc_lb_policy * lb_policy ; <nl> + grpc_subchannel * subchannel ; <nl> + grpc_subchannel_args args ; <nl> + <nl> + if ( r - > next_completion ! = NULL & & ! r - > published ) { <nl> + cfg = grpc_client_config_create ( ) ; <nl> + memset ( & args , 0 , sizeof ( args ) ) ; <nl> + args . addr = ( struct sockaddr * ) & r - > addr ; <nl> + args . addr_len = r - > addr_len ; <nl> + subchannel = <nl> + grpc_subchannel_factory_create_subchannel ( r - > subchannel_factory , & args ) ; <nl> + lb_policy = r - > lb_policy_factory ( & subchannel , 1 ) ; <nl> + grpc_client_config_set_lb_policy ( cfg , lb_policy ) ; <nl> + GRPC_LB_POLICY_UNREF ( lb_policy , " unix " ) ; <nl> + r - > published = 1 ; <nl> + * r - > target_config = cfg ; <nl> + grpc_iomgr_add_callback ( r - > next_completion ) ; <nl> + r - > next_completion = NULL ; <nl> + } <nl> + } <nl> + <nl> + static void unix_destroy ( grpc_resolver * gr ) { <nl> + unix_resolver * r = ( unix_resolver * ) gr ; <nl> + gpr_mu_destroy ( & r - > mu ) ; <nl> + grpc_subchannel_factory_unref ( r - > subchannel_factory ) ; <nl> + gpr_free ( r ) ; <nl> + } <nl> + <nl> + static grpc_resolver * unix_create ( <nl> + grpc_uri * uri , <nl> + grpc_lb_policy * ( * lb_policy_factory ) ( grpc_subchannel * * subchannels , <nl> + size_t num_subchannels ) , <nl> + grpc_subchannel_factory * subchannel_factory ) { <nl> + unix_resolver * r ; <nl> + <nl> + if ( 0 ! = strcmp ( uri - > authority , " " ) ) { <nl> + gpr_log ( GPR_ERROR , " authority based uri ' s not supported " ) ; <nl> + return NULL ; <nl> + } <nl> + <nl> + r = gpr_malloc ( sizeof ( unix_resolver ) ) ; <nl> + memset ( r , 0 , sizeof ( * r ) ) ; <nl> + gpr_ref_init ( & r - > refs , 1 ) ; <nl> + gpr_mu_init ( & r - > mu ) ; <nl> + grpc_resolver_init ( & r - > base , & unix_resolver_vtable ) ; <nl> + r - > subchannel_factory = subchannel_factory ; <nl> + r - > lb_policy_factory = lb_policy_factory ; <nl> + <nl> + r - > addr . sun_family = AF_UNIX ; <nl> + strcpy ( r - > addr . sun_path , uri - > path ) ; <nl> + r - > addr_len = strlen ( r - > addr . sun_path ) + sizeof ( r - > addr . sun_family ) + 1 ; <nl> + <nl> + grpc_subchannel_factory_ref ( subchannel_factory ) ; <nl> + return & r - > base ; <nl> + } <nl> + <nl> + / * <nl> + * FACTORY <nl> + * / <nl> + <nl> + static void unix_factory_ref ( grpc_resolver_factory * factory ) { } <nl> + <nl> + static void unix_factory_unref ( grpc_resolver_factory * factory ) { } <nl> + <nl> + static grpc_resolver * unix_factory_create_resolver ( <nl> + grpc_resolver_factory * factory , grpc_uri * uri , <nl> + grpc_subchannel_factory * subchannel_factory ) { <nl> + return unix_create ( uri , grpc_create_pick_first_lb_policy , subchannel_factory ) ; <nl> + } <nl> + <nl> + static const grpc_resolver_factory_vtable unix_factory_vtable = { <nl> + unix_factory_ref , unix_factory_unref , unix_factory_create_resolver } ; <nl> + static grpc_resolver_factory unix_resolver_factory = { & unix_factory_vtable } ; <nl> + <nl> + grpc_resolver_factory * grpc_unix_resolver_factory_create ( ) { <nl> + return & unix_resolver_factory ; <nl> + } <nl> + <nl> + # endif <nl> new file mode 100644 <nl> index 00000000000 . . 57ace59e218 <nl> mmm / dev / null <nl> ppp b / src / core / client_config / resolvers / unix_resolver_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_INTERNAL_CORE_CLIENT_CONFIG_RESOLVERS_UNIX_RESOLVER_H <nl> + # define GRPC_INTERNAL_CORE_CLIENT_CONFIG_RESOLVERS_UNIX_RESOLVER_H <nl> + <nl> + # include < grpc / support / port_platform . h > <nl> + <nl> + # include " src / core / client_config / resolver_factory . h " <nl> + <nl> + / * * Create a unix resolver factory * / <nl> + grpc_resolver_factory * grpc_unix_resolver_factory_create ( void ) ; <nl> + <nl> + # endif / * GRPC_INTERNAL_CORE_CLIENT_CONFIG_RESOLVERS_UNIX_RESOLVER_H * / <nl> new file mode 100644 <nl> index 00000000000 . . 6cf9062ab0c <nl> mmm / dev / null <nl> ppp b / src / core / client_config / subchannel . 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 " src / core / client_config / subchannel . h " <nl> + <nl> + # include < string . h > <nl> + <nl> + # include < grpc / support / alloc . h > <nl> + <nl> + # include " src / core / channel / channel_args . h " <nl> + # include " src / core / channel / connected_channel . h " <nl> + # include " src / core / iomgr / alarm . h " <nl> + # include " src / core / transport / connectivity_state . h " <nl> + <nl> + typedef struct { <nl> + / * all fields protected by subchannel - > mu * / <nl> + / * * refcount * / <nl> + int refs ; <nl> + / * * parent subchannel * / <nl> + grpc_subchannel * subchannel ; <nl> + } connection ; <nl> + <nl> + typedef struct { <nl> + grpc_iomgr_closure closure ; <nl> + size_t version ; <nl> + grpc_subchannel * subchannel ; <nl> + grpc_connectivity_state connectivity_state ; <nl> + } state_watcher ; <nl> + <nl> + typedef struct waiting_for_connect { <nl> + struct waiting_for_connect * next ; <nl> + grpc_iomgr_closure * notify ; <nl> + grpc_pollset * pollset ; <nl> + grpc_subchannel_call * * target ; <nl> + grpc_subchannel * subchannel ; <nl> + grpc_iomgr_closure continuation ; <nl> + } waiting_for_connect ; <nl> + <nl> + struct grpc_subchannel { <nl> + grpc_connector * connector ; <nl> + <nl> + / * * non - transport related channel filters * / <nl> + const grpc_channel_filter * * filters ; <nl> + size_t num_filters ; <nl> + / * * channel arguments * / <nl> + grpc_channel_args * args ; <nl> + / * * address to connect to * / <nl> + struct sockaddr * addr ; <nl> + size_t addr_len ; <nl> + / * * metadata context * / <nl> + grpc_mdctx * mdctx ; <nl> + / * * master channel - the grpc_channel instance that ultimately owns <nl> + this channel_data via its channel stack . <nl> + We occasionally use this to bump the refcount on the master channel <nl> + to keep ourselves alive through an asynchronous operation . * / <nl> + grpc_channel * master ; <nl> + / * * have we seen a disconnection ? * / <nl> + int disconnected ; <nl> + <nl> + / * * set during connection * / <nl> + grpc_connect_out_args connecting_result ; <nl> + <nl> + / * * callback for connection finishing * / <nl> + grpc_iomgr_closure connected ; <nl> + <nl> + / * * pollset_set tracking who ' s interested in a connection <nl> + being setup * / <nl> + grpc_pollset_set pollset_set ; <nl> + <nl> + / * * mutex protecting remaining elements * / <nl> + gpr_mu mu ; <nl> + <nl> + / * * active connection * / <nl> + connection * active ; <nl> + / * * version number for the active connection * / <nl> + size_t active_version ; <nl> + / * * refcount * / <nl> + int refs ; <nl> + / * * are we connecting * / <nl> + int connecting ; <nl> + / * * things waiting for a connection * / <nl> + waiting_for_connect * waiting ; <nl> + / * * connectivity state tracking * / <nl> + grpc_connectivity_state_tracker state_tracker ; <nl> + <nl> + / * * next connect attempt time * / <nl> + gpr_timespec next_attempt ; <nl> + / * * amount to backoff each failure * / <nl> + gpr_timespec backoff_delta ; <nl> + / * * do we have an active alarm ? * / <nl> + int have_alarm ; <nl> + / * * our alarm * / <nl> + grpc_alarm alarm ; <nl> + } ; <nl> + <nl> + struct grpc_subchannel_call { <nl> + connection * connection ; <nl> + gpr_refcount refs ; <nl> + } ; <nl> + <nl> + # define SUBCHANNEL_CALL_TO_CALL_STACK ( call ) ( ( grpc_call_stack * ) ( ( call ) + 1 ) ) <nl> + # define CHANNEL_STACK_FROM_CONNECTION ( con ) ( ( grpc_channel_stack * ) ( ( con ) + 1 ) ) <nl> + <nl> + static grpc_subchannel_call * create_call ( connection * con ) ; <nl> + static void connectivity_state_changed_locked ( grpc_subchannel * c ) ; <nl> + static grpc_connectivity_state compute_connectivity_locked ( grpc_subchannel * c ) ; <nl> + static gpr_timespec compute_connect_deadline ( grpc_subchannel * c ) ; <nl> + static void subchannel_connected ( void * subchannel , int iomgr_success ) ; <nl> + <nl> + static void subchannel_ref_locked ( <nl> + grpc_subchannel * c GRPC_SUBCHANNEL_REF_EXTRA_ARGS ) ; <nl> + static int subchannel_unref_locked ( <nl> + grpc_subchannel * c GRPC_SUBCHANNEL_REF_EXTRA_ARGS ) GRPC_MUST_USE_RESULT ; <nl> + static void connection_ref_locked ( connection * c GRPC_SUBCHANNEL_REF_EXTRA_ARGS ) ; <nl> + static grpc_subchannel * connection_unref_locked ( <nl> + connection * c GRPC_SUBCHANNEL_REF_EXTRA_ARGS ) GRPC_MUST_USE_RESULT ; <nl> + static void subchannel_destroy ( grpc_subchannel * c ) ; <nl> + <nl> + # ifdef GRPC_SUBCHANNEL_REFCOUNT_DEBUG <nl> + # define SUBCHANNEL_REF_LOCKED ( p , r ) \ <nl> + subchannel_ref_locked ( ( p ) , __FILE__ , __LINE__ , ( r ) ) <nl> + # define SUBCHANNEL_UNREF_LOCKED ( p , r ) \ <nl> + subchannel_unref_locked ( ( p ) , __FILE__ , __LINE__ , ( r ) ) <nl> + # define CONNECTION_REF_LOCKED ( p , r ) \ <nl> + connection_ref_locked ( ( p ) , __FILE__ , __LINE__ , ( r ) ) <nl> + # define CONNECTION_UNREF_LOCKED ( p , r ) \ <nl> + connection_unref_locked ( ( p ) , __FILE__ , __LINE__ , ( r ) ) <nl> + # define REF_PASS_ARGS , file , line , reason <nl> + # define REF_LOG ( name , p ) \ <nl> + gpr_log ( file , line , GPR_LOG_SEVERITY_DEBUG , " % s : % p ref % d - > % d % s " , \ <nl> + ( name ) , ( p ) , ( p ) - > refs , ( p ) - > refs + 1 , reason ) <nl> + # define UNREF_LOG ( name , p ) \ <nl> + gpr_log ( file , line , GPR_LOG_SEVERITY_DEBUG , " % s : % p unref % d - > % d % s " , \ <nl> + ( name ) , ( p ) , ( p ) - > refs , ( p ) - > refs - 1 , reason ) <nl> + # else <nl> + # define SUBCHANNEL_REF_LOCKED ( p , r ) subchannel_ref_locked ( ( p ) ) <nl> + # define SUBCHANNEL_UNREF_LOCKED ( p , r ) subchannel_unref_locked ( ( p ) ) <nl> + # define CONNECTION_REF_LOCKED ( p , r ) connection_ref_locked ( ( p ) ) <nl> + # define CONNECTION_UNREF_LOCKED ( p , r ) connection_unref_locked ( ( p ) ) <nl> + # define REF_PASS_ARGS <nl> + # define REF_LOG ( name , p ) \ <nl> + do { \ <nl> + } while ( 0 ) <nl> + # define UNREF_LOG ( name , p ) \ <nl> + do { \ <nl> + } while ( 0 ) <nl> + # endif <nl> + <nl> + / * <nl> + * connection implementation <nl> + * / <nl> + <nl> + static void connection_destroy ( connection * c ) { <nl> + GPR_ASSERT ( c - > refs = = 0 ) ; <nl> + grpc_channel_stack_destroy ( CHANNEL_STACK_FROM_CONNECTION ( c ) ) ; <nl> + gpr_free ( c ) ; <nl> + } <nl> + <nl> + static void connection_ref_locked ( <nl> + connection * c GRPC_SUBCHANNEL_REF_EXTRA_ARGS ) { <nl> + REF_LOG ( " CONNECTION " , c ) ; <nl> + subchannel_ref_locked ( c - > subchannel REF_PASS_ARGS ) ; <nl> + + + c - > refs ; <nl> + } <nl> + <nl> + static grpc_subchannel * connection_unref_locked ( <nl> + connection * c GRPC_SUBCHANNEL_REF_EXTRA_ARGS ) { <nl> + grpc_subchannel * destroy = NULL ; <nl> + UNREF_LOG ( " CONNECTION " , c ) ; <nl> + if ( subchannel_unref_locked ( c - > subchannel REF_PASS_ARGS ) ) { <nl> + destroy = c - > subchannel ; <nl> + } <nl> + if ( - - c - > refs = = 0 & & c - > subchannel - > active ! = c ) { <nl> + connection_destroy ( c ) ; <nl> + } <nl> + return destroy ; <nl> + } <nl> + <nl> + / * <nl> + * grpc_subchannel implementation <nl> + * / <nl> + <nl> + static void subchannel_ref_locked ( <nl> + grpc_subchannel * c GRPC_SUBCHANNEL_REF_EXTRA_ARGS ) { <nl> + REF_LOG ( " SUBCHANNEL " , c ) ; <nl> + + + c - > refs ; <nl> + } <nl> + <nl> + static int subchannel_unref_locked ( <nl> + grpc_subchannel * c GRPC_SUBCHANNEL_REF_EXTRA_ARGS ) { <nl> + UNREF_LOG ( " SUBCHANNEL " , c ) ; <nl> + return - - c - > refs = = 0 ; <nl> + } <nl> + <nl> + void grpc_subchannel_ref ( grpc_subchannel * c GRPC_SUBCHANNEL_REF_EXTRA_ARGS ) { <nl> + gpr_mu_lock ( & c - > mu ) ; <nl> + subchannel_ref_locked ( c REF_PASS_ARGS ) ; <nl> + gpr_mu_unlock ( & c - > mu ) ; <nl> + } <nl> + <nl> + void grpc_subchannel_unref ( grpc_subchannel * c GRPC_SUBCHANNEL_REF_EXTRA_ARGS ) { <nl> + int destroy ; <nl> + gpr_mu_lock ( & c - > mu ) ; <nl> + destroy = subchannel_unref_locked ( c REF_PASS_ARGS ) ; <nl> + gpr_mu_unlock ( & c - > mu ) ; <nl> + if ( destroy ) subchannel_destroy ( c ) ; <nl> + } <nl> + <nl> + static void subchannel_destroy ( grpc_subchannel * c ) { <nl> + if ( c - > active ! = NULL ) { <nl> + connection_destroy ( c - > active ) ; <nl> + } <nl> + gpr_free ( c - > filters ) ; <nl> + grpc_channel_args_destroy ( c - > args ) ; <nl> + gpr_free ( c - > addr ) ; <nl> + grpc_mdctx_unref ( c - > mdctx ) ; <nl> + grpc_pollset_set_destroy ( & c - > pollset_set ) ; <nl> + grpc_connectivity_state_destroy ( & c - > state_tracker ) ; <nl> + grpc_connector_unref ( c - > connector ) ; <nl> + gpr_free ( c ) ; <nl> + } <nl> + <nl> + void grpc_subchannel_add_interested_party ( grpc_subchannel * c , <nl> + grpc_pollset * pollset ) { <nl> + grpc_pollset_set_add_pollset ( & c - > pollset_set , pollset ) ; <nl> + } <nl> + <nl> + void grpc_subchannel_del_interested_party ( grpc_subchannel * c , <nl> + grpc_pollset * pollset ) { <nl> + grpc_pollset_set_del_pollset ( & c - > pollset_set , pollset ) ; <nl> + } <nl> + <nl> + grpc_subchannel * grpc_subchannel_create ( grpc_connector * connector , <nl> + grpc_subchannel_args * args ) { <nl> + grpc_subchannel * c = gpr_malloc ( sizeof ( * c ) ) ; <nl> + memset ( c , 0 , sizeof ( * c ) ) ; <nl> + c - > refs = 1 ; <nl> + c - > connector = connector ; <nl> + grpc_connector_ref ( c - > connector ) ; <nl> + c - > num_filters = args - > filter_count ; <nl> + c - > filters = gpr_malloc ( sizeof ( grpc_channel_filter * ) * c - > num_filters ) ; <nl> + memcpy ( c - > filters , args - > filters , <nl> + sizeof ( grpc_channel_filter * ) * c - > num_filters ) ; <nl> + c - > addr = gpr_malloc ( args - > addr_len ) ; <nl> + memcpy ( c - > addr , args - > addr , args - > addr_len ) ; <nl> + c - > addr_len = args - > addr_len ; <nl> + c - > args = grpc_channel_args_copy ( args - > args ) ; <nl> + c - > mdctx = args - > mdctx ; <nl> + c - > master = args - > master ; <nl> + grpc_mdctx_ref ( c - > mdctx ) ; <nl> + grpc_pollset_set_init ( & c - > pollset_set ) ; <nl> + grpc_iomgr_closure_init ( & c - > connected , subchannel_connected , c ) ; <nl> + grpc_connectivity_state_init ( & c - > state_tracker , GRPC_CHANNEL_IDLE ) ; <nl> + gpr_mu_init ( & c - > mu ) ; <nl> + return c ; <nl> + } <nl> + <nl> + static void continue_connect ( grpc_subchannel * c ) { <nl> + grpc_connect_in_args args ; <nl> + <nl> + args . interested_parties = & c - > pollset_set ; <nl> + args . addr = c - > addr ; <nl> + args . addr_len = c - > addr_len ; <nl> + args . deadline = compute_connect_deadline ( c ) ; <nl> + args . channel_args = c - > args ; <nl> + args . metadata_context = c - > mdctx ; <nl> + <nl> + grpc_connector_connect ( c - > connector , & args , & c - > connecting_result , <nl> + & c - > connected ) ; <nl> + } <nl> + <nl> + static void start_connect ( grpc_subchannel * c ) { <nl> + gpr_timespec now = gpr_now ( ) ; <nl> + c - > next_attempt = now ; <nl> + c - > backoff_delta = gpr_time_from_seconds ( 1 ) ; <nl> + <nl> + continue_connect ( c ) ; <nl> + } <nl> + <nl> + static void continue_creating_call ( void * arg , int iomgr_success ) { <nl> + waiting_for_connect * w4c = arg ; <nl> + grpc_subchannel_create_call ( w4c - > subchannel , w4c - > pollset , w4c - > target , <nl> + w4c - > notify ) ; <nl> + GRPC_SUBCHANNEL_UNREF ( w4c - > subchannel , " waiting_for_connect " ) ; <nl> + gpr_free ( w4c ) ; <nl> + } <nl> + <nl> + void grpc_subchannel_create_call ( grpc_subchannel * c , grpc_pollset * pollset , <nl> + grpc_subchannel_call * * target , <nl> + grpc_iomgr_closure * notify ) { <nl> + connection * con ; <nl> + gpr_mu_lock ( & c - > mu ) ; <nl> + if ( c - > active ! = NULL ) { <nl> + con = c - > active ; <nl> + CONNECTION_REF_LOCKED ( con , " call " ) ; <nl> + gpr_mu_unlock ( & c - > mu ) ; <nl> + <nl> + * target = create_call ( con ) ; <nl> + notify - > cb ( notify - > cb_arg , 1 ) ; <nl> + } else { <nl> + waiting_for_connect * w4c = gpr_malloc ( sizeof ( * w4c ) ) ; <nl> + w4c - > next = c - > waiting ; <nl> + w4c - > notify = notify ; <nl> + w4c - > pollset = pollset ; <nl> + w4c - > target = target ; <nl> + w4c - > subchannel = c ; <nl> + / * released when clearing w4c * / <nl> + SUBCHANNEL_REF_LOCKED ( c , " waiting_for_connect " ) ; <nl> + grpc_iomgr_closure_init ( & w4c - > continuation , continue_creating_call , w4c ) ; <nl> + c - > waiting = w4c ; <nl> + grpc_subchannel_add_interested_party ( c , pollset ) ; <nl> + if ( ! c - > connecting ) { <nl> + c - > connecting = 1 ; <nl> + connectivity_state_changed_locked ( c ) ; <nl> + / * released by connection * / <nl> + SUBCHANNEL_REF_LOCKED ( c , " connecting " ) ; <nl> + gpr_mu_unlock ( & c - > mu ) ; <nl> + <nl> + start_connect ( c ) ; <nl> + } else { <nl> + gpr_mu_unlock ( & c - > mu ) ; <nl> + } <nl> + } <nl> + } <nl> + <nl> + grpc_connectivity_state grpc_subchannel_check_connectivity ( grpc_subchannel * c ) { <nl> + grpc_connectivity_state state ; <nl> + gpr_mu_lock ( & c - > mu ) ; <nl> + state = grpc_connectivity_state_check ( & c - > state_tracker ) ; <nl> + gpr_mu_unlock ( & c - > mu ) ; <nl> + return state ; <nl> + } <nl> + <nl> + void grpc_subchannel_notify_on_state_change ( grpc_subchannel * c , <nl> + grpc_connectivity_state * state , <nl> + grpc_iomgr_closure * notify ) { <nl> + int do_connect = 0 ; <nl> + gpr_mu_lock ( & c - > mu ) ; <nl> + if ( grpc_connectivity_state_notify_on_state_change ( & c - > state_tracker , state , <nl> + notify ) ) { <nl> + do_connect = 1 ; <nl> + c - > connecting = 1 ; <nl> + / * released by connection * / <nl> + SUBCHANNEL_REF_LOCKED ( c , " connecting " ) ; <nl> + connectivity_state_changed_locked ( c ) ; <nl> + } <nl> + gpr_mu_unlock ( & c - > mu ) ; <nl> + if ( do_connect ) { <nl> + start_connect ( c ) ; <nl> + } <nl> + } <nl> + <nl> + void grpc_subchannel_process_transport_op ( grpc_subchannel * c , <nl> + grpc_transport_op * op ) { <nl> + connection * con = NULL ; <nl> + grpc_subchannel * destroy ; <nl> + int cancel_alarm = 0 ; <nl> + gpr_mu_lock ( & c - > mu ) ; <nl> + if ( op - > disconnect ) { <nl> + c - > disconnected = 1 ; <nl> + connectivity_state_changed_locked ( c ) ; <nl> + if ( c - > have_alarm ) { <nl> + cancel_alarm = 1 ; <nl> + } <nl> + } <nl> + if ( c - > active ! = NULL ) { <nl> + con = c - > active ; <nl> + CONNECTION_REF_LOCKED ( con , " transport - op " ) ; <nl> + } <nl> + gpr_mu_unlock ( & c - > mu ) ; <nl> + <nl> + if ( con ! = NULL ) { <nl> + grpc_channel_stack * channel_stack = CHANNEL_STACK_FROM_CONNECTION ( con ) ; <nl> + grpc_channel_element * top_elem = <nl> + grpc_channel_stack_element ( channel_stack , 0 ) ; <nl> + top_elem - > filter - > start_transport_op ( top_elem , op ) ; <nl> + <nl> + gpr_mu_lock ( & c - > mu ) ; <nl> + destroy = CONNECTION_UNREF_LOCKED ( con , " transport - op " ) ; <nl> + gpr_mu_unlock ( & c - > mu ) ; <nl> + if ( destroy ) { <nl> + subchannel_destroy ( destroy ) ; <nl> + } <nl> + } <nl> + <nl> + if ( cancel_alarm ) { <nl> + grpc_alarm_cancel ( & c - > alarm ) ; <nl> + } <nl> + } <nl> + <nl> + static void on_state_changed ( void * p , int iomgr_success ) { <nl> + state_watcher * sw = p ; <nl> + grpc_subchannel * c = sw - > subchannel ; <nl> + gpr_mu * mu = & c - > mu ; <nl> + int destroy ; <nl> + grpc_transport_op op ; <nl> + grpc_channel_element * elem ; <nl> + connection * destroy_connection = NULL ; <nl> + <nl> + gpr_mu_lock ( mu ) ; <nl> + <nl> + / * if we failed or there is a version number mismatch , just leave <nl> + this closure * / <nl> + if ( ! iomgr_success | | sw - > subchannel - > active_version ! = sw - > version ) { <nl> + goto done ; <nl> + } <nl> + <nl> + switch ( sw - > connectivity_state ) { <nl> + case GRPC_CHANNEL_CONNECTING : <nl> + case GRPC_CHANNEL_READY : <nl> + case GRPC_CHANNEL_IDLE : <nl> + / * all is still good : keep watching * / <nl> + memset ( & op , 0 , sizeof ( op ) ) ; <nl> + op . connectivity_state = & sw - > connectivity_state ; <nl> + op . on_connectivity_state_change = & sw - > closure ; <nl> + elem = grpc_channel_stack_element ( <nl> + CHANNEL_STACK_FROM_CONNECTION ( c - > active ) , 0 ) ; <nl> + elem - > filter - > start_transport_op ( elem , & op ) ; <nl> + / * early out * / <nl> + gpr_mu_unlock ( mu ) ; <nl> + return ; <nl> + case GRPC_CHANNEL_FATAL_FAILURE : <nl> + case GRPC_CHANNEL_TRANSIENT_FAILURE : <nl> + / * things have gone wrong , deactivate and enter idle * / <nl> + if ( sw - > subchannel - > active - > refs = = 0 ) { <nl> + destroy_connection = sw - > subchannel - > active ; <nl> + } <nl> + sw - > subchannel - > active = NULL ; <nl> + grpc_connectivity_state_set ( & c - > state_tracker , <nl> + GRPC_CHANNEL_TRANSIENT_FAILURE ) ; <nl> + break ; <nl> + } <nl> + <nl> + done : <nl> + connectivity_state_changed_locked ( c ) ; <nl> + destroy = SUBCHANNEL_UNREF_LOCKED ( c , " state_watcher " ) ; <nl> + gpr_free ( sw ) ; <nl> + gpr_mu_unlock ( mu ) ; <nl> + if ( destroy ) { <nl> + subchannel_destroy ( c ) ; <nl> + } <nl> + if ( destroy_connection ! = NULL ) { <nl> + connection_destroy ( destroy_connection ) ; <nl> + } <nl> + } <nl> + <nl> + static void publish_transport ( grpc_subchannel * c ) { <nl> + size_t channel_stack_size ; <nl> + connection * con ; <nl> + grpc_channel_stack * stk ; <nl> + size_t num_filters ; <nl> + const grpc_channel_filter * * filters ; <nl> + waiting_for_connect * w4c ; <nl> + grpc_transport_op op ; <nl> + state_watcher * sw ; <nl> + connection * destroy_connection = NULL ; <nl> + grpc_channel_element * elem ; <nl> + <nl> + / * build final filter list * / <nl> + num_filters = c - > num_filters + c - > connecting_result . num_filters + 1 ; <nl> + filters = gpr_malloc ( sizeof ( * filters ) * num_filters ) ; <nl> + memcpy ( filters , c - > filters , sizeof ( * filters ) * c - > num_filters ) ; <nl> + memcpy ( filters + c - > num_filters , c - > connecting_result . filters , <nl> + sizeof ( * filters ) * c - > connecting_result . num_filters ) ; <nl> + filters [ num_filters - 1 ] = & grpc_connected_channel_filter ; <nl> + <nl> + / * construct channel stack * / <nl> + channel_stack_size = grpc_channel_stack_size ( filters , num_filters ) ; <nl> + con = gpr_malloc ( sizeof ( connection ) + channel_stack_size ) ; <nl> + stk = ( grpc_channel_stack * ) ( con + 1 ) ; <nl> + con - > refs = 0 ; <nl> + con - > subchannel = c ; <nl> + grpc_channel_stack_init ( filters , num_filters , c - > master , c - > args , c - > mdctx , <nl> + stk ) ; <nl> + grpc_connected_channel_bind_transport ( stk , c - > connecting_result . transport ) ; <nl> + gpr_free ( c - > connecting_result . filters ) ; <nl> + memset ( & c - > connecting_result , 0 , sizeof ( c - > connecting_result ) ) ; <nl> + <nl> + / * initialize state watcher * / <nl> + sw = gpr_malloc ( sizeof ( * sw ) ) ; <nl> + grpc_iomgr_closure_init ( & sw - > closure , on_state_changed , sw ) ; <nl> + sw - > subchannel = c ; <nl> + sw - > connectivity_state = GRPC_CHANNEL_READY ; <nl> + <nl> + gpr_mu_lock ( & c - > mu ) ; <nl> + <nl> + if ( c - > disconnected ) { <nl> + gpr_mu_unlock ( & c - > mu ) ; <nl> + gpr_free ( sw ) ; <nl> + gpr_free ( filters ) ; <nl> + grpc_channel_stack_destroy ( stk ) ; <nl> + return ; <nl> + } <nl> + <nl> + / * publish * / <nl> + if ( c - > active ! = NULL & & c - > active - > refs = = 0 ) { <nl> + destroy_connection = c - > active ; <nl> + } <nl> + c - > active = con ; <nl> + c - > active_version + + ; <nl> + sw - > version = c - > active_version ; <nl> + c - > connecting = 0 ; <nl> + <nl> + / * watch for changes ; subchannel ref for connecting is donated <nl> + to the state watcher * / <nl> + memset ( & op , 0 , sizeof ( op ) ) ; <nl> + op . connectivity_state = & sw - > connectivity_state ; <nl> + op . on_connectivity_state_change = & sw - > closure ; <nl> + SUBCHANNEL_REF_LOCKED ( c , " state_watcher " ) ; <nl> + GPR_ASSERT ( ! SUBCHANNEL_UNREF_LOCKED ( c , " connecting " ) ) ; <nl> + elem = <nl> + grpc_channel_stack_element ( CHANNEL_STACK_FROM_CONNECTION ( c - > active ) , 0 ) ; <nl> + elem - > filter - > start_transport_op ( elem , & op ) ; <nl> + <nl> + / * signal completion * / <nl> + connectivity_state_changed_locked ( c ) ; <nl> + while ( ( w4c = c - > waiting ) ) { <nl> + c - > waiting = w4c - > next ; <nl> + grpc_iomgr_add_callback ( & w4c - > continuation ) ; <nl> + } <nl> + <nl> + gpr_mu_unlock ( & c - > mu ) ; <nl> + <nl> + gpr_free ( filters ) ; <nl> + <nl> + if ( destroy_connection ! = NULL ) { <nl> + connection_destroy ( destroy_connection ) ; <nl> + } <nl> + } <nl> + <nl> + static void on_alarm ( void * arg , int iomgr_success ) { <nl> + grpc_subchannel * c = arg ; <nl> + gpr_mu_lock ( & c - > mu ) ; <nl> + c - > have_alarm = 0 ; <nl> + if ( c - > disconnected ) { <nl> + iomgr_success = 0 ; <nl> + } <nl> + connectivity_state_changed_locked ( c ) ; <nl> + gpr_mu_unlock ( & c - > mu ) ; <nl> + if ( iomgr_success ) { <nl> + continue_connect ( c ) ; <nl> + } else { <nl> + GRPC_SUBCHANNEL_UNREF ( c , " connecting " ) ; <nl> + } <nl> + } <nl> + <nl> + static void subchannel_connected ( void * arg , int iomgr_success ) { <nl> + grpc_subchannel * c = arg ; <nl> + if ( c - > connecting_result . transport ! = NULL ) { <nl> + publish_transport ( c ) ; <nl> + } else { <nl> + gpr_mu_lock ( & c - > mu ) ; <nl> + connectivity_state_changed_locked ( c ) ; <nl> + GPR_ASSERT ( ! c - > have_alarm ) ; <nl> + c - > have_alarm = 1 ; <nl> + c - > next_attempt = gpr_time_add ( c - > next_attempt , c - > backoff_delta ) ; <nl> + c - > backoff_delta = gpr_time_add ( c - > backoff_delta , c - > backoff_delta ) ; <nl> + grpc_alarm_init ( & c - > alarm , c - > next_attempt , on_alarm , c , gpr_now ( ) ) ; <nl> + gpr_mu_unlock ( & c - > mu ) ; <nl> + } <nl> + } <nl> + <nl> + static gpr_timespec compute_connect_deadline ( grpc_subchannel * c ) { <nl> + return gpr_time_add ( c - > next_attempt , c - > backoff_delta ) ; <nl> + } <nl> + <nl> + static grpc_connectivity_state compute_connectivity_locked ( grpc_subchannel * c ) { <nl> + if ( c - > disconnected ) { <nl> + return GRPC_CHANNEL_FATAL_FAILURE ; <nl> + } <nl> + if ( c - > connecting ) { <nl> + if ( c - > have_alarm ) { <nl> + return GRPC_CHANNEL_TRANSIENT_FAILURE ; <nl> + } <nl> + return GRPC_CHANNEL_CONNECTING ; <nl> + } <nl> + if ( c - > active ) { <nl> + return GRPC_CHANNEL_READY ; <nl> + } <nl> + return GRPC_CHANNEL_IDLE ; <nl> + } <nl> + <nl> + static void connectivity_state_changed_locked ( grpc_subchannel * c ) { <nl> + grpc_connectivity_state current = compute_connectivity_locked ( c ) ; <nl> + grpc_connectivity_state_set ( & c - > state_tracker , current ) ; <nl> + } <nl> + <nl> + / * <nl> + * grpc_subchannel_call implementation <nl> + * / <nl> + <nl> + void grpc_subchannel_call_ref ( <nl> + grpc_subchannel_call * c GRPC_SUBCHANNEL_REF_EXTRA_ARGS ) { <nl> + gpr_ref ( & c - > refs ) ; <nl> + } <nl> + <nl> + void grpc_subchannel_call_unref ( <nl> + grpc_subchannel_call * c GRPC_SUBCHANNEL_REF_EXTRA_ARGS ) { <nl> + if ( gpr_unref ( & c - > refs ) ) { <nl> + gpr_mu * mu = & c - > connection - > subchannel - > mu ; <nl> + grpc_subchannel * destroy ; <nl> + grpc_call_stack_destroy ( SUBCHANNEL_CALL_TO_CALL_STACK ( c ) ) ; <nl> + gpr_mu_lock ( mu ) ; <nl> + destroy = CONNECTION_UNREF_LOCKED ( c - > connection , " call " ) ; <nl> + gpr_mu_unlock ( mu ) ; <nl> + gpr_free ( c ) ; <nl> + if ( destroy ! = NULL ) { <nl> + subchannel_destroy ( destroy ) ; <nl> + } <nl> + } <nl> + } <nl> + <nl> + void grpc_subchannel_call_process_op ( grpc_subchannel_call * call , <nl> + grpc_transport_stream_op * op ) { <nl> + grpc_call_stack * call_stack = SUBCHANNEL_CALL_TO_CALL_STACK ( call ) ; <nl> + grpc_call_element * top_elem = grpc_call_stack_element ( call_stack , 0 ) ; <nl> + top_elem - > filter - > start_transport_stream_op ( top_elem , op ) ; <nl> + } <nl> + <nl> + grpc_subchannel_call * create_call ( connection * con ) { <nl> + grpc_channel_stack * chanstk = CHANNEL_STACK_FROM_CONNECTION ( con ) ; <nl> + grpc_subchannel_call * call = <nl> + gpr_malloc ( sizeof ( grpc_subchannel_call ) + chanstk - > call_stack_size ) ; <nl> + grpc_call_stack * callstk = SUBCHANNEL_CALL_TO_CALL_STACK ( call ) ; <nl> + call - > connection = con ; <nl> + gpr_ref_init ( & call - > refs , 1 ) ; <nl> + grpc_call_stack_init ( chanstk , NULL , NULL , callstk ) ; <nl> + return call ; <nl> + } <nl> new file mode 100644 <nl> index 00000000000 . . a23a623277f <nl> mmm / dev / null <nl> ppp b / src / core / client_config / subchannel . 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_INTERNAL_CORE_CLIENT_CONFIG_SUBCHANNEL_H <nl> + # define GRPC_INTERNAL_CORE_CLIENT_CONFIG_SUBCHANNEL_H <nl> + <nl> + # include " src / core / channel / channel_stack . h " <nl> + # include " src / core / client_config / connector . h " <nl> + <nl> + / * * A ( sub - ) channel that knows how to connect to exactly one target <nl> + address . Provides a target for load balancing . * / <nl> + typedef struct grpc_subchannel grpc_subchannel ; <nl> + typedef struct grpc_subchannel_call grpc_subchannel_call ; <nl> + typedef struct grpc_subchannel_args grpc_subchannel_args ; <nl> + <nl> + # ifdef GRPC_SUBCHANNEL_REFCOUNT_DEBUG <nl> + # define GRPC_SUBCHANNEL_REF ( p , r ) \ <nl> + grpc_subchannel_ref ( ( p ) , __FILE__ , __LINE__ , ( r ) ) <nl> + # define GRPC_SUBCHANNEL_UNREF ( p , r ) \ <nl> + grpc_subchannel_unref ( ( p ) , __FILE__ , __LINE__ , ( r ) ) <nl> + # define GRPC_SUBCHANNEL_CALL_REF ( p , r ) \ <nl> + grpc_subchannel_call_ref ( ( p ) , __FILE__ , __LINE__ , ( r ) ) <nl> + # define GRPC_SUBCHANNEL_CALL_UNREF ( p , r ) \ <nl> + grpc_subchannel_call_unref ( ( p ) , __FILE__ , __LINE__ , ( r ) ) <nl> + # define GRPC_SUBCHANNEL_REF_EXTRA_ARGS \ <nl> + , const char * file , int line , const char * reason <nl> + # else <nl> + # define GRPC_SUBCHANNEL_REF ( p , r ) grpc_subchannel_ref ( ( p ) ) <nl> + # define GRPC_SUBCHANNEL_UNREF ( p , r ) grpc_subchannel_unref ( ( p ) ) <nl> + # define GRPC_SUBCHANNEL_CALL_REF ( p , r ) grpc_subchannel_call_ref ( ( p ) ) <nl> + # define GRPC_SUBCHANNEL_CALL_UNREF ( p , r ) grpc_subchannel_call_unref ( ( p ) ) <nl> + # define GRPC_SUBCHANNEL_REF_EXTRA_ARGS <nl> + # endif <nl> + <nl> + void grpc_subchannel_ref ( <nl> + grpc_subchannel * channel GRPC_SUBCHANNEL_REF_EXTRA_ARGS ) ; <nl> + void grpc_subchannel_unref ( <nl> + grpc_subchannel * channel GRPC_SUBCHANNEL_REF_EXTRA_ARGS ) ; <nl> + void grpc_subchannel_call_ref ( <nl> + grpc_subchannel_call * call GRPC_SUBCHANNEL_REF_EXTRA_ARGS ) ; <nl> + void grpc_subchannel_call_unref ( <nl> + grpc_subchannel_call * call GRPC_SUBCHANNEL_REF_EXTRA_ARGS ) ; <nl> + <nl> + / * * construct a call ( possibly asynchronously ) * / <nl> + void grpc_subchannel_create_call ( grpc_subchannel * subchannel , <nl> + grpc_pollset * pollset , <nl> + grpc_subchannel_call * * target , <nl> + grpc_iomgr_closure * notify ) ; <nl> + <nl> + / * * process a transport level op * / <nl> + void grpc_subchannel_process_transport_op ( grpc_subchannel * subchannel , <nl> + grpc_transport_op * op ) ; <nl> + <nl> + / * * poll the current connectivity state of a channel * / <nl> + grpc_connectivity_state grpc_subchannel_check_connectivity ( <nl> + grpc_subchannel * channel ) ; <nl> + <nl> + / * * call notify when the connectivity state of a channel changes from * state . <nl> + Updates * state with the new state of the channel * / <nl> + void grpc_subchannel_notify_on_state_change ( grpc_subchannel * channel , <nl> + grpc_connectivity_state * state , <nl> + grpc_iomgr_closure * notify ) ; <nl> + <nl> + void grpc_subchannel_add_interested_party ( grpc_subchannel * channel , <nl> + grpc_pollset * pollset ) ; <nl> + void grpc_subchannel_del_interested_party ( grpc_subchannel * channel , <nl> + grpc_pollset * pollset ) ; <nl> + <nl> + / * * continue processing a transport op * / <nl> + void grpc_subchannel_call_process_op ( grpc_subchannel_call * subchannel_call , <nl> + grpc_transport_stream_op * op ) ; <nl> + <nl> + struct grpc_subchannel_args { <nl> + / * * Channel filters for this channel - wrapped factories will likely <nl> + want to mutate this * / <nl> + const grpc_channel_filter * * filters ; <nl> + / * * The number of filters in the above array * / <nl> + size_t filter_count ; <nl> + / * * Channel arguments to be supplied to the newly created channel * / <nl> + const grpc_channel_args * args ; <nl> + / * * Address to connect to * / <nl> + struct sockaddr * addr ; <nl> + size_t addr_len ; <nl> + / * * metadata context to use * / <nl> + grpc_mdctx * mdctx ; <nl> + / * * master channel * / <nl> + grpc_channel * master ; <nl> + } ; <nl> + <nl> + / * * create a subchannel given a connector * / <nl> + grpc_subchannel * grpc_subchannel_create ( grpc_connector * connector , <nl> + grpc_subchannel_args * args ) ; <nl> + <nl> + # endif / * GRPC_INTERNAL_CORE_CLIENT_CONFIG_SUBCHANNEL_H * / <nl> new file mode 100644 <nl> index 00000000000 . . f71386594c0 <nl> mmm / dev / null <nl> ppp b / src / core / client_config / subchannel_factory . 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 " src / core / client_config / subchannel_factory . h " <nl> + <nl> + void grpc_subchannel_factory_ref ( grpc_subchannel_factory * factory ) { <nl> + factory - > vtable - > ref ( factory ) ; <nl> + } <nl> + void grpc_subchannel_factory_unref ( grpc_subchannel_factory * factory ) { <nl> + factory - > vtable - > unref ( factory ) ; <nl> + } <nl> + <nl> + grpc_subchannel * grpc_subchannel_factory_create_subchannel ( <nl> + grpc_subchannel_factory * factory , grpc_subchannel_args * args ) { <nl> + return factory - > vtable - > create_subchannel ( factory , args ) ; <nl> + } <nl> similarity index 53 % <nl> rename from src / core / channel / child_channel . h <nl> rename to src / core / client_config / subchannel_factory . h <nl> mmm a / src / core / channel / child_channel . h <nl> ppp b / src / core / client_config / subchannel_factory . h <nl> <nl> * <nl> * / <nl> <nl> - # ifndef GRPC_INTERNAL_CORE_CHANNEL_CHILD_CHANNEL_H <nl> - # define GRPC_INTERNAL_CORE_CHANNEL_CHILD_CHANNEL_H <nl> + # ifndef GRPC_INTERNAL_CORE_CLIENT_CONFIG_SUBCHANNEL_FACTORY_H <nl> + # define GRPC_INTERNAL_CORE_CLIENT_CONFIG_SUBCHANNEL_FACTORY_H <nl> <nl> # include " src / core / channel / channel_stack . h " <nl> + # include " src / core / client_config / subchannel . h " <nl> <nl> - / * helper for filters that need to host child channel stacks . . . handles <nl> - lifetime and upwards propagation cleanly * / <nl> + typedef struct grpc_subchannel_factory grpc_subchannel_factory ; <nl> + typedef struct grpc_subchannel_factory_vtable grpc_subchannel_factory_vtable ; <nl> <nl> - extern const grpc_channel_filter grpc_child_channel_top_filter ; <nl> + / * * Constructor for new configured channels . <nl> + Creating decorators around this type is encouraged to adapt behavior . * / <nl> + struct grpc_subchannel_factory { <nl> + const grpc_subchannel_factory_vtable * vtable ; <nl> + } ; <nl> <nl> - typedef grpc_channel_stack grpc_child_channel ; <nl> - typedef grpc_call_stack grpc_child_call ; <nl> + struct grpc_subchannel_factory_vtable { <nl> + void ( * ref ) ( grpc_subchannel_factory * factory ) ; <nl> + void ( * unref ) ( grpc_subchannel_factory * factory ) ; <nl> + grpc_subchannel * ( * create_subchannel ) ( grpc_subchannel_factory * factory , <nl> + grpc_subchannel_args * args ) ; <nl> + } ; <nl> <nl> - / * filters [ 0 ] must be & grpc_child_channel_top_filter * / <nl> - grpc_child_channel * grpc_child_channel_create ( <nl> - grpc_channel_element * parent , const grpc_channel_filter * * filters , <nl> - size_t filter_count , const grpc_channel_args * args , <nl> - grpc_mdctx * metadata_context ) ; <nl> - void grpc_child_channel_handle_op ( grpc_child_channel * channel , <nl> - grpc_channel_op * op ) ; <nl> - grpc_channel_element * grpc_child_channel_get_bottom_element ( <nl> - grpc_child_channel * channel ) ; <nl> - void grpc_child_channel_destroy ( grpc_child_channel * channel , <nl> - int wait_for_callbacks ) ; <nl> + void grpc_subchannel_factory_ref ( grpc_subchannel_factory * factory ) ; <nl> + void grpc_subchannel_factory_unref ( grpc_subchannel_factory * factory ) ; <nl> <nl> - grpc_child_call * grpc_child_channel_create_call ( grpc_child_channel * channel , <nl> - grpc_call_element * parent , <nl> - grpc_transport_op * initial_op ) ; <nl> - grpc_call_element * grpc_child_call_get_top_element ( grpc_child_call * call ) ; <nl> - void grpc_child_call_destroy ( grpc_child_call * call ) ; <nl> + / * * Create a new grpc_subchannel * / <nl> + grpc_subchannel * grpc_subchannel_factory_create_subchannel ( <nl> + grpc_subchannel_factory * factory , grpc_subchannel_args * args ) ; <nl> <nl> - # endif / * GRPC_INTERNAL_CORE_CHANNEL_CHILD_CHANNEL_H * / <nl> + # endif / * GRPC_INTERNAL_CORE_CLIENT_CONFIG_SUBCHANNEL_FACTORY_H * / <nl> new file mode 100644 <nl> index 00000000000 . . 776a2559231 <nl> mmm / dev / null <nl> ppp b / src / core / client_config / uri_parser . 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 " src / core / client_config / uri_parser . h " <nl> + <nl> + # include < string . h > <nl> + <nl> + # include < grpc / support / alloc . h > <nl> + # include < grpc / support / log . h > <nl> + # include < grpc / support / string_util . h > <nl> + <nl> + static grpc_uri * bad_uri ( const char * uri_text , int pos , const char * section , <nl> + int suppress_errors ) { <nl> + char * line_prefix ; <nl> + int pfx_len ; <nl> + <nl> + if ( ! suppress_errors ) { <nl> + gpr_asprintf ( & line_prefix , " bad uri . % s : ' " , section ) ; <nl> + pfx_len = strlen ( line_prefix ) + pos ; <nl> + gpr_log ( GPR_ERROR , " % s % s ' " , line_prefix , uri_text ) ; <nl> + gpr_free ( line_prefix ) ; <nl> + <nl> + line_prefix = gpr_malloc ( pfx_len + 1 ) ; <nl> + memset ( line_prefix , ' ' , pfx_len ) ; <nl> + line_prefix [ pfx_len ] = 0 ; <nl> + gpr_log ( GPR_ERROR , " % s ^ here " , line_prefix ) ; <nl> + gpr_free ( line_prefix ) ; <nl> + } <nl> + <nl> + return NULL ; <nl> + } <nl> + <nl> + static char * copy_fragment ( const char * src , int begin , int end ) { <nl> + char * out = gpr_malloc ( end - begin + 1 ) ; <nl> + memcpy ( out , src + begin , end - begin ) ; <nl> + out [ end - begin ] = 0 ; <nl> + return out ; <nl> + } <nl> + <nl> + grpc_uri * grpc_uri_parse ( const char * uri_text , int suppress_errors ) { <nl> + grpc_uri * uri ; <nl> + int scheme_begin = 0 ; <nl> + int scheme_end = - 1 ; <nl> + int authority_begin = - 1 ; <nl> + int authority_end = - 1 ; <nl> + int path_begin = - 1 ; <nl> + int path_end = - 1 ; <nl> + int i ; <nl> + <nl> + for ( i = scheme_begin ; uri_text [ i ] ! = 0 ; i + + ) { <nl> + if ( uri_text [ i ] = = ' : ' ) { <nl> + scheme_end = i ; <nl> + break ; <nl> + } <nl> + if ( uri_text [ i ] > = ' a ' & & uri_text [ i ] < = ' z ' ) continue ; <nl> + if ( uri_text [ i ] > = ' A ' & & uri_text [ i ] < = ' Z ' ) continue ; <nl> + if ( i ! = scheme_begin ) { <nl> + if ( uri_text [ i ] > = ' 0 ' & & uri_text [ i ] < = ' 9 ' ) continue ; <nl> + if ( uri_text [ i ] = = ' + ' ) continue ; <nl> + if ( uri_text [ i ] = = ' - ' ) continue ; <nl> + if ( uri_text [ i ] = = ' . ' ) continue ; <nl> + } <nl> + break ; <nl> + } <nl> + if ( scheme_end = = - 1 ) { <nl> + return bad_uri ( uri_text , i , " scheme " , suppress_errors ) ; <nl> + } <nl> + <nl> + if ( uri_text [ scheme_end + 1 ] = = ' / ' & & uri_text [ scheme_end + 2 ] = = ' / ' ) { <nl> + authority_begin = scheme_end + 3 ; <nl> + for ( i = authority_begin ; uri_text [ i ] ! = 0 ; i + + ) { <nl> + if ( uri_text [ i ] = = ' / ' ) { <nl> + authority_end = i ; <nl> + } <nl> + if ( uri_text [ i ] = = ' ? ' ) { <nl> + return bad_uri ( uri_text , i , " query_not_supported " , suppress_errors ) ; <nl> + } <nl> + if ( uri_text [ i ] = = ' # ' ) { <nl> + return bad_uri ( uri_text , i , " fragment_not_supported " , suppress_errors ) ; <nl> + } <nl> + } <nl> + if ( authority_end = = - 1 & & uri_text [ i ] = = 0 ) { <nl> + authority_end = i ; <nl> + } <nl> + if ( authority_end = = - 1 ) { <nl> + return bad_uri ( uri_text , i , " authority " , suppress_errors ) ; <nl> + } <nl> + / * TODO ( ctiller ) : parse the authority correctly * / <nl> + path_begin = authority_end ; <nl> + } else { <nl> + path_begin = scheme_end + 1 ; <nl> + } <nl> + <nl> + for ( i = path_begin ; uri_text [ i ] ! = 0 ; i + + ) { <nl> + if ( uri_text [ i ] = = ' ? ' ) { <nl> + return bad_uri ( uri_text , i , " query_not_supported " , suppress_errors ) ; <nl> + } <nl> + if ( uri_text [ i ] = = ' # ' ) { <nl> + return bad_uri ( uri_text , i , " fragment_not_supported " , suppress_errors ) ; <nl> + } <nl> + } <nl> + path_end = i ; <nl> + <nl> + uri = gpr_malloc ( sizeof ( * uri ) ) ; <nl> + memset ( uri , 0 , sizeof ( * uri ) ) ; <nl> + uri - > scheme = copy_fragment ( uri_text , scheme_begin , scheme_end ) ; <nl> + uri - > authority = copy_fragment ( uri_text , authority_begin , authority_end ) ; <nl> + uri - > path = copy_fragment ( uri_text , path_begin , path_end ) ; <nl> + <nl> + return uri ; <nl> + } <nl> + <nl> + void grpc_uri_destroy ( grpc_uri * uri ) { <nl> + if ( ! uri ) return ; <nl> + gpr_free ( uri - > scheme ) ; <nl> + gpr_free ( uri - > authority ) ; <nl> + gpr_free ( uri - > path ) ; <nl> + gpr_free ( uri ) ; <nl> + } <nl> new file mode 100644 <nl> index 00000000000 . . ce4e6aecb09 <nl> mmm / dev / null <nl> ppp b / src / core / client_config / uri_parser . 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_INTERNAL_CORE_CLIENT_CONFIG_URI_PARSER_H <nl> + # define GRPC_INTERNAL_CORE_CLIENT_CONFIG_URI_PARSER_H <nl> + <nl> + typedef struct { <nl> + char * scheme ; <nl> + char * authority ; <nl> + char * path ; <nl> + } grpc_uri ; <nl> + <nl> + / * * parse a uri , return NULL on failure * / <nl> + grpc_uri * grpc_uri_parse ( const char * uri_text , int suppress_errors ) ; <nl> + <nl> + / * * destroy a uri * / <nl> + void grpc_uri_destroy ( grpc_uri * uri ) ; <nl> + <nl> + # endif <nl> mmm a / src / core / httpcli / httpcli . c <nl> ppp b / src / core / httpcli / httpcli . c <nl> static void on_connected ( void * arg , grpc_endpoint * tcp ) { <nl> GRPC_SECURITY_OK ) ; <nl> grpc_setup_secure_transport ( & sc - > base , tcp , on_secure_transport_setup_done , <nl> req ) ; <nl> - grpc_security_connector_unref ( & sc - > base ) ; <nl> + GRPC_SECURITY_CONNECTOR_UNREF ( & sc - > base , " httpcli " ) ; <nl> } else { <nl> start_write ( req ) ; <nl> } <nl> mmm a / src / core / iomgr / fd_posix . c <nl> ppp b / src / core / iomgr / fd_posix . c <nl> static void destroy ( grpc_fd * fd ) { <nl> # define UNREF_BY ( fd , n , reason ) unref_by ( fd , n , reason , __FILE__ , __LINE__ ) <nl> static void ref_by ( grpc_fd * fd , int n , const char * reason , const char * file , <nl> int line ) { <nl> - gpr_log ( GPR_DEBUG , " FD % d % p ref % d % d - > % d [ % s ; % s : % d ] " , fd - > fd , fd , n , <nl> + gpr_log ( GPR_DEBUG , " FD % d % p ref % d % d - > % d [ % s ; % s : % d ] " , fd - > fd , fd , n , <nl> gpr_atm_no_barrier_load ( & fd - > refst ) , <nl> gpr_atm_no_barrier_load ( & fd - > refst ) + n , reason , file , line ) ; <nl> # else <nl> static void wake_all_watchers_locked ( grpc_fd * fd ) { <nl> } <nl> <nl> static int has_watchers ( grpc_fd * fd ) { <nl> - return fd - > read_watcher ! = NULL | | fd - > write_watcher ! = NULL | | fd - > inactive_watcher_root . next ! = & fd - > inactive_watcher_root ; <nl> + return fd - > read_watcher ! = NULL | | fd - > write_watcher ! = NULL | | <nl> + fd - > inactive_watcher_root . next ! = & fd - > inactive_watcher_root ; <nl> } <nl> <nl> void grpc_fd_orphan ( grpc_fd * fd , grpc_iomgr_closure * on_done , <nl> mmm a / src / core / iomgr / iocp_windows . h <nl> ppp b / src / core / iomgr / iocp_windows . h <nl> <nl> # ifndef GRPC_INTERNAL_CORE_IOMGR_IOCP_WINDOWS_H <nl> # define GRPC_INTERNAL_CORE_IOMGR_IOCP_WINDOWS_H <nl> <nl> - # include < windows . h > <nl> # include < grpc / support / sync . h > <nl> <nl> # include " src / core / iomgr / socket_windows . h " <nl> mmm a / src / core / iomgr / iomgr . c <nl> ppp b / src / core / iomgr / iomgr . c <nl> void grpc_iomgr_shutdown ( void ) { <nl> " memory leaks are likely " , <nl> count_objects ( ) ) ; <nl> for ( obj = g_root_object . next ; obj ! = & g_root_object ; obj = obj - > next ) { <nl> - gpr_log ( GPR_DEBUG , " LEAKED OBJECT : % s " , obj - > name ) ; <nl> + gpr_log ( GPR_DEBUG , " LEAKED OBJECT : % s % p " , obj - > name , obj ) ; <nl> } <nl> break ; <nl> } <nl> void grpc_iomgr_shutdown ( void ) { <nl> } <nl> <nl> void grpc_iomgr_register_object ( grpc_iomgr_object * obj , const char * name ) { <nl> - gpr_mu_lock ( & g_mu ) ; <nl> obj - > name = gpr_strdup ( name ) ; <nl> + gpr_mu_lock ( & g_mu ) ; <nl> obj - > next = & g_root_object ; <nl> obj - > prev = obj - > next - > prev ; <nl> obj - > next - > prev = obj - > prev - > next = obj ; <nl> void grpc_iomgr_unregister_object ( grpc_iomgr_object * obj ) { <nl> gpr_mu_lock ( & g_mu ) ; <nl> obj - > next - > prev = obj - > prev ; <nl> obj - > prev - > next = obj - > next ; <nl> - gpr_free ( obj - > name ) ; <nl> gpr_cv_signal ( & g_rcv ) ; <nl> gpr_mu_unlock ( & g_mu ) ; <nl> + gpr_free ( obj - > name ) ; <nl> } <nl> <nl> void grpc_iomgr_closure_init ( grpc_iomgr_closure * closure , grpc_iomgr_cb_func cb , <nl> void grpc_iomgr_closure_init ( grpc_iomgr_closure * closure , grpc_iomgr_cb_func cb , <nl> closure - > next = NULL ; <nl> } <nl> <nl> + static void assert_not_scheduled_locked ( grpc_iomgr_closure * closure ) { <nl> + # ifndef NDEBUG <nl> + grpc_iomgr_closure * c ; <nl> + <nl> + for ( c = g_cbs_head ; c ; c = c - > next ) { <nl> + GPR_ASSERT ( c ! = closure ) ; <nl> + } <nl> + # endif <nl> + } <nl> + <nl> void grpc_iomgr_add_delayed_callback ( grpc_iomgr_closure * closure , int success ) { <nl> closure - > success = success ; <nl> + GPR_ASSERT ( closure - > cb ) ; <nl> gpr_mu_lock ( & g_mu ) ; <nl> + assert_not_scheduled_locked ( closure ) ; <nl> closure - > next = NULL ; <nl> if ( ! g_cbs_tail ) { <nl> g_cbs_head = g_cbs_tail = closure ; <nl> mmm a / src / core / iomgr / pollset_posix . c <nl> ppp b / src / core / iomgr / pollset_posix . c <nl> static void basic_do_promote ( void * args , int success ) { <nl> pollset - > in_flight_cbs - - ; <nl> if ( pollset - > shutting_down ) { <nl> / * We don ' t care about this pollset anymore . * / <nl> - if ( pollset - > in_flight_cbs = = 0 & & pollset - > counter = = 0 ) { <nl> + if ( pollset - > in_flight_cbs = = 0 & & pollset - > counter = = 0 & & ! pollset - > called_shutdown ) { <nl> + pollset - > called_shutdown = 1 ; <nl> do_shutdown_cb = 1 ; <nl> } <nl> } else if ( grpc_fd_is_orphaned ( fd ) ) { <nl> mmm a / src / core / iomgr / pollset_set_posix . c <nl> ppp b / src / core / iomgr / pollset_set_posix . c <nl> void grpc_pollset_set_del_fd ( grpc_pollset_set * pollset_set , grpc_fd * fd ) { <nl> if ( pollset_set - > fds [ i ] = = fd ) { <nl> pollset_set - > fd_count - - ; <nl> GPR_SWAP ( grpc_fd * , pollset_set - > fds [ i ] , <nl> - pollset_set - > fds [ pollset_set - > pollset_count ] ) ; <nl> + pollset_set - > fds [ pollset_set - > fd_count ] ) ; <nl> GRPC_FD_UNREF ( fd , " pollset_set " ) ; <nl> break ; <nl> } <nl> mmm a / src / core / iomgr / pollset_windows . h <nl> ppp b / src / core / iomgr / pollset_windows . h <nl> <nl> # ifndef GRPC_INTERNAL_CORE_IOMGR_POLLSET_WINDOWS_H <nl> # define GRPC_INTERNAL_CORE_IOMGR_POLLSET_WINDOWS_H <nl> <nl> - # include < windows . h > <nl> # include < grpc / support / sync . h > <nl> <nl> # include " src / core / iomgr / socket_windows . h " <nl> mmm a / src / core / iomgr / sockaddr_win32 . h <nl> ppp b / src / core / iomgr / sockaddr_win32 . h <nl> <nl> # ifndef GRPC_INTERNAL_CORE_IOMGR_SOCKADDR_WIN32_H <nl> # define GRPC_INTERNAL_CORE_IOMGR_SOCKADDR_WIN32_H <nl> <nl> - # include < ws2tcpip . h > <nl> # include < winsock2 . h > <nl> + # include < ws2tcpip . h > <nl> # include < mswsock . h > <nl> <nl> # ifdef __MINGW32__ <nl> mmm a / src / core / iomgr / socket_windows . h <nl> ppp b / src / core / iomgr / socket_windows . h <nl> <nl> # ifndef GRPC_INTERNAL_CORE_IOMGR_SOCKET_WINDOWS_H <nl> # define GRPC_INTERNAL_CORE_IOMGR_SOCKET_WINDOWS_H <nl> <nl> - # include < windows . h > <nl> + # include < grpc / support / port_platform . h > <nl> + # include < winsock2 . h > <nl> <nl> # include < grpc / support / sync . h > <nl> # include < grpc / support / atm . h > <nl> mmm a / src / core / iomgr / tcp_client_posix . c <nl> ppp b / src / core / iomgr / tcp_client_posix . c <nl> typedef struct { <nl> grpc_alarm alarm ; <nl> int refs ; <nl> grpc_iomgr_closure write_closure ; <nl> + grpc_pollset_set * interested_parties ; <nl> } async_connect ; <nl> <nl> static int prepare_socket ( const struct sockaddr * addr , int fd ) { <nl> static void on_writable ( void * acp , int success ) { <nl> goto finish ; <nl> } <nl> } else { <nl> + grpc_pollset_set_del_fd ( ac - > interested_parties , ac - > fd ) ; <nl> ep = grpc_tcp_create ( ac - > fd , GRPC_TCP_DEFAULT_READ_SLICE_SIZE ) ; <nl> goto finish ; <nl> } <nl> static void on_writable ( void * acp , int success ) { <nl> finish : <nl> gpr_mu_lock ( & ac - > mu ) ; <nl> if ( ! ep ) { <nl> + grpc_pollset_set_del_fd ( ac - > interested_parties , ac - > fd ) ; <nl> grpc_fd_orphan ( ac - > fd , NULL , " tcp_client_orphan " ) ; <nl> } <nl> done = ( - - ac - > refs = = 0 ) ; <nl> void grpc_tcp_client_connect ( void ( * cb ) ( void * arg , grpc_endpoint * ep ) , <nl> ac - > cb = cb ; <nl> ac - > cb_arg = arg ; <nl> ac - > fd = fdobj ; <nl> + ac - > interested_parties = interested_parties ; <nl> gpr_mu_init ( & ac - > mu ) ; <nl> ac - > refs = 2 ; <nl> ac - > write_closure . cb = on_writable ; <nl> mmm a / src / core / security / client_auth_filter . c <nl> ppp b / src / core / security / client_auth_filter . c <nl> typedef struct { <nl> so that work can progress when this call wants work to <nl> progress * / <nl> grpc_pollset * pollset ; <nl> - grpc_transport_op op ; <nl> + grpc_transport_stream_op op ; <nl> size_t op_md_idx ; <nl> int sent_initial_metadata ; <nl> gpr_uint8 security_context_set ; <nl> typedef struct { <nl> static void bubble_up_error ( grpc_call_element * elem , const char * error_msg ) { <nl> call_data * calld = elem - > call_data ; <nl> channel_data * chand = elem - > channel_data ; <nl> - grpc_transport_op_add_cancellation ( <nl> + grpc_transport_stream_op_add_cancellation ( <nl> & calld - > op , GRPC_STATUS_UNAUTHENTICATED , <nl> grpc_mdstr_from_string ( chand - > md_ctx , error_msg ) ) ; <nl> grpc_call_next_op ( elem , & calld - > op ) ; <nl> static void on_credentials_metadata ( void * user_data , <nl> grpc_call_element * elem = ( grpc_call_element * ) user_data ; <nl> call_data * calld = elem - > call_data ; <nl> channel_data * chand = elem - > channel_data ; <nl> - grpc_transport_op * op = & calld - > op ; <nl> + grpc_transport_stream_op * op = & calld - > op ; <nl> grpc_metadata_batch * mdb ; <nl> size_t i ; <nl> if ( status ! = GRPC_CREDENTIALS_OK ) { <nl> static char * build_service_url ( const char * url_scheme , call_data * calld ) { <nl> } <nl> <nl> static void send_security_metadata ( grpc_call_element * elem , <nl> - grpc_transport_op * op ) { <nl> + grpc_transport_stream_op * op ) { <nl> call_data * calld = elem - > call_data ; <nl> channel_data * chand = elem - > channel_data ; <nl> grpc_client_security_context * ctx = <nl> static void on_host_checked ( void * user_data , grpc_security_status status ) { <nl> op contains type and call direction information , in addition to the data <nl> that is being sent or received . * / <nl> static void auth_start_transport_op ( grpc_call_element * elem , <nl> - grpc_transport_op * op ) { <nl> + grpc_transport_stream_op * op ) { <nl> / * grab pointers to our data from the call element * / <nl> call_data * calld = elem - > call_data ; <nl> channel_data * chand = elem - > channel_data ; <nl> static void auth_start_transport_op ( grpc_call_element * elem , <nl> grpc_call_next_op ( elem , op ) ; <nl> } <nl> <nl> - / * Called on special channel events , such as disconnection or new incoming <nl> - calls on the server * / <nl> - static void channel_op ( grpc_channel_element * elem , <nl> - grpc_channel_element * from_elem , grpc_channel_op * op ) { <nl> - grpc_channel_next_op ( elem , op ) ; <nl> - } <nl> - <nl> / * Constructor for call_data * / <nl> static void init_call_elem ( grpc_call_element * elem , <nl> const void * server_transport_data , <nl> - grpc_transport_op * initial_op ) { <nl> + grpc_transport_stream_op * initial_op ) { <nl> call_data * calld = elem - > call_data ; <nl> calld - > creds = NULL ; <nl> calld - > host = NULL ; <nl> static void destroy_call_elem ( grpc_call_element * elem ) { <nl> } <nl> <nl> / * Constructor for channel_data * / <nl> - static void init_channel_elem ( grpc_channel_element * elem , <nl> + static void init_channel_elem ( grpc_channel_element * elem , grpc_channel * master , <nl> const grpc_channel_args * args , <nl> grpc_mdctx * metadata_context , int is_first , <nl> int is_last ) { <nl> static void init_channel_elem ( grpc_channel_element * elem , <nl> / * The first and the last filters tend to be implemented differently to <nl> handle the case that there ' s no ' next ' filter to call on the up or down <nl> path * / <nl> - GPR_ASSERT ( ! is_first ) ; <nl> GPR_ASSERT ( ! is_last ) ; <nl> GPR_ASSERT ( sc ! = NULL ) ; <nl> <nl> / * initialize members * / <nl> GPR_ASSERT ( sc - > is_client_side ) ; <nl> chand - > security_connector = <nl> - ( grpc_channel_security_connector * ) grpc_security_connector_ref ( sc ) ; <nl> + ( grpc_channel_security_connector * ) GRPC_SECURITY_CONNECTOR_REF ( <nl> + sc , " client_auth_filter " ) ; <nl> chand - > md_ctx = metadata_context ; <nl> chand - > authority_string = grpc_mdstr_from_string ( chand - > md_ctx , " : authority " ) ; <nl> chand - > path_string = grpc_mdstr_from_string ( chand - > md_ctx , " : path " ) ; <nl> static void destroy_channel_elem ( grpc_channel_element * elem ) { <nl> / * grab pointers to our data from the channel element * / <nl> channel_data * chand = elem - > channel_data ; <nl> grpc_channel_security_connector * ctx = chand - > security_connector ; <nl> - if ( ctx ! = NULL ) grpc_security_connector_unref ( & ctx - > base ) ; <nl> + if ( ctx ! = NULL ) <nl> + GRPC_SECURITY_CONNECTOR_UNREF ( & ctx - > base , " client_auth_filter " ) ; <nl> if ( chand - > authority_string ! = NULL ) { <nl> grpc_mdstr_unref ( chand - > authority_string ) ; <nl> } <nl> static void destroy_channel_elem ( grpc_channel_element * elem ) { <nl> } <nl> <nl> const grpc_channel_filter grpc_client_auth_filter = { <nl> - auth_start_transport_op , channel_op , sizeof ( call_data ) , <nl> + auth_start_transport_op , grpc_channel_next_op , sizeof ( call_data ) , <nl> init_call_elem , destroy_call_elem , sizeof ( channel_data ) , <nl> init_channel_elem , destroy_channel_elem , " client - auth " } ; <nl> mmm a / src / core / security / credentials . c <nl> ppp b / src / core / security / credentials . c <nl> static grpc_security_status ssl_create_security_connector ( <nl> arg . type = GRPC_ARG_STRING ; <nl> arg . key = GRPC_ARG_HTTP2_SCHEME ; <nl> arg . value . string = " https " ; <nl> - * new_args = grpc_channel_args_copy_and_add ( args , & arg ) ; <nl> + * new_args = grpc_channel_args_copy_and_add ( args , & arg , 1 ) ; <nl> return status ; <nl> } <nl> <nl> mmm a / src / core / security / secure_transport_setup . c <nl> ppp b / src / core / security / secure_transport_setup . c <nl> static void secure_transport_setup_done ( grpc_secure_transport_setup * s , <nl> if ( s - > handshaker ! = NULL ) tsi_handshaker_destroy ( s - > handshaker ) ; <nl> if ( s - > handshake_buffer ! = NULL ) gpr_free ( s - > handshake_buffer ) ; <nl> gpr_slice_buffer_destroy ( & s - > left_overs ) ; <nl> - grpc_security_connector_unref ( s - > connector ) ; <nl> + GRPC_SECURITY_CONNECTOR_UNREF ( s - > connector , " secure_transport_setup " ) ; <nl> gpr_free ( s ) ; <nl> } <nl> <nl> static void on_handshake_data_received_from_peer ( <nl> gpr_slice_split_tail ( & slices [ i ] , consumed_slice_size ) ) ; <nl> gpr_slice_unref ( slices [ i ] ) ; / * split_tail above increments refcount . * / <nl> } <nl> - gpr_slice_buffer_addn ( & s - > left_overs , & slices [ i + 1 ] , <nl> - num_left_overs - ( size_t ) has_left_overs_in_current_slice ) ; <nl> + gpr_slice_buffer_addn ( <nl> + & s - > left_overs , & slices [ i + 1 ] , <nl> + num_left_overs - ( size_t ) has_left_overs_in_current_slice ) ; <nl> check_peer ( s ) ; <nl> } <nl> <nl> void grpc_setup_secure_transport ( grpc_security_connector * connector , <nl> secure_transport_setup_done ( s , 0 ) ; <nl> return ; <nl> } <nl> - s - > connector = grpc_security_connector_ref ( connector ) ; <nl> + s - > connector = <nl> + GRPC_SECURITY_CONNECTOR_REF ( connector , " secure_transport_setup " ) ; <nl> s - > handshake_buffer_size = GRPC_INITIAL_HANDSHAKE_BUFFER_SIZE ; <nl> s - > handshake_buffer = gpr_malloc ( s - > handshake_buffer_size ) ; <nl> s - > endpoint = nonsecure_endpoint ; <nl> mmm a / src / core / security / security_connector . c <nl> ppp b / src / core / security / security_connector . c <nl> static const char * ssl_cipher_suites ( void ) { <nl> / * - - Common methods . - - * / <nl> <nl> / * Returns the first property with that name . * / <nl> - const tsi_peer_property * tsi_peer_get_property_by_name ( <nl> - const tsi_peer * peer , const char * name ) { <nl> + const tsi_peer_property * tsi_peer_get_property_by_name ( const tsi_peer * peer , <nl> + const char * name ) { <nl> size_t i ; <nl> if ( peer = = NULL ) return NULL ; <nl> for ( i = 0 ; i < peer - > property_count ; i + + ) { <nl> - const tsi_peer_property * property = & peer - > properties [ i ] ; <nl> + const tsi_peer_property * property = & peer - > properties [ i ] ; <nl> if ( name = = NULL & & property - > name = = NULL ) { <nl> return property ; <nl> } <nl> grpc_security_status grpc_channel_security_connector_check_call_host ( <nl> return sc - > check_call_host ( sc , host , cb , user_data ) ; <nl> } <nl> <nl> - void grpc_security_connector_unref ( grpc_security_connector * sc ) { <nl> - if ( sc = = NULL ) return ; <nl> - if ( gpr_unref ( & sc - > refcount ) ) sc - > vtable - > destroy ( sc ) ; <nl> - } <nl> - <nl> + # ifdef GRPC_SECURITY_CONNECTOR_REFCOUNT_DEBUG <nl> + grpc_security_connector * grpc_security_connector_ref ( <nl> + grpc_security_connector * sc , const char * file , int line , <nl> + const char * reason ) { <nl> + if ( sc = = NULL ) return NULL ; <nl> + gpr_log ( file , line , GPR_LOG_SEVERITY_DEBUG , <nl> + " SECURITY_CONNECTOR : % p ref % d - > % d % s " , sc , <nl> + ( int ) sc - > refcount . count , ( int ) sc - > refcount . count + 1 , reason ) ; <nl> + # else <nl> grpc_security_connector * grpc_security_connector_ref ( <nl> grpc_security_connector * sc ) { <nl> if ( sc = = NULL ) return NULL ; <nl> + # endif <nl> gpr_ref ( & sc - > refcount ) ; <nl> return sc ; <nl> } <nl> <nl> + # ifdef GRPC_SECURITY_CONNECTOR_REFCOUNT_DEBUG <nl> + void grpc_security_connector_unref ( grpc_security_connector * sc , <nl> + const char * file , int line , <nl> + const char * reason ) { <nl> + if ( sc = = NULL ) return ; <nl> + gpr_log ( file , line , GPR_LOG_SEVERITY_DEBUG , <nl> + " SECURITY_CONNECTOR : % p unref % d - > % d % s " , sc , <nl> + ( int ) sc - > refcount . count , ( int ) sc - > refcount . count - 1 , reason ) ; <nl> + # else <nl> + void grpc_security_connector_unref ( grpc_security_connector * sc ) { <nl> + if ( sc = = NULL ) return ; <nl> + # endif <nl> + if ( gpr_unref ( & sc - > refcount ) ) sc - > vtable - > destroy ( sc ) ; <nl> + } <nl> + <nl> static void connector_pointer_arg_destroy ( void * p ) { <nl> - grpc_security_connector_unref ( p ) ; <nl> + GRPC_SECURITY_CONNECTOR_UNREF ( p , " connector_pointer_arg " ) ; <nl> } <nl> <nl> static void * connector_pointer_arg_copy ( void * p ) { <nl> - return grpc_security_connector_ref ( p ) ; <nl> + return GRPC_SECURITY_CONNECTOR_REF ( p , " connector_pointer_arg " ) ; <nl> } <nl> <nl> grpc_arg grpc_security_connector_to_arg ( grpc_security_connector * sc ) { <nl> grpc_security_status grpc_ssl_channel_security_connector_create ( <nl> config - > pem_private_key , config - > pem_private_key_size , <nl> config - > pem_cert_chain , config - > pem_cert_chain_size , pem_root_certs , <nl> pem_root_certs_size , ssl_cipher_suites ( ) , alpn_protocol_strings , <nl> - alpn_protocol_string_lengths , ( uint16_t ) num_alpn_protocols , & c - > handshaker_factory ) ; <nl> + alpn_protocol_string_lengths , ( uint16_t ) num_alpn_protocols , <nl> + & c - > handshaker_factory ) ; <nl> if ( result ! = TSI_OK ) { <nl> gpr_log ( GPR_ERROR , " Handshaker factory creation failed with % s . " , <nl> tsi_result_to_string ( result ) ) ; <nl> grpc_security_status grpc_ssl_server_security_connector_create ( <nl> ( const unsigned char * * ) config - > pem_cert_chains , <nl> config - > pem_cert_chains_sizes , config - > num_key_cert_pairs , <nl> config - > pem_root_certs , config - > pem_root_certs_size , ssl_cipher_suites ( ) , <nl> - alpn_protocol_strings , alpn_protocol_string_lengths , ( uint16_t ) num_alpn_protocols , <nl> - & c - > handshaker_factory ) ; <nl> + alpn_protocol_strings , alpn_protocol_string_lengths , <nl> + ( uint16_t ) num_alpn_protocols , & c - > handshaker_factory ) ; <nl> if ( result ! = TSI_OK ) { <nl> gpr_log ( GPR_ERROR , " Handshaker factory creation failed with % s . " , <nl> tsi_result_to_string ( result ) ) ; <nl> mmm a / src / core / security / security_connector . h <nl> ppp b / src / core / security / security_connector . h <nl> struct grpc_security_connector { <nl> grpc_auth_context * auth_context ; / * Populated after the peer is checked . * / <nl> } ; <nl> <nl> - / * Increments the refcount . * / <nl> + / * Refcounting . * / <nl> + # ifdef GRPC_SECURITY_CONNECTOR_REFCOUNT_DEBUG <nl> + # define GRPC_SECURITY_CONNECTOR_REF ( p , r ) \ <nl> + grpc_security_connector_ref ( ( p ) , __FILE__ , __LINE__ , ( r ) ) <nl> + # define GRPC_SECURITY_CONNECTOR_UNREF ( p , r ) \ <nl> + grpc_security_connector_unref ( ( p ) , __FILE__ , __LINE__ , ( r ) ) <nl> grpc_security_connector * grpc_security_connector_ref ( <nl> - grpc_security_connector * sc ) ; <nl> - <nl> - / * Decrements the refcount and destroys the object if it reaches 0 . * / <nl> - void grpc_security_connector_unref ( grpc_security_connector * sc ) ; <nl> + grpc_security_connector * policy , const char * file , int line , <nl> + const char * reason ) ; <nl> + void grpc_security_connector_unref ( grpc_security_connector * policy , <nl> + const char * file , int line , <nl> + const char * reason ) ; <nl> + # else <nl> + # define GRPC_SECURITY_CONNECTOR_REF ( p , r ) grpc_security_connector_ref ( ( p ) ) <nl> + # define GRPC_SECURITY_CONNECTOR_UNREF ( p , r ) grpc_security_connector_unref ( ( p ) ) <nl> + grpc_security_connector * grpc_security_connector_ref ( <nl> + grpc_security_connector * policy ) ; <nl> + void grpc_security_connector_unref ( grpc_security_connector * policy ) ; <nl> + # endif <nl> <nl> / * Handshake creation . * / <nl> grpc_security_status grpc_security_connector_create_handshaker ( <nl> typedef struct { <nl> specific error code otherwise . <nl> * / <nl> grpc_security_status grpc_ssl_channel_security_connector_create ( <nl> - grpc_credentials * request_metadata_creds , <nl> - const grpc_ssl_config * config , const char * target_name , <nl> - const char * overridden_target_name , grpc_channel_security_connector * * sc ) ; <nl> + grpc_credentials * request_metadata_creds , const grpc_ssl_config * config , <nl> + const char * target_name , const char * overridden_target_name , <nl> + grpc_channel_security_connector * * sc ) ; <nl> <nl> / * Gets the default ssl roots . * / <nl> size_t grpc_get_default_ssl_roots ( const unsigned char * * pem_root_certs ) ; <nl> grpc_security_status grpc_ssl_server_security_connector_create ( <nl> const grpc_ssl_server_config * config , grpc_security_connector * * sc ) ; <nl> <nl> / * Util . * / <nl> - const tsi_peer_property * tsi_peer_get_property_by_name ( <nl> - const tsi_peer * peer , const char * name ) ; <nl> + const tsi_peer_property * tsi_peer_get_property_by_name ( const tsi_peer * peer , <nl> + const char * name ) ; <nl> <nl> / * Exposed for testing only . * / <nl> grpc_auth_context * tsi_ssl_peer_to_auth_context ( const tsi_peer * peer ) ; <nl> mmm a / src / core / security / server_auth_filter . c <nl> ppp b / src / core / security / server_auth_filter . c <nl> typedef struct channel_data { <nl> op contains type and call direction information , in addition to the data <nl> that is being sent or received . * / <nl> static void auth_start_transport_op ( grpc_call_element * elem , <nl> - grpc_transport_op * op ) { <nl> + grpc_transport_stream_op * op ) { <nl> / * TODO ( jboeuf ) : Get the metadata and get a new context from it . * / <nl> <nl> / * pass control down the stack * / <nl> grpc_call_next_op ( elem , op ) ; <nl> } <nl> <nl> - / * Called on special channel events , such as disconnection or new incoming <nl> - calls on the server * / <nl> - static void channel_op ( grpc_channel_element * elem , <nl> - grpc_channel_element * from_elem , grpc_channel_op * op ) { <nl> - grpc_channel_next_op ( elem , op ) ; <nl> - } <nl> - <nl> / * Constructor for call_data * / <nl> static void init_call_elem ( grpc_call_element * elem , <nl> const void * server_transport_data , <nl> - grpc_transport_op * initial_op ) { <nl> + grpc_transport_stream_op * initial_op ) { <nl> / * grab pointers to our data from the call element * / <nl> call_data * calld = elem - > call_data ; <nl> channel_data * chand = elem - > channel_data ; <nl> static void init_call_elem ( grpc_call_element * elem , <nl> } <nl> <nl> / * Destructor for call_data * / <nl> - static void destroy_call_elem ( grpc_call_element * elem ) { <nl> - } <nl> + static void destroy_call_elem ( grpc_call_element * elem ) { } <nl> <nl> / * Constructor for channel_data * / <nl> - static void init_channel_elem ( grpc_channel_element * elem , <nl> + static void init_channel_elem ( grpc_channel_element * elem , grpc_channel * master , <nl> const grpc_channel_args * args , grpc_mdctx * mdctx , <nl> int is_first , int is_last ) { <nl> grpc_security_connector * sc = grpc_find_security_connector_in_args ( args ) ; <nl> static void init_channel_elem ( grpc_channel_element * elem , <nl> <nl> / * initialize members * / <nl> GPR_ASSERT ( ! sc - > is_client_side ) ; <nl> - chand - > security_connector = grpc_security_connector_ref ( sc ) ; <nl> + chand - > security_connector = <nl> + GRPC_SECURITY_CONNECTOR_REF ( sc , " server_auth_filter " ) ; <nl> } <nl> <nl> / * Destructor for channel data * / <nl> static void destroy_channel_elem ( grpc_channel_element * elem ) { <nl> / * grab pointers to our data from the channel element * / <nl> channel_data * chand = elem - > channel_data ; <nl> - grpc_security_connector_unref ( chand - > security_connector ) ; <nl> + GRPC_SECURITY_CONNECTOR_UNREF ( chand - > security_connector , <nl> + " server_auth_filter " ) ; <nl> } <nl> <nl> const grpc_channel_filter grpc_server_auth_filter = { <nl> - auth_start_transport_op , channel_op , sizeof ( call_data ) , init_call_elem , <nl> - destroy_call_elem , sizeof ( channel_data ) , init_channel_elem , <nl> - destroy_channel_elem , " server - auth " } ; <nl> + auth_start_transport_op , grpc_channel_next_op , sizeof ( call_data ) , <nl> + init_call_elem , destroy_call_elem , sizeof ( channel_data ) , <nl> + init_channel_elem , destroy_channel_elem , " server - auth " } ; <nl> mmm a / src / core / security / server_secure_chttp2 . c <nl> ppp b / src / core / security / server_secure_chttp2 . c <nl> static void state_unref ( grpc_server_secure_state * state ) { <nl> gpr_mu_lock ( & state - > mu ) ; <nl> gpr_mu_unlock ( & state - > mu ) ; <nl> / * clean up * / <nl> - grpc_security_connector_unref ( state - > sc ) ; <nl> + GRPC_SECURITY_CONNECTOR_UNREF ( state - > sc , " server " ) ; <nl> gpr_free ( state ) ; <nl> } <nl> } <nl> <nl> - static grpc_transport_setup_result setup_transport ( void * statep , <nl> - grpc_transport * transport , <nl> - grpc_mdctx * mdctx ) { <nl> + static void setup_transport ( void * statep , grpc_transport * transport , <nl> + grpc_mdctx * mdctx ) { <nl> static grpc_channel_filter const * extra_filters [ ] = { <nl> & grpc_server_auth_filter , & grpc_http_server_filter } ; <nl> grpc_server_secure_state * state = statep ; <nl> - grpc_transport_setup_result result ; <nl> grpc_arg connector_arg = grpc_security_connector_to_arg ( state - > sc ) ; <nl> grpc_channel_args * args_copy = grpc_channel_args_copy_and_add ( <nl> - grpc_server_get_channel_args ( state - > server ) , & connector_arg ) ; <nl> - result = grpc_server_setup_transport ( state - > server , transport , extra_filters , <nl> - GPR_ARRAY_SIZE ( extra_filters ) , mdctx , <nl> - args_copy ) ; <nl> + grpc_server_get_channel_args ( state - > server ) , & connector_arg , 1 ) ; <nl> + grpc_server_setup_transport ( state - > server , transport , extra_filters , <nl> + GPR_ARRAY_SIZE ( extra_filters ) , mdctx , args_copy ) ; <nl> grpc_channel_args_destroy ( args_copy ) ; <nl> - return result ; <nl> } <nl> <nl> static void on_secure_transport_setup_done ( void * statep , <nl> grpc_security_status status , <nl> grpc_endpoint * secure_endpoint ) { <nl> grpc_server_secure_state * state = statep ; <nl> + grpc_transport * transport ; <nl> + grpc_mdctx * mdctx ; <nl> if ( status = = GRPC_SECURITY_OK ) { <nl> gpr_mu_lock ( & state - > mu ) ; <nl> if ( ! state - > is_shutdown ) { <nl> - grpc_create_chttp2_transport ( <nl> - setup_transport , state , grpc_server_get_channel_args ( state - > server ) , <nl> - secure_endpoint , NULL , 0 , grpc_mdctx_create ( ) , 0 ) ; <nl> + mdctx = grpc_mdctx_create ( ) ; <nl> + transport = grpc_create_chttp2_transport ( <nl> + grpc_server_get_channel_args ( state - > server ) , secure_endpoint , mdctx , <nl> + 0 ) ; <nl> + setup_transport ( state , transport , mdctx ) ; <nl> + grpc_chttp2_transport_start_reading ( transport , NULL , 0 ) ; <nl> } else { <nl> / * We need to consume this here , because the server may already have gone <nl> * away . * / <nl> int grpc_server_add_secure_http2_port ( grpc_server * server , const char * addr , <nl> / * Error path : cleanup and return * / <nl> error : <nl> if ( sc ) { <nl> - grpc_security_connector_unref ( sc ) ; <nl> + GRPC_SECURITY_CONNECTOR_UNREF ( sc , " server " ) ; <nl> } <nl> if ( resolved ) { <nl> grpc_resolved_addresses_destroy ( resolved ) ; <nl> mmm a / src / core / support / cpu_windows . c <nl> ppp b / src / core / support / cpu_windows . c <nl> <nl> # include < grpc / support / port_platform . h > <nl> <nl> # ifdef GPR_WIN32 <nl> - # include < windows . h > <nl> # include < grpc / support / log . h > <nl> <nl> unsigned gpr_cpu_num_cores ( void ) { <nl> mmm a / src / core / support / string_win32 . c <nl> ppp b / src / core / support / string_win32 . c <nl> <nl> <nl> # ifdef GPR_WIN32 <nl> <nl> - # include < windows . h > <nl> # include < stdio . h > <nl> # include < stdarg . h > <nl> # include < string . h > <nl> mmm a / src / core / support / string_win32 . h <nl> ppp b / src / core / support / string_win32 . h <nl> <nl> <nl> # ifdef GPR_WIN32 <nl> <nl> - # include < windows . h > <nl> - <nl> / * These allocate new strings using gpr_malloc to convert from and to utf - 8 . * / <nl> LPTSTR gpr_char_to_tchar ( LPCSTR input ) ; <nl> LPSTR gpr_tchar_to_char ( LPCTSTR input ) ; <nl> mmm a / src / core / support / sync_win32 . c <nl> ppp b / src / core / support / sync_win32 . c <nl> <nl> <nl> # ifdef GPR_WIN32 <nl> <nl> - # undef _WIN32_WINNT <nl> - # define _WIN32_WINNT 0x0600 <nl> - # include < windows . h > <nl> # include < grpc / support / log . h > <nl> # include < grpc / support / sync . h > <nl> # include < grpc / support / time . h > <nl> mmm a / src / core / support / thd_win32 . c <nl> ppp b / src / core / support / thd_win32 . c <nl> <nl> <nl> # ifdef GPR_WIN32 <nl> <nl> - # include < windows . h > <nl> # include < string . h > <nl> # include < grpc / support / alloc . h > <nl> # include < grpc / support / log . h > <nl> mmm a / src / core / support / time_win32 . c <nl> ppp b / src / core / support / time_win32 . c <nl> <nl> <nl> # include < grpc / support / time . h > <nl> # include < sys / timeb . h > <nl> - # include < windows . h > <nl> <nl> gpr_timespec gpr_now ( void ) { <nl> gpr_timespec now_tv ; <nl> mmm a / src / core / surface / call . c <nl> ppp b / src / core / surface / call . c <nl> struct grpc_call { <nl> static void set_deadline_alarm ( grpc_call * call , gpr_timespec deadline ) ; <nl> static void call_on_done_recv ( void * call , int success ) ; <nl> static void call_on_done_send ( void * call , int success ) ; <nl> - static int fill_send_ops ( grpc_call * call , grpc_transport_op * op ) ; <nl> - static void execute_op ( grpc_call * call , grpc_transport_op * op ) ; <nl> + static int fill_send_ops ( grpc_call * call , grpc_transport_stream_op * op ) ; <nl> + static void execute_op ( grpc_call * call , grpc_transport_stream_op * op ) ; <nl> static void recv_metadata ( grpc_call * call , grpc_metadata_batch * metadata ) ; <nl> static void finish_read_ops ( grpc_call * call ) ; <nl> static grpc_call_error cancel_with_status ( grpc_call * c , grpc_status_code status , <nl> grpc_call * grpc_call_create ( grpc_channel * channel , grpc_completion_queue * cq , <nl> size_t add_initial_metadata_count , <nl> gpr_timespec send_deadline ) { <nl> size_t i ; <nl> - grpc_transport_op initial_op ; <nl> - grpc_transport_op * initial_op_ptr = NULL ; <nl> + grpc_transport_stream_op initial_op ; <nl> + grpc_transport_stream_op * initial_op_ptr = NULL ; <nl> grpc_channel_stack * channel_stack = grpc_channel_get_channel_stack ( channel ) ; <nl> grpc_call * call = <nl> gpr_malloc ( sizeof ( grpc_call ) + channel_stack - > call_stack_size ) ; <nl> static int need_more_data ( grpc_call * call ) { <nl> ( is_op_live ( call , GRPC_IOREQ_RECV_CLOSE ) & & <nl> grpc_bbq_empty ( & call - > incoming_queue ) ) | | <nl> ( call - > write_state = = WRITE_STATE_INITIAL & & ! call - > is_client ) | | <nl> - ( call - > cancel_with_status ! = GRPC_STATUS_OK ) | | <nl> - call - > destroy_called ; <nl> + ( call - > cancel_with_status ! = GRPC_STATUS_OK ) | | call - > destroy_called ; <nl> } <nl> <nl> static void unlock ( grpc_call * call ) { <nl> - grpc_transport_op op ; <nl> + grpc_transport_stream_op op ; <nl> completed_request completed_requests [ GRPC_IOREQ_OP_COUNT ] ; <nl> int completing_requests = 0 ; <nl> int start_op = 0 ; <nl> static void copy_byte_buffer_to_stream_ops ( grpc_byte_buffer * byte_buffer , <nl> } <nl> } <nl> <nl> - static int fill_send_ops ( grpc_call * call , grpc_transport_op * op ) { <nl> + static int fill_send_ops ( grpc_call * call , grpc_transport_stream_op * op ) { <nl> grpc_ioreq_data data ; <nl> gpr_uint32 flags ; <nl> grpc_metadata_batch mdb ; <nl> static void finished_loose_op_allocated ( void * alloc , int success ) { <nl> gpr_free ( args ) ; <nl> } <nl> <nl> - static void execute_op ( grpc_call * call , grpc_transport_op * op ) { <nl> + static void execute_op ( grpc_call * call , grpc_transport_stream_op * op ) { <nl> grpc_call_element * elem ; <nl> <nl> GPR_ASSERT ( op - > on_consumed = = NULL ) ; <nl> static void execute_op ( grpc_call * call , grpc_transport_op * op ) { <nl> } else { <nl> finished_loose_op_allocated_args * args = gpr_malloc ( sizeof ( * args ) ) ; <nl> args - > call = call ; <nl> - grpc_iomgr_closure_init ( & args - > closure , finished_loose_op_allocated , args ) ; <nl> + grpc_iomgr_closure_init ( & args - > closure , finished_loose_op_allocated , <nl> + args ) ; <nl> op - > on_consumed = & args - > closure ; <nl> } <nl> } <nl> <nl> elem = CALL_ELEM_FROM_CALL ( call , 0 ) ; <nl> op - > context = call - > context ; <nl> - elem - > filter - > start_transport_op ( elem , op ) ; <nl> + elem - > filter - > start_transport_stream_op ( elem , op ) ; <nl> } <nl> <nl> grpc_call * grpc_call_from_top_element ( grpc_call_element * elem ) { <nl> static gpr_uint32 decode_compression ( grpc_mdelem * md ) { <nl> } else { <nl> gpr_uint32 parsed_clevel_bytes ; <nl> if ( gpr_parse_bytes_to_uint32 ( grpc_mdstr_as_c_string ( md - > value ) , <nl> - GPR_SLICE_LENGTH ( md - > value - > slice ) , <nl> - & parsed_clevel_bytes ) ) { <nl> + GPR_SLICE_LENGTH ( md - > value - > slice ) , <nl> + & parsed_clevel_bytes ) ) { <nl> / * the following cast is safe , as a gpr_uint32 should be able to hold all <nl> * possible values of the grpc_compression_level enum * / <nl> - clevel = ( grpc_compression_level ) parsed_clevel_bytes ; <nl> + clevel = ( grpc_compression_level ) parsed_clevel_bytes ; <nl> } else { <nl> - clevel = GRPC_COMPRESS_LEVEL_NONE ; / * could not parse , no compression * / <nl> + clevel = GRPC_COMPRESS_LEVEL_NONE ; / * could not parse , no compression * / <nl> } <nl> grpc_mdelem_set_user_data ( md , destroy_compression , <nl> ( void * ) ( gpr_intptr ) ( clevel + COMPRESS_OFFSET ) ) ; <nl> static void recv_metadata ( grpc_call * call , grpc_metadata_batch * md ) { <nl> set_status_code ( call , STATUS_FROM_WIRE , decode_status ( md ) ) ; <nl> } else if ( key = = grpc_channel_get_message_string ( call - > channel ) ) { <nl> set_status_details ( call , STATUS_FROM_WIRE , grpc_mdstr_ref ( md - > value ) ) ; <nl> - } else if ( key = = grpc_channel_get_compresssion_level_string ( call - > channel ) ) { <nl> + } else if ( key = = <nl> + grpc_channel_get_compresssion_level_string ( call - > channel ) ) { <nl> set_decode_compression_level ( call , decode_compression ( md ) ) ; <nl> } else { <nl> dest = & call - > buffered_metadata [ is_trailing ] ; <nl> mmm a / src / core / surface / channel . c <nl> ppp b / src / core / surface / channel . c <nl> <nl> # include " src / core / iomgr / iomgr . h " <nl> # include " src / core / support / string . h " <nl> # include " src / core / surface / call . h " <nl> - # include " src / core / surface / client . h " <nl> # include " src / core / surface / init . h " <nl> # include < grpc / support / alloc . h > <nl> # include < grpc / support / log . h > <nl> grpc_channel * grpc_channel_create_from_filters ( <nl> grpc_channel * channel = gpr_malloc ( size ) ; <nl> GPR_ASSERT ( grpc_is_initialized ( ) & & " call grpc_init ( ) " ) ; <nl> channel - > is_client = is_client ; <nl> - / * decremented by grpc_channel_destroy , and grpc_client_channel_closed if <nl> - * is_client * / <nl> - gpr_ref_init ( & channel - > refs , 1 + is_client ) ; <nl> + / * decremented by grpc_channel_destroy * / <nl> + gpr_ref_init ( & channel - > refs , 1 ) ; <nl> channel - > metadata_context = mdctx ; <nl> channel - > grpc_status_string = grpc_mdstr_from_string ( mdctx , " grpc - status " ) ; <nl> channel - > grpc_compression_level_string = <nl> grpc_channel * grpc_channel_create_from_filters ( <nl> } <nl> channel - > path_string = grpc_mdstr_from_string ( mdctx , " : path " ) ; <nl> channel - > authority_string = grpc_mdstr_from_string ( mdctx , " : authority " ) ; <nl> - grpc_channel_stack_init ( filters , num_filters , args , channel - > metadata_context , <nl> - CHANNEL_STACK_FROM_CHANNEL ( channel ) ) ; <nl> gpr_mu_init ( & channel - > registered_call_mu ) ; <nl> channel - > registered_calls = NULL ; <nl> <nl> grpc_channel * grpc_channel_create_from_filters ( <nl> } <nl> } <nl> <nl> + grpc_channel_stack_init ( filters , num_filters , channel , args , <nl> + channel - > metadata_context , <nl> + CHANNEL_STACK_FROM_CHANNEL ( channel ) ) ; <nl> + <nl> return channel ; <nl> } <nl> <nl> void grpc_channel_internal_unref ( grpc_channel * channel ) { <nl> } <nl> <nl> void grpc_channel_destroy ( grpc_channel * channel ) { <nl> - grpc_channel_op op ; <nl> + grpc_transport_op op ; <nl> grpc_channel_element * elem ; <nl> - <nl> + memset ( & op , 0 , sizeof ( op ) ) ; <nl> + op . disconnect = 1 ; <nl> elem = grpc_channel_stack_element ( CHANNEL_STACK_FROM_CHANNEL ( channel ) , 0 ) ; <nl> - <nl> - op . type = GRPC_CHANNEL_GOAWAY ; <nl> - op . dir = GRPC_CALL_DOWN ; <nl> - op . data . goaway . status = GRPC_STATUS_OK ; <nl> - op . data . goaway . message = gpr_slice_from_copied_string ( " Client disconnect " ) ; <nl> - elem - > filter - > channel_op ( elem , NULL , & op ) ; <nl> - <nl> - op . type = GRPC_CHANNEL_DISCONNECT ; <nl> - op . dir = GRPC_CALL_DOWN ; <nl> - elem - > filter - > channel_op ( elem , NULL , & op ) ; <nl> + elem - > filter - > start_transport_op ( elem , & op ) ; <nl> <nl> GRPC_CHANNEL_INTERNAL_UNREF ( channel , " channel " ) ; <nl> } <nl> <nl> - void grpc_client_channel_closed ( grpc_channel_element * elem ) { <nl> - GRPC_CHANNEL_INTERNAL_UNREF ( CHANNEL_FROM_TOP_ELEM ( elem ) , " closed " ) ; <nl> - } <nl> - <nl> grpc_channel_stack * grpc_channel_get_channel_stack ( grpc_channel * channel ) { <nl> return CHANNEL_STACK_FROM_CHANNEL ( channel ) ; <nl> } <nl> grpc_mdstr * grpc_channel_get_compresssion_level_string ( grpc_channel * channel ) { <nl> return channel - > grpc_compression_level_string ; <nl> } <nl> <nl> - <nl> grpc_mdelem * grpc_channel_get_reffed_status_elem ( grpc_channel * channel , int i ) { <nl> if ( i > = 0 & & i < NUM_CACHED_STATUS_ELEMS ) { <nl> return grpc_mdelem_ref ( channel - > grpc_status_elem [ i ] ) ; <nl> mmm a / src / core / surface / channel . h <nl> ppp b / src / core / surface / channel . h <nl> <nl> # define GRPC_INTERNAL_CORE_SURFACE_CHANNEL_H <nl> <nl> # include " src / core / channel / channel_stack . h " <nl> + # include " src / core / client_config / subchannel_factory . h " <nl> <nl> grpc_channel * grpc_channel_create_from_filters ( <nl> const grpc_channel_filter * * filters , size_t count , <nl> grpc_mdstr * grpc_channel_get_compresssion_level_string ( grpc_channel * channel ) ; <nl> grpc_mdstr * grpc_channel_get_message_string ( grpc_channel * channel ) ; <nl> gpr_uint32 grpc_channel_get_max_message_length ( grpc_channel * channel ) ; <nl> <nl> - void grpc_client_channel_closed ( grpc_channel_element * elem ) ; <nl> - <nl> # ifdef GRPC_CHANNEL_REF_COUNT_DEBUG <nl> void grpc_channel_internal_ref ( grpc_channel * channel , const char * reason ) ; <nl> void grpc_channel_internal_unref ( grpc_channel * channel , const char * reason ) ; <nl> mmm a / src / core / surface / channel_create . c <nl> ppp b / src / core / surface / channel_create . c <nl> <nl> * <nl> * / <nl> <nl> - # include " src / core / iomgr / sockaddr . h " <nl> - <nl> # include < grpc / grpc . h > <nl> <nl> # include < stdlib . h > <nl> # include < string . h > <nl> <nl> - # include " src / core / channel / census_filter . h " <nl> + # include < grpc / support / alloc . h > <nl> + <nl> # include " src / core / channel / channel_args . h " <nl> # include " src / core / channel / client_channel . h " <nl> - # include " src / core / channel / client_setup . h " <nl> - # include " src / core / channel / connected_channel . h " <nl> # include " src / core / channel / http_client_filter . h " <nl> - # include " src / core / iomgr / endpoint . h " <nl> - # include " src / core / iomgr / resolve_address . h " <nl> + # include " src / core / client_config / resolver_registry . h " <nl> # include " src / core / iomgr / tcp_client . h " <nl> # include " src / core / surface / channel . h " <nl> - # include " src / core / surface / client . h " <nl> - # include " src / core / support / string . h " <nl> # include " src / core / transport / chttp2_transport . h " <nl> - # include < grpc / support / alloc . h > <nl> - # include < grpc / support / log . h > <nl> - # include < grpc / support / string_util . h > <nl> - # include < grpc / support / sync . h > <nl> - # include < grpc / support / useful . h > <nl> - <nl> - typedef struct setup setup ; <nl> <nl> - / * A single setup request ( started via initiate ) * / <nl> typedef struct { <nl> - grpc_client_setup_request * cs_request ; <nl> - setup * setup ; <nl> - / * Resolved addresses , or null if resolution not yet completed * / <nl> - grpc_resolved_addresses * resolved ; <nl> - / * which address in resolved should we pick for the next connection attempt * / <nl> - size_t resolved_index ; <nl> - } request ; <nl> - <nl> - / * Global setup logic ( may be running many simultaneous setup requests , but <nl> - with only one ' active ' * / <nl> - struct setup { <nl> - const char * target ; <nl> - grpc_transport_setup_callback setup_callback ; <nl> - void * setup_user_data ; <nl> - } ; <nl> - <nl> - static int maybe_try_next_resolved ( request * r ) ; <nl> - <nl> - static void done ( request * r , int was_successful ) { <nl> - grpc_client_setup_request_finish ( r - > cs_request , was_successful ) ; <nl> - if ( r - > resolved ) { <nl> - grpc_resolved_addresses_destroy ( r - > resolved ) ; <nl> - } <nl> - gpr_free ( r ) ; <nl> + grpc_connector base ; <nl> + gpr_refcount refs ; <nl> + <nl> + grpc_iomgr_closure * notify ; <nl> + grpc_connect_in_args args ; <nl> + grpc_connect_out_args * result ; <nl> + } connector ; <nl> + <nl> + static void connector_ref ( grpc_connector * con ) { <nl> + connector * c = ( connector * ) con ; <nl> + gpr_ref ( & c - > refs ) ; <nl> } <nl> <nl> - / * connection callback : tcp is either valid , or null on error * / <nl> - static void on_connect ( void * rp , grpc_endpoint * tcp ) { <nl> - request * r = rp ; <nl> - <nl> - if ( ! grpc_client_setup_request_should_continue ( r - > cs_request , " on_connect " ) ) { <nl> - if ( tcp ) { <nl> - grpc_endpoint_shutdown ( tcp ) ; <nl> - grpc_endpoint_destroy ( tcp ) ; <nl> - } <nl> - done ( r , 0 ) ; <nl> - return ; <nl> + static void connector_unref ( grpc_connector * con ) { <nl> + connector * c = ( connector * ) con ; <nl> + if ( gpr_unref ( & c - > refs ) ) { <nl> + gpr_free ( c ) ; <nl> } <nl> + } <nl> <nl> - if ( ! tcp ) { <nl> - if ( ! maybe_try_next_resolved ( r ) ) { <nl> - done ( r , 0 ) ; <nl> - return ; <nl> - } else { <nl> - return ; <nl> - } <nl> - } else if ( grpc_client_setup_cb_begin ( r - > cs_request , " on_connect " ) ) { <nl> - grpc_create_chttp2_transport ( <nl> - r - > setup - > setup_callback , r - > setup - > setup_user_data , <nl> - grpc_client_setup_get_channel_args ( r - > cs_request ) , tcp , NULL , 0 , <nl> - grpc_client_setup_get_mdctx ( r - > cs_request ) , 1 ) ; <nl> - grpc_client_setup_cb_end ( r - > cs_request , " on_connect " ) ; <nl> - done ( r , 1 ) ; <nl> - return ; <nl> + static void connected ( void * arg , grpc_endpoint * tcp ) { <nl> + connector * c = arg ; <nl> + grpc_iomgr_closure * notify ; <nl> + if ( tcp ! = NULL ) { <nl> + c - > result - > transport = grpc_create_chttp2_transport ( <nl> + c - > args . channel_args , tcp , c - > args . metadata_context , 1 ) ; <nl> + grpc_chttp2_transport_start_reading ( c - > result - > transport , NULL , 0 ) ; <nl> + GPR_ASSERT ( c - > result - > transport ) ; <nl> + c - > result - > filters = gpr_malloc ( sizeof ( grpc_channel_filter * ) ) ; <nl> + c - > result - > filters [ 0 ] = & grpc_http_client_filter ; <nl> + c - > result - > num_filters = 1 ; <nl> } else { <nl> - done ( r , 0 ) ; <nl> + memset ( c - > result , 0 , sizeof ( * c - > result ) ) ; <nl> } <nl> + notify = c - > notify ; <nl> + c - > notify = NULL ; <nl> + grpc_iomgr_add_callback ( notify ) ; <nl> } <nl> <nl> - / * attempt to connect to the next available resolved address * / <nl> - static int maybe_try_next_resolved ( request * r ) { <nl> - grpc_resolved_address * addr ; <nl> - if ( ! r - > resolved ) return 0 ; <nl> - if ( r - > resolved_index = = r - > resolved - > naddrs ) return 0 ; <nl> - addr = & r - > resolved - > addrs [ r - > resolved_index + + ] ; <nl> - grpc_tcp_client_connect ( <nl> - on_connect , r , grpc_client_setup_get_interested_parties ( r - > cs_request ) , <nl> - ( struct sockaddr * ) & addr - > addr , addr - > len , <nl> - grpc_client_setup_request_deadline ( r - > cs_request ) ) ; <nl> - return 1 ; <nl> + static void connector_connect ( grpc_connector * con , <nl> + const grpc_connect_in_args * args , <nl> + grpc_connect_out_args * result , <nl> + grpc_iomgr_closure * notify ) { <nl> + connector * c = ( connector * ) con ; <nl> + GPR_ASSERT ( c - > notify = = NULL ) ; <nl> + GPR_ASSERT ( notify - > cb ) ; <nl> + c - > notify = notify ; <nl> + c - > args = * args ; <nl> + c - > result = result ; <nl> + grpc_tcp_client_connect ( connected , c , args - > interested_parties , args - > addr , <nl> + args - > addr_len , args - > deadline ) ; <nl> } <nl> <nl> - / * callback for when our target address has been resolved * / <nl> - static void on_resolved ( void * rp , grpc_resolved_addresses * resolved ) { <nl> - request * r = rp ; <nl> - <nl> - / * if we ' re not still the active request , abort * / <nl> - if ( ! grpc_client_setup_request_should_continue ( r - > cs_request , <nl> - " on_resolved " ) ) { <nl> - if ( resolved ) { <nl> - grpc_resolved_addresses_destroy ( resolved ) ; <nl> - } <nl> - done ( r , 0 ) ; <nl> - return ; <nl> - } <nl> + static const grpc_connector_vtable connector_vtable = { <nl> + connector_ref , connector_unref , connector_connect } ; <nl> <nl> - if ( ! resolved ) { <nl> - done ( r , 0 ) ; <nl> - return ; <nl> - } else { <nl> - r - > resolved = resolved ; <nl> - r - > resolved_index = 0 ; <nl> - if ( ! maybe_try_next_resolved ( r ) ) { <nl> - done ( r , 0 ) ; <nl> - } <nl> - } <nl> + typedef struct { <nl> + grpc_subchannel_factory base ; <nl> + gpr_refcount refs ; <nl> + grpc_mdctx * mdctx ; <nl> + grpc_channel_args * merge_args ; <nl> + } subchannel_factory ; <nl> + <nl> + static void subchannel_factory_ref ( grpc_subchannel_factory * scf ) { <nl> + subchannel_factory * f = ( subchannel_factory * ) scf ; <nl> + gpr_ref ( & f - > refs ) ; <nl> } <nl> <nl> - static void initiate_setup ( void * sp , grpc_client_setup_request * cs_request ) { <nl> - request * r = gpr_malloc ( sizeof ( request ) ) ; <nl> - r - > setup = sp ; <nl> - r - > cs_request = cs_request ; <nl> - r - > resolved = NULL ; <nl> - r - > resolved_index = 0 ; <nl> - / * TODO ( klempner ) : Make grpc_resolve_address respect deadline * / <nl> - grpc_resolve_address ( r - > setup - > target , " http " , on_resolved , r ) ; <nl> + static void subchannel_factory_unref ( grpc_subchannel_factory * scf ) { <nl> + subchannel_factory * f = ( subchannel_factory * ) scf ; <nl> + if ( gpr_unref ( & f - > refs ) ) { <nl> + grpc_channel_args_destroy ( f - > merge_args ) ; <nl> + grpc_mdctx_unref ( f - > mdctx ) ; <nl> + gpr_free ( f ) ; <nl> + } <nl> } <nl> <nl> - static void done_setup ( void * sp ) { <nl> - setup * s = sp ; <nl> - gpr_free ( ( void * ) s - > target ) ; <nl> - gpr_free ( s ) ; <nl> + static grpc_subchannel * subchannel_factory_create_subchannel ( <nl> + grpc_subchannel_factory * scf , grpc_subchannel_args * args ) { <nl> + subchannel_factory * f = ( subchannel_factory * ) scf ; <nl> + connector * c = gpr_malloc ( sizeof ( * c ) ) ; <nl> + grpc_channel_args * final_args = <nl> + grpc_channel_args_merge ( args - > args , f - > merge_args ) ; <nl> + grpc_subchannel * s ; <nl> + memset ( c , 0 , sizeof ( * c ) ) ; <nl> + c - > base . vtable = & connector_vtable ; <nl> + gpr_ref_init ( & c - > refs , 1 ) ; <nl> + args - > mdctx = f - > mdctx ; <nl> + args - > args = final_args ; <nl> + s = grpc_subchannel_create ( & c - > base , args ) ; <nl> + grpc_connector_unref ( & c - > base ) ; <nl> + grpc_channel_args_destroy ( final_args ) ; <nl> + return s ; <nl> } <nl> <nl> - static grpc_transport_setup_result complete_setup ( void * channel_stack , <nl> - grpc_transport * transport , <nl> - grpc_mdctx * mdctx ) { <nl> - static grpc_channel_filter const * extra_filters [ ] = { <nl> - & grpc_http_client_filter } ; <nl> - return grpc_client_channel_transport_setup_complete ( <nl> - channel_stack , transport , extra_filters , GPR_ARRAY_SIZE ( extra_filters ) , <nl> - mdctx ) ; <nl> - } <nl> + static const grpc_subchannel_factory_vtable subchannel_factory_vtable = { <nl> + subchannel_factory_ref , subchannel_factory_unref , <nl> + subchannel_factory_create_subchannel } ; <nl> <nl> / * Create a client channel : <nl> Asynchronously : - resolve target <nl> static grpc_transport_setup_result complete_setup ( void * channel_stack , <nl> - perform handshakes * / <nl> grpc_channel * grpc_channel_create ( const char * target , <nl> const grpc_channel_args * args ) { <nl> - setup * s = gpr_malloc ( sizeof ( setup ) ) ; <nl> - grpc_mdctx * mdctx = grpc_mdctx_create ( ) ; <nl> grpc_channel * channel = NULL ; <nl> # define MAX_FILTERS 3 <nl> const grpc_channel_filter * filters [ MAX_FILTERS ] ; <nl> + grpc_resolver * resolver ; <nl> + subchannel_factory * f ; <nl> + grpc_mdctx * mdctx = grpc_mdctx_create ( ) ; <nl> int n = 0 ; <nl> - filters [ n + + ] = & grpc_client_surface_filter ; <nl> / * TODO ( census ) <nl> if ( grpc_channel_args_is_census_enabled ( args ) ) { <nl> filters [ n + + ] = & grpc_client_census_filter ; <nl> } * / <nl> filters [ n + + ] = & grpc_client_channel_filter ; <nl> GPR_ASSERT ( n < = MAX_FILTERS ) ; <nl> - channel = grpc_channel_create_from_filters ( filters , n , args , mdctx , 1 ) ; <nl> <nl> - s - > target = gpr_strdup ( target ) ; <nl> - s - > setup_callback = complete_setup ; <nl> - s - > setup_user_data = grpc_channel_get_channel_stack ( channel ) ; <nl> + f = gpr_malloc ( sizeof ( * f ) ) ; <nl> + f - > base . vtable = & subchannel_factory_vtable ; <nl> + gpr_ref_init ( & f - > refs , 1 ) ; <nl> + grpc_mdctx_ref ( mdctx ) ; <nl> + f - > mdctx = mdctx ; <nl> + f - > merge_args = grpc_channel_args_copy ( args ) ; <nl> + resolver = grpc_resolver_create ( target , & f - > base ) ; <nl> + if ( ! resolver ) { <nl> + return NULL ; <nl> + } <nl> <nl> - grpc_client_setup_create_and_attach ( grpc_channel_get_channel_stack ( channel ) , <nl> - args , mdctx , initiate_setup , done_setup , <nl> - s ) ; <nl> + channel = grpc_channel_create_from_filters ( filters , n , args , mdctx , 1 ) ; <nl> + grpc_client_channel_set_resolver ( grpc_channel_get_channel_stack ( channel ) , <nl> + resolver ) ; <nl> + GRPC_RESOLVER_UNREF ( resolver , " create " ) ; <nl> + grpc_subchannel_factory_unref ( & f - > base ) ; <nl> <nl> return channel ; <nl> } <nl> deleted file mode 100644 <nl> index 8ac4dd1e0e2 . . 00000000000 <nl> mmm a / src / core / surface / client . c <nl> ppp / dev / null <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 " src / core / surface / client . h " <nl> - <nl> - # include " src / core / surface / call . h " <nl> - # include " src / core / surface / channel . h " <nl> - # include " src / core / support / string . h " <nl> - # include < grpc / support / alloc . h > <nl> - # include < grpc / support / log . h > <nl> - <nl> - typedef struct { void * unused ; } call_data ; <nl> - <nl> - typedef struct { void * unused ; } channel_data ; <nl> - <nl> - static void client_start_transport_op ( grpc_call_element * elem , <nl> - grpc_transport_op * op ) { <nl> - GRPC_CALL_LOG_OP ( GPR_INFO , elem , op ) ; <nl> - grpc_call_next_op ( elem , op ) ; <nl> - } <nl> - <nl> - static void channel_op ( grpc_channel_element * elem , <nl> - grpc_channel_element * from_elem , grpc_channel_op * op ) { <nl> - switch ( op - > type ) { <nl> - case GRPC_ACCEPT_CALL : <nl> - gpr_log ( GPR_ERROR , " Client cannot accept new calls " ) ; <nl> - break ; <nl> - case GRPC_TRANSPORT_CLOSED : <nl> - grpc_client_channel_closed ( elem ) ; <nl> - break ; <nl> - case GRPC_TRANSPORT_GOAWAY : <nl> - gpr_slice_unref ( op - > data . goaway . message ) ; <nl> - break ; <nl> - default : <nl> - GPR_ASSERT ( op - > dir = = GRPC_CALL_DOWN ) ; <nl> - grpc_channel_next_op ( elem , op ) ; <nl> - } <nl> - } <nl> - <nl> - static void init_call_elem ( grpc_call_element * elem , <nl> - const void * transport_server_data , <nl> - grpc_transport_op * initial_op ) { } <nl> - <nl> - static void destroy_call_elem ( grpc_call_element * elem ) { } <nl> - <nl> - static void init_channel_elem ( grpc_channel_element * elem , <nl> - const grpc_channel_args * args , grpc_mdctx * mdctx , <nl> - int is_first , int is_last ) { <nl> - GPR_ASSERT ( is_first ) ; <nl> - GPR_ASSERT ( ! is_last ) ; <nl> - } <nl> - <nl> - static void destroy_channel_elem ( grpc_channel_element * elem ) { } <nl> - <nl> - const grpc_channel_filter grpc_client_surface_filter = { <nl> - client_start_transport_op , channel_op , sizeof ( call_data ) , init_call_elem , <nl> - destroy_call_elem , sizeof ( channel_data ) , init_channel_elem , <nl> - destroy_channel_elem , " client " , <nl> - } ; <nl> mmm a / src / core / surface / init . c <nl> ppp b / src / core / surface / init . c <nl> <nl> * <nl> * / <nl> <nl> + # include < grpc / support / port_platform . h > <nl> + <nl> # include < grpc / census . h > <nl> # include < grpc / grpc . h > <nl> # include " src / core / channel / channel_stack . h " <nl> + # include " src / core / client_config / resolver_registry . h " <nl> + # include " src / core / client_config / resolvers / dns_resolver . h " <nl> # include " src / core / debug / trace . h " <nl> # include " src / core / iomgr / iomgr . h " <nl> # include " src / core / profiling / timers . h " <nl> <nl> # include " src / core / surface / surface_trace . h " <nl> # include " src / core / transport / chttp2_transport . h " <nl> <nl> + # ifdef GPR_POSIX_SOCKET <nl> + # include " src / core / client_config / resolvers / unix_resolver_posix . h " <nl> + # endif <nl> + <nl> static gpr_once g_basic_init = GPR_ONCE_INIT ; <nl> static gpr_mu g_init_mu ; <nl> static int g_initializations ; <nl> void grpc_init ( void ) { <nl> <nl> gpr_mu_lock ( & g_init_mu ) ; <nl> if ( + + g_initializations = = 1 ) { <nl> + grpc_resolver_registry_init ( " dns : / / / " ) ; <nl> + grpc_register_resolver_type ( " dns " , grpc_dns_resolver_factory_create ( ) ) ; <nl> + # ifdef GPR_POSIX_SOCKET <nl> + grpc_register_resolver_type ( " unix " , grpc_unix_resolver_factory_create ( ) ) ; <nl> + # endif <nl> grpc_register_tracer ( " channel " , & grpc_trace_channel ) ; <nl> grpc_register_tracer ( " surface " , & grpc_surface_trace ) ; <nl> grpc_register_tracer ( " http " , & grpc_http_trace ) ; <nl> void grpc_shutdown ( void ) { <nl> census_shutdown ( ) ; <nl> grpc_timers_global_destroy ( ) ; <nl> grpc_tracer_shutdown ( ) ; <nl> + grpc_resolver_registry_shutdown ( ) ; <nl> } <nl> gpr_mu_unlock ( & g_init_mu ) ; <nl> } <nl> mmm a / src / core / surface / lame_client . c <nl> ppp b / src / core / surface / lame_client . c <nl> typedef struct { <nl> <nl> typedef struct { grpc_mdctx * mdctx ; } channel_data ; <nl> <nl> - static void lame_start_transport_op ( grpc_call_element * elem , <nl> - grpc_transport_op * op ) { <nl> + static void lame_start_transport_stream_op ( grpc_call_element * elem , <nl> + grpc_transport_stream_op * op ) { <nl> call_data * calld = elem - > call_data ; <nl> channel_data * chand = elem - > channel_data ; <nl> GRPC_CALL_LOG_OP ( GPR_INFO , elem , op ) ; <nl> - if ( op - > send_ops ) { <nl> + if ( op - > send_ops ! = NULL ) { <nl> grpc_stream_ops_unref_owned_objects ( op - > send_ops - > ops , op - > send_ops - > nops ) ; <nl> op - > on_done_send - > cb ( op - > on_done_send - > cb_arg , 0 ) ; <nl> } <nl> - if ( op - > recv_ops ) { <nl> + if ( op - > recv_ops ! = NULL ) { <nl> char tmp [ GPR_LTOA_MIN_BUFSIZE ] ; <nl> grpc_metadata_batch mdb ; <nl> gpr_ltoa ( GRPC_STATUS_UNKNOWN , tmp ) ; <nl> static void lame_start_transport_op ( grpc_call_element * elem , <nl> * op - > recv_state = GRPC_STREAM_CLOSED ; <nl> op - > on_done_recv - > cb ( op - > on_done_recv - > cb_arg , 1 ) ; <nl> } <nl> - if ( op - > on_consumed ) { <nl> + if ( op - > on_consumed ! = NULL ) { <nl> op - > on_consumed - > cb ( op - > on_consumed - > cb_arg , 0 ) ; <nl> } <nl> } <nl> <nl> - static void channel_op ( grpc_channel_element * elem , <nl> - grpc_channel_element * from_elem , grpc_channel_op * op ) { <nl> - switch ( op - > type ) { <nl> - case GRPC_CHANNEL_GOAWAY : <nl> - gpr_slice_unref ( op - > data . goaway . message ) ; <nl> - break ; <nl> - case GRPC_CHANNEL_DISCONNECT : <nl> - grpc_client_channel_closed ( elem ) ; <nl> - break ; <nl> - default : <nl> - break ; <nl> + static void lame_start_transport_op ( grpc_channel_element * elem , <nl> + grpc_transport_op * op ) { <nl> + if ( op - > on_connectivity_state_change ) { <nl> + GPR_ASSERT ( * op - > connectivity_state ! = GRPC_CHANNEL_FATAL_FAILURE ) ; <nl> + * op - > connectivity_state = GRPC_CHANNEL_FATAL_FAILURE ; <nl> + op - > on_connectivity_state_change - > cb ( <nl> + op - > on_connectivity_state_change - > cb_arg , 1 ) ; <nl> + } <nl> + if ( op - > on_consumed ! = NULL ) { <nl> + op - > on_consumed - > cb ( op - > on_consumed - > cb_arg , 1 ) ; <nl> } <nl> } <nl> <nl> static void init_call_elem ( grpc_call_element * elem , <nl> const void * transport_server_data , <nl> - grpc_transport_op * initial_op ) { <nl> + grpc_transport_stream_op * initial_op ) { <nl> if ( initial_op ) { <nl> - grpc_transport_op_finish_with_failure ( initial_op ) ; <nl> + grpc_transport_stream_op_finish_with_failure ( initial_op ) ; <nl> } <nl> } <nl> <nl> static void destroy_call_elem ( grpc_call_element * elem ) { } <nl> <nl> - static void init_channel_elem ( grpc_channel_element * elem , <nl> + static void init_channel_elem ( grpc_channel_element * elem , grpc_channel * master , <nl> const grpc_channel_args * args , grpc_mdctx * mdctx , <nl> int is_first , int is_last ) { <nl> channel_data * chand = elem - > channel_data ; <nl> static void init_channel_elem ( grpc_channel_element * elem , <nl> static void destroy_channel_elem ( grpc_channel_element * elem ) { } <nl> <nl> static const grpc_channel_filter lame_filter = { <nl> - lame_start_transport_op , channel_op , sizeof ( call_data ) , <nl> - init_call_elem , destroy_call_elem , sizeof ( channel_data ) , <nl> - init_channel_elem , destroy_channel_elem , " lame - client " , <nl> + lame_start_transport_stream_op , <nl> + lame_start_transport_op , <nl> + sizeof ( call_data ) , <nl> + init_call_elem , <nl> + destroy_call_elem , <nl> + sizeof ( channel_data ) , <nl> + init_channel_elem , <nl> + destroy_channel_elem , <nl> + " lame - client " , <nl> } ; <nl> <nl> grpc_channel * grpc_lame_client_channel_create ( void ) { <nl> mmm a / src / core / surface / secure_channel_create . c <nl> ppp b / src / core / surface / secure_channel_create . c <nl> <nl> * <nl> * / <nl> <nl> - # include " src / core / iomgr / sockaddr . h " <nl> - <nl> # include < grpc / grpc . h > <nl> <nl> # include < stdlib . h > <nl> # include < string . h > <nl> <nl> - # include " src / core / channel / census_filter . h " <nl> + # include < grpc / support / alloc . h > <nl> + <nl> # include " src / core / channel / channel_args . h " <nl> # include " src / core / channel / client_channel . h " <nl> - # include " src / core / channel / client_setup . h " <nl> - # include " src / core / channel / connected_channel . h " <nl> # include " src / core / channel / http_client_filter . h " <nl> - # include " src / core / iomgr / resolve_address . h " <nl> + # include " src / core / client_config / resolver_registry . h " <nl> # include " src / core / iomgr / tcp_client . h " <nl> # include " src / core / security / auth_filters . h " <nl> # include " src / core / security / credentials . h " <nl> # include " src / core / security / secure_transport_setup . h " <nl> - # include " src / core / support / string . h " <nl> # include " src / core / surface / channel . h " <nl> - # include " src / core / surface / client . h " <nl> # include " src / core / transport / chttp2_transport . h " <nl> - # include < grpc / grpc_security . h > <nl> - # include < grpc / support / alloc . h > <nl> - # include < grpc / support / log . h > <nl> - # include < grpc / support / string_util . h > <nl> - # include < grpc / support / sync . h > <nl> - # include < grpc / support / useful . h > <nl> # include " src / core / tsi / transport_security_interface . h " <nl> <nl> - typedef struct setup setup ; <nl> - <nl> - / * A single setup request ( started via initiate ) * / <nl> typedef struct { <nl> - grpc_client_setup_request * cs_request ; <nl> - setup * setup ; <nl> - / * Resolved addresses , or null if resolution not yet completed . * / <nl> - grpc_resolved_addresses * resolved ; <nl> - / * which address in resolved should we pick for the next connection attempt * / <nl> - size_t resolved_index ; <nl> - } request ; <nl> + grpc_connector base ; <nl> + gpr_refcount refs ; <nl> <nl> - struct setup { <nl> grpc_channel_security_connector * security_connector ; <nl> - const char * target ; <nl> - grpc_transport_setup_callback setup_callback ; <nl> - void * setup_user_data ; <nl> - } ; <nl> <nl> - static int maybe_try_next_resolved ( request * r ) ; <nl> + grpc_iomgr_closure * notify ; <nl> + grpc_connect_in_args args ; <nl> + grpc_connect_out_args * result ; <nl> + } connector ; <nl> <nl> - static void done ( request * r , int was_successful ) { <nl> - grpc_client_setup_request_finish ( r - > cs_request , was_successful ) ; <nl> - if ( r - > resolved ) { <nl> - grpc_resolved_addresses_destroy ( r - > resolved ) ; <nl> + static void connector_ref ( grpc_connector * con ) { <nl> + connector * c = ( connector * ) con ; <nl> + gpr_ref ( & c - > refs ) ; <nl> + } <nl> + <nl> + static void connector_unref ( grpc_connector * con ) { <nl> + connector * c = ( connector * ) con ; <nl> + if ( gpr_unref ( & c - > refs ) ) { <nl> + gpr_free ( c ) ; <nl> } <nl> - gpr_free ( r ) ; <nl> } <nl> <nl> - static void on_secure_transport_setup_done ( void * rp , <nl> + static void on_secure_transport_setup_done ( void * arg , <nl> grpc_security_status status , <nl> grpc_endpoint * secure_endpoint ) { <nl> - request * r = rp ; <nl> + connector * c = arg ; <nl> + grpc_iomgr_closure * notify ; <nl> if ( status ! = GRPC_SECURITY_OK ) { <nl> gpr_log ( GPR_ERROR , " Secure transport setup failed with error % d . " , status ) ; <nl> - done ( r , 0 ) ; <nl> - } else if ( grpc_client_setup_cb_begin ( r - > cs_request , <nl> - " on_secure_transport_setup_done " ) ) { <nl> - grpc_create_chttp2_transport ( <nl> - r - > setup - > setup_callback , r - > setup - > setup_user_data , <nl> - grpc_client_setup_get_channel_args ( r - > cs_request ) , secure_endpoint , <nl> - NULL , 0 , grpc_client_setup_get_mdctx ( r - > cs_request ) , 1 ) ; <nl> - grpc_client_setup_cb_end ( r - > cs_request , " on_secure_transport_setup_done " ) ; <nl> - done ( r , 1 ) ; <nl> + memset ( c - > result , 0 , sizeof ( * c - > result ) ) ; <nl> } else { <nl> - done ( r , 0 ) ; <nl> + c - > result - > transport = grpc_create_chttp2_transport ( <nl> + c - > args . channel_args , secure_endpoint , c - > args . metadata_context , 1 ) ; <nl> + grpc_chttp2_transport_start_reading ( c - > result - > transport , NULL , 0 ) ; <nl> + c - > result - > filters = gpr_malloc ( sizeof ( grpc_channel_filter * ) * 2 ) ; <nl> + c - > result - > filters [ 0 ] = & grpc_client_auth_filter ; <nl> + c - > result - > filters [ 1 ] = & grpc_http_client_filter ; <nl> + c - > result - > num_filters = 2 ; <nl> } <nl> + notify = c - > notify ; <nl> + c - > notify = NULL ; <nl> + grpc_iomgr_add_callback ( notify ) ; <nl> } <nl> <nl> - / * connection callback : tcp is either valid , or null on error * / <nl> - static void on_connect ( void * rp , grpc_endpoint * tcp ) { <nl> - request * r = rp ; <nl> - <nl> - if ( ! grpc_client_setup_request_should_continue ( r - > cs_request , <nl> - " on_connect . secure " ) ) { <nl> - if ( tcp ) { <nl> - grpc_endpoint_shutdown ( tcp ) ; <nl> - grpc_endpoint_destroy ( tcp ) ; <nl> - } <nl> - done ( r , 0 ) ; <nl> - return ; <nl> - } <nl> - <nl> - if ( ! tcp ) { <nl> - if ( ! maybe_try_next_resolved ( r ) ) { <nl> - done ( r , 0 ) ; <nl> - return ; <nl> - } else { <nl> - return ; <nl> - } <nl> + static void connected ( void * arg , grpc_endpoint * tcp ) { <nl> + connector * c = arg ; <nl> + grpc_iomgr_closure * notify ; <nl> + if ( tcp ! = NULL ) { <nl> + grpc_setup_secure_transport ( & c - > security_connector - > base , tcp , <nl> + on_secure_transport_setup_done , c ) ; <nl> } else { <nl> - grpc_setup_secure_transport ( & r - > setup - > security_connector - > base , tcp , <nl> - on_secure_transport_setup_done , r ) ; <nl> + memset ( c - > result , 0 , sizeof ( * c - > result ) ) ; <nl> + notify = c - > notify ; <nl> + c - > notify = NULL ; <nl> + grpc_iomgr_add_callback ( notify ) ; <nl> } <nl> } <nl> <nl> - / * attempt to connect to the next available resolved address * / <nl> - static int maybe_try_next_resolved ( request * r ) { <nl> - grpc_resolved_address * addr ; <nl> - if ( ! r - > resolved ) return 0 ; <nl> - if ( r - > resolved_index = = r - > resolved - > naddrs ) return 0 ; <nl> - addr = & r - > resolved - > addrs [ r - > resolved_index + + ] ; <nl> - grpc_tcp_client_connect ( <nl> - on_connect , r , grpc_client_setup_get_interested_parties ( r - > cs_request ) , <nl> - ( struct sockaddr * ) & addr - > addr , addr - > len , <nl> - grpc_client_setup_request_deadline ( r - > cs_request ) ) ; <nl> - return 1 ; <nl> + static void connector_connect ( grpc_connector * con , <nl> + const grpc_connect_in_args * args , <nl> + grpc_connect_out_args * result , <nl> + grpc_iomgr_closure * notify ) { <nl> + connector * c = ( connector * ) con ; <nl> + GPR_ASSERT ( c - > notify = = NULL ) ; <nl> + GPR_ASSERT ( notify - > cb ) ; <nl> + c - > notify = notify ; <nl> + c - > args = * args ; <nl> + c - > result = result ; <nl> + grpc_tcp_client_connect ( connected , c , args - > interested_parties , args - > addr , <nl> + args - > addr_len , args - > deadline ) ; <nl> } <nl> <nl> - / * callback for when our target address has been resolved * / <nl> - static void on_resolved ( void * rp , grpc_resolved_addresses * resolved ) { <nl> - request * r = rp ; <nl> + static const grpc_connector_vtable connector_vtable = { <nl> + connector_ref , connector_unref , connector_connect } ; <nl> <nl> - / * if we ' re not still the active request , abort * / <nl> - if ( ! grpc_client_setup_request_should_continue ( r - > cs_request , <nl> - " on_resolved . secure " ) ) { <nl> - if ( resolved ) { <nl> - grpc_resolved_addresses_destroy ( resolved ) ; <nl> - } <nl> - done ( r , 0 ) ; <nl> - return ; <nl> - } <nl> + typedef struct { <nl> + grpc_subchannel_factory base ; <nl> + gpr_refcount refs ; <nl> + grpc_mdctx * mdctx ; <nl> + grpc_channel_args * merge_args ; <nl> + grpc_channel_security_connector * security_connector ; <nl> + } subchannel_factory ; <nl> <nl> - if ( ! resolved ) { <nl> - done ( r , 0 ) ; <nl> - return ; <nl> - } else { <nl> - r - > resolved = resolved ; <nl> - r - > resolved_index = 0 ; <nl> - if ( ! maybe_try_next_resolved ( r ) ) { <nl> - done ( r , 0 ) ; <nl> - } <nl> - } <nl> + static void subchannel_factory_ref ( grpc_subchannel_factory * scf ) { <nl> + subchannel_factory * f = ( subchannel_factory * ) scf ; <nl> + gpr_ref ( & f - > refs ) ; <nl> } <nl> <nl> - static void initiate_setup ( void * sp , grpc_client_setup_request * cs_request ) { <nl> - request * r = gpr_malloc ( sizeof ( request ) ) ; <nl> - r - > setup = sp ; <nl> - r - > cs_request = cs_request ; <nl> - r - > resolved = NULL ; <nl> - r - > resolved_index = 0 ; <nl> - / * TODO ( klempner ) : Make grpc_resolve_address respect deadline * / <nl> - grpc_resolve_address ( r - > setup - > target , " https " , on_resolved , r ) ; <nl> + static void subchannel_factory_unref ( grpc_subchannel_factory * scf ) { <nl> + subchannel_factory * f = ( subchannel_factory * ) scf ; <nl> + if ( gpr_unref ( & f - > refs ) ) { <nl> + GRPC_SECURITY_CONNECTOR_UNREF ( & f - > security_connector - > base , <nl> + " subchannel_factory " ) ; <nl> + grpc_channel_args_destroy ( f - > merge_args ) ; <nl> + grpc_mdctx_unref ( f - > mdctx ) ; <nl> + gpr_free ( f ) ; <nl> + } <nl> } <nl> <nl> - static void done_setup ( void * sp ) { <nl> - setup * s = sp ; <nl> - gpr_free ( ( void * ) s - > target ) ; <nl> - grpc_security_connector_unref ( & s - > security_connector - > base ) ; <nl> - gpr_free ( s ) ; <nl> + static grpc_subchannel * subchannel_factory_create_subchannel ( <nl> + grpc_subchannel_factory * scf , grpc_subchannel_args * args ) { <nl> + subchannel_factory * f = ( subchannel_factory * ) scf ; <nl> + connector * c = gpr_malloc ( sizeof ( * c ) ) ; <nl> + grpc_channel_args * final_args = <nl> + grpc_channel_args_merge ( args - > args , f - > merge_args ) ; <nl> + grpc_subchannel * s ; <nl> + memset ( c , 0 , sizeof ( * c ) ) ; <nl> + c - > base . vtable = & connector_vtable ; <nl> + c - > security_connector = f - > security_connector ; <nl> + gpr_ref_init ( & c - > refs , 1 ) ; <nl> + args - > mdctx = f - > mdctx ; <nl> + args - > args = final_args ; <nl> + s = grpc_subchannel_create ( & c - > base , args ) ; <nl> + grpc_connector_unref ( & c - > base ) ; <nl> + grpc_channel_args_destroy ( final_args ) ; <nl> + return s ; <nl> } <nl> <nl> - static grpc_transport_setup_result complete_setup ( void * channel_stack , <nl> - grpc_transport * transport , <nl> - grpc_mdctx * mdctx ) { <nl> - static grpc_channel_filter const * extra_filters [ ] = { <nl> - & grpc_client_auth_filter , & grpc_http_client_filter } ; <nl> - return grpc_client_channel_transport_setup_complete ( <nl> - channel_stack , transport , extra_filters , GPR_ARRAY_SIZE ( extra_filters ) , <nl> - mdctx ) ; <nl> - } <nl> + static const grpc_subchannel_factory_vtable subchannel_factory_vtable = { <nl> + subchannel_factory_ref , subchannel_factory_unref , <nl> + subchannel_factory_create_subchannel } ; <nl> <nl> / * Create a secure client channel : <nl> Asynchronously : - resolve target <nl> static grpc_transport_setup_result complete_setup ( void * channel_stack , <nl> grpc_channel * grpc_secure_channel_create ( grpc_credentials * creds , <nl> const char * target , <nl> const grpc_channel_args * args ) { <nl> - setup * s ; <nl> grpc_channel * channel ; <nl> grpc_arg connector_arg ; <nl> grpc_channel_args * args_copy ; <nl> grpc_channel_args * new_args_from_connector ; <nl> grpc_channel_security_connector * connector ; <nl> grpc_mdctx * mdctx ; <nl> + grpc_resolver * resolver ; <nl> + subchannel_factory * f ; <nl> # define MAX_FILTERS 3 <nl> const grpc_channel_filter * filters [ MAX_FILTERS ] ; <nl> int n = 0 ; <nl> grpc_channel * grpc_secure_channel_create ( grpc_credentials * creds , <nl> } <nl> mdctx = grpc_mdctx_create ( ) ; <nl> <nl> - s = gpr_malloc ( sizeof ( setup ) ) ; <nl> connector_arg = grpc_security_connector_to_arg ( & connector - > base ) ; <nl> args_copy = grpc_channel_args_copy_and_add ( <nl> new_args_from_connector ! = NULL ? new_args_from_connector : args , <nl> - & connector_arg ) ; <nl> - filters [ n + + ] = & grpc_client_surface_filter ; <nl> + & connector_arg , 1 ) ; <nl> / * TODO ( census ) <nl> if ( grpc_channel_args_is_census_enabled ( args ) ) { <nl> filters [ n + + ] = & grpc_client_census_filter ; <nl> } * / <nl> filters [ n + + ] = & grpc_client_channel_filter ; <nl> GPR_ASSERT ( n < = MAX_FILTERS ) ; <nl> + <nl> + f = gpr_malloc ( sizeof ( * f ) ) ; <nl> + f - > base . vtable = & subchannel_factory_vtable ; <nl> + gpr_ref_init ( & f - > refs , 1 ) ; <nl> + grpc_mdctx_ref ( mdctx ) ; <nl> + f - > mdctx = mdctx ; <nl> + GRPC_SECURITY_CONNECTOR_REF ( & connector - > base , " subchannel_factory " ) ; <nl> + f - > security_connector = connector ; <nl> + f - > merge_args = grpc_channel_args_copy ( args_copy ) ; <nl> + resolver = grpc_resolver_create ( target , & f - > base ) ; <nl> + if ( ! resolver ) { <nl> + return NULL ; <nl> + } <nl> + <nl> channel = grpc_channel_create_from_filters ( filters , n , args_copy , mdctx , 1 ) ; <nl> + grpc_client_channel_set_resolver ( grpc_channel_get_channel_stack ( channel ) , <nl> + resolver ) ; <nl> + GRPC_RESOLVER_UNREF ( resolver , " create " ) ; <nl> + grpc_subchannel_factory_unref ( & f - > base ) ; <nl> + GRPC_SECURITY_CONNECTOR_UNREF ( & connector - > base , " channel_create " ) ; <nl> + <nl> grpc_channel_args_destroy ( args_copy ) ; <nl> if ( new_args_from_connector ! = NULL ) { <nl> grpc_channel_args_destroy ( new_args_from_connector ) ; <nl> } <nl> <nl> - s - > target = gpr_strdup ( target ) ; <nl> - s - > setup_callback = complete_setup ; <nl> - s - > setup_user_data = grpc_channel_get_channel_stack ( channel ) ; <nl> - s - > security_connector = connector ; <nl> - grpc_client_setup_create_and_attach ( grpc_channel_get_channel_stack ( channel ) , <nl> - args , mdctx , initiate_setup , done_setup , <nl> - s ) ; <nl> return channel ; <nl> } <nl> mmm a / src / core / surface / server . c <nl> ppp b / src / core / surface / server . c <nl> typedef struct channel_registered_method { <nl> struct channel_data { <nl> grpc_server * server ; <nl> size_t num_calls ; <nl> + grpc_connectivity_state connectivity_state ; <nl> grpc_channel * channel ; <nl> grpc_mdstr * path_key ; <nl> grpc_mdstr * authority_key ; <nl> struct channel_data { <nl> gpr_uint32 registered_method_slots ; <nl> gpr_uint32 registered_method_max_probes ; <nl> grpc_iomgr_closure finish_destroy_channel_closure ; <nl> + grpc_iomgr_closure channel_connectivity_changed ; <nl> } ; <nl> <nl> typedef struct shutdown_tag { <nl> struct grpc_server { <nl> before mu_call . This is currently used in shutdown processing <nl> ( grpc_server_shutdown_and_notify and maybe_finish_shutdown ) * / <nl> gpr_mu mu_global ; / * mutex for server and channel state * / <nl> - gpr_mu mu_call ; / * mutex for call - specific state * / <nl> + gpr_mu mu_call ; / * mutex for call - specific state * / <nl> <nl> registered_method * registered_methods ; <nl> requested_call_array requested_calls ; <nl> struct call_data { <nl> call_link links [ CALL_LIST_COUNT ] ; <nl> } ; <nl> <nl> + typedef struct { <nl> + grpc_channel * * channels ; <nl> + grpc_channel * * disconnects ; <nl> + size_t num_channels ; <nl> + size_t num_disconnects ; <nl> + } channel_broadcaster ; <nl> + <nl> # define SERVER_FROM_CALL_ELEM ( elem ) \ <nl> ( ( ( channel_data * ) ( elem ) - > channel_data ) - > server ) <nl> <nl> static void begin_call ( grpc_server * server , call_data * calld , <nl> requested_call * rc ) ; <nl> static void fail_call ( grpc_server * server , requested_call * rc ) ; <nl> - static void shutdown_channel ( channel_data * chand , int send_goaway , <nl> - int send_disconnect ) ; <nl> / * Before calling maybe_finish_shutdown , we must hold mu_global and not <nl> hold mu_call * / <nl> static void maybe_finish_shutdown ( grpc_server * server ) ; <nl> <nl> + / * channel broadcaster * / <nl> + <nl> + / * assumes server locked * / <nl> + static void channel_broadcaster_init ( grpc_server * s , channel_broadcaster * cb ) { <nl> + channel_data * c ; <nl> + size_t count = 0 ; <nl> + size_t dc_count = 0 ; <nl> + for ( c = s - > root_channel_data . next ; c ! = & s - > root_channel_data ; c = c - > next ) { <nl> + count + + ; <nl> + if ( c - > num_calls = = 0 ) { <nl> + dc_count + + ; <nl> + } <nl> + } <nl> + cb - > num_channels = count ; <nl> + cb - > num_disconnects = dc_count ; <nl> + cb - > channels = gpr_malloc ( sizeof ( * cb - > channels ) * cb - > num_channels ) ; <nl> + cb - > disconnects = gpr_malloc ( sizeof ( * cb - > channels ) * cb - > num_disconnects ) ; <nl> + count = 0 ; <nl> + dc_count = 0 ; <nl> + for ( c = s - > root_channel_data . next ; c ! = & s - > root_channel_data ; c = c - > next ) { <nl> + cb - > channels [ count + + ] = c - > channel ; <nl> + GRPC_CHANNEL_INTERNAL_REF ( c - > channel , " broadcast " ) ; <nl> + if ( c - > num_calls = = 0 ) { <nl> + cb - > disconnects [ dc_count + + ] = c - > channel ; <nl> + GRPC_CHANNEL_INTERNAL_REF ( c - > channel , " broadcast - disconnect " ) ; <nl> + } <nl> + } <nl> + } <nl> + <nl> + struct shutdown_cleanup_args { <nl> + grpc_iomgr_closure closure ; <nl> + gpr_slice slice ; <nl> + } ; <nl> + <nl> + static void shutdown_cleanup ( void * arg , int iomgr_status_ignored ) { <nl> + struct shutdown_cleanup_args * a = arg ; <nl> + gpr_slice_unref ( a - > slice ) ; <nl> + gpr_free ( a ) ; <nl> + } <nl> + <nl> + static void send_shutdown ( grpc_channel * channel , int send_goaway , <nl> + int send_disconnect ) { <nl> + grpc_transport_op op ; <nl> + struct shutdown_cleanup_args * sc ; <nl> + grpc_channel_element * elem ; <nl> + <nl> + memset ( & op , 0 , sizeof ( op ) ) ; <nl> + op . send_goaway = send_goaway ; <nl> + sc = gpr_malloc ( sizeof ( * sc ) ) ; <nl> + sc - > slice = gpr_slice_from_copied_string ( " Server shutdown " ) ; <nl> + op . goaway_message = & sc - > slice ; <nl> + op . goaway_status = GRPC_STATUS_OK ; <nl> + op . disconnect = send_disconnect ; <nl> + grpc_iomgr_closure_init ( & sc - > closure , shutdown_cleanup , sc ) ; <nl> + op . on_consumed = & sc - > closure ; <nl> + <nl> + elem = grpc_channel_stack_element ( grpc_channel_get_channel_stack ( channel ) , 0 ) ; <nl> + elem - > filter - > start_transport_op ( elem , & op ) ; <nl> + } <nl> + <nl> + static void channel_broadcaster_shutdown ( channel_broadcaster * cb , <nl> + int send_goaway , int send_disconnect ) { <nl> + size_t i ; <nl> + <nl> + for ( i = 0 ; i < cb - > num_channels ; i + + ) { <nl> + send_shutdown ( cb - > channels [ i ] , 1 , 0 ) ; <nl> + GRPC_CHANNEL_INTERNAL_UNREF ( cb - > channels [ i ] , " broadcast " ) ; <nl> + } <nl> + for ( i = 0 ; i < cb - > num_disconnects ; i + + ) { <nl> + send_shutdown ( cb - > disconnects [ i ] , 0 , 1 ) ; <nl> + GRPC_CHANNEL_INTERNAL_UNREF ( cb - > channels [ i ] , " broadcast - disconnect " ) ; <nl> + } <nl> + gpr_free ( cb - > channels ) ; <nl> + gpr_free ( cb - > disconnects ) ; <nl> + } <nl> + <nl> + / * call list * / <nl> + <nl> static int call_list_join ( call_data * * root , call_data * call , call_list list ) { <nl> GPR_ASSERT ( ! call - > root [ list ] ) ; <nl> call - > root [ list ] = root ; <nl> static grpc_mdelem * server_filter ( void * user_data , grpc_mdelem * md ) { <nl> return md ; <nl> } <nl> <nl> - static void decrement_call_count ( channel_data * chand ) { <nl> + static int decrement_call_count ( channel_data * chand ) { <nl> + int disconnect = 0 ; <nl> chand - > num_calls - - ; <nl> if ( 0 = = chand - > num_calls & & chand - > server - > shutdown ) { <nl> - shutdown_channel ( chand , 0 , 1 ) ; <nl> + disconnect = 1 ; <nl> } <nl> maybe_finish_shutdown ( chand - > server ) ; <nl> + return disconnect ; <nl> } <nl> <nl> static void server_on_recv ( void * ptr , int success ) { <nl> static void server_on_recv ( void * ptr , int success ) { <nl> call_data * calld = elem - > call_data ; <nl> channel_data * chand = elem - > channel_data ; <nl> int remove_res ; <nl> + int disconnect = 0 ; <nl> <nl> if ( success & & ! calld - > got_initial_metadata ) { <nl> size_t i ; <nl> static void server_on_recv ( void * ptr , int success ) { <nl> gpr_mu_unlock ( & chand - > server - > mu_call ) ; <nl> gpr_mu_lock ( & chand - > server - > mu_global ) ; <nl> if ( remove_res ) { <nl> - decrement_call_count ( chand ) ; <nl> + disconnect = decrement_call_count ( chand ) ; <nl> + if ( disconnect ) { <nl> + GRPC_CHANNEL_INTERNAL_REF ( chand - > channel , " send - disconnect " ) ; <nl> + } <nl> } <nl> gpr_mu_unlock ( & chand - > server - > mu_global ) ; <nl> + if ( disconnect ) { <nl> + send_shutdown ( chand - > channel , 0 , 1 ) ; <nl> + GRPC_CHANNEL_INTERNAL_UNREF ( chand - > channel , " send - disconnect " ) ; <nl> + } <nl> break ; <nl> } <nl> <nl> calld - > on_done_recv - > cb ( calld - > on_done_recv - > cb_arg , success ) ; <nl> } <nl> <nl> - static void server_mutate_op ( grpc_call_element * elem , grpc_transport_op * op ) { <nl> + static void server_mutate_op ( grpc_call_element * elem , <nl> + grpc_transport_stream_op * op ) { <nl> call_data * calld = elem - > call_data ; <nl> <nl> if ( op - > recv_ops ) { <nl> static void server_mutate_op ( grpc_call_element * elem , grpc_transport_op * op ) { <nl> } <nl> } <nl> <nl> - static void server_start_transport_op ( grpc_call_element * elem , <nl> - grpc_transport_op * op ) { <nl> + static void server_start_transport_stream_op ( grpc_call_element * elem , <nl> + grpc_transport_stream_op * op ) { <nl> GRPC_CALL_LOG_OP ( GPR_INFO , elem , op ) ; <nl> server_mutate_op ( elem , op ) ; <nl> grpc_call_next_op ( elem , op ) ; <nl> } <nl> <nl> - static void channel_op ( grpc_channel_element * elem , <nl> - grpc_channel_element * from_elem , grpc_channel_op * op ) { <nl> - channel_data * chand = elem - > channel_data ; <nl> - grpc_server * server = chand - > server ; <nl> - <nl> - switch ( op - > type ) { <nl> - case GRPC_ACCEPT_CALL : <nl> - / * create a call * / <nl> - grpc_call_create ( chand - > channel , NULL , <nl> - op - > data . accept_call . transport_server_data , NULL , 0 , <nl> - gpr_inf_future ) ; <nl> - break ; <nl> - case GRPC_TRANSPORT_CLOSED : <nl> - / * if the transport is closed for a server channel , we destroy the <nl> - channel * / <nl> - gpr_mu_lock ( & server - > mu_global ) ; <nl> - server_ref ( server ) ; <nl> - destroy_channel ( chand ) ; <nl> - gpr_mu_unlock ( & server - > mu_global ) ; <nl> - server_unref ( server ) ; <nl> - break ; <nl> - case GRPC_TRANSPORT_GOAWAY : <nl> - gpr_slice_unref ( op - > data . goaway . message ) ; <nl> - break ; <nl> - default : <nl> - GPR_ASSERT ( op - > dir = = GRPC_CALL_DOWN ) ; <nl> - grpc_channel_next_op ( elem , op ) ; <nl> - break ; <nl> - } <nl> + static void accept_stream ( void * cd , grpc_transport * transport , <nl> + const void * transport_server_data ) { <nl> + channel_data * chand = cd ; <nl> + / * create a call * / <nl> + grpc_call_create ( chand - > channel , NULL , transport_server_data , NULL , 0 , <nl> + gpr_inf_future ) ; <nl> } <nl> <nl> - typedef struct { <nl> - channel_data * chand ; <nl> - int send_goaway ; <nl> - int send_disconnect ; <nl> - grpc_iomgr_closure finish_shutdown_channel_closure ; <nl> - } shutdown_channel_args ; <nl> - <nl> - static void finish_shutdown_channel ( void * p , int success ) { <nl> - shutdown_channel_args * sca = p ; <nl> - grpc_channel_op op ; <nl> - <nl> - if ( sca - > send_goaway ) { <nl> - op . type = GRPC_CHANNEL_GOAWAY ; <nl> - op . dir = GRPC_CALL_DOWN ; <nl> - op . data . goaway . status = GRPC_STATUS_OK ; <nl> - op . data . goaway . message = gpr_slice_from_copied_string ( " Server shutdown " ) ; <nl> - channel_op ( grpc_channel_stack_element ( <nl> - grpc_channel_get_channel_stack ( sca - > chand - > channel ) , 0 ) , <nl> - NULL , & op ) ; <nl> - } <nl> - if ( sca - > send_disconnect ) { <nl> - op . type = GRPC_CHANNEL_DISCONNECT ; <nl> - op . dir = GRPC_CALL_DOWN ; <nl> - channel_op ( grpc_channel_stack_element ( <nl> - grpc_channel_get_channel_stack ( sca - > chand - > channel ) , 0 ) , <nl> - NULL , & op ) ; <nl> + static void channel_connectivity_changed ( void * cd , int iomgr_status_ignored ) { <nl> + channel_data * chand = cd ; <nl> + grpc_server * server = chand - > server ; <nl> + if ( chand - > connectivity_state ! = GRPC_CHANNEL_FATAL_FAILURE ) { <nl> + grpc_transport_op op ; <nl> + memset ( & op , 0 , sizeof ( op ) ) ; <nl> + op . on_connectivity_state_change = & chand - > channel_connectivity_changed , <nl> + op . connectivity_state = & chand - > connectivity_state ; <nl> + grpc_channel_next_op ( grpc_channel_stack_element ( <nl> + grpc_channel_get_channel_stack ( chand - > channel ) , 0 ) , <nl> + & op ) ; <nl> + } else { <nl> + gpr_mu_lock ( & server - > mu_global ) ; <nl> + destroy_channel ( chand ) ; <nl> + gpr_mu_unlock ( & server - > mu_global ) ; <nl> + GRPC_CHANNEL_INTERNAL_UNREF ( chand - > channel , " connectivity " ) ; <nl> } <nl> - GRPC_CHANNEL_INTERNAL_UNREF ( sca - > chand - > channel , " shutdown " ) ; <nl> - <nl> - gpr_free ( sca ) ; <nl> - } <nl> - <nl> - static void shutdown_channel ( channel_data * chand , int send_goaway , <nl> - int send_disconnect ) { <nl> - shutdown_channel_args * sca ; <nl> - GRPC_CHANNEL_INTERNAL_REF ( chand - > channel , " shutdown " ) ; <nl> - sca = gpr_malloc ( sizeof ( shutdown_channel_args ) ) ; <nl> - sca - > chand = chand ; <nl> - sca - > send_goaway = send_goaway ; <nl> - sca - > send_disconnect = send_disconnect ; <nl> - sca - > finish_shutdown_channel_closure . cb = finish_shutdown_channel ; <nl> - sca - > finish_shutdown_channel_closure . cb_arg = sca ; <nl> - grpc_iomgr_add_callback ( & sca - > finish_shutdown_channel_closure ) ; <nl> } <nl> <nl> static void init_call_elem ( grpc_call_element * elem , <nl> const void * server_transport_data , <nl> - grpc_transport_op * initial_op ) { <nl> + grpc_transport_stream_op * initial_op ) { <nl> call_data * calld = elem - > call_data ; <nl> channel_data * chand = elem - > channel_data ; <nl> memset ( calld , 0 , sizeof ( call_data ) ) ; <nl> static void destroy_call_elem ( grpc_call_element * elem ) { <nl> server_unref ( chand - > server ) ; <nl> } <nl> <nl> - static void init_channel_elem ( grpc_channel_element * elem , <nl> + static void init_channel_elem ( grpc_channel_element * elem , grpc_channel * master , <nl> const grpc_channel_args * args , <nl> grpc_mdctx * metadata_context , int is_first , <nl> int is_last ) { <nl> static void init_channel_elem ( grpc_channel_element * elem , <nl> chand - > authority_key = grpc_mdstr_from_string ( metadata_context , " : authority " ) ; <nl> chand - > next = chand - > prev = chand ; <nl> chand - > registered_methods = NULL ; <nl> + chand - > connectivity_state = GRPC_CHANNEL_IDLE ; <nl> + grpc_iomgr_closure_init ( & chand - > channel_connectivity_changed , <nl> + channel_connectivity_changed , chand ) ; <nl> } <nl> <nl> static void destroy_channel_elem ( grpc_channel_element * elem ) { <nl> static void destroy_channel_elem ( grpc_channel_element * elem ) { <nl> } <nl> <nl> static const grpc_channel_filter server_surface_filter = { <nl> - server_start_transport_op , <nl> - channel_op , <nl> + server_start_transport_stream_op , <nl> + grpc_channel_next_op , <nl> sizeof ( call_data ) , <nl> init_call_elem , <nl> destroy_call_elem , <nl> void grpc_server_start ( grpc_server * server ) { <nl> } <nl> } <nl> <nl> - grpc_transport_setup_result grpc_server_setup_transport ( <nl> - grpc_server * s , grpc_transport * transport , <nl> - grpc_channel_filter const * * extra_filters , size_t num_extra_filters , <nl> - grpc_mdctx * mdctx , const grpc_channel_args * args ) { <nl> + void grpc_server_setup_transport ( grpc_server * s , grpc_transport * transport , <nl> + grpc_channel_filter const * * extra_filters , <nl> + size_t num_extra_filters , grpc_mdctx * mdctx , <nl> + const grpc_channel_args * args ) { <nl> size_t num_filters = s - > channel_filter_count + num_extra_filters + 1 ; <nl> grpc_channel_filter const * * filters = <nl> gpr_malloc ( sizeof ( grpc_channel_filter * ) * num_filters ) ; <nl> grpc_transport_setup_result grpc_server_setup_transport ( <nl> gpr_uint32 slots ; <nl> gpr_uint32 probes ; <nl> gpr_uint32 max_probes = 0 ; <nl> - grpc_transport_setup_result result ; <nl> + grpc_transport_op op ; <nl> <nl> for ( i = 0 ; i < s - > channel_filter_count ; i + + ) { <nl> filters [ i ] = s - > channel_filters [ i ] ; <nl> grpc_transport_setup_result grpc_server_setup_transport ( <nl> filters [ i ] = & grpc_connected_channel_filter ; <nl> <nl> for ( i = 0 ; i < s - > cq_count ; i + + ) { <nl> - grpc_transport_add_to_pollset ( transport , grpc_cq_pollset ( s - > cqs [ i ] ) ) ; <nl> + memset ( & op , 0 , sizeof ( op ) ) ; <nl> + op . bind_pollset = grpc_cq_pollset ( s - > cqs [ i ] ) ; <nl> + grpc_transport_perform_op ( transport , & op ) ; <nl> } <nl> <nl> channel = <nl> grpc_transport_setup_result grpc_server_setup_transport ( <nl> chand - > registered_method_max_probes = max_probes ; <nl> } <nl> <nl> - result = grpc_connected_channel_bind_transport ( <nl> - grpc_channel_get_channel_stack ( channel ) , transport ) ; <nl> + grpc_connected_channel_bind_transport ( grpc_channel_get_channel_stack ( channel ) , <nl> + transport ) ; <nl> <nl> gpr_mu_lock ( & s - > mu_global ) ; <nl> chand - > next = & s - > root_channel_data ; <nl> grpc_transport_setup_result grpc_server_setup_transport ( <nl> <nl> gpr_free ( filters ) ; <nl> <nl> - return result ; <nl> + GRPC_CHANNEL_INTERNAL_REF ( channel , " connectivity " ) ; <nl> + memset ( & op , 0 , sizeof ( op ) ) ; <nl> + op . set_accept_stream = accept_stream ; <nl> + op . set_accept_stream_user_data = chand ; <nl> + op . on_connectivity_state_change = & chand - > channel_connectivity_changed ; <nl> + op . connectivity_state = & chand - > connectivity_state ; <nl> + grpc_transport_perform_op ( transport , & op ) ; <nl> } <nl> <nl> void grpc_server_shutdown_and_notify ( grpc_server * server , <nl> grpc_completion_queue * cq , void * tag ) { <nl> listener * l ; <nl> requested_call_array requested_calls ; <nl> - channel_data * c ; <nl> size_t i ; <nl> registered_method * rm ; <nl> shutdown_tag * sdt ; <nl> + channel_broadcaster broadcaster ; <nl> <nl> / * lock , and gather up some stuff to do * / <nl> gpr_mu_lock ( & server - > mu_global ) ; <nl> void grpc_server_shutdown_and_notify ( grpc_server * server , <nl> return ; <nl> } <nl> <nl> - for ( c = server - > root_channel_data . next ; c ! = & server - > root_channel_data ; <nl> - c = c - > next ) { <nl> - shutdown_channel ( c , 1 , c - > num_calls = = 0 ) ; <nl> - } <nl> + channel_broadcaster_init ( server , & broadcaster ) ; <nl> <nl> / * collect all unregistered then registered calls * / <nl> gpr_mu_lock ( & server - > mu_call ) ; <nl> void grpc_server_shutdown_and_notify ( grpc_server * server , <nl> for ( l = server - > listeners ; l ; l = l - > next ) { <nl> l - > destroy ( server , l - > arg ) ; <nl> } <nl> + <nl> + channel_broadcaster_shutdown ( & broadcaster , 1 , 0 ) ; <nl> } <nl> <nl> void grpc_server_listener_destroy_done ( void * s ) { <nl> static void begin_call ( grpc_server * server , call_data * calld , <nl> calld - > cq_new = rc - > cq_for_notification ; <nl> switch ( rc - > type ) { <nl> case BATCH_CALL : <nl> + GPR_ASSERT ( calld - > host ! = NULL ) ; <nl> + GPR_ASSERT ( calld - > path ! = NULL ) ; <nl> cpstr ( & rc - > data . batch . details - > host , <nl> & rc - > data . batch . details - > host_capacity , calld - > host ) ; <nl> cpstr ( & rc - > data . batch . details - > method , <nl> mmm a / src / core / surface / server . h <nl> ppp b / src / core / surface / server . h <nl> void grpc_server_listener_destroy_done ( void * server ) ; <nl> <nl> / * Setup a transport - creates a channel stack , binds the transport to the <nl> server * / <nl> - grpc_transport_setup_result grpc_server_setup_transport ( <nl> - grpc_server * server , grpc_transport * transport , <nl> - grpc_channel_filter const * * extra_filters , size_t num_extra_filters , <nl> - grpc_mdctx * mdctx , const grpc_channel_args * args ) ; <nl> + void grpc_server_setup_transport ( grpc_server * server , grpc_transport * transport , <nl> + grpc_channel_filter const * * extra_filters , <nl> + size_t num_extra_filters , grpc_mdctx * mdctx , <nl> + const grpc_channel_args * args ) ; <nl> <nl> const grpc_channel_args * grpc_server_get_channel_args ( grpc_server * server ) ; <nl> <nl> mmm a / src / core / surface / server_chttp2 . c <nl> ppp b / src / core / surface / server_chttp2 . c <nl> <nl> # include < grpc / support / log . h > <nl> # include < grpc / support / useful . h > <nl> <nl> - static grpc_transport_setup_result setup_transport ( void * server , <nl> - grpc_transport * transport , <nl> - grpc_mdctx * mdctx ) { <nl> + static void setup_transport ( void * server , grpc_transport * transport , <nl> + grpc_mdctx * mdctx ) { <nl> static grpc_channel_filter const * extra_filters [ ] = { <nl> & grpc_http_server_filter } ; <nl> - return grpc_server_setup_transport ( server , transport , extra_filters , <nl> - GPR_ARRAY_SIZE ( extra_filters ) , mdctx , <nl> - grpc_server_get_channel_args ( server ) ) ; <nl> + grpc_server_setup_transport ( server , transport , extra_filters , <nl> + GPR_ARRAY_SIZE ( extra_filters ) , mdctx , <nl> + grpc_server_get_channel_args ( server ) ) ; <nl> } <nl> <nl> static void new_transport ( void * server , grpc_endpoint * tcp ) { <nl> static void new_transport ( void * server , grpc_endpoint * tcp ) { <nl> * ( as in server_secure_chttp2 . c ) needs to add synchronization to avoid this <nl> * case . <nl> * / <nl> - grpc_create_chttp2_transport ( setup_transport , server , <nl> - grpc_server_get_channel_args ( server ) , tcp , NULL , <nl> - 0 , grpc_mdctx_create ( ) , 0 ) ; <nl> + grpc_mdctx * mdctx = grpc_mdctx_create ( ) ; <nl> + grpc_transport * transport = grpc_create_chttp2_transport ( <nl> + grpc_server_get_channel_args ( server ) , tcp , mdctx , 0 ) ; <nl> + setup_transport ( server , transport , mdctx ) ; <nl> + grpc_chttp2_transport_start_reading ( transport , NULL , 0 ) ; <nl> } <nl> <nl> / * Server callback : start listening on our ports * / <nl> mmm a / src / core / transport / chttp2 / incoming_metadata . c <nl> ppp b / src / core / transport / chttp2 / incoming_metadata . c <nl> void grpc_incoming_metadata_buffer_move_to_referencing_sopb ( <nl> sopb - > ops [ i ] . data . metadata . list . tail = <nl> ( void * ) ( delta + ( gpr_intptr ) sopb - > ops [ i ] . data . metadata . list . tail ) ; <nl> } <nl> + src - > count = 0 ; <nl> } <nl> <nl> void grpc_chttp2_incoming_metadata_buffer_postprocess_sopb_and_begin_live_op ( <nl> mmm a / src / core / transport / chttp2 / internal . h <nl> ppp b / src / core / transport / chttp2 / internal . h <nl> <nl> # ifndef GRPC_INTERNAL_CORE_CHTTP2_INTERNAL_H <nl> # define GRPC_INTERNAL_CORE_CHTTP2_INTERNAL_H <nl> <nl> - # include " src / core / transport / transport_impl . h " <nl> # include " src / core / iomgr / endpoint . h " <nl> # include " src / core / transport / chttp2 / frame . h " <nl> # include " src / core / transport / chttp2 / frame_data . h " <nl> <nl> # include " src / core / transport / chttp2 / incoming_metadata . h " <nl> # include " src / core / transport / chttp2 / stream_encoder . h " <nl> # include " src / core / transport / chttp2 / stream_map . h " <nl> + # include " src / core / transport / connectivity_state . h " <nl> + # include " src / core / transport / transport_impl . h " <nl> <nl> typedef struct grpc_chttp2_transport grpc_chttp2_transport ; <nl> typedef struct grpc_chttp2_stream grpc_chttp2_stream ; <nl> typedef enum { <nl> GRPC_CHTTP2_LIST_WRITABLE_WINDOW_UPDATE , <nl> GRPC_CHTTP2_LIST_PARSING_SEEN , <nl> GRPC_CHTTP2_LIST_CLOSED_WAITING_FOR_PARSING , <nl> + GRPC_CHTTP2_LIST_CANCELLED_WAITING_FOR_WRITING , <nl> GRPC_CHTTP2_LIST_INCOMING_WINDOW_UPDATED , <nl> / * * streams that are waiting to start because there are too many concurrent <nl> streams on the connection * / <nl> typedef struct { <nl> grpc_chttp2_stream * prev ; <nl> } grpc_chttp2_stream_link ; <nl> <nl> - typedef enum { <nl> - GRPC_CHTTP2_ERROR_STATE_NONE , <nl> - GRPC_CHTTP2_ERROR_STATE_SEEN , <nl> - GRPC_CHTTP2_ERROR_STATE_NOTIFIED <nl> - } grpc_chttp2_error_state ; <nl> - <nl> / * We keep several sets of connection wide parameters * / <nl> typedef enum { <nl> / * The settings our peer has asked for ( and we have acked ) * / <nl> typedef struct { <nl> / * * data to write next write * / <nl> gpr_slice_buffer qbuf ; <nl> / * * queued callbacks * / <nl> - grpc_iomgr_closure * pending_closures ; <nl> + grpc_iomgr_closure * pending_closures_head ; <nl> + grpc_iomgr_closure * pending_closures_tail ; <nl> <nl> / * * window available for us to send to peer * / <nl> gpr_uint32 outgoing_window ; <nl> typedef struct { <nl> / * * how much window would we like to have for incoming_window * / <nl> gpr_uint32 connection_window_target ; <nl> <nl> + / * * have we seen a goaway * / <nl> + gpr_uint8 seen_goaway ; <nl> + <nl> / * * is this transport a client ? * / <nl> gpr_uint8 is_client ; <nl> / * * are the local settings dirty and need to be sent ? * / <nl> typedef struct { <nl> / * * settings values * / <nl> gpr_uint32 settings [ GRPC_NUM_SETTING_SETS ] [ GRPC_CHTTP2_NUM_SETTINGS ] ; <nl> <nl> - / * * has there been a connection level error , and have we notified <nl> - anyone about it ? * / <nl> - grpc_chttp2_error_state error_state ; <nl> - <nl> / * * what is the next stream id to be allocated by this peer ? <nl> copied to next_stream_id in parsing when parsing commences * / <nl> gpr_uint32 next_stream_id ; <nl> typedef struct { <nl> / * * concurrent stream count : updated when not parsing , <nl> so this is a strict over - estimation on the client * / <nl> gpr_uint32 concurrent_stream_count ; <nl> - <nl> - / * * is there a goaway available ? ( boolean ) * / <nl> - grpc_chttp2_error_state goaway_state ; <nl> - / * * what is the debug text of the goaway ? * / <nl> - gpr_slice goaway_text ; <nl> - / * * what is the status code of the goaway ? * / <nl> - grpc_status_code goaway_error ; <nl> } grpc_chttp2_transport_global ; <nl> <nl> typedef struct { <nl> struct grpc_chttp2_transport { <nl> grpc_chttp2_stream * * accepting_stream ; <nl> <nl> struct { <nl> - / * * is a thread currently performing channel callbacks * / <nl> - gpr_uint8 executing ; <nl> - / * * transport channel - level callback * / <nl> - const grpc_transport_callbacks * cb ; <nl> - / * * user data for cb calls * / <nl> - void * cb_user_data ; <nl> - / * * closure for notifying transport closure * / <nl> - grpc_iomgr_closure notify_closed ; <nl> + / * accept stream callback * / <nl> + void ( * accept_stream ) ( void * user_data , grpc_transport * transport , <nl> + const void * server_data ) ; <nl> + void * accept_stream_user_data ; <nl> + <nl> + / * * connectivity tracking * / <nl> + grpc_connectivity_state_tracker state_tracker ; <nl> } channel_callback ; <nl> } ; <nl> <nl> int grpc_chttp2_list_pop_closed_waiting_for_parsing ( <nl> grpc_chttp2_transport_global * transport_global , <nl> grpc_chttp2_stream_global * * stream_global ) ; <nl> <nl> + void grpc_chttp2_list_add_cancelled_waiting_for_writing ( <nl> + grpc_chttp2_transport_global * transport_global , <nl> + grpc_chttp2_stream_global * stream_global ) ; <nl> + int grpc_chttp2_list_pop_cancelled_waiting_for_writing ( <nl> + grpc_chttp2_transport_global * transport_global , <nl> + grpc_chttp2_stream_global * * stream_global ) ; <nl> + <nl> void grpc_chttp2_list_add_read_write_state_changed ( <nl> grpc_chttp2_transport_global * transport_global , <nl> grpc_chttp2_stream_global * stream_global ) ; <nl> mmm a / src / core / transport / chttp2 / stream_lists . c <nl> ppp b / src / core / transport / chttp2 / stream_lists . c <nl> int grpc_chttp2_list_pop_writable_window_update_stream ( <nl> void grpc_chttp2_list_remove_writable_window_update_stream ( <nl> grpc_chttp2_transport_global * transport_global , <nl> grpc_chttp2_stream_global * stream_global ) { <nl> - stream_list_maybe_remove ( TRANSPORT_FROM_GLOBAL ( transport_global ) , STREAM_FROM_GLOBAL ( stream_global ) , GRPC_CHTTP2_LIST_WRITABLE_WINDOW_UPDATE ) ; <nl> + stream_list_maybe_remove ( TRANSPORT_FROM_GLOBAL ( transport_global ) , <nl> + STREAM_FROM_GLOBAL ( stream_global ) , <nl> + GRPC_CHTTP2_LIST_WRITABLE_WINDOW_UPDATE ) ; <nl> } <nl> <nl> void grpc_chttp2_list_add_parsing_seen_stream ( <nl> int grpc_chttp2_list_pop_closed_waiting_for_parsing ( <nl> return r ; <nl> } <nl> <nl> + void grpc_chttp2_list_add_cancelled_waiting_for_writing ( <nl> + grpc_chttp2_transport_global * transport_global , <nl> + grpc_chttp2_stream_global * stream_global ) { <nl> + stream_list_add ( TRANSPORT_FROM_GLOBAL ( transport_global ) , <nl> + STREAM_FROM_GLOBAL ( stream_global ) , <nl> + GRPC_CHTTP2_LIST_CANCELLED_WAITING_FOR_WRITING ) ; <nl> + } <nl> + <nl> + int grpc_chttp2_list_pop_cancelled_waiting_for_writing ( <nl> + grpc_chttp2_transport_global * transport_global , <nl> + grpc_chttp2_stream_global * * stream_global ) { <nl> + grpc_chttp2_stream * stream ; <nl> + int r = stream_list_pop ( TRANSPORT_FROM_GLOBAL ( transport_global ) , & stream , <nl> + GRPC_CHTTP2_LIST_CANCELLED_WAITING_FOR_WRITING ) ; <nl> + * stream_global = & stream - > global ; <nl> + return r ; <nl> + } <nl> + <nl> void grpc_chttp2_list_add_incoming_window_updated ( <nl> grpc_chttp2_transport_global * transport_global , <nl> grpc_chttp2_stream_global * stream_global ) { <nl> mmm a / src / core / transport / chttp2 / writing . c <nl> ppp b / src / core / transport / chttp2 / writing . c <nl> int grpc_chttp2_unlocking_check_writes ( <nl> grpc_chttp2_list_add_writing_stream ( transport_writing , stream_writing ) ; <nl> } <nl> <nl> - / * we should either exhaust window or have no ops left , but not both * / <nl> - if ( stream_global - > outgoing_sopb - > nops = = 0 ) { <nl> - stream_global - > outgoing_sopb = NULL ; <nl> - grpc_chttp2_schedule_closure ( transport_global , <nl> - stream_global - > send_done_closure , 1 ) ; <nl> - } else if ( stream_global - > outgoing_window > 0 ) { <nl> + if ( stream_global - > outgoing_window > 0 & & <nl> + stream_global - > outgoing_sopb - > nops ! = 0 ) { <nl> grpc_chttp2_list_add_writable_stream ( transport_global , stream_global ) ; <nl> } <nl> } <nl> void grpc_chttp2_cleanup_writing ( <nl> <nl> while ( grpc_chttp2_list_pop_written_stream ( <nl> transport_global , transport_writing , & stream_global , & stream_writing ) ) { <nl> + if ( stream_global - > outgoing_sopb - > nops = = 0 ) { <nl> + stream_global - > outgoing_sopb = NULL ; <nl> + grpc_chttp2_schedule_closure ( transport_global , <nl> + stream_global - > send_done_closure , 1 ) ; <nl> + } <nl> if ( stream_writing - > send_closed ! = GRPC_DONT_SEND_CLOSED ) { <nl> stream_global - > write_state = GRPC_WRITE_STATE_SENT_CLOSE ; <nl> if ( ! transport_global - > is_client ) { <nl> mmm a / src / core / transport / chttp2_transport . c <nl> ppp b / src / core / transport / chttp2_transport . c <nl> <nl> # include < stdio . h > <nl> # include < string . h > <nl> <nl> + # include < grpc / support / alloc . h > <nl> + # include < grpc / support / log . h > <nl> + # include < grpc / support / slice_buffer . h > <nl> + # include < grpc / support / string_util . h > <nl> + # include < grpc / support / useful . h > <nl> + <nl> # include " src / core / profiling / timers . h " <nl> # include " src / core / support / string . h " <nl> # include " src / core / transport / chttp2 / http2_errors . h " <nl> + # include " src / core / transport / chttp2 / internal . h " <nl> # include " src / core / transport / chttp2 / status_conversion . h " <nl> # include " src / core / transport / chttp2 / timeout_encoding . h " <nl> - # include " src / core / transport / chttp2 / internal . h " <nl> # include " src / core / transport / transport_impl . h " <nl> - # include < grpc / support / alloc . h > <nl> - # include < grpc / support / log . h > <nl> - # include < grpc / support / slice_buffer . h > <nl> - # include < grpc / support / string_util . h > <nl> - # include < grpc / support / useful . h > <nl> <nl> # define DEFAULT_WINDOW 65535 <nl> # define DEFAULT_CONNECTION_WINDOW_TARGET ( 1024 * 1024 ) <nl> static const grpc_transport_vtable vtable ; <nl> static void lock ( grpc_chttp2_transport * t ) ; <nl> static void unlock ( grpc_chttp2_transport * t ) ; <nl> <nl> - static void unlock_check_channel_callbacks ( grpc_chttp2_transport * t ) ; <nl> static void unlock_check_read_write_state ( grpc_chttp2_transport * t ) ; <nl> <nl> / * forward declarations of various callbacks that we ' ll build closures around * / <nl> static void writing_action ( void * t , int iomgr_success_ignored ) ; <nl> static void reading_action ( void * t , int iomgr_success_ignored ) ; <nl> - static void notify_closed ( void * t , int iomgr_success_ignored ) ; <nl> <nl> / * * Set a transport level setting , and push it to our peer * / <nl> static void push_setting ( grpc_chttp2_transport * t , grpc_chttp2_setting_id id , <nl> static void recv_data ( void * tp , gpr_slice * slices , size_t nslices , <nl> static void drop_connection ( grpc_chttp2_transport * t ) ; <nl> <nl> / * * Perform a transport_op * / <nl> - static void perform_op_locked ( grpc_chttp2_transport_global * transport_global , <nl> - grpc_chttp2_stream_global * stream_global , <nl> - grpc_transport_op * op ) ; <nl> + static void perform_stream_op_locked ( <nl> + grpc_chttp2_transport_global * transport_global , <nl> + grpc_chttp2_stream_global * stream_global , grpc_transport_stream_op * op ) ; <nl> <nl> / * * Cancel a stream : coming from the transport API * / <nl> static void cancel_from_api ( grpc_chttp2_transport_global * transport_global , <nl> static void add_to_pollset_locked ( grpc_chttp2_transport * t , <nl> static void maybe_start_some_streams ( <nl> grpc_chttp2_transport_global * transport_global ) ; <nl> <nl> + static void connectivity_state_set ( <nl> + grpc_chttp2_transport_global * transport_global , <nl> + grpc_connectivity_state state ) ; <nl> + <nl> / * <nl> * CONSTRUCTION / DESTRUCTION / REFCOUNTING <nl> * / <nl> static void destruct_transport ( grpc_chttp2_transport * t ) { <nl> <nl> grpc_chttp2_stream_map_destroy ( & t - > parsing_stream_map ) ; <nl> grpc_chttp2_stream_map_destroy ( & t - > new_stream_map ) ; <nl> + grpc_connectivity_state_destroy ( & t - > channel_callback . state_tracker ) ; <nl> <nl> gpr_mu_unlock ( & t - > mu ) ; <nl> gpr_mu_destroy ( & t - > mu ) ; <nl> static void ref_transport ( grpc_chttp2_transport * t ) { gpr_ref ( & t - > refs ) ; } <nl> # endif <nl> <nl> static void init_transport ( grpc_chttp2_transport * t , <nl> - grpc_transport_setup_callback setup , void * arg , <nl> const grpc_channel_args * channel_args , <nl> - grpc_endpoint * ep , gpr_slice * slices , size_t nslices , <nl> - grpc_mdctx * mdctx , int is_client ) { <nl> + grpc_endpoint * ep , grpc_mdctx * mdctx , <nl> + int is_client ) { <nl> size_t i ; <nl> int j ; <nl> - grpc_transport_setup_result sr ; <nl> <nl> GPR_ASSERT ( strlen ( GRPC_CHTTP2_CLIENT_CONNECT_STRING ) = = <nl> GRPC_CHTTP2_CLIENT_CONNECT_STRLEN ) ; <nl> static void init_transport ( grpc_chttp2_transport * t , <nl> grpc_mdctx_ref ( mdctx ) ; <nl> t - > metadata_context = mdctx ; <nl> t - > endpoint_reading = 1 ; <nl> - t - > global . error_state = GRPC_CHTTP2_ERROR_STATE_NONE ; <nl> t - > global . next_stream_id = is_client ? 1 : 2 ; <nl> t - > global . is_client = is_client ; <nl> t - > global . outgoing_window = DEFAULT_WINDOW ; <nl> static void init_transport ( grpc_chttp2_transport * t , <nl> t - > parsing . deframe_state = <nl> is_client ? GRPC_DTS_FH_0 : GRPC_DTS_CLIENT_PREFIX_0 ; <nl> t - > writing . is_client = is_client ; <nl> + grpc_connectivity_state_init ( & t - > channel_callback . state_tracker , <nl> + GRPC_CHANNEL_READY ) ; <nl> <nl> gpr_slice_buffer_init ( & t - > global . qbuf ) ; <nl> <nl> static void init_transport ( grpc_chttp2_transport * t , <nl> grpc_chttp2_goaway_parser_init ( & t - > parsing . goaway_parser ) ; <nl> grpc_chttp2_hpack_parser_init ( & t - > parsing . hpack_parser , t - > metadata_context ) ; <nl> <nl> - grpc_iomgr_closure_init ( & t - > channel_callback . notify_closed , notify_closed , t ) ; <nl> if ( is_client ) { <nl> gpr_slice_buffer_add ( <nl> & t - > global . qbuf , <nl> static void init_transport ( grpc_chttp2_transport * t , <nl> } <nl> } <nl> } <nl> - <nl> - gpr_mu_lock ( & t - > mu ) ; <nl> - t - > channel_callback . executing = 1 ; <nl> - REF_TRANSPORT ( t , " init " ) ; / * matches unref at end of this function * / <nl> - gpr_mu_unlock ( & t - > mu ) ; <nl> - <nl> - sr = setup ( arg , & t - > base , t - > metadata_context ) ; <nl> - <nl> - lock ( t ) ; <nl> - t - > channel_callback . cb = sr . callbacks ; <nl> - t - > channel_callback . cb_user_data = sr . user_data ; <nl> - t - > channel_callback . executing = 0 ; <nl> - unlock ( t ) ; <nl> - <nl> - REF_TRANSPORT ( t , " recv_data " ) ; / * matches unref inside recv_data * / <nl> - recv_data ( t , slices , nslices , GRPC_ENDPOINT_CB_OK ) ; <nl> - <nl> - UNREF_TRANSPORT ( t , " init " ) ; <nl> } <nl> <nl> static void destroy_transport ( grpc_transport * gt ) { <nl> static void destroy_transport ( grpc_transport * gt ) { <nl> static void close_transport_locked ( grpc_chttp2_transport * t ) { <nl> if ( ! t - > closed ) { <nl> t - > closed = 1 ; <nl> + connectivity_state_set ( & t - > global , GRPC_CHANNEL_FATAL_FAILURE ) ; <nl> if ( t - > ep ) { <nl> grpc_endpoint_shutdown ( t - > ep ) ; <nl> } <nl> } <nl> } <nl> <nl> - static void close_transport ( grpc_transport * gt ) { <nl> - grpc_chttp2_transport * t = ( grpc_chttp2_transport * ) gt ; <nl> - gpr_mu_lock ( & t - > mu ) ; <nl> - close_transport_locked ( t ) ; <nl> - gpr_mu_unlock ( & t - > mu ) ; <nl> - } <nl> - <nl> - static void goaway ( grpc_transport * gt , grpc_status_code status , <nl> - gpr_slice debug_data ) { <nl> - grpc_chttp2_transport * t = ( grpc_chttp2_transport * ) gt ; <nl> - lock ( t ) ; <nl> - grpc_chttp2_goaway_append ( t - > global . last_incoming_stream_id , <nl> - grpc_chttp2_grpc_status_to_http2_error ( status ) , <nl> - debug_data , & t - > global . qbuf ) ; <nl> - unlock ( t ) ; <nl> - } <nl> - <nl> static int init_stream ( grpc_transport * gt , grpc_stream * gs , <nl> - const void * server_data , grpc_transport_op * initial_op ) { <nl> + const void * server_data , <nl> + grpc_transport_stream_op * initial_op ) { <nl> grpc_chttp2_transport * t = ( grpc_chttp2_transport * ) gt ; <nl> grpc_chttp2_stream * s = ( grpc_chttp2_stream * ) gs ; <nl> <nl> static int init_stream ( grpc_transport * gt , grpc_stream * gs , <nl> s - > global . in_stream_map = 1 ; <nl> } <nl> <nl> - if ( initial_op ) perform_op_locked ( & t - > global , & s - > global , initial_op ) ; <nl> + if ( initial_op ) perform_stream_op_locked ( & t - > global , & s - > global , initial_op ) ; <nl> unlock ( t ) ; <nl> <nl> return 0 ; <nl> grpc_chttp2_stream_parsing * grpc_chttp2_parsing_accept_stream ( <nl> grpc_chttp2_transport * t = TRANSPORT_FROM_PARSING ( transport_parsing ) ; <nl> GPR_ASSERT ( t - > accepting_stream = = NULL ) ; <nl> t - > accepting_stream = & accepting ; <nl> - t - > channel_callback . cb - > accept_stream ( t - > channel_callback . cb_user_data , <nl> - & t - > base , ( void * ) ( gpr_uintptr ) id ) ; <nl> + t - > channel_callback . accept_stream ( t - > channel_callback . accept_stream_user_data , <nl> + & t - > base , ( void * ) ( gpr_uintptr ) id ) ; <nl> t - > accepting_stream = NULL ; <nl> return & accepting - > parsing ; <nl> } <nl> static void unlock ( grpc_chttp2_transport * t ) { <nl> grpc_iomgr_closure * run_closures ; <nl> <nl> unlock_check_read_write_state ( t ) ; <nl> - if ( ! t - > writing_active & & t - > global . error_state = = GRPC_CHTTP2_ERROR_STATE_NONE & & <nl> + if ( ! t - > writing_active & & ! t - > closed & & <nl> grpc_chttp2_unlocking_check_writes ( & t - > global , & t - > writing ) ) { <nl> t - > writing_active = 1 ; <nl> REF_TRANSPORT ( t , " writing " ) ; <nl> grpc_chttp2_schedule_closure ( & t - > global , & t - > writing_action , 1 ) ; <nl> } <nl> - / * unlock_check_parser ( t ) ; * / <nl> - unlock_check_channel_callbacks ( t ) ; <nl> <nl> - run_closures = t - > global . pending_closures ; <nl> - t - > global . pending_closures = NULL ; <nl> + run_closures = t - > global . pending_closures_head ; <nl> + t - > global . pending_closures_head = NULL ; <nl> + t - > global . pending_closures_tail = NULL ; <nl> <nl> gpr_mu_unlock ( & t - > mu ) ; <nl> <nl> static void writing_action ( void * gt , int iomgr_success_ignored ) { <nl> void grpc_chttp2_add_incoming_goaway ( <nl> grpc_chttp2_transport_global * transport_global , gpr_uint32 goaway_error , <nl> gpr_slice goaway_text ) { <nl> - char * msg = gpr_hexdump ( ( char * ) GPR_SLICE_START_PTR ( goaway_text ) , GPR_SLICE_LENGTH ( goaway_text ) , GPR_HEXDUMP_PLAINTEXT ) ; <nl> + char * msg = gpr_hexdump ( ( char * ) GPR_SLICE_START_PTR ( goaway_text ) , <nl> + GPR_SLICE_LENGTH ( goaway_text ) , GPR_HEXDUMP_PLAINTEXT ) ; <nl> + gpr_log ( GPR_DEBUG , " got goaway [ % d ] : % s " , goaway_error , msg ) ; <nl> gpr_free ( msg ) ; <nl> - if ( transport_global - > goaway_state = = GRPC_CHTTP2_ERROR_STATE_NONE ) { <nl> - transport_global - > goaway_state = GRPC_CHTTP2_ERROR_STATE_SEEN ; <nl> - transport_global - > goaway_text = goaway_text ; <nl> - transport_global - > goaway_error = goaway_error ; <nl> - } else { <nl> - gpr_slice_unref ( goaway_text ) ; <nl> - } <nl> + gpr_slice_unref ( goaway_text ) ; <nl> + transport_global - > seen_goaway = 1 ; <nl> + connectivity_state_set ( transport_global , GRPC_CHANNEL_FATAL_FAILURE ) ; <nl> } <nl> <nl> static void maybe_start_some_streams ( <nl> static void maybe_start_some_streams ( <nl> transport_global - > next_stream_id + = 2 ; <nl> <nl> if ( transport_global - > next_stream_id > = MAX_CLIENT_STREAM_ID ) { <nl> - grpc_chttp2_add_incoming_goaway ( <nl> - transport_global , GRPC_CHTTP2_NO_ERROR , <nl> - gpr_slice_from_copied_string ( " Exceeded sequence number limit " ) ) ; <nl> + connectivity_state_set ( transport_global , GRPC_CHANNEL_TRANSIENT_FAILURE ) ; <nl> } <nl> <nl> stream_global - > outgoing_window = <nl> static void maybe_start_some_streams ( <nl> } <nl> } <nl> <nl> - static void perform_op_locked ( grpc_chttp2_transport_global * transport_global , <nl> - grpc_chttp2_stream_global * stream_global , <nl> - grpc_transport_op * op ) { <nl> + static void perform_stream_op_locked ( <nl> + grpc_chttp2_transport_global * transport_global , <nl> + grpc_chttp2_stream_global * stream_global , grpc_transport_stream_op * op ) { <nl> if ( op - > cancel_with_status ! = GRPC_STATUS_OK ) { <nl> cancel_from_api ( transport_global , stream_global , op - > cancel_with_status ) ; <nl> } <nl> static void perform_op_locked ( grpc_chttp2_transport_global * transport_global , <nl> } <nl> } <nl> <nl> - static void perform_op ( grpc_transport * gt , grpc_stream * gs , <nl> - grpc_transport_op * op ) { <nl> + static void perform_stream_op ( grpc_transport * gt , grpc_stream * gs , <nl> + grpc_transport_stream_op * op ) { <nl> grpc_chttp2_transport * t = ( grpc_chttp2_transport * ) gt ; <nl> grpc_chttp2_stream * s = ( grpc_chttp2_stream * ) gs ; <nl> <nl> lock ( t ) ; <nl> - perform_op_locked ( & t - > global , & s - > global , op ) ; <nl> + perform_stream_op_locked ( & t - > global , & s - > global , op ) ; <nl> unlock ( t ) ; <nl> } <nl> <nl> - static void send_ping ( grpc_transport * gt , grpc_iomgr_closure * on_recv ) { <nl> - grpc_chttp2_transport * t = ( grpc_chttp2_transport * ) gt ; <nl> + static void send_ping_locked ( grpc_chttp2_transport * t , <nl> + grpc_iomgr_closure * on_recv ) { <nl> grpc_chttp2_outstanding_ping * p = gpr_malloc ( sizeof ( * p ) ) ; <nl> - <nl> - lock ( t ) ; <nl> p - > next = & t - > global . pings ; <nl> p - > prev = p - > next - > prev ; <nl> p - > prev - > next = p - > next - > prev = p ; <nl> static void send_ping ( grpc_transport * gt , grpc_iomgr_closure * on_recv ) { <nl> p - > id [ 7 ] = t - > global . ping_counter & 0xff ; <nl> p - > on_recv = on_recv ; <nl> gpr_slice_buffer_add ( & t - > global . qbuf , grpc_chttp2_ping_create ( 0 , p - > id ) ) ; <nl> + } <nl> + <nl> + static void perform_transport_op ( grpc_transport * gt , grpc_transport_op * op ) { <nl> + grpc_chttp2_transport * t = ( grpc_chttp2_transport * ) gt ; <nl> + <nl> + lock ( t ) ; <nl> + <nl> + if ( op - > on_consumed ) { <nl> + grpc_chttp2_schedule_closure ( & t - > global , op - > on_consumed , 1 ) ; <nl> + } <nl> + <nl> + if ( op - > on_connectivity_state_change ) { <nl> + grpc_connectivity_state_notify_on_state_change ( <nl> + & t - > channel_callback . state_tracker , op - > connectivity_state , <nl> + op - > on_connectivity_state_change ) ; <nl> + } <nl> + <nl> + if ( op - > send_goaway ) { <nl> + grpc_chttp2_goaway_append ( <nl> + t - > global . last_incoming_stream_id , <nl> + grpc_chttp2_grpc_status_to_http2_error ( op - > goaway_status ) , <nl> + gpr_slice_ref ( * op - > goaway_message ) , & t - > global . qbuf ) ; <nl> + } <nl> + <nl> + if ( op - > set_accept_stream ! = NULL ) { <nl> + t - > channel_callback . accept_stream = op - > set_accept_stream ; <nl> + t - > channel_callback . accept_stream_user_data = <nl> + op - > set_accept_stream_user_data ; <nl> + } <nl> + <nl> + if ( op - > bind_pollset ) { <nl> + add_to_pollset_locked ( t , op - > bind_pollset ) ; <nl> + } <nl> + <nl> + if ( op - > send_ping ) { <nl> + send_ping_locked ( t , op - > send_ping ) ; <nl> + } <nl> + <nl> + if ( op - > disconnect ) { <nl> + close_transport_locked ( t ) ; <nl> + } <nl> + <nl> unlock ( t ) ; <nl> } <nl> <nl> static void remove_stream ( grpc_chttp2_transport * t , gpr_uint32 id ) { <nl> grpc_chttp2_parsing_become_skip_parser ( & t - > parsing ) ; <nl> } <nl> <nl> - new_stream_count = <nl> - grpc_chttp2_stream_map_size ( & t - > parsing_stream_map ) + <nl> - grpc_chttp2_stream_map_size ( & t - > new_stream_map ) ; <nl> + new_stream_count = grpc_chttp2_stream_map_size ( & t - > parsing_stream_map ) + <nl> + grpc_chttp2_stream_map_size ( & t - > new_stream_map ) ; <nl> if ( new_stream_count ! = t - > global . concurrent_stream_count ) { <nl> t - > global . concurrent_stream_count = new_stream_count ; <nl> maybe_start_some_streams ( & t - > global ) ; <nl> static void unlock_check_read_write_state ( grpc_chttp2_transport * t ) { <nl> } <nl> } <nl> <nl> + if ( ! t - > writing_active ) { <nl> + while ( grpc_chttp2_list_pop_cancelled_waiting_for_writing ( transport_global , <nl> + & stream_global ) ) { <nl> + grpc_chttp2_list_add_read_write_state_changed ( transport_global , <nl> + stream_global ) ; <nl> + } <nl> + } <nl> + <nl> while ( grpc_chttp2_list_pop_read_write_state_changed ( transport_global , <nl> & stream_global ) ) { <nl> if ( stream_global - > cancelled ) { <nl> - stream_global - > write_state = GRPC_WRITE_STATE_SENT_CLOSE ; <nl> - stream_global - > read_closed = 1 ; <nl> - if ( ! stream_global - > published_cancelled ) { <nl> - char buffer [ GPR_LTOA_MIN_BUFSIZE ] ; <nl> - gpr_ltoa ( stream_global - > cancelled_status , buffer ) ; <nl> - grpc_chttp2_incoming_metadata_buffer_add ( & stream_global - > incoming_metadata , <nl> - grpc_mdelem_from_strings ( t - > metadata_context , " grpc - status " , buffer ) ) ; <nl> - grpc_chttp2_incoming_metadata_buffer_place_metadata_batch_into ( <nl> - & stream_global - > incoming_metadata , <nl> - & stream_global - > incoming_sopb ) ; <nl> - stream_global - > published_cancelled = 1 ; <nl> + if ( t - > writing_active & & <nl> + stream_global - > write_state ! = GRPC_WRITE_STATE_SENT_CLOSE ) { <nl> + grpc_chttp2_list_add_cancelled_waiting_for_writing ( transport_global , <nl> + stream_global ) ; <nl> + } else { <nl> + stream_global - > write_state = GRPC_WRITE_STATE_SENT_CLOSE ; <nl> + stream_global - > read_closed = 1 ; <nl> + if ( ! stream_global - > published_cancelled ) { <nl> + char buffer [ GPR_LTOA_MIN_BUFSIZE ] ; <nl> + gpr_ltoa ( stream_global - > cancelled_status , buffer ) ; <nl> + grpc_chttp2_incoming_metadata_buffer_add ( <nl> + & stream_global - > incoming_metadata , <nl> + grpc_mdelem_from_strings ( t - > metadata_context , " grpc - status " , <nl> + buffer ) ) ; <nl> + grpc_chttp2_incoming_metadata_buffer_place_metadata_batch_into ( <nl> + & stream_global - > incoming_metadata , & stream_global - > incoming_sopb ) ; <nl> + stream_global - > published_cancelled = 1 ; <nl> + } <nl> } <nl> } <nl> if ( stream_global - > write_state = = GRPC_WRITE_STATE_SENT_CLOSE & & <nl> static void cancel_from_api ( grpc_chttp2_transport_global * transport_global , <nl> stream_global - > cancelled = 1 ; <nl> stream_global - > cancelled_status = status ; <nl> if ( stream_global - > id ! = 0 ) { <nl> - gpr_slice_buffer_add ( & transport_global - > qbuf , <nl> - grpc_chttp2_rst_stream_create ( <nl> - stream_global - > id , <nl> - grpc_chttp2_grpc_status_to_http2_error ( status ) ) ) ; <nl> + gpr_slice_buffer_add ( <nl> + & transport_global - > qbuf , <nl> + grpc_chttp2_rst_stream_create ( <nl> + stream_global - > id , grpc_chttp2_grpc_status_to_http2_error ( status ) ) ) ; <nl> } <nl> grpc_chttp2_list_add_read_write_state_changed ( transport_global , <nl> stream_global ) ; <nl> static void end_all_the_calls ( grpc_chttp2_transport * t ) { <nl> } <nl> <nl> static void drop_connection ( grpc_chttp2_transport * t ) { <nl> - if ( t - > global . error_state = = GRPC_CHTTP2_ERROR_STATE_NONE ) { <nl> - t - > global . error_state = GRPC_CHTTP2_ERROR_STATE_SEEN ; <nl> - } <nl> close_transport_locked ( t ) ; <nl> end_all_the_calls ( t ) ; <nl> } <nl> static void recv_data ( void * tp , gpr_slice * slices , size_t nslices , <nl> lock ( t ) ; <nl> i = 0 ; <nl> GPR_ASSERT ( ! t - > parsing_active ) ; <nl> - if ( t - > global . error_state = = GRPC_CHTTP2_ERROR_STATE_NONE ) { <nl> + if ( ! t - > closed ) { <nl> t - > parsing_active = 1 ; <nl> / * merge stream lists * / <nl> grpc_chttp2_stream_map_move_into ( & t - > new_stream_map , <nl> static void recv_data ( void * tp , gpr_slice * slices , size_t nslices , <nl> / * merge stream lists * / <nl> grpc_chttp2_stream_map_move_into ( & t - > new_stream_map , <nl> & t - > parsing_stream_map ) ; <nl> - t - > global . concurrent_stream_count = grpc_chttp2_stream_map_size ( & t - > parsing_stream_map ) ; <nl> + t - > global . concurrent_stream_count = <nl> + grpc_chttp2_stream_map_size ( & t - > parsing_stream_map ) ; <nl> if ( t - > parsing . initial_window_update ! = 0 ) { <nl> grpc_chttp2_stream_map_for_each ( & t - > parsing_stream_map , <nl> update_global_window , t ) ; <nl> static void reading_action ( void * pt , int iomgr_success_ignored ) { <nl> * CALLBACK LOOP <nl> * / <nl> <nl> - typedef struct { <nl> - grpc_chttp2_transport * t ; <nl> - gpr_uint32 error ; <nl> - gpr_slice text ; <nl> - grpc_iomgr_closure closure ; <nl> - } notify_goaways_args ; <nl> - <nl> - static void notify_goaways ( void * p , int iomgr_success_ignored ) { <nl> - notify_goaways_args * a = p ; <nl> - grpc_chttp2_transport * t = a - > t ; <nl> - <nl> - t - > channel_callback . cb - > goaway ( t - > channel_callback . cb_user_data , & t - > base , <nl> - a - > error , a - > text ) ; <nl> - <nl> - gpr_free ( a ) ; <nl> - <nl> - lock ( t ) ; <nl> - t - > channel_callback . executing = 0 ; <nl> - unlock ( t ) ; <nl> - <nl> - UNREF_TRANSPORT ( t , " notify_goaways " ) ; <nl> + static void schedule_closure_for_connectivity ( void * a , <nl> + grpc_iomgr_closure * closure ) { <nl> + grpc_chttp2_schedule_closure ( a , closure , 1 ) ; <nl> } <nl> <nl> - static void notify_closed ( void * gt , int iomgr_success_ignored ) { <nl> - grpc_chttp2_transport * t = gt ; <nl> - t - > channel_callback . cb - > closed ( t - > channel_callback . cb_user_data , & t - > base ) ; <nl> - <nl> - lock ( t ) ; <nl> - t - > channel_callback . executing = 0 ; <nl> - unlock ( t ) ; <nl> - <nl> - UNREF_TRANSPORT ( t , " notify_closed " ) ; <nl> - } <nl> - <nl> - static void unlock_check_channel_callbacks ( grpc_chttp2_transport * t ) { <nl> - if ( t - > channel_callback . executing ) { <nl> - return ; <nl> - } <nl> - if ( t - > global . goaway_state ! = GRPC_CHTTP2_ERROR_STATE_NONE ) { <nl> - if ( t - > global . goaway_state = = GRPC_CHTTP2_ERROR_STATE_SEEN & & <nl> - t - > global . error_state ! = GRPC_CHTTP2_ERROR_STATE_NOTIFIED ) { <nl> - notify_goaways_args * a = gpr_malloc ( sizeof ( * a ) ) ; <nl> - a - > t = t ; <nl> - a - > error = t - > global . goaway_error ; <nl> - a - > text = t - > global . goaway_text ; <nl> - t - > global . goaway_state = GRPC_CHTTP2_ERROR_STATE_NOTIFIED ; <nl> - t - > channel_callback . executing = 1 ; <nl> - grpc_iomgr_closure_init ( & a - > closure , notify_goaways , a ) ; <nl> - REF_TRANSPORT ( t , " notify_goaways " ) ; <nl> - grpc_chttp2_schedule_closure ( & t - > global , & a - > closure , 1 ) ; <nl> - return ; <nl> - } else if ( t - > global . goaway_state ! = GRPC_CHTTP2_ERROR_STATE_NOTIFIED ) { <nl> - return ; <nl> - } <nl> - } <nl> - if ( t - > global . error_state = = GRPC_CHTTP2_ERROR_STATE_SEEN ) { <nl> - t - > global . error_state = GRPC_CHTTP2_ERROR_STATE_NOTIFIED ; <nl> - t - > channel_callback . executing = 1 ; <nl> - REF_TRANSPORT ( t , " notify_closed " ) ; <nl> - grpc_chttp2_schedule_closure ( & t - > global , & t - > channel_callback . notify_closed , <nl> - 1 ) ; <nl> - } <nl> + static void connectivity_state_set ( <nl> + grpc_chttp2_transport_global * transport_global , <nl> + grpc_connectivity_state state ) { <nl> + GRPC_CHTTP2_IF_TRACING ( <nl> + gpr_log ( GPR_DEBUG , " set connectivity_state = % d " , state ) ) ; <nl> + grpc_connectivity_state_set_with_scheduler ( <nl> + & TRANSPORT_FROM_GLOBAL ( transport_global ) - > channel_callback . state_tracker , <nl> + state , schedule_closure_for_connectivity , transport_global ) ; <nl> } <nl> <nl> void grpc_chttp2_schedule_closure ( <nl> grpc_chttp2_transport_global * transport_global , grpc_iomgr_closure * closure , <nl> int success ) { <nl> closure - > success = success ; <nl> - closure - > next = transport_global - > pending_closures ; <nl> - transport_global - > pending_closures = closure ; <nl> + if ( transport_global - > pending_closures_tail = = NULL ) { <nl> + transport_global - > pending_closures_head = <nl> + transport_global - > pending_closures_tail = closure ; <nl> + } else { <nl> + transport_global - > pending_closures_tail - > next = closure ; <nl> + transport_global - > pending_closures_tail = closure ; <nl> + } <nl> + closure - > next = NULL ; <nl> } <nl> <nl> / * <nl> static void add_to_pollset_locked ( grpc_chttp2_transport * t , <nl> } <nl> } <nl> <nl> - static void add_to_pollset ( grpc_transport * gt , grpc_pollset * pollset ) { <nl> - grpc_chttp2_transport * t = ( grpc_chttp2_transport * ) gt ; <nl> - lock ( t ) ; <nl> - add_to_pollset_locked ( t , pollset ) ; <nl> - unlock ( t ) ; <nl> - } <nl> - <nl> / * <nl> * TRACING <nl> * / <nl> void grpc_chttp2_flowctl_trace ( const char * file , int line , const char * reason , <nl> * INTEGRATION GLUE <nl> * / <nl> <nl> - static const grpc_transport_vtable vtable = { sizeof ( grpc_chttp2_stream ) , <nl> - init_stream , <nl> - perform_op , <nl> - add_to_pollset , <nl> - destroy_stream , <nl> - goaway , <nl> - close_transport , <nl> - send_ping , <nl> - destroy_transport } ; <nl> - <nl> - void grpc_create_chttp2_transport ( grpc_transport_setup_callback setup , <nl> - void * arg , <nl> - const grpc_channel_args * channel_args , <nl> - grpc_endpoint * ep , gpr_slice * slices , <nl> - size_t nslices , grpc_mdctx * mdctx , <nl> - int is_client ) { <nl> + static const grpc_transport_vtable vtable = { <nl> + sizeof ( grpc_chttp2_stream ) , init_stream , perform_stream_op , <nl> + perform_transport_op , destroy_stream , destroy_transport } ; <nl> + <nl> + grpc_transport * grpc_create_chttp2_transport ( <nl> + const grpc_channel_args * channel_args , grpc_endpoint * ep , grpc_mdctx * mdctx , <nl> + int is_client ) { <nl> grpc_chttp2_transport * t = gpr_malloc ( sizeof ( grpc_chttp2_transport ) ) ; <nl> - init_transport ( t , setup , arg , channel_args , ep , slices , nslices , mdctx , <nl> - is_client ) ; <nl> + init_transport ( t , channel_args , ep , mdctx , is_client ) ; <nl> + return & t - > base ; <nl> + } <nl> + <nl> + void grpc_chttp2_transport_start_reading ( grpc_transport * transport , <nl> + gpr_slice * slices , size_t nslices ) { <nl> + grpc_chttp2_transport * t = ( grpc_chttp2_transport * ) transport ; <nl> + REF_TRANSPORT ( t , " recv_data " ) ; / * matches unref inside recv_data * / <nl> + recv_data ( t , slices , nslices , GRPC_ENDPOINT_CB_OK ) ; <nl> } <nl> mmm a / src / core / transport / chttp2_transport . h <nl> ppp b / src / core / transport / chttp2_transport . h <nl> <nl> extern int grpc_http_trace ; <nl> extern int grpc_flowctl_trace ; <nl> <nl> - void grpc_create_chttp2_transport ( grpc_transport_setup_callback setup , <nl> - void * arg , <nl> - const grpc_channel_args * channel_args , <nl> - grpc_endpoint * ep , gpr_slice * slices , <nl> - size_t nslices , grpc_mdctx * metadata_context , <nl> - int is_client ) ; <nl> + grpc_transport * grpc_create_chttp2_transport ( <nl> + const grpc_channel_args * channel_args , grpc_endpoint * ep , <nl> + grpc_mdctx * metadata_context , int is_client ) ; <nl> + <nl> + void grpc_chttp2_transport_start_reading ( grpc_transport * transport , <nl> + gpr_slice * slices , size_t nslices ) ; <nl> <nl> # endif / * GRPC_INTERNAL_CORE_TRANSPORT_CHTTP2_TRANSPORT_H * / <nl> new file mode 100644 <nl> index 00000000000 . . 1091ceae441 <nl> mmm / dev / null <nl> ppp b / src / core / transport / connectivity_state . 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 " src / core / transport / connectivity_state . h " <nl> + # include < grpc / support / alloc . h > <nl> + # include < grpc / support / log . h > <nl> + <nl> + void grpc_connectivity_state_init ( grpc_connectivity_state_tracker * tracker , <nl> + grpc_connectivity_state init_state ) { <nl> + tracker - > current_state = init_state ; <nl> + tracker - > watchers = NULL ; <nl> + } <nl> + <nl> + void grpc_connectivity_state_destroy ( grpc_connectivity_state_tracker * tracker ) { <nl> + grpc_connectivity_state_watcher * w ; <nl> + while ( ( w = tracker - > watchers ) ) { <nl> + tracker - > watchers = w - > next ; <nl> + <nl> + if ( GRPC_CHANNEL_FATAL_FAILURE ! = * w - > current ) { <nl> + * w - > current = GRPC_CHANNEL_FATAL_FAILURE ; <nl> + grpc_iomgr_add_callback ( w - > notify ) ; <nl> + } else { <nl> + grpc_iomgr_add_delayed_callback ( w - > notify , 0 ) ; <nl> + } <nl> + gpr_free ( w ) ; <nl> + } <nl> + } <nl> + <nl> + grpc_connectivity_state grpc_connectivity_state_check ( <nl> + grpc_connectivity_state_tracker * tracker ) { <nl> + return tracker - > current_state ; <nl> + } <nl> + <nl> + int grpc_connectivity_state_notify_on_state_change ( <nl> + grpc_connectivity_state_tracker * tracker , grpc_connectivity_state * current , <nl> + grpc_iomgr_closure * notify ) { <nl> + if ( tracker - > current_state ! = * current ) { <nl> + * current = tracker - > current_state ; <nl> + grpc_iomgr_add_callback ( notify ) ; <nl> + } else { <nl> + grpc_connectivity_state_watcher * w = gpr_malloc ( sizeof ( * w ) ) ; <nl> + w - > current = current ; <nl> + w - > notify = notify ; <nl> + w - > next = tracker - > watchers ; <nl> + tracker - > watchers = w ; <nl> + } <nl> + return tracker - > current_state = = GRPC_CHANNEL_IDLE ; <nl> + } <nl> + <nl> + void grpc_connectivity_state_set_with_scheduler ( <nl> + grpc_connectivity_state_tracker * tracker , grpc_connectivity_state state , <nl> + void ( * scheduler ) ( void * arg , grpc_iomgr_closure * closure ) , void * arg ) { <nl> + grpc_connectivity_state_watcher * new = NULL ; <nl> + grpc_connectivity_state_watcher * w ; <nl> + if ( tracker - > current_state = = state ) { <nl> + return ; <nl> + } <nl> + tracker - > current_state = state ; <nl> + while ( ( w = tracker - > watchers ) ) { <nl> + tracker - > watchers = w - > next ; <nl> + <nl> + if ( state ! = * w - > current ) { <nl> + * w - > current = state ; <nl> + scheduler ( arg , w - > notify ) ; <nl> + gpr_free ( w ) ; <nl> + } else { <nl> + w - > next = new ; <nl> + new = w ; <nl> + } <nl> + } <nl> + tracker - > watchers = new ; <nl> + } <nl> + <nl> + static void default_scheduler ( void * ignored , grpc_iomgr_closure * closure ) { <nl> + grpc_iomgr_add_callback ( closure ) ; <nl> + } <nl> + <nl> + void grpc_connectivity_state_set ( grpc_connectivity_state_tracker * tracker , <nl> + grpc_connectivity_state state ) { <nl> + grpc_connectivity_state_set_with_scheduler ( tracker , state , default_scheduler , <nl> + NULL ) ; <nl> + } <nl> new file mode 100644 <nl> index 00000000000 . . bbdcbcb0691 <nl> mmm / dev / null <nl> ppp b / src / core / transport / connectivity_state . 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_INTERNAL_CORE_TRANSPORT_CONNECTIVITY_STATE_H <nl> + # define GRPC_INTERNAL_CORE_TRANSPORT_CONNECTIVITY_STATE_H <nl> + <nl> + # include < grpc / grpc . h > <nl> + # include " src / core / iomgr / iomgr . h " <nl> + <nl> + typedef struct grpc_connectivity_state_watcher { <nl> + / * * we keep watchers in a linked list * / <nl> + struct grpc_connectivity_state_watcher * next ; <nl> + / * * closure to notify on change * / <nl> + grpc_iomgr_closure * notify ; <nl> + / * * the current state as believed by the watcher * / <nl> + grpc_connectivity_state * current ; <nl> + } grpc_connectivity_state_watcher ; <nl> + <nl> + typedef struct { <nl> + / * * current connectivity state * / <nl> + grpc_connectivity_state current_state ; <nl> + / * * all our watchers * / <nl> + grpc_connectivity_state_watcher * watchers ; <nl> + } grpc_connectivity_state_tracker ; <nl> + <nl> + void grpc_connectivity_state_init ( grpc_connectivity_state_tracker * tracker , <nl> + grpc_connectivity_state init_state ) ; <nl> + void grpc_connectivity_state_destroy ( grpc_connectivity_state_tracker * tracker ) ; <nl> + <nl> + void grpc_connectivity_state_set ( grpc_connectivity_state_tracker * tracker , <nl> + grpc_connectivity_state state ) ; <nl> + void grpc_connectivity_state_set_with_scheduler ( <nl> + grpc_connectivity_state_tracker * tracker , grpc_connectivity_state state , <nl> + void ( * scheduler ) ( void * arg , grpc_iomgr_closure * closure ) , void * arg ) ; <nl> + <nl> + grpc_connectivity_state grpc_connectivity_state_check ( <nl> + grpc_connectivity_state_tracker * tracker ) ; <nl> + <nl> + / * * Return 1 if the channel should start connecting , 0 otherwise * / <nl> + int grpc_connectivity_state_notify_on_state_change ( <nl> + grpc_connectivity_state_tracker * tracker , grpc_connectivity_state * current , <nl> + grpc_iomgr_closure * notify ) ; <nl> + <nl> + # endif / * GRPC_INTERNAL_CORE_TRANSPORT_CONNECTIVITY_STATE_H * / <nl> mmm a / src / core / transport / transport . c <nl> ppp b / src / core / transport / transport . c <nl> size_t grpc_transport_stream_size ( grpc_transport * transport ) { <nl> return transport - > vtable - > sizeof_stream ; <nl> } <nl> <nl> - void grpc_transport_goaway ( grpc_transport * transport , grpc_status_code status , <nl> - gpr_slice message ) { <nl> - transport - > vtable - > goaway ( transport , status , message ) ; <nl> - } <nl> - <nl> - void grpc_transport_close ( grpc_transport * transport ) { <nl> - transport - > vtable - > close ( transport ) ; <nl> - } <nl> - <nl> void grpc_transport_destroy ( grpc_transport * transport ) { <nl> transport - > vtable - > destroy ( transport ) ; <nl> } <nl> <nl> int grpc_transport_init_stream ( grpc_transport * transport , grpc_stream * stream , <nl> const void * server_data , <nl> - grpc_transport_op * initial_op ) { <nl> + grpc_transport_stream_op * initial_op ) { <nl> return transport - > vtable - > init_stream ( transport , stream , server_data , <nl> initial_op ) ; <nl> } <nl> <nl> - void grpc_transport_perform_op ( grpc_transport * transport , grpc_stream * stream , <nl> - grpc_transport_op * op ) { <nl> - transport - > vtable - > perform_op ( transport , stream , op ) ; <nl> + void grpc_transport_perform_stream_op ( grpc_transport * transport , <nl> + grpc_stream * stream , <nl> + grpc_transport_stream_op * op ) { <nl> + transport - > vtable - > perform_stream_op ( transport , stream , op ) ; <nl> } <nl> <nl> - void grpc_transport_add_to_pollset ( grpc_transport * transport , <nl> - grpc_pollset * pollset ) { <nl> - transport - > vtable - > add_to_pollset ( transport , pollset ) ; <nl> + void grpc_transport_perform_op ( grpc_transport * transport , <nl> + grpc_transport_op * op ) { <nl> + transport - > vtable - > perform_op ( transport , op ) ; <nl> } <nl> <nl> void grpc_transport_destroy_stream ( grpc_transport * transport , <nl> void grpc_transport_destroy_stream ( grpc_transport * transport , <nl> transport - > vtable - > destroy_stream ( transport , stream ) ; <nl> } <nl> <nl> - void grpc_transport_ping ( grpc_transport * transport , grpc_iomgr_closure * cb ) { <nl> - transport - > vtable - > ping ( transport , cb ) ; <nl> - } <nl> - <nl> - void grpc_transport_setup_cancel ( grpc_transport_setup * setup ) { <nl> - setup - > vtable - > cancel ( setup ) ; <nl> - } <nl> - <nl> - void grpc_transport_setup_initiate ( grpc_transport_setup * setup ) { <nl> - setup - > vtable - > initiate ( setup ) ; <nl> - } <nl> - <nl> - void grpc_transport_setup_add_interested_party ( grpc_transport_setup * setup , <nl> - grpc_pollset * pollset ) { <nl> - setup - > vtable - > add_interested_party ( setup , pollset ) ; <nl> - } <nl> - <nl> - void grpc_transport_setup_del_interested_party ( grpc_transport_setup * setup , <nl> - grpc_pollset * pollset ) { <nl> - setup - > vtable - > del_interested_party ( setup , pollset ) ; <nl> - } <nl> - <nl> - void grpc_transport_op_finish_with_failure ( grpc_transport_op * op ) { <nl> + void grpc_transport_stream_op_finish_with_failure ( <nl> + grpc_transport_stream_op * op ) { <nl> if ( op - > send_ops ) { <nl> op - > on_done_send - > cb ( op - > on_done_send - > cb_arg , 0 ) ; <nl> } <nl> void grpc_transport_op_finish_with_failure ( grpc_transport_op * op ) { <nl> } <nl> } <nl> <nl> - void grpc_transport_op_add_cancellation ( grpc_transport_op * op , <nl> - grpc_status_code status , <nl> - grpc_mdstr * message ) { <nl> + void grpc_transport_stream_op_add_cancellation ( grpc_transport_stream_op * op , <nl> + grpc_status_code status , <nl> + grpc_mdstr * message ) { <nl> if ( op - > cancel_with_status = = GRPC_STATUS_OK ) { <nl> op - > cancel_with_status = status ; <nl> } <nl> mmm a / src / core / transport / transport . h <nl> ppp b / src / core / transport / transport . h <nl> <nl> <nl> / * forward declarations * / <nl> typedef struct grpc_transport grpc_transport ; <nl> - typedef struct grpc_transport_callbacks grpc_transport_callbacks ; <nl> <nl> / * grpc_stream doesn ' t actually exist . It ' s used as a typesafe <nl> opaque pointer for whatever data the transport wants to track <nl> typedef enum grpc_stream_state { <nl> GRPC_STREAM_CLOSED <nl> } grpc_stream_state ; <nl> <nl> - / * Transport op : a set of operations to perform on a transport * / <nl> - typedef struct grpc_transport_op { <nl> + / * Transport stream op : a set of operations to perform on a transport <nl> + against a single stream * / <nl> + typedef struct grpc_transport_stream_op { <nl> grpc_iomgr_closure * on_consumed ; <nl> <nl> grpc_stream_op_buffer * send_ops ; <nl> typedef struct grpc_transport_op { <nl> <nl> / * Indexes correspond to grpc_context_index enum values * / <nl> grpc_call_context_element * context ; <nl> - } grpc_transport_op ; <nl> + } grpc_transport_stream_op ; <nl> <nl> - / * Callbacks made from the transport to the upper layers of grpc . * / <nl> - struct grpc_transport_callbacks { <nl> - / * Initialize a new stream on behalf of the transport . <nl> - Must result in a call to <nl> - grpc_transport_init_stream ( transport , . . . , request ) in the same call <nl> - stack . <nl> - Must not result in any other calls to the transport . <nl> - <nl> - Arguments : <nl> - user_data - the transport user data set at transport creation time <nl> - transport - the grpc_transport instance making this call <nl> - request - request parameters for this stream ( owned by the caller ) <nl> - server_data - opaque transport dependent argument that should be passed <nl> - to grpc_transport_init_stream <nl> - * / <nl> - void ( * accept_stream ) ( void * user_data , grpc_transport * transport , <nl> - const void * server_data ) ; <nl> - <nl> - void ( * goaway ) ( void * user_data , grpc_transport * transport , <nl> - grpc_status_code status , gpr_slice debug ) ; <nl> - <nl> - / * The transport has been closed * / <nl> - void ( * closed ) ( void * user_data , grpc_transport * transport ) ; <nl> - } ; <nl> + / * * Transport op : a set of operations to perform on a transport as a whole * / <nl> + typedef struct grpc_transport_op { <nl> + / * * called when processing of this op is done * / <nl> + grpc_iomgr_closure * on_consumed ; <nl> + / * * connectivity monitoring * / <nl> + grpc_iomgr_closure * on_connectivity_state_change ; <nl> + grpc_connectivity_state * connectivity_state ; <nl> + / * * should the transport be disconnected * / <nl> + int disconnect ; <nl> + / * * should we send a goaway ? * / <nl> + int send_goaway ; <nl> + / * * what should the goaway contain ? * / <nl> + grpc_status_code goaway_status ; <nl> + gpr_slice * goaway_message ; <nl> + / * * set the callback for accepting new streams ; <nl> + this is a permanent callback , unlike the other one - shot closures * / <nl> + void ( * set_accept_stream ) ( void * user_data , grpc_transport * transport , <nl> + const void * server_data ) ; <nl> + void * set_accept_stream_user_data ; <nl> + / * * add this transport to a pollset * / <nl> + grpc_pollset * bind_pollset ; <nl> + / * * send a ping , call this back if not NULL * / <nl> + grpc_iomgr_closure * send_ping ; <nl> + } grpc_transport_op ; <nl> <nl> / * Returns the amount of memory required to store a grpc_stream for this <nl> transport * / <nl> size_t grpc_transport_stream_size ( grpc_transport * transport ) ; <nl> supplied from the accept_stream callback function * / <nl> int grpc_transport_init_stream ( grpc_transport * transport , grpc_stream * stream , <nl> const void * server_data , <nl> - grpc_transport_op * initial_op ) ; <nl> + grpc_transport_stream_op * initial_op ) ; <nl> <nl> / * Destroy transport data for a stream . <nl> <nl> int grpc_transport_init_stream ( grpc_transport * transport , grpc_stream * stream , <nl> void grpc_transport_destroy_stream ( grpc_transport * transport , <nl> grpc_stream * stream ) ; <nl> <nl> - void grpc_transport_op_finish_with_failure ( grpc_transport_op * op ) ; <nl> - <nl> - void grpc_transport_op_add_cancellation ( grpc_transport_op * op , <nl> - grpc_status_code status , <nl> - grpc_mdstr * message ) ; <nl> + void grpc_transport_stream_op_finish_with_failure ( grpc_transport_stream_op * op ) ; <nl> <nl> - / * TODO ( ctiller ) : remove this * / <nl> - void grpc_transport_add_to_pollset ( grpc_transport * transport , <nl> - grpc_pollset * pollset ) ; <nl> + void grpc_transport_stream_op_add_cancellation ( grpc_transport_stream_op * op , <nl> + grpc_status_code status , <nl> + grpc_mdstr * message ) ; <nl> <nl> - char * grpc_transport_op_string ( grpc_transport_op * op ) ; <nl> + char * grpc_transport_stream_op_string ( grpc_transport_stream_op * op ) ; <nl> <nl> / * Send a batch of operations on a transport <nl> <nl> char * grpc_transport_op_string ( grpc_transport_op * op ) ; <nl> transport - the transport on which to initiate the stream <nl> stream - the stream on which to send the operations . This must be <nl> non - NULL and previously initialized by the same transport . <nl> - op - a grpc_transport_op specifying the op to perform * / <nl> - void grpc_transport_perform_op ( grpc_transport * transport , grpc_stream * stream , <nl> + op - a grpc_transport_stream_op specifying the op to perform * / <nl> + void grpc_transport_perform_stream_op ( grpc_transport * transport , <nl> + grpc_stream * stream , <nl> + grpc_transport_stream_op * op ) ; <nl> + <nl> + void grpc_transport_perform_op ( grpc_transport * transport , <nl> grpc_transport_op * op ) ; <nl> <nl> / * Send a ping on a transport <nl> void grpc_transport_close ( grpc_transport * transport ) ; <nl> / * Destroy the transport * / <nl> void grpc_transport_destroy ( grpc_transport * transport ) ; <nl> <nl> - / * Return type for grpc_transport_setup_callback * / <nl> - typedef struct grpc_transport_setup_result { <nl> - void * user_data ; <nl> - const grpc_transport_callbacks * callbacks ; <nl> - } grpc_transport_setup_result ; <nl> - <nl> - / * Given a transport , return callbacks for that transport . Used to finalize <nl> - setup as a transport is being created * / <nl> - typedef grpc_transport_setup_result ( * grpc_transport_setup_callback ) ( <nl> - void * setup_arg , grpc_transport * transport , grpc_mdctx * mdctx ) ; <nl> - <nl> - typedef struct grpc_transport_setup grpc_transport_setup ; <nl> - typedef struct grpc_transport_setup_vtable grpc_transport_setup_vtable ; <nl> - <nl> - struct grpc_transport_setup_vtable { <nl> - void ( * initiate ) ( grpc_transport_setup * setup ) ; <nl> - void ( * add_interested_party ) ( grpc_transport_setup * setup , <nl> - grpc_pollset * pollset ) ; <nl> - void ( * del_interested_party ) ( grpc_transport_setup * setup , <nl> - grpc_pollset * pollset ) ; <nl> - void ( * cancel ) ( grpc_transport_setup * setup ) ; <nl> - } ; <nl> - <nl> - / * Transport setup is an asynchronous utility interface for client channels to <nl> - establish connections . It ' s transport agnostic . * / <nl> - struct grpc_transport_setup { <nl> - const grpc_transport_setup_vtable * vtable ; <nl> - } ; <nl> - <nl> - / * Initiate transport setup : e . g . for TCP + DNS trigger a resolve of the name <nl> - given at transport construction time , create the tcp connection , perform <nl> - handshakes , and call some grpc_transport_setup_result function provided at <nl> - setup construction time . <nl> - This * may * be implemented as a no - op if the setup process monitors something <nl> - continuously . * / <nl> - void grpc_transport_setup_initiate ( grpc_transport_setup * setup ) ; <nl> - <nl> - void grpc_transport_setup_add_interested_party ( grpc_transport_setup * setup , <nl> - grpc_pollset * pollset ) ; <nl> - void grpc_transport_setup_del_interested_party ( grpc_transport_setup * setup , <nl> - grpc_pollset * pollset ) ; <nl> - <nl> - / * Cancel transport setup . After this returns , no new transports should be <nl> - created , and all pending transport setup callbacks should be completed . <nl> - After this call completes , setup should be considered invalid ( this can be <nl> - used as a destruction call by setup ) . * / <nl> - void grpc_transport_setup_cancel ( grpc_transport_setup * setup ) ; <nl> - <nl> # endif / * GRPC_INTERNAL_CORE_TRANSPORT_TRANSPORT_H * / <nl> mmm a / src / core / transport / transport_impl . h <nl> ppp b / src / core / transport / transport_impl . h <nl> typedef struct grpc_transport_vtable { <nl> <nl> / * implementation of grpc_transport_init_stream * / <nl> int ( * init_stream ) ( grpc_transport * self , grpc_stream * stream , <nl> - const void * server_data , grpc_transport_op * initial_op ) ; <nl> + const void * server_data , <nl> + grpc_transport_stream_op * initial_op ) ; <nl> <nl> - / * implementation of grpc_transport_send_batch * / <nl> - void ( * perform_op ) ( grpc_transport * self , grpc_stream * stream , <nl> - grpc_transport_op * op ) ; <nl> + / * implementation of grpc_transport_perform_stream_op * / <nl> + void ( * perform_stream_op ) ( grpc_transport * self , grpc_stream * stream , <nl> + grpc_transport_stream_op * op ) ; <nl> <nl> - / * implementation of grpc_transport_add_to_pollset * / <nl> - void ( * add_to_pollset ) ( grpc_transport * self , grpc_pollset * pollset ) ; <nl> + / * implementation of grpc_transport_perform_op * / <nl> + void ( * perform_op ) ( grpc_transport * self , grpc_transport_op * op ) ; <nl> <nl> / * implementation of grpc_transport_destroy_stream * / <nl> void ( * destroy_stream ) ( grpc_transport * self , grpc_stream * stream ) ; <nl> <nl> - / * implementation of grpc_transport_goaway * / <nl> - void ( * goaway ) ( grpc_transport * self , grpc_status_code status , <nl> - gpr_slice debug_data ) ; <nl> - <nl> - / * implementation of grpc_transport_close * / <nl> - void ( * close ) ( grpc_transport * self ) ; <nl> - <nl> - / * implementation of grpc_transport_ping * / <nl> - void ( * ping ) ( grpc_transport * self , grpc_iomgr_closure * cb ) ; <nl> - <nl> / * implementation of grpc_transport_destroy * / <nl> void ( * destroy ) ( grpc_transport * self ) ; <nl> } grpc_transport_vtable ; <nl> mmm a / src / core / transport / transport_op_string . c <nl> ppp b / src / core / transport / transport_op_string . c <nl> char * grpc_sopb_string ( grpc_stream_op_buffer * sopb ) { <nl> return out ; <nl> } <nl> <nl> - char * grpc_transport_op_string ( grpc_transport_op * op ) { <nl> + char * grpc_transport_stream_op_string ( grpc_transport_stream_op * op ) { <nl> char * tmp ; <nl> char * out ; <nl> int first = 1 ; <nl> char * grpc_transport_op_string ( grpc_transport_op * op ) { <nl> gpr_strvec_add ( & b , tmp ) ; <nl> } <nl> <nl> + if ( op - > on_consumed ! = NULL ) { <nl> + if ( ! first ) gpr_strvec_add ( & b , gpr_strdup ( " " ) ) ; <nl> + first = 0 ; <nl> + gpr_asprintf ( & tmp , " ON_CONSUMED : % p " , op - > on_consumed ) ; <nl> + gpr_strvec_add ( & b , tmp ) ; <nl> + } <nl> + <nl> out = gpr_strvec_flatten ( & b , NULL ) ; <nl> gpr_strvec_destroy ( & b ) ; <nl> <nl> char * grpc_transport_op_string ( grpc_transport_op * op ) { <nl> } <nl> <nl> void grpc_call_log_op ( char * file , int line , gpr_log_severity severity , <nl> - grpc_call_element * elem , grpc_transport_op * op ) { <nl> - char * str = grpc_transport_op_string ( op ) ; <nl> + grpc_call_element * elem , grpc_transport_stream_op * op ) { <nl> + char * str = grpc_transport_stream_op_string ( op ) ; <nl> gpr_log ( file , line , severity , " OP [ % s : % p ] : % s " , elem - > filter - > name , elem , str ) ; <nl> gpr_free ( str ) ; <nl> } <nl> mmm a / test / core / bad_client / bad_client . c <nl> ppp b / test / core / bad_client / bad_client . c <nl> static void done_write ( void * arg , grpc_endpoint_cb_status status ) { <nl> gpr_event_set ( & a - > done_write , ( void * ) 1 ) ; <nl> } <nl> <nl> - static grpc_transport_setup_result server_setup_transport ( <nl> - void * ts , grpc_transport * transport , grpc_mdctx * mdctx ) { <nl> + static void server_setup_transport ( void * ts , grpc_transport * transport , <nl> + grpc_mdctx * mdctx ) { <nl> thd_args * a = ts ; <nl> static grpc_channel_filter const * extra_filters [ ] = { <nl> & grpc_http_server_filter } ; <nl> - return grpc_server_setup_transport ( a - > server , transport , extra_filters , <nl> - GPR_ARRAY_SIZE ( extra_filters ) , mdctx , <nl> - grpc_server_get_channel_args ( a - > server ) ) ; <nl> + grpc_server_setup_transport ( a - > server , transport , extra_filters , <nl> + GPR_ARRAY_SIZE ( extra_filters ) , mdctx , <nl> + grpc_server_get_channel_args ( a - > server ) ) ; <nl> } <nl> <nl> void grpc_run_bad_client_test ( grpc_bad_client_server_side_validator validator , <nl> void grpc_run_bad_client_test ( grpc_bad_client_server_side_validator validator , <nl> thd_args a ; <nl> gpr_thd_id id ; <nl> char * hex ; <nl> + grpc_transport * transport ; <nl> + grpc_mdctx * mdctx = grpc_mdctx_create ( ) ; <nl> gpr_slice slice = <nl> gpr_slice_from_copied_buffer ( client_payload , client_payload_length ) ; <nl> <nl> void grpc_run_bad_client_test ( grpc_bad_client_server_side_validator validator , <nl> a . validator = validator ; <nl> grpc_server_register_completion_queue ( a . server , a . cq ) ; <nl> grpc_server_start ( a . server ) ; <nl> - grpc_create_chttp2_transport ( server_setup_transport , & a , NULL , sfd . server , <nl> - NULL , 0 , grpc_mdctx_create ( ) , 0 ) ; <nl> + transport = grpc_create_chttp2_transport ( NULL , sfd . server , mdctx , 0 ) ; <nl> + server_setup_transport ( & a , transport , mdctx ) ; <nl> + grpc_chttp2_transport_start_reading ( transport , NULL , 0 ) ; <nl> <nl> / * Bind everything into the same pollset * / <nl> grpc_endpoint_add_to_pollset ( sfd . client , grpc_cq_pollset ( a . cq ) ) ; <nl> mmm a / test / core / channel / channel_stack_test . c <nl> ppp b / test / core / channel / channel_stack_test . c <nl> <nl> # include < grpc / support / log . h > <nl> # include " test / core / util / test_config . h " <nl> <nl> - static void channel_init_func ( grpc_channel_element * elem , <nl> + static void channel_init_func ( grpc_channel_element * elem , grpc_channel * master , <nl> const grpc_channel_args * args , <nl> grpc_mdctx * metadata_context , int is_first , <nl> int is_last ) { <nl> static void channel_init_func ( grpc_channel_element * elem , <nl> <nl> static void call_init_func ( grpc_call_element * elem , <nl> const void * server_transport_data , <nl> - grpc_transport_op * initial_op ) { <nl> + grpc_transport_stream_op * initial_op ) { <nl> + + * ( int * ) ( elem - > channel_data ) ; <nl> * ( int * ) ( elem - > call_data ) = 0 ; <nl> } <nl> static void call_destroy_func ( grpc_call_element * elem ) { <nl> + + * ( int * ) ( elem - > channel_data ) ; <nl> } <nl> <nl> - static void call_func ( grpc_call_element * elem , grpc_transport_op * op ) { <nl> + static void call_func ( grpc_call_element * elem , grpc_transport_stream_op * op ) { <nl> + + * ( int * ) ( elem - > call_data ) ; <nl> } <nl> <nl> - static void channel_func ( grpc_channel_element * elem , <nl> - grpc_channel_element * from_elem , grpc_channel_op * op ) { <nl> + static void channel_func ( grpc_channel_element * elem , grpc_transport_op * op ) { <nl> + + * ( int * ) ( elem - > channel_data ) ; <nl> } <nl> <nl> static void test_create_channel_stack ( void ) { <nl> const grpc_channel_filter filter = { <nl> - call_func , channel_func , sizeof ( int ) , call_init_func , call_destroy_func , <nl> - sizeof ( int ) , channel_init_func , channel_destroy_func , " some_test_filter " } ; <nl> + call_func , channel_func , sizeof ( int ) , <nl> + call_init_func , call_destroy_func , sizeof ( int ) , <nl> + channel_init_func , channel_destroy_func , " some_test_filter " } ; <nl> const grpc_channel_filter * filters = & filter ; <nl> grpc_channel_stack * channel_stack ; <nl> grpc_call_stack * call_stack ; <nl> static void test_create_channel_stack ( void ) { <nl> chan_args . args = & arg ; <nl> <nl> channel_stack = gpr_malloc ( grpc_channel_stack_size ( & filters , 1 ) ) ; <nl> - grpc_channel_stack_init ( & filters , 1 , & chan_args , metadata_context , <nl> + grpc_channel_stack_init ( & filters , 1 , NULL , & chan_args , metadata_context , <nl> channel_stack ) ; <nl> GPR_ASSERT ( channel_stack - > count = = 1 ) ; <nl> channel_elem = grpc_channel_stack_element ( channel_stack , 0 ) ; <nl> new file mode 100644 <nl> index 00000000000 . . e5f9017ce09 <nl> mmm / dev / null <nl> ppp b / test / core / client_config / uri_parser_test . 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 " src / core / client_config / uri_parser . h " <nl> + <nl> + # include < string . h > <nl> + <nl> + # include < grpc / support / log . h > <nl> + <nl> + # include " test / core / util / test_config . h " <nl> + <nl> + static void test_succeeds ( const char * uri_text , const char * scheme , <nl> + const char * authority , const char * path ) { <nl> + grpc_uri * uri = grpc_uri_parse ( uri_text , 0 ) ; <nl> + GPR_ASSERT ( uri ) ; <nl> + GPR_ASSERT ( 0 = = strcmp ( scheme , uri - > scheme ) ) ; <nl> + GPR_ASSERT ( 0 = = strcmp ( authority , uri - > authority ) ) ; <nl> + GPR_ASSERT ( 0 = = strcmp ( path , uri - > path ) ) ; <nl> + grpc_uri_destroy ( uri ) ; <nl> + } <nl> + <nl> + static void test_fails ( const char * uri_text ) { <nl> + GPR_ASSERT ( NULL = = grpc_uri_parse ( uri_text , 0 ) ) ; <nl> + } <nl> + <nl> + int main ( int argc , char * * argv ) { <nl> + grpc_test_init ( argc , argv ) ; <nl> + test_succeeds ( " http : / / www . google . com " , " http " , " www . google . com " , " " ) ; <nl> + test_succeeds ( " dns : / / / foo " , " dns " , " " , " / foo " ) ; <nl> + test_succeeds ( " http : / / www . google . com : 90 " , " http " , " www . google . com : 90 " , " " ) ; <nl> + test_succeeds ( " a192 . 4 - df : foo . coom " , " a192 . 4 - df " , " " , " foo . coom " ) ; <nl> + test_succeeds ( " a + b : foo . coom " , " a + b " , " " , " foo . coom " ) ; <nl> + test_fails ( " xyz " ) ; <nl> + test_fails ( " http : / / www . google . com ? why - are - you - using - queries " ) ; <nl> + test_fails ( " dns : foo . com # fragments - arent - supported - here " ) ; <nl> + test_fails ( " http : ? huh " ) ; <nl> + test_fails ( " unix : # yeah - right " ) ; <nl> + return 0 ; <nl> + } <nl> mmm a / test / core / end2end / fixtures / chttp2_fullstack . c <nl> ppp b / test / core / end2end / fixtures / chttp2_fullstack . c <nl> <nl> # include " src / core / channel / connected_channel . h " <nl> # include " src / core / channel / http_server_filter . h " <nl> # include " src / core / surface / channel . h " <nl> - # include " src / core / surface / client . h " <nl> # include " src / core / surface / server . h " <nl> # include " src / core / transport / chttp2_transport . h " <nl> # include < grpc / support / alloc . h > <nl> void chttp2_init_client_fullstack ( grpc_end2end_test_fixture * f , <nl> grpc_channel_args * client_args ) { <nl> fullstack_fixture_data * ffd = f - > fixture_data ; <nl> f - > client = grpc_channel_create ( ffd - > localaddr , client_args ) ; <nl> + GPR_ASSERT ( f - > client ) ; <nl> } <nl> <nl> void chttp2_init_server_fullstack ( grpc_end2end_test_fixture * f , <nl> mmm a / test / core / end2end / fixtures / chttp2_fullstack_uds_posix . c <nl> ppp b / test / core / end2end / fixtures / chttp2_fullstack_uds_posix . c <nl> <nl> # include " src / core / channel / http_server_filter . h " <nl> # include " src / core / support / string . h " <nl> # include " src / core / surface / channel . h " <nl> - # include " src / core / surface / client . h " <nl> # include " src / core / surface / server . h " <nl> # include " src / core / transport / chttp2_transport . h " <nl> # include < grpc / support / alloc . h > <nl> mmm a / test / core / end2end / fixtures / chttp2_fullstack_with_poll . c <nl> ppp b / test / core / end2end / fixtures / chttp2_fullstack_with_poll . c <nl> <nl> # include " src / core / channel / connected_channel . h " <nl> # include " src / core / channel / http_server_filter . h " <nl> # include " src / core / surface / channel . h " <nl> - # include " src / core / surface / client . h " <nl> # include " src / core / surface / server . h " <nl> # include " src / core / transport / chttp2_transport . h " <nl> # include < grpc / support / alloc . h > <nl> mmm a / test / core / end2end / fixtures / chttp2_simple_ssl_fullstack . c <nl> ppp b / test / core / end2end / fixtures / chttp2_simple_ssl_fullstack . c <nl> static void chttp2_init_client_simple_ssl_secure_fullstack ( <nl> GRPC_SSL_TARGET_NAME_OVERRIDE_ARG , <nl> { " foo . test . google . fr " } } ; <nl> grpc_channel_args * new_client_args = <nl> - grpc_channel_args_copy_and_add ( client_args , & ssl_name_override ) ; <nl> + grpc_channel_args_copy_and_add ( client_args , & ssl_name_override , 1 ) ; <nl> chttp2_init_client_secure_fullstack ( f , new_client_args , ssl_creds ) ; <nl> grpc_channel_args_destroy ( new_client_args ) ; <nl> } <nl> mmm a / test / core / end2end / fixtures / chttp2_simple_ssl_fullstack_with_poll . c <nl> ppp b / test / core / end2end / fixtures / chttp2_simple_ssl_fullstack_with_poll . c <nl> static void chttp2_init_client_simple_ssl_secure_fullstack ( <nl> GRPC_SSL_TARGET_NAME_OVERRIDE_ARG , <nl> { " foo . test . google . fr " } } ; <nl> grpc_channel_args * new_client_args = <nl> - grpc_channel_args_copy_and_add ( client_args , & ssl_name_override ) ; <nl> + grpc_channel_args_copy_and_add ( client_args , & ssl_name_override , 1 ) ; <nl> chttp2_init_client_secure_fullstack ( f , new_client_args , ssl_creds ) ; <nl> grpc_channel_args_destroy ( new_client_args ) ; <nl> } <nl> mmm a / test / core / end2end / fixtures / chttp2_simple_ssl_with_oauth2_fullstack . c <nl> ppp b / test / core / end2end / fixtures / chttp2_simple_ssl_with_oauth2_fullstack . c <nl> static void chttp2_init_client_simple_ssl_with_oauth2_secure_fullstack ( <nl> GRPC_SSL_TARGET_NAME_OVERRIDE_ARG , <nl> { " foo . test . google . fr " } } ; <nl> grpc_channel_args * new_client_args = <nl> - grpc_channel_args_copy_and_add ( client_args , & ssl_name_override ) ; <nl> + grpc_channel_args_copy_and_add ( client_args , & ssl_name_override , 1 ) ; <nl> chttp2_init_client_secure_fullstack ( f , new_client_args , ssl_oauth2_creds ) ; <nl> grpc_channel_args_destroy ( new_client_args ) ; <nl> grpc_credentials_release ( ssl_creds ) ; <nl> mmm a / test / core / end2end / fixtures / chttp2_socket_pair . c <nl> ppp b / test / core / end2end / fixtures / chttp2_socket_pair . c <nl> <nl> # include " src / core / iomgr / endpoint_pair . h " <nl> # include " src / core / iomgr / iomgr . h " <nl> # include " src / core / surface / channel . h " <nl> - # include " src / core / surface / client . h " <nl> # include " src / core / surface / server . h " <nl> # include " src / core / transport / chttp2_transport . h " <nl> # include < grpc / support / alloc . h > <nl> <nl> / * chttp2 transport that is immediately available ( used for testing <nl> connected_channel without a client_channel * / <nl> <nl> - static grpc_transport_setup_result server_setup_transport ( <nl> - void * ts , grpc_transport * transport , grpc_mdctx * mdctx ) { <nl> + static void server_setup_transport ( void * ts , grpc_transport * transport , <nl> + grpc_mdctx * mdctx ) { <nl> grpc_end2end_test_fixture * f = ts ; <nl> static grpc_channel_filter const * extra_filters [ ] = { <nl> & grpc_http_server_filter } ; <nl> - return grpc_server_setup_transport ( f - > server , transport , extra_filters , <nl> - GPR_ARRAY_SIZE ( extra_filters ) , mdctx , <nl> - grpc_server_get_channel_args ( f - > server ) ) ; <nl> + grpc_server_setup_transport ( f - > server , transport , extra_filters , <nl> + GPR_ARRAY_SIZE ( extra_filters ) , mdctx , <nl> + grpc_server_get_channel_args ( f - > server ) ) ; <nl> } <nl> <nl> typedef struct { <nl> typedef struct { <nl> grpc_channel_args * client_args ; <nl> } sp_client_setup ; <nl> <nl> - static grpc_transport_setup_result client_setup_transport ( <nl> - void * ts , grpc_transport * transport , grpc_mdctx * mdctx ) { <nl> + static void client_setup_transport ( void * ts , grpc_transport * transport , <nl> + grpc_mdctx * mdctx ) { <nl> sp_client_setup * cs = ts ; <nl> <nl> - const grpc_channel_filter * filters [ ] = { & grpc_client_surface_filter , <nl> - & grpc_http_client_filter , <nl> + const grpc_channel_filter * filters [ ] = { & grpc_http_client_filter , <nl> & grpc_connected_channel_filter } ; <nl> size_t nfilters = sizeof ( filters ) / sizeof ( * filters ) ; <nl> grpc_channel * channel = grpc_channel_create_from_filters ( <nl> static grpc_transport_setup_result client_setup_transport ( <nl> <nl> cs - > f - > client = channel ; <nl> <nl> - return grpc_connected_channel_bind_transport ( <nl> - grpc_channel_get_channel_stack ( channel ) , transport ) ; <nl> + grpc_connected_channel_bind_transport ( grpc_channel_get_channel_stack ( channel ) , <nl> + transport ) ; <nl> } <nl> <nl> static grpc_end2end_test_fixture chttp2_create_fixture_socketpair ( <nl> static grpc_end2end_test_fixture chttp2_create_fixture_socketpair ( <nl> static void chttp2_init_client_socketpair ( grpc_end2end_test_fixture * f , <nl> grpc_channel_args * client_args ) { <nl> grpc_endpoint_pair * sfd = f - > fixture_data ; <nl> + grpc_transport * transport ; <nl> + grpc_mdctx * mdctx = grpc_mdctx_create ( ) ; <nl> sp_client_setup cs ; <nl> cs . client_args = client_args ; <nl> cs . f = f ; <nl> - grpc_create_chttp2_transport ( client_setup_transport , & cs , client_args , <nl> - sfd - > client , NULL , 0 , grpc_mdctx_create ( ) , 1 ) ; <nl> + transport = grpc_create_chttp2_transport ( client_args , sfd - > client , mdctx , 1 ) ; <nl> + client_setup_transport ( & cs , transport , mdctx ) ; <nl> GPR_ASSERT ( f - > client ) ; <nl> + grpc_chttp2_transport_start_reading ( transport , NULL , 0 ) ; <nl> } <nl> <nl> static void chttp2_init_server_socketpair ( grpc_end2end_test_fixture * f , <nl> grpc_channel_args * server_args ) { <nl> grpc_endpoint_pair * sfd = f - > fixture_data ; <nl> + grpc_mdctx * mdctx = grpc_mdctx_create ( ) ; <nl> + grpc_transport * transport ; <nl> GPR_ASSERT ( ! f - > server ) ; <nl> f - > server = grpc_server_create_from_filters ( NULL , 0 , server_args ) ; <nl> grpc_server_register_completion_queue ( f - > server , f - > cq ) ; <nl> grpc_server_start ( f - > server ) ; <nl> - grpc_create_chttp2_transport ( server_setup_transport , f , server_args , <nl> - sfd - > server , NULL , 0 , grpc_mdctx_create ( ) , 0 ) ; <nl> + transport = grpc_create_chttp2_transport ( server_args , sfd - > server , mdctx , 0 ) ; <nl> + server_setup_transport ( f , transport , mdctx ) ; <nl> + grpc_chttp2_transport_start_reading ( transport , NULL , 0 ) ; <nl> } <nl> <nl> static void chttp2_tear_down_socketpair ( grpc_end2end_test_fixture * f ) { <nl> mmm a / test / core / end2end / fixtures / chttp2_socket_pair_one_byte_at_a_time . c <nl> ppp b / test / core / end2end / fixtures / chttp2_socket_pair_one_byte_at_a_time . c <nl> <nl> # include " src / core / iomgr / endpoint_pair . h " <nl> # include " src / core / iomgr / iomgr . h " <nl> # include " src / core / surface / channel . h " <nl> - # include " src / core / surface / client . h " <nl> # include " src / core / surface / server . h " <nl> # include " src / core / transport / chttp2_transport . h " <nl> # include < grpc / support / alloc . h > <nl> <nl> / * chttp2 transport that is immediately available ( used for testing <nl> connected_channel without a client_channel * / <nl> <nl> - static grpc_transport_setup_result server_setup_transport ( <nl> - void * ts , grpc_transport * transport , grpc_mdctx * mdctx ) { <nl> + static void server_setup_transport ( void * ts , grpc_transport * transport , <nl> + grpc_mdctx * mdctx ) { <nl> grpc_end2end_test_fixture * f = ts ; <nl> static grpc_channel_filter const * extra_filters [ ] = { <nl> & grpc_http_server_filter } ; <nl> - return grpc_server_setup_transport ( f - > server , transport , extra_filters , <nl> - GPR_ARRAY_SIZE ( extra_filters ) , mdctx , <nl> - grpc_server_get_channel_args ( f - > server ) ) ; <nl> + grpc_server_setup_transport ( f - > server , transport , extra_filters , <nl> + GPR_ARRAY_SIZE ( extra_filters ) , mdctx , <nl> + grpc_server_get_channel_args ( f - > server ) ) ; <nl> } <nl> <nl> typedef struct { <nl> typedef struct { <nl> grpc_channel_args * client_args ; <nl> } sp_client_setup ; <nl> <nl> - static grpc_transport_setup_result client_setup_transport ( <nl> - void * ts , grpc_transport * transport , grpc_mdctx * mdctx ) { <nl> + static void client_setup_transport ( void * ts , grpc_transport * transport , <nl> + grpc_mdctx * mdctx ) { <nl> sp_client_setup * cs = ts ; <nl> <nl> - const grpc_channel_filter * filters [ ] = { & grpc_client_surface_filter , <nl> - & grpc_http_client_filter , <nl> + const grpc_channel_filter * filters [ ] = { & grpc_http_client_filter , <nl> & grpc_connected_channel_filter } ; <nl> size_t nfilters = sizeof ( filters ) / sizeof ( * filters ) ; <nl> grpc_channel * channel = grpc_channel_create_from_filters ( <nl> static grpc_transport_setup_result client_setup_transport ( <nl> <nl> cs - > f - > client = channel ; <nl> <nl> - return grpc_connected_channel_bind_transport ( <nl> - grpc_channel_get_channel_stack ( channel ) , transport ) ; <nl> + grpc_connected_channel_bind_transport ( grpc_channel_get_channel_stack ( channel ) , <nl> + transport ) ; <nl> } <nl> <nl> static grpc_end2end_test_fixture chttp2_create_fixture_socketpair ( <nl> static grpc_end2end_test_fixture chttp2_create_fixture_socketpair ( <nl> static void chttp2_init_client_socketpair ( grpc_end2end_test_fixture * f , <nl> grpc_channel_args * client_args ) { <nl> grpc_endpoint_pair * sfd = f - > fixture_data ; <nl> + grpc_transport * transport ; <nl> + grpc_mdctx * mdctx = grpc_mdctx_create ( ) ; <nl> sp_client_setup cs ; <nl> cs . client_args = client_args ; <nl> cs . f = f ; <nl> - grpc_create_chttp2_transport ( client_setup_transport , & cs , client_args , <nl> - sfd - > client , NULL , 0 , grpc_mdctx_create ( ) , 1 ) ; <nl> + transport = grpc_create_chttp2_transport ( client_args , sfd - > client , mdctx , 1 ) ; <nl> + client_setup_transport ( & cs , transport , mdctx ) ; <nl> GPR_ASSERT ( f - > client ) ; <nl> + grpc_chttp2_transport_start_reading ( transport , NULL , 0 ) ; <nl> } <nl> <nl> static void chttp2_init_server_socketpair ( grpc_end2end_test_fixture * f , <nl> grpc_channel_args * server_args ) { <nl> grpc_endpoint_pair * sfd = f - > fixture_data ; <nl> + grpc_mdctx * mdctx = grpc_mdctx_create ( ) ; <nl> + grpc_transport * transport ; <nl> GPR_ASSERT ( ! f - > server ) ; <nl> f - > server = grpc_server_create_from_filters ( NULL , 0 , server_args ) ; <nl> grpc_server_register_completion_queue ( f - > server , f - > cq ) ; <nl> grpc_server_start ( f - > server ) ; <nl> - grpc_create_chttp2_transport ( server_setup_transport , f , server_args , <nl> - sfd - > server , NULL , 0 , grpc_mdctx_create ( ) , 0 ) ; <nl> + transport = grpc_create_chttp2_transport ( server_args , sfd - > server , mdctx , 0 ) ; <nl> + server_setup_transport ( f , transport , mdctx ) ; <nl> + grpc_chttp2_transport_start_reading ( transport , NULL , 0 ) ; <nl> } <nl> <nl> static void chttp2_tear_down_socketpair ( grpc_end2end_test_fixture * f ) { <nl> mmm a / test / core / end2end / fixtures / chttp2_socket_pair_with_grpc_trace . c <nl> ppp b / test / core / end2end / fixtures / chttp2_socket_pair_with_grpc_trace . c <nl> <nl> # include " src / core / iomgr / iomgr . h " <nl> # include " src / core / support / env . h " <nl> # include " src / core / surface / channel . h " <nl> - # include " src / core / surface / client . h " <nl> # include " src / core / surface / server . h " <nl> # include " src / core / transport / chttp2_transport . h " <nl> # include < grpc / support / alloc . h > <nl> <nl> / * chttp2 transport that is immediately available ( used for testing <nl> connected_channel without a client_channel * / <nl> <nl> - static grpc_transport_setup_result server_setup_transport ( <nl> - void * ts , grpc_transport * transport , grpc_mdctx * mdctx ) { <nl> + static void server_setup_transport ( void * ts , grpc_transport * transport , <nl> + grpc_mdctx * mdctx ) { <nl> grpc_end2end_test_fixture * f = ts ; <nl> static grpc_channel_filter const * extra_filters [ ] = { <nl> & grpc_http_server_filter } ; <nl> - return grpc_server_setup_transport ( f - > server , transport , extra_filters , <nl> - GPR_ARRAY_SIZE ( extra_filters ) , mdctx , <nl> - grpc_server_get_channel_args ( f - > server ) ) ; <nl> + grpc_server_setup_transport ( f - > server , transport , extra_filters , <nl> + GPR_ARRAY_SIZE ( extra_filters ) , mdctx , <nl> + grpc_server_get_channel_args ( f - > server ) ) ; <nl> } <nl> <nl> typedef struct { <nl> typedef struct { <nl> grpc_channel_args * client_args ; <nl> } sp_client_setup ; <nl> <nl> - static grpc_transport_setup_result client_setup_transport ( <nl> - void * ts , grpc_transport * transport , grpc_mdctx * mdctx ) { <nl> + static void client_setup_transport ( void * ts , grpc_transport * transport , <nl> + grpc_mdctx * mdctx ) { <nl> sp_client_setup * cs = ts ; <nl> <nl> - const grpc_channel_filter * filters [ ] = { & grpc_client_surface_filter , <nl> - & grpc_http_client_filter , <nl> + const grpc_channel_filter * filters [ ] = { & grpc_http_client_filter , <nl> & grpc_connected_channel_filter } ; <nl> size_t nfilters = sizeof ( filters ) / sizeof ( * filters ) ; <nl> grpc_channel * channel = grpc_channel_create_from_filters ( <nl> static grpc_transport_setup_result client_setup_transport ( <nl> <nl> cs - > f - > client = channel ; <nl> <nl> - return grpc_connected_channel_bind_transport ( <nl> - grpc_channel_get_channel_stack ( channel ) , transport ) ; <nl> + grpc_connected_channel_bind_transport ( grpc_channel_get_channel_stack ( channel ) , <nl> + transport ) ; <nl> } <nl> <nl> static grpc_end2end_test_fixture chttp2_create_fixture_socketpair ( <nl> static grpc_end2end_test_fixture chttp2_create_fixture_socketpair ( <nl> static void chttp2_init_client_socketpair ( grpc_end2end_test_fixture * f , <nl> grpc_channel_args * client_args ) { <nl> grpc_endpoint_pair * sfd = f - > fixture_data ; <nl> + grpc_transport * transport ; <nl> + grpc_mdctx * mdctx = grpc_mdctx_create ( ) ; <nl> sp_client_setup cs ; <nl> cs . client_args = client_args ; <nl> cs . f = f ; <nl> - grpc_create_chttp2_transport ( client_setup_transport , & cs , client_args , <nl> - sfd - > client , NULL , 0 , grpc_mdctx_create ( ) , 1 ) ; <nl> + transport = grpc_create_chttp2_transport ( client_args , sfd - > client , mdctx , 1 ) ; <nl> + client_setup_transport ( & cs , transport , mdctx ) ; <nl> GPR_ASSERT ( f - > client ) ; <nl> + grpc_chttp2_transport_start_reading ( transport , NULL , 0 ) ; <nl> } <nl> <nl> static void chttp2_init_server_socketpair ( grpc_end2end_test_fixture * f , <nl> grpc_channel_args * server_args ) { <nl> grpc_endpoint_pair * sfd = f - > fixture_data ; <nl> + grpc_mdctx * mdctx = grpc_mdctx_create ( ) ; <nl> + grpc_transport * transport ; <nl> GPR_ASSERT ( ! f - > server ) ; <nl> f - > server = grpc_server_create_from_filters ( NULL , 0 , server_args ) ; <nl> grpc_server_register_completion_queue ( f - > server , f - > cq ) ; <nl> grpc_server_start ( f - > server ) ; <nl> - grpc_create_chttp2_transport ( server_setup_transport , f , server_args , <nl> - sfd - > server , NULL , 0 , grpc_mdctx_create ( ) , 0 ) ; <nl> + transport = grpc_create_chttp2_transport ( server_args , sfd - > server , mdctx , 0 ) ; <nl> + server_setup_transport ( f , transport , mdctx ) ; <nl> + grpc_chttp2_transport_start_reading ( transport , NULL , 0 ) ; <nl> } <nl> <nl> static void chttp2_tear_down_socketpair ( grpc_end2end_test_fixture * f ) { <nl> mmm a / test / core / end2end / multiple_server_queues_test . c <nl> ppp b / test / core / end2end / multiple_server_queues_test . c <nl> int main ( int argc , char * * argv ) { <nl> grpc_server_register_completion_queue ( server , cq2 ) ; <nl> grpc_server_start ( server ) ; <nl> grpc_server_shutdown_and_notify ( server , cq2 , NULL ) ; <nl> - grpc_completion_queue_next ( cq2 , gpr_inf_future ) ; / * cue queue hang * / <nl> + grpc_completion_queue_next ( cq2 , gpr_inf_future ) ; / * cue queue hang * / <nl> grpc_completion_queue_shutdown ( cq1 ) ; <nl> grpc_completion_queue_shutdown ( cq2 ) ; <nl> grpc_completion_queue_next ( cq1 , gpr_inf_future ) ; <nl> mmm a / test / core / end2end / tests / request_with_flags . c <nl> ppp b / test / core / end2end / tests / request_with_flags . c <nl> static void test_invoke_request_with_flags ( <nl> gpr_slice request_payload_slice = gpr_slice_from_copied_string ( " hello world " ) ; <nl> grpc_byte_buffer * request_payload = <nl> grpc_raw_byte_buffer_create ( & request_payload_slice , 1 ) ; <nl> - gpr_timespec deadline = GRPC_TIMEOUT_MILLIS_TO_DEADLINE ( 100 ) ; <nl> + gpr_timespec deadline = GRPC_TIMEOUT_MILLIS_TO_DEADLINE ( 10 ) ; <nl> grpc_end2end_test_fixture f = <nl> begin_test ( config , " test_invoke_request_with_flags " , NULL , NULL ) ; <nl> cq_verifier * cqv = cq_verifier_create ( f . cq ) ; <nl> mmm a / test / core / iomgr / fd_conservation_posix_test . c <nl> ppp b / test / core / iomgr / fd_conservation_posix_test . c <nl> <nl> # include " src / core / iomgr / iomgr . h " <nl> <nl> int main ( int argc , char * * argv ) { <nl> - int i ; <nl> - struct rlimit rlim ; <nl> - grpc_endpoint_pair p ; <nl> + int i ; <nl> + struct rlimit rlim ; <nl> + grpc_endpoint_pair p ; <nl> grpc_test_init ( argc , argv ) ; <nl> grpc_iomgr_init ( ) ; <nl> <nl> int main ( int argc , char * * argv ) { <nl> GPR_ASSERT ( 0 = = setrlimit ( RLIMIT_NOFILE , & rlim ) ) ; <nl> <nl> for ( i = 0 ; i < 100 ; i + + ) { <nl> - p = grpc_iomgr_create_endpoint_pair ( " test " , 1 ) ; <nl> - grpc_endpoint_destroy ( p . client ) ; <nl> - grpc_endpoint_destroy ( p . server ) ; <nl> + p = grpc_iomgr_create_endpoint_pair ( " test " , 1 ) ; <nl> + grpc_endpoint_destroy ( p . client ) ; <nl> + grpc_endpoint_destroy ( p . server ) ; <nl> } <nl> <nl> grpc_iomgr_shutdown ( ) ; <nl> mmm a / tools / doxygen / Doxyfile . core . internal <nl> ppp b / tools / doxygen / Doxyfile . core . internal <nl> src / core / census / grpc_context . h \ <nl> src / core / channel / census_filter . h \ <nl> src / core / channel / channel_args . h \ <nl> src / core / channel / channel_stack . h \ <nl> - src / core / channel / child_channel . h \ <nl> src / core / channel / client_channel . h \ <nl> - src / core / channel / client_setup . h \ <nl> src / core / channel / connected_channel . h \ <nl> src / core / channel / context . h \ <nl> src / core / channel / http_client_filter . h \ <nl> src / core / channel / http_server_filter . h \ <nl> src / core / channel / noop_filter . h \ <nl> + src / core / client_config / client_config . h \ <nl> + src / core / client_config / connector . h \ <nl> + src / core / client_config / lb_policies / pick_first . h \ <nl> + src / core / client_config / lb_policy . h \ <nl> + src / core / client_config / resolver . h \ <nl> + src / core / client_config / resolver_factory . h \ <nl> + src / core / client_config / resolver_registry . h \ <nl> + src / core / client_config / resolvers / dns_resolver . h \ <nl> + src / core / client_config / resolvers / unix_resolver_posix . h \ <nl> + src / core / client_config / subchannel . h \ <nl> + src / core / client_config / subchannel_factory . h \ <nl> + src / core / client_config / uri_parser . h \ <nl> src / core / compression / message_compress . h \ <nl> src / core / debug / trace . h \ <nl> src / core / iomgr / alarm . h \ <nl> src / core / profiling / timers_preciseclock . h \ <nl> src / core / surface / byte_buffer_queue . h \ <nl> src / core / surface / call . h \ <nl> src / core / surface / channel . h \ <nl> - src / core / surface / client . h \ <nl> src / core / surface / completion_queue . h \ <nl> src / core / surface / event_string . h \ <nl> src / core / surface / init . h \ <nl> src / core / transport / chttp2 / stream_map . h \ <nl> src / core / transport / chttp2 / timeout_encoding . h \ <nl> src / core / transport / chttp2 / varint . h \ <nl> src / core / transport / chttp2_transport . h \ <nl> + src / core / transport / connectivity_state . h \ <nl> src / core / transport / metadata . h \ <nl> src / core / transport / stream_op . h \ <nl> src / core / transport / transport . h \ <nl> src / core / tsi / transport_security . c \ <nl> src / core / census / grpc_context . c \ <nl> src / core / channel / channel_args . c \ <nl> src / core / channel / channel_stack . c \ <nl> - src / core / channel / child_channel . c \ <nl> src / core / channel / client_channel . c \ <nl> - src / core / channel / client_setup . c \ <nl> src / core / channel / connected_channel . c \ <nl> src / core / channel / http_client_filter . c \ <nl> src / core / channel / http_server_filter . c \ <nl> src / core / channel / noop_filter . c \ <nl> + src / core / client_config / client_config . c \ <nl> + src / core / client_config / connector . c \ <nl> + src / core / client_config / lb_policies / pick_first . c \ <nl> + src / core / client_config / lb_policy . c \ <nl> + src / core / client_config / resolver . c \ <nl> + src / core / client_config / resolver_factory . c \ <nl> + src / core / client_config / resolver_registry . c \ <nl> + src / core / client_config / resolvers / dns_resolver . c \ <nl> + src / core / client_config / resolvers / unix_resolver_posix . c \ <nl> + src / core / client_config / subchannel . c \ <nl> + src / core / client_config / subchannel_factory . c \ <nl> + src / core / client_config / uri_parser . c \ <nl> src / core / compression / algorithm . c \ <nl> src / core / compression / message_compress . c \ <nl> src / core / debug / trace . c \ <nl> src / core / surface / call_details . c \ <nl> src / core / surface / call_log_batch . c \ <nl> src / core / surface / channel . c \ <nl> src / core / surface / channel_create . c \ <nl> - src / core / surface / client . c \ <nl> src / core / surface / completion_queue . c \ <nl> src / core / surface / event_string . c \ <nl> src / core / surface / init . c \ <nl> src / core / transport / chttp2 / timeout_encoding . c \ <nl> src / core / transport / chttp2 / varint . c \ <nl> src / core / transport / chttp2 / writing . c \ <nl> src / core / transport / chttp2_transport . c \ <nl> + src / core / transport / connectivity_state . c \ <nl> src / core / transport / metadata . c \ <nl> src / core / transport / stream_op . c \ <nl> src / core / transport / transport . c \ <nl> mmm a / tools / run_tests / sources_and_headers . json <nl> ppp b / tools / run_tests / sources_and_headers . json <nl> <nl> " test / core / tsi / transport_security_test . c " <nl> ] <nl> } , <nl> + { <nl> + " deps " : [ <nl> + " gpr " , <nl> + " gpr_test_util " , <nl> + " grpc " , <nl> + " grpc_test_util " <nl> + ] , <nl> + " headers " : [ ] , <nl> + " language " : " c " , <nl> + " name " : " uri_parser_test " , <nl> + " src " : [ <nl> + " test / core / client_config / uri_parser_test . c " <nl> + ] <nl> + } , <nl> { <nl> " deps " : [ <nl> " gpr " , <nl> <nl> " src / core / channel / census_filter . h " , <nl> " src / core / channel / channel_args . h " , <nl> " src / core / channel / channel_stack . h " , <nl> - " src / core / channel / child_channel . h " , <nl> " src / core / channel / client_channel . h " , <nl> - " src / core / channel / client_setup . h " , <nl> " src / core / channel / connected_channel . h " , <nl> " src / core / channel / context . h " , <nl> " src / core / channel / http_client_filter . h " , <nl> " src / core / channel / http_server_filter . h " , <nl> " src / core / channel / noop_filter . h " , <nl> + " src / core / client_config / client_config . h " , <nl> + " src / core / client_config / connector . h " , <nl> + " src / core / client_config / lb_policies / pick_first . h " , <nl> + " src / core / client_config / lb_policy . h " , <nl> + " src / core / client_config / resolver . h " , <nl> + " src / core / client_config / resolver_factory . h " , <nl> + " src / core / client_config / resolver_registry . h " , <nl> + " src / core / client_config / resolvers / dns_resolver . h " , <nl> + " src / core / client_config / resolvers / unix_resolver_posix . h " , <nl> + " src / core / client_config / subchannel . h " , <nl> + " src / core / client_config / subchannel_factory . h " , <nl> + " src / core / client_config / uri_parser . h " , <nl> " src / core / compression / message_compress . h " , <nl> " src / core / debug / trace . h " , <nl> " src / core / httpcli / format_request . h " , <nl> <nl> " src / core / surface / byte_buffer_queue . h " , <nl> " src / core / surface / call . h " , <nl> " src / core / surface / channel . h " , <nl> - " src / core / surface / client . h " , <nl> " src / core / surface / completion_queue . h " , <nl> " src / core / surface / event_string . h " , <nl> " src / core / surface / init . h " , <nl> <nl> " src / core / transport / chttp2 / timeout_encoding . h " , <nl> " src / core / transport / chttp2 / varint . h " , <nl> " src / core / transport / chttp2_transport . h " , <nl> + " src / core / transport / connectivity_state . h " , <nl> " src / core / transport / metadata . h " , <nl> " src / core / transport / stream_op . h " , <nl> " src / core / transport / transport . h " , <nl> <nl> " src / core / channel / channel_args . h " , <nl> " src / core / channel / channel_stack . c " , <nl> " src / core / channel / channel_stack . h " , <nl> - " src / core / channel / child_channel . c " , <nl> - " src / core / channel / child_channel . h " , <nl> " src / core / channel / client_channel . c " , <nl> " src / core / channel / client_channel . h " , <nl> - " src / core / channel / client_setup . c " , <nl> - " src / core / channel / client_setup . h " , <nl> " src / core / channel / connected_channel . c " , <nl> " src / core / channel / connected_channel . h " , <nl> " src / core / channel / context . h " , <nl> <nl> " src / core / channel / http_server_filter . h " , <nl> " src / core / channel / noop_filter . c " , <nl> " src / core / channel / noop_filter . h " , <nl> + " src / core / client_config / client_config . c " , <nl> + " src / core / client_config / client_config . h " , <nl> + " src / core / client_config / connector . c " , <nl> + " src / core / client_config / connector . h " , <nl> + " src / core / client_config / lb_policies / pick_first . c " , <nl> + " src / core / client_config / lb_policies / pick_first . h " , <nl> + " src / core / client_config / lb_policy . c " , <nl> + " src / core / client_config / lb_policy . h " , <nl> + " src / core / client_config / resolver . c " , <nl> + " src / core / client_config / resolver . h " , <nl> + " src / core / client_config / resolver_factory . c " , <nl> + " src / core / client_config / resolver_factory . h " , <nl> + " src / core / client_config / resolver_registry . c " , <nl> + " src / core / client_config / resolver_registry . h " , <nl> + " src / core / client_config / resolvers / dns_resolver . c " , <nl> + " src / core / client_config / resolvers / dns_resolver . h " , <nl> + " src / core / client_config / resolvers / unix_resolver_posix . c " , <nl> + " src / core / client_config / resolvers / unix_resolver_posix . h " , <nl> + " src / core / client_config / subchannel . c " , <nl> + " src / core / client_config / subchannel . h " , <nl> + " src / core / client_config / subchannel_factory . c " , <nl> + " src / core / client_config / subchannel_factory . h " , <nl> + " src / core / client_config / uri_parser . c " , <nl> + " src / core / client_config / uri_parser . h " , <nl> " src / core / compression / algorithm . c " , <nl> " src / core / compression / message_compress . c " , <nl> " src / core / compression / message_compress . h " , <nl> <nl> " src / core / surface / channel . c " , <nl> " src / core / surface / channel . h " , <nl> " src / core / surface / channel_create . c " , <nl> - " src / core / surface / client . c " , <nl> - " src / core / surface / client . h " , <nl> " src / core / surface / completion_queue . c " , <nl> " src / core / surface / completion_queue . h " , <nl> " src / core / surface / event_string . c " , <nl> <nl> " src / core / transport / chttp2 / writing . c " , <nl> " src / core / transport / chttp2_transport . c " , <nl> " src / core / transport / chttp2_transport . h " , <nl> + " src / core / transport / connectivity_state . c " , <nl> + " src / core / transport / connectivity_state . h " , <nl> " src / core / transport / metadata . c " , <nl> " src / core / transport / metadata . h " , <nl> " src / core / transport / stream_op . c " , <nl> <nl> " src / core / channel / census_filter . h " , <nl> " src / core / channel / channel_args . h " , <nl> " src / core / channel / channel_stack . h " , <nl> - " src / core / channel / child_channel . h " , <nl> " src / core / channel / client_channel . h " , <nl> - " src / core / channel / client_setup . h " , <nl> " src / core / channel / connected_channel . h " , <nl> " src / core / channel / context . h " , <nl> " src / core / channel / http_client_filter . h " , <nl> " src / core / channel / http_server_filter . h " , <nl> " src / core / channel / noop_filter . h " , <nl> + " src / core / client_config / client_config . h " , <nl> + " src / core / client_config / connector . h " , <nl> + " src / core / client_config / lb_policies / pick_first . h " , <nl> + " src / core / client_config / lb_policy . h " , <nl> + " src / core / client_config / resolver . h " , <nl> + " src / core / client_config / resolver_factory . h " , <nl> + " src / core / client_config / resolver_registry . h " , <nl> + " src / core / client_config / resolvers / dns_resolver . h " , <nl> + " src / core / client_config / resolvers / unix_resolver_posix . h " , <nl> + " src / core / client_config / subchannel . h " , <nl> + " src / core / client_config / subchannel_factory . h " , <nl> + " src / core / client_config / uri_parser . h " , <nl> " src / core / compression / message_compress . h " , <nl> " src / core / debug / trace . h " , <nl> " src / core / iomgr / alarm . h " , <nl> <nl> " src / core / surface / byte_buffer_queue . h " , <nl> " src / core / surface / call . h " , <nl> " src / core / surface / channel . h " , <nl> - " src / core / surface / client . h " , <nl> " src / core / surface / completion_queue . h " , <nl> " src / core / surface / event_string . h " , <nl> " src / core / surface / init . h " , <nl> <nl> " src / core / transport / chttp2 / timeout_encoding . h " , <nl> " src / core / transport / chttp2 / varint . h " , <nl> " src / core / transport / chttp2_transport . h " , <nl> + " src / core / transport / connectivity_state . h " , <nl> " src / core / transport / metadata . h " , <nl> " src / core / transport / stream_op . h " , <nl> " src / core / transport / transport . h " , <nl> <nl> " src / core / channel / channel_args . h " , <nl> " src / core / channel / channel_stack . c " , <nl> " src / core / channel / channel_stack . h " , <nl> - " src / core / channel / child_channel . c " , <nl> - " src / core / channel / child_channel . h " , <nl> " src / core / channel / client_channel . c " , <nl> " src / core / channel / client_channel . h " , <nl> - " src / core / channel / client_setup . c " , <nl> - " src / core / channel / client_setup . h " , <nl> " src / core / channel / connected_channel . c " , <nl> " src / core / channel / connected_channel . h " , <nl> " src / core / channel / context . h " , <nl> <nl> " src / core / channel / http_server_filter . h " , <nl> " src / core / channel / noop_filter . c " , <nl> " src / core / channel / noop_filter . h " , <nl> + " src / core / client_config / client_config . c " , <nl> + " src / core / client_config / client_config . h " , <nl> + " src / core / client_config / connector . c " , <nl> + " src / core / client_config / connector . h " , <nl> + " src / core / client_config / lb_policies / pick_first . c " , <nl> + " src / core / client_config / lb_policies / pick_first . h " , <nl> + " src / core / client_config / lb_policy . c " , <nl> + " src / core / client_config / lb_policy . h " , <nl> + " src / core / client_config / resolver . c " , <nl> + " src / core / client_config / resolver . h " , <nl> + " src / core / client_config / resolver_factory . c " , <nl> + " src / core / client_config / resolver_factory . h " , <nl> + " src / core / client_config / resolver_registry . c " , <nl> + " src / core / client_config / resolver_registry . h " , <nl> + " src / core / client_config / resolvers / dns_resolver . c " , <nl> + " src / core / client_config / resolvers / dns_resolver . h " , <nl> + " src / core / client_config / resolvers / unix_resolver_posix . c " , <nl> + " src / core / client_config / resolvers / unix_resolver_posix . h " , <nl> + " src / core / client_config / subchannel . c " , <nl> + " src / core / client_config / subchannel . h " , <nl> + " src / core / client_config / subchannel_factory . c " , <nl> + " src / core / client_config / subchannel_factory . h " , <nl> + " src / core / client_config / uri_parser . c " , <nl> + " src / core / client_config / uri_parser . h " , <nl> " src / core / compression / algorithm . c " , <nl> " src / core / compression / message_compress . c " , <nl> " src / core / compression / message_compress . h " , <nl> <nl> " src / core / surface / channel . c " , <nl> " src / core / surface / channel . h " , <nl> " src / core / surface / channel_create . c " , <nl> - " src / core / surface / client . c " , <nl> - " src / core / surface / client . h " , <nl> " src / core / surface / completion_queue . c " , <nl> " src / core / surface / completion_queue . h " , <nl> " src / core / surface / event_string . c " , <nl> <nl> " src / core / transport / chttp2 / writing . c " , <nl> " src / core / transport / chttp2_transport . c " , <nl> " src / core / transport / chttp2_transport . h " , <nl> + " src / core / transport / connectivity_state . c " , <nl> + " src / core / transport / connectivity_state . h " , <nl> " src / core / transport / metadata . c " , <nl> " src / core / transport / metadata . h " , <nl> " src / core / transport / stream_op . c " , <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 " : " uri_parser_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> $ ( OUT_DIR ) : <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_flags . 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 Debug \ bad_client_test . 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 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_auth_context_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_security_connector_test . exe grpc_stream_op_test . exe hpack_parser_test . exe hpack_table_test . exe httpcli_format_request_test . exe httpcli_parser_test . exe json_rewrite . exe json_rewrite_test . exe json_test . exe lame_client_test . exe message_compress_test . exe multi_init_test . exe multiple_server_queues_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_flags_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_flags_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_flags_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_flags_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_flags_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_flags_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_flags_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_flags_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_flags_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_flags_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_flags_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 connection_prefix_bad_client_test . exe initial_settings_frame_bad_client_test . exe <nl> + buildtests_c : alarm_heap_test . exe alarm_list_test . exe alarm_test . exe alpn_test . exe bin_encoder_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_auth_context_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_security_connector_test . exe grpc_stream_op_test . exe hpack_parser_test . exe hpack_table_test . exe httpcli_format_request_test . exe httpcli_parser_test . exe json_rewrite . exe json_rewrite_test . exe json_test . exe lame_client_test . exe message_compress_test . exe multi_init_test . exe multiple_server_queues_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 uri_parser_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_flags_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_flags_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_flags_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_flags_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_flags_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_flags_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_flags_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_flags_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_flags_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_flags_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_flags_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 connection_prefix_bad_client_test . exe initial_settings_frame_bad_client_test . exe <nl> echo All tests built . <nl> <nl> buildtests_cxx : interop_client . exe interop_server . exe <nl> transport_security_test . exe : build_libs $ ( OUT_DIR ) <nl> transport_security_test : transport_security_test . exe <nl> echo Running transport_security_test <nl> $ ( OUT_DIR ) \ transport_security_test . exe <nl> + uri_parser_test . exe : build_libs $ ( OUT_DIR ) <nl> + echo Building uri_parser_test <nl> + $ ( CC ) $ ( CFLAGS ) / Fo : $ ( OUT_DIR ) \ $ ( REPO_ROOT ) \ test \ core \ client_config \ uri_parser_test . c <nl> + $ ( LINK ) $ ( LFLAGS ) / OUT : " $ ( OUT_DIR ) \ uri_parser_test . exe " Debug \ grpc_test_util . lib Debug \ grpc . lib Debug \ gpr_test_util . lib Debug \ gpr . lib $ ( LIBS ) $ ( OUT_DIR ) \ uri_parser_test . obj <nl> + uri_parser_test : uri_parser_test . exe <nl> + echo Running uri_parser_test <nl> + $ ( OUT_DIR ) \ uri_parser_test . exe <nl> interop_client . exe : build_libs $ ( OUT_DIR ) <nl> echo Building interop_client <nl> $ ( CC ) $ ( CFLAGS ) / Fo : $ ( OUT_DIR ) \ $ ( REPO_ROOT ) \ vsprojects \ dummy . c <nl> mmm a / vsprojects / grpc / grpc . vcxproj <nl> ppp b / vsprojects / grpc / grpc . vcxproj <nl> <nl> < ClInclude Include = " . . \ . . \ src \ core \ channel \ census_filter . h " / > <nl> < ClInclude Include = " . . \ . . \ src \ core \ channel \ channel_args . h " / > <nl> < ClInclude Include = " . . \ . . \ src \ core \ channel \ channel_stack . h " / > <nl> - < ClInclude Include = " . . \ . . \ src \ core \ channel \ child_channel . h " / > <nl> < ClInclude Include = " . . \ . . \ src \ core \ channel \ client_channel . h " / > <nl> - < ClInclude Include = " . . \ . . \ src \ core \ channel \ client_setup . h " / > <nl> < ClInclude Include = " . . \ . . \ src \ core \ channel \ connected_channel . h " / > <nl> < ClInclude Include = " . . \ . . \ src \ core \ channel \ context . h " / > <nl> < ClInclude Include = " . . \ . . \ src \ core \ channel \ http_client_filter . h " / > <nl> < ClInclude Include = " . . \ . . \ src \ core \ channel \ http_server_filter . h " / > <nl> < ClInclude Include = " . . \ . . \ src \ core \ channel \ noop_filter . h " / > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ client_config . h " / > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ connector . h " / > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ lb_policies \ pick_first . h " / > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ lb_policy . h " / > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ resolver . h " / > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ resolver_factory . h " / > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ resolver_registry . h " / > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ resolvers \ dns_resolver . h " / > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ resolvers \ unix_resolver_posix . h " / > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ subchannel . h " / > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ subchannel_factory . h " / > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ uri_parser . h " / > <nl> < ClInclude Include = " . . \ . . \ src \ core \ compression \ message_compress . h " / > <nl> < ClInclude Include = " . . \ . . \ src \ core \ debug \ trace . h " / > <nl> < ClInclude Include = " . . \ . . \ src \ core \ iomgr \ alarm . h " / > <nl> <nl> < ClInclude Include = " . . \ . . \ src \ core \ surface \ byte_buffer_queue . h " / > <nl> < ClInclude Include = " . . \ . . \ src \ core \ surface \ call . h " / > <nl> < ClInclude Include = " . . \ . . \ src \ core \ surface \ channel . h " / > <nl> - < ClInclude Include = " . . \ . . \ src \ core \ surface \ client . h " / > <nl> < ClInclude Include = " . . \ . . \ src \ core \ surface \ completion_queue . h " / > <nl> < ClInclude Include = " . . \ . . \ src \ core \ surface \ event_string . h " / > <nl> < ClInclude Include = " . . \ . . \ src \ core \ surface \ init . h " / > <nl> <nl> < ClInclude Include = " . . \ . . \ src \ core \ transport \ chttp2 \ timeout_encoding . h " / > <nl> < ClInclude Include = " . . \ . . \ src \ core \ transport \ chttp2 \ varint . h " / > <nl> < ClInclude Include = " . . \ . . \ src \ core \ transport \ chttp2_transport . h " / > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ transport \ connectivity_state . h " / > <nl> < ClInclude Include = " . . \ . . \ src \ core \ transport \ metadata . h " / > <nl> < ClInclude Include = " . . \ . . \ src \ core \ transport \ stream_op . h " / > <nl> < ClInclude Include = " . . \ . . \ src \ core \ transport \ transport . h " / > <nl> <nl> < / ClCompile > <nl> < ClCompile Include = " . . \ . . \ src \ core \ channel \ channel_stack . c " > <nl> < / ClCompile > <nl> - < ClCompile Include = " . . \ . . \ src \ core \ channel \ child_channel . c " > <nl> - < / ClCompile > <nl> < ClCompile Include = " . . \ . . \ src \ core \ channel \ client_channel . c " > <nl> < / ClCompile > <nl> - < ClCompile Include = " . . \ . . \ src \ core \ channel \ client_setup . c " > <nl> - < / ClCompile > <nl> < ClCompile Include = " . . \ . . \ src \ core \ channel \ connected_channel . c " > <nl> < / ClCompile > <nl> < ClCompile Include = " . . \ . . \ src \ core \ channel \ http_client_filter . c " > <nl> <nl> < / ClCompile > <nl> < ClCompile Include = " . . \ . . \ src \ core \ channel \ noop_filter . c " > <nl> < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ client_config . c " > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ connector . c " > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ lb_policies \ pick_first . c " > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ lb_policy . c " > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ resolver . c " > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ resolver_factory . c " > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ resolver_registry . c " > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ resolvers \ dns_resolver . c " > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ resolvers \ unix_resolver_posix . c " > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ subchannel . c " > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ subchannel_factory . c " > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ uri_parser . c " > <nl> + < / ClCompile > <nl> < ClCompile Include = " . . \ . . \ src \ core \ compression \ algorithm . c " > <nl> < / ClCompile > <nl> < ClCompile Include = " . . \ . . \ src \ core \ compression \ message_compress . c " > <nl> <nl> < / ClCompile > <nl> < ClCompile Include = " . . \ . . \ src \ core \ surface \ channel_create . c " > <nl> < / ClCompile > <nl> - < ClCompile Include = " . . \ . . \ src \ core \ surface \ client . c " > <nl> - < / ClCompile > <nl> < ClCompile Include = " . . \ . . \ src \ core \ surface \ completion_queue . c " > <nl> < / ClCompile > <nl> < ClCompile Include = " . . \ . . \ src \ core \ surface \ event_string . c " > <nl> <nl> < / ClCompile > <nl> < ClCompile Include = " . . \ . . \ src \ core \ transport \ chttp2_transport . c " > <nl> < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ transport \ connectivity_state . c " > <nl> + < / ClCompile > <nl> < ClCompile Include = " . . \ . . \ src \ core \ transport \ metadata . c " > <nl> < / ClCompile > <nl> < ClCompile Include = " . . \ . . \ src \ core \ transport \ stream_op . c " > <nl> mmm a / vsprojects / grpc / grpc . vcxproj . filters <nl> ppp b / vsprojects / grpc / grpc . vcxproj . filters <nl> <nl> < ClCompile Include = " . . \ . . \ src \ core \ channel \ channel_stack . c " > <nl> < Filter > src \ core \ channel < / Filter > <nl> < / ClCompile > <nl> - < ClCompile Include = " . . \ . . \ src \ core \ channel \ child_channel . c " > <nl> - < Filter > src \ core \ channel < / Filter > <nl> - < / ClCompile > <nl> < ClCompile Include = " . . \ . . \ src \ core \ channel \ client_channel . c " > <nl> < Filter > src \ core \ channel < / Filter > <nl> < / ClCompile > <nl> - < ClCompile Include = " . . \ . . \ src \ core \ channel \ client_setup . c " > <nl> - < Filter > src \ core \ channel < / Filter > <nl> - < / ClCompile > <nl> < ClCompile Include = " . . \ . . \ src \ core \ channel \ connected_channel . c " > <nl> < Filter > src \ core \ channel < / Filter > <nl> < / ClCompile > <nl> <nl> < ClCompile Include = " . . \ . . \ src \ core \ channel \ noop_filter . c " > <nl> < Filter > src \ core \ channel < / Filter > <nl> < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ client_config . c " > <nl> + < Filter > src \ core \ client_config < / Filter > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ connector . c " > <nl> + < Filter > src \ core \ client_config < / Filter > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ lb_policies \ pick_first . c " > <nl> + < Filter > src \ core \ client_config \ lb_policies < / Filter > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ lb_policy . c " > <nl> + < Filter > src \ core \ client_config < / Filter > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ resolver . c " > <nl> + < Filter > src \ core \ client_config < / Filter > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ resolver_factory . c " > <nl> + < Filter > src \ core \ client_config < / Filter > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ resolver_registry . c " > <nl> + < Filter > src \ core \ client_config < / Filter > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ resolvers \ dns_resolver . c " > <nl> + < Filter > src \ core \ client_config \ resolvers < / Filter > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ resolvers \ unix_resolver_posix . c " > <nl> + < Filter > src \ core \ client_config \ resolvers < / Filter > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ subchannel . c " > <nl> + < Filter > src \ core \ client_config < / Filter > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ subchannel_factory . c " > <nl> + < Filter > src \ core \ client_config < / Filter > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ uri_parser . c " > <nl> + < Filter > src \ core \ client_config < / Filter > <nl> + < / ClCompile > <nl> < ClCompile Include = " . . \ . . \ src \ core \ compression \ algorithm . c " > <nl> < Filter > src \ core \ compression < / Filter > <nl> < / ClCompile > <nl> <nl> < ClCompile Include = " . . \ . . \ src \ core \ surface \ channel_create . c " > <nl> < Filter > src \ core \ surface < / Filter > <nl> < / ClCompile > <nl> - < ClCompile Include = " . . \ . . \ src \ core \ surface \ client . c " > <nl> - < Filter > src \ core \ surface < / Filter > <nl> - < / ClCompile > <nl> < ClCompile Include = " . . \ . . \ src \ core \ surface \ completion_queue . c " > <nl> < Filter > src \ core \ surface < / Filter > <nl> < / ClCompile > <nl> <nl> < ClCompile Include = " . . \ . . \ src \ core \ transport \ chttp2_transport . c " > <nl> < Filter > src \ core \ transport < / Filter > <nl> < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ transport \ connectivity_state . c " > <nl> + < Filter > src \ core \ transport < / Filter > <nl> + < / ClCompile > <nl> < ClCompile Include = " . . \ . . \ src \ core \ transport \ metadata . c " > <nl> < Filter > src \ core \ transport < / Filter > <nl> < / ClCompile > <nl> <nl> < ClInclude Include = " . . \ . . \ src \ core \ channel \ channel_stack . h " > <nl> < Filter > src \ core \ channel < / Filter > <nl> < / ClInclude > <nl> - < ClInclude Include = " . . \ . . \ src \ core \ channel \ child_channel . h " > <nl> - < Filter > src \ core \ channel < / Filter > <nl> - < / ClInclude > <nl> < ClInclude Include = " . . \ . . \ src \ core \ channel \ client_channel . h " > <nl> < Filter > src \ core \ channel < / Filter > <nl> < / ClInclude > <nl> - < ClInclude Include = " . . \ . . \ src \ core \ channel \ client_setup . h " > <nl> - < Filter > src \ core \ channel < / Filter > <nl> - < / ClInclude > <nl> < ClInclude Include = " . . \ . . \ src \ core \ channel \ connected_channel . h " > <nl> < Filter > src \ core \ channel < / Filter > <nl> < / ClInclude > <nl> <nl> < ClInclude Include = " . . \ . . \ src \ core \ channel \ noop_filter . h " > <nl> < Filter > src \ core \ channel < / Filter > <nl> < / ClInclude > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ client_config . h " > <nl> + < Filter > src \ core \ client_config < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ connector . h " > <nl> + < Filter > src \ core \ client_config < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ lb_policies \ pick_first . h " > <nl> + < Filter > src \ core \ client_config \ lb_policies < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ lb_policy . h " > <nl> + < Filter > src \ core \ client_config < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ resolver . h " > <nl> + < Filter > src \ core \ client_config < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ resolver_factory . h " > <nl> + < Filter > src \ core \ client_config < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ resolver_registry . h " > <nl> + < Filter > src \ core \ client_config < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ resolvers \ dns_resolver . h " > <nl> + < Filter > src \ core \ client_config \ resolvers < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ resolvers \ unix_resolver_posix . h " > <nl> + < Filter > src \ core \ client_config \ resolvers < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ subchannel . h " > <nl> + < Filter > src \ core \ client_config < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ subchannel_factory . h " > <nl> + < Filter > src \ core \ client_config < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ uri_parser . h " > <nl> + < Filter > src \ core \ client_config < / Filter > <nl> + < / ClInclude > <nl> < ClInclude Include = " . . \ . . \ src \ core \ compression \ message_compress . h " > <nl> < Filter > src \ core \ compression < / Filter > <nl> < / ClInclude > <nl> <nl> < ClInclude Include = " . . \ . . \ src \ core \ surface \ channel . h " > <nl> < Filter > src \ core \ surface < / Filter > <nl> < / ClInclude > <nl> - < ClInclude Include = " . . \ . . \ src \ core \ surface \ client . h " > <nl> - < Filter > src \ core \ surface < / Filter > <nl> - < / ClInclude > <nl> < ClInclude Include = " . . \ . . \ src \ core \ surface \ completion_queue . h " > <nl> < Filter > src \ core \ surface < / Filter > <nl> < / ClInclude > <nl> <nl> < ClInclude Include = " . . \ . . \ src \ core \ transport \ chttp2_transport . h " > <nl> < Filter > src \ core \ transport < / Filter > <nl> < / ClInclude > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ transport \ connectivity_state . h " > <nl> + < Filter > src \ core \ transport < / Filter > <nl> + < / ClInclude > <nl> < ClInclude Include = " . . \ . . \ src \ core \ transport \ metadata . h " > <nl> < Filter > src \ core \ transport < / Filter > <nl> < / ClInclude > <nl> <nl> < Filter Include = " src \ core \ channel " > <nl> < UniqueIdentifier > { d897b6c3 - c555 - 234e - a589 - b4f008063615 } < / UniqueIdentifier > <nl> < / Filter > <nl> + < Filter Include = " src \ core \ client_config " > <nl> + < UniqueIdentifier > { e71e6928 - b1e3 - 0616 - 0961 - 1505370458ab } < / UniqueIdentifier > <nl> + < / Filter > <nl> + < Filter Include = " src \ core \ client_config \ lb_policies " > <nl> + < UniqueIdentifier > { a3eca4d5 - f760 - 61a6 - 7251 - 556b828c8b44 } < / UniqueIdentifier > <nl> + < / Filter > <nl> + < Filter Include = " src \ core \ client_config \ resolvers " > <nl> + < UniqueIdentifier > { 6d97b8d9 - 2c15 - 927a - 892a - 709d073c02ab } < / UniqueIdentifier > <nl> + < / Filter > <nl> < Filter Include = " src \ core \ compression " > <nl> < UniqueIdentifier > { 263cb913 - dfe6 - 42a4 - 096b - cac231f76305 } < / UniqueIdentifier > <nl> < / Filter > <nl> mmm a / vsprojects / grpc_unsecure / grpc_unsecure . vcxproj <nl> ppp b / vsprojects / grpc_unsecure / grpc_unsecure . vcxproj <nl> <nl> < ClInclude Include = " . . \ . . \ src \ core \ channel \ census_filter . h " / > <nl> < ClInclude Include = " . . \ . . \ src \ core \ channel \ channel_args . h " / > <nl> < ClInclude Include = " . . \ . . \ src \ core \ channel \ channel_stack . h " / > <nl> - < ClInclude Include = " . . \ . . \ src \ core \ channel \ child_channel . h " / > <nl> < ClInclude Include = " . . \ . . \ src \ core \ channel \ client_channel . h " / > <nl> - < ClInclude Include = " . . \ . . \ src \ core \ channel \ client_setup . h " / > <nl> < ClInclude Include = " . . \ . . \ src \ core \ channel \ connected_channel . h " / > <nl> < ClInclude Include = " . . \ . . \ src \ core \ channel \ context . h " / > <nl> < ClInclude Include = " . . \ . . \ src \ core \ channel \ http_client_filter . h " / > <nl> < ClInclude Include = " . . \ . . \ src \ core \ channel \ http_server_filter . h " / > <nl> < ClInclude Include = " . . \ . . \ src \ core \ channel \ noop_filter . h " / > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ client_config . h " / > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ connector . h " / > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ lb_policies \ pick_first . h " / > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ lb_policy . h " / > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ resolver . h " / > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ resolver_factory . h " / > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ resolver_registry . h " / > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ resolvers \ dns_resolver . h " / > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ resolvers \ unix_resolver_posix . h " / > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ subchannel . h " / > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ subchannel_factory . h " / > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ uri_parser . h " / > <nl> < ClInclude Include = " . . \ . . \ src \ core \ compression \ message_compress . h " / > <nl> < ClInclude Include = " . . \ . . \ src \ core \ debug \ trace . h " / > <nl> < ClInclude Include = " . . \ . . \ src \ core \ iomgr \ alarm . h " / > <nl> <nl> < ClInclude Include = " . . \ . . \ src \ core \ surface \ byte_buffer_queue . h " / > <nl> < ClInclude Include = " . . \ . . \ src \ core \ surface \ call . h " / > <nl> < ClInclude Include = " . . \ . . \ src \ core \ surface \ channel . h " / > <nl> - < ClInclude Include = " . . \ . . \ src \ core \ surface \ client . h " / > <nl> < ClInclude Include = " . . \ . . \ src \ core \ surface \ completion_queue . h " / > <nl> < ClInclude Include = " . . \ . . \ src \ core \ surface \ event_string . h " / > <nl> < ClInclude Include = " . . \ . . \ src \ core \ surface \ init . h " / > <nl> <nl> < ClInclude Include = " . . \ . . \ src \ core \ transport \ chttp2 \ timeout_encoding . h " / > <nl> < ClInclude Include = " . . \ . . \ src \ core \ transport \ chttp2 \ varint . h " / > <nl> < ClInclude Include = " . . \ . . \ src \ core \ transport \ chttp2_transport . h " / > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ transport \ connectivity_state . h " / > <nl> < ClInclude Include = " . . \ . . \ src \ core \ transport \ metadata . h " / > <nl> < ClInclude Include = " . . \ . . \ src \ core \ transport \ stream_op . h " / > <nl> < ClInclude Include = " . . \ . . \ src \ core \ transport \ transport . h " / > <nl> <nl> < / ClCompile > <nl> < ClCompile Include = " . . \ . . \ src \ core \ channel \ channel_stack . c " > <nl> < / ClCompile > <nl> - < ClCompile Include = " . . \ . . \ src \ core \ channel \ child_channel . c " > <nl> - < / ClCompile > <nl> < ClCompile Include = " . . \ . . \ src \ core \ channel \ client_channel . c " > <nl> < / ClCompile > <nl> - < ClCompile Include = " . . \ . . \ src \ core \ channel \ client_setup . c " > <nl> - < / ClCompile > <nl> < ClCompile Include = " . . \ . . \ src \ core \ channel \ connected_channel . c " > <nl> < / ClCompile > <nl> < ClCompile Include = " . . \ . . \ src \ core \ channel \ http_client_filter . c " > <nl> <nl> < / ClCompile > <nl> < ClCompile Include = " . . \ . . \ src \ core \ channel \ noop_filter . c " > <nl> < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ client_config . c " > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ connector . c " > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ lb_policies \ pick_first . c " > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ lb_policy . c " > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ resolver . c " > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ resolver_factory . c " > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ resolver_registry . c " > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ resolvers \ dns_resolver . c " > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ resolvers \ unix_resolver_posix . c " > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ subchannel . c " > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ subchannel_factory . c " > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ uri_parser . c " > <nl> + < / ClCompile > <nl> < ClCompile Include = " . . \ . . \ src \ core \ compression \ algorithm . c " > <nl> < / ClCompile > <nl> < ClCompile Include = " . . \ . . \ src \ core \ compression \ message_compress . c " > <nl> <nl> < / ClCompile > <nl> < ClCompile Include = " . . \ . . \ src \ core \ surface \ channel_create . c " > <nl> < / ClCompile > <nl> - < ClCompile Include = " . . \ . . \ src \ core \ surface \ client . c " > <nl> - < / ClCompile > <nl> < ClCompile Include = " . . \ . . \ src \ core \ surface \ completion_queue . c " > <nl> < / ClCompile > <nl> < ClCompile Include = " . . \ . . \ src \ core \ surface \ event_string . c " > <nl> <nl> < / ClCompile > <nl> < ClCompile Include = " . . \ . . \ src \ core \ transport \ chttp2_transport . c " > <nl> < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ transport \ connectivity_state . c " > <nl> + < / ClCompile > <nl> < ClCompile Include = " . . \ . . \ src \ core \ transport \ metadata . c " > <nl> < / ClCompile > <nl> < ClCompile Include = " . . \ . . \ src \ core \ transport \ stream_op . c " > <nl> mmm a / vsprojects / grpc_unsecure / grpc_unsecure . vcxproj . filters <nl> ppp b / vsprojects / grpc_unsecure / grpc_unsecure . vcxproj . filters <nl> <nl> < ClCompile Include = " . . \ . . \ src \ core \ channel \ channel_stack . c " > <nl> < Filter > src \ core \ channel < / Filter > <nl> < / ClCompile > <nl> - < ClCompile Include = " . . \ . . \ src \ core \ channel \ child_channel . c " > <nl> - < Filter > src \ core \ channel < / Filter > <nl> - < / ClCompile > <nl> < ClCompile Include = " . . \ . . \ src \ core \ channel \ client_channel . c " > <nl> < Filter > src \ core \ channel < / Filter > <nl> < / ClCompile > <nl> - < ClCompile Include = " . . \ . . \ src \ core \ channel \ client_setup . c " > <nl> - < Filter > src \ core \ channel < / Filter > <nl> - < / ClCompile > <nl> < ClCompile Include = " . . \ . . \ src \ core \ channel \ connected_channel . c " > <nl> < Filter > src \ core \ channel < / Filter > <nl> < / ClCompile > <nl> <nl> < ClCompile Include = " . . \ . . \ src \ core \ channel \ noop_filter . c " > <nl> < Filter > src \ core \ channel < / Filter > <nl> < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ client_config . c " > <nl> + < Filter > src \ core \ client_config < / Filter > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ connector . c " > <nl> + < Filter > src \ core \ client_config < / Filter > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ lb_policies \ pick_first . c " > <nl> + < Filter > src \ core \ client_config \ lb_policies < / Filter > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ lb_policy . c " > <nl> + < Filter > src \ core \ client_config < / Filter > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ resolver . c " > <nl> + < Filter > src \ core \ client_config < / Filter > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ resolver_factory . c " > <nl> + < Filter > src \ core \ client_config < / Filter > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ resolver_registry . c " > <nl> + < Filter > src \ core \ client_config < / Filter > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ resolvers \ dns_resolver . c " > <nl> + < Filter > src \ core \ client_config \ resolvers < / Filter > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ resolvers \ unix_resolver_posix . c " > <nl> + < Filter > src \ core \ client_config \ resolvers < / Filter > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ subchannel . c " > <nl> + < Filter > src \ core \ client_config < / Filter > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ subchannel_factory . c " > <nl> + < Filter > src \ core \ client_config < / Filter > <nl> + < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ client_config \ uri_parser . c " > <nl> + < Filter > src \ core \ client_config < / Filter > <nl> + < / ClCompile > <nl> < ClCompile Include = " . . \ . . \ src \ core \ compression \ algorithm . c " > <nl> < Filter > src \ core \ compression < / Filter > <nl> < / ClCompile > <nl> <nl> < ClCompile Include = " . . \ . . \ src \ core \ surface \ channel_create . c " > <nl> < Filter > src \ core \ surface < / Filter > <nl> < / ClCompile > <nl> - < ClCompile Include = " . . \ . . \ src \ core \ surface \ client . c " > <nl> - < Filter > src \ core \ surface < / Filter > <nl> - < / ClCompile > <nl> < ClCompile Include = " . . \ . . \ src \ core \ surface \ completion_queue . c " > <nl> < Filter > src \ core \ surface < / Filter > <nl> < / ClCompile > <nl> <nl> < ClCompile Include = " . . \ . . \ src \ core \ transport \ chttp2_transport . c " > <nl> < Filter > src \ core \ transport < / Filter > <nl> < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ src \ core \ transport \ connectivity_state . c " > <nl> + < Filter > src \ core \ transport < / Filter > <nl> + < / ClCompile > <nl> < ClCompile Include = " . . \ . . \ src \ core \ transport \ metadata . c " > <nl> < Filter > src \ core \ transport < / Filter > <nl> < / ClCompile > <nl> <nl> < ClInclude Include = " . . \ . . \ src \ core \ channel \ channel_stack . h " > <nl> < Filter > src \ core \ channel < / Filter > <nl> < / ClInclude > <nl> - < ClInclude Include = " . . \ . . \ src \ core \ channel \ child_channel . h " > <nl> - < Filter > src \ core \ channel < / Filter > <nl> - < / ClInclude > <nl> < ClInclude Include = " . . \ . . \ src \ core \ channel \ client_channel . h " > <nl> < Filter > src \ core \ channel < / Filter > <nl> < / ClInclude > <nl> - < ClInclude Include = " . . \ . . \ src \ core \ channel \ client_setup . h " > <nl> - < Filter > src \ core \ channel < / Filter > <nl> - < / ClInclude > <nl> < ClInclude Include = " . . \ . . \ src \ core \ channel \ connected_channel . h " > <nl> < Filter > src \ core \ channel < / Filter > <nl> < / ClInclude > <nl> <nl> < ClInclude Include = " . . \ . . \ src \ core \ channel \ noop_filter . h " > <nl> < Filter > src \ core \ channel < / Filter > <nl> < / ClInclude > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ client_config . h " > <nl> + < Filter > src \ core \ client_config < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ connector . h " > <nl> + < Filter > src \ core \ client_config < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ lb_policies \ pick_first . h " > <nl> + < Filter > src \ core \ client_config \ lb_policies < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ lb_policy . h " > <nl> + < Filter > src \ core \ client_config < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ resolver . h " > <nl> + < Filter > src \ core \ client_config < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ resolver_factory . h " > <nl> + < Filter > src \ core \ client_config < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ resolver_registry . h " > <nl> + < Filter > src \ core \ client_config < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ resolvers \ dns_resolver . h " > <nl> + < Filter > src \ core \ client_config \ resolvers < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ resolvers \ unix_resolver_posix . h " > <nl> + < Filter > src \ core \ client_config \ resolvers < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ subchannel . h " > <nl> + < Filter > src \ core \ client_config < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ subchannel_factory . h " > <nl> + < Filter > src \ core \ client_config < / Filter > <nl> + < / ClInclude > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ client_config \ uri_parser . h " > <nl> + < Filter > src \ core \ client_config < / Filter > <nl> + < / ClInclude > <nl> < ClInclude Include = " . . \ . . \ src \ core \ compression \ message_compress . h " > <nl> < Filter > src \ core \ compression < / Filter > <nl> < / ClInclude > <nl> <nl> < ClInclude Include = " . . \ . . \ src \ core \ surface \ channel . h " > <nl> < Filter > src \ core \ surface < / Filter > <nl> < / ClInclude > <nl> - < ClInclude Include = " . . \ . . \ src \ core \ surface \ client . h " > <nl> - < Filter > src \ core \ surface < / Filter > <nl> - < / ClInclude > <nl> < ClInclude Include = " . . \ . . \ src \ core \ surface \ completion_queue . h " > <nl> < Filter > src \ core \ surface < / Filter > <nl> < / ClInclude > <nl> <nl> < ClInclude Include = " . . \ . . \ src \ core \ transport \ chttp2_transport . h " > <nl> < Filter > src \ core \ transport < / Filter > <nl> < / ClInclude > <nl> + < ClInclude Include = " . . \ . . \ src \ core \ transport \ connectivity_state . h " > <nl> + < Filter > src \ core \ transport < / Filter > <nl> + < / ClInclude > <nl> < ClInclude Include = " . . \ . . \ src \ core \ transport \ metadata . h " > <nl> < Filter > src \ core \ transport < / Filter > <nl> < / ClInclude > <nl> <nl> < Filter Include = " src \ core \ channel " > <nl> < UniqueIdentifier > { cc102c4b - 66ff - cf4c - 2288 - d76327e1a183 } < / UniqueIdentifier > <nl> < / Filter > <nl> + < Filter Include = " src \ core \ client_config " > <nl> + < UniqueIdentifier > { 02bd7340 - 02ee - 4337 - ffa5 - 0b6ecc7cf60c } < / UniqueIdentifier > <nl> + < / Filter > <nl> + < Filter Include = " src \ core \ client_config \ lb_policies " > <nl> + < UniqueIdentifier > { 308af086 - 46c7 - fa66 - 9021 - 19b1c3d4a6bd } < / UniqueIdentifier > <nl> + < / Filter > <nl> + < Filter Include = " src \ core \ client_config \ resolvers " > <nl> + < UniqueIdentifier > { dd617c24 - 6f07 - fdff - 80d5 - c8610d6f815e } < / UniqueIdentifier > <nl> + < / Filter > <nl> < Filter Include = " src \ core \ compression " > <nl> < UniqueIdentifier > { 2e3aca1d - 223d - 10a1 - b282 - 7f9fc68ee6f5 } < / UniqueIdentifier > <nl> < / Filter > <nl>
|
Merge remote - tracking branch ' upstream / master ' into security_context2
|
grpc/grpc
|
e114a017203b1f42257154bf23e764b215176eff
|
2015-07-07T23:18:36Z
|
mmm a / modules / perception / camera / app / cipv_camera . cc <nl> ppp b / modules / perception / camera / app / cipv_camera . cc <nl> bool Cipv : : IsPointLeftOfLine ( const Point2Df & point , <nl> } else { <nl> if ( debug_level_ > = 2 ) { <nl> AINFO < < " point ( " < < point ( 0 ) < < " , " < < point ( 1 ) <nl> - < < " ) is right of line_segment ( " <nl> - < < line_seg_start_point ( 0 ) < < " , " <nl> + < < " ) is right of line_segment ( " < < line_seg_start_point ( 0 ) < < " , " <nl> < < line_seg_start_point ( 1 ) < < " ) - > ( " < < line_seg_end_point ( 0 ) <nl> < < " , " < < line_seg_end_point ( 1 ) <nl> < < " ) , cross_product : " < < cross_product ; <nl> mmm a / modules / perception / onboard / component / fusion_camera_detection_component . cc <nl> ppp b / modules / perception / onboard / component / fusion_camera_detection_component . cc <nl> bool FusionCameraDetectionComponent : : Init ( ) { <nl> <nl> if ( enable_cipv_ ) { <nl> cipv_ . Init ( homography_im2car_ , min_laneline_length_for_cipv_ , <nl> - average_lane_width_in_meter_ , max_vehicle_width_in_meter_ , <nl> - average_frame_rate_ , image_based_cipv_ , debug_level_ ) ; <nl> + average_lane_width_in_meter_ , max_vehicle_width_in_meter_ , <nl> + average_frame_rate_ , image_based_cipv_ , debug_level_ ) ; <nl> } <nl> <nl> if ( enable_visualization_ ) { <nl> mmm a / modules / perception / radar / lib / tracker / common / radar_track . h <nl> ppp b / modules / perception / radar / lib / tracker / common / radar_track . h <nl> class RadarTrack { <nl> double GetTrackingTime ( ) ; <nl> bool IsDead ( ) { return is_dead_ ; } <nl> void SetDead ( ) { is_dead_ = true ; } <nl> - bool ConfirmTrack ( ) { <nl> - return tracked_times_ > s_tracked_times_threshold_ ; <nl> - } <nl> + bool ConfirmTrack ( ) { return tracked_times_ > s_tracked_times_threshold_ ; } <nl> static void SetTrackedTimesThreshold ( const int & threshold ) { <nl> s_tracked_times_threshold_ = threshold ; <nl> } <nl> mmm a / modules / planning / scenarios / lane_follow / lane_follow_stage . cc <nl> ppp b / modules / planning / scenarios / lane_follow / lane_follow_stage . cc <nl> void LaneFollowStage : : PlanFallbackTrajectory ( <nl> reference_line_info - > st_graph_data ( ) . is_initialized ( ) <nl> ? reference_line_info - > st_graph_data ( ) . min_s_on_st_boundaries ( ) <nl> : std : : numeric_limits < double > : : infinity ( ) ; <nl> - const double curr_speed_distance = FLAGS_fallback_total_time * <nl> + const double curr_speed_distance = <nl> + FLAGS_fallback_total_time * <nl> std : : min ( FLAGS_default_cruise_speed , <nl> reference_line_info - > vehicle_state ( ) . linear_velocity ( ) ) ; <nl> * reference_line_info - > mutable_speed_data ( ) = <nl> - SpeedProfileGenerator : : GenerateFallbackSpeed ( std : : min ( { <nl> - curr_speed_distance , stop_path_distance , stop_speed_distance } ) ) ; <nl> + SpeedProfileGenerator : : GenerateFallbackSpeed ( std : : min ( <nl> + { curr_speed_distance , stop_path_distance , stop_speed_distance } ) ) ; <nl> <nl> if ( reference_line_info - > trajectory_type ( ) ! = ADCTrajectory : : PATH_FALLBACK ) { <nl> reference_line_info - > AddCost ( kSpeedOptimizationFallbackCost ) ; <nl> mmm a / modules / planning / tasks / deciders / path_bounds_decider . cc <nl> ppp b / modules / planning / tasks / deciders / path_bounds_decider . cc <nl> bool PathBoundsDecider : : GetBoundaryFromLanesAndADC ( <nl> ? curr_neighbor_lane_width <nl> : 0 . 0 ) ; <nl> double curr_left_bound_adc = <nl> - std : : fmax ( adc_l_to_lane_center_ , adc_l_to_lane_center_ + <nl> - ADC_speed_buffer ) + <nl> + std : : fmax ( adc_l_to_lane_center_ , <nl> + adc_l_to_lane_center_ + ADC_speed_buffer ) + <nl> GetBufferBetweenADCCenterAndEdge ( ) + ADC_buffer ; <nl> double curr_left_bound = <nl> std : : fmax ( curr_left_bound_lane , curr_left_bound_adc ) - offset_to_map ; <nl> bool PathBoundsDecider : : GetBoundaryFromLanesAndADC ( <nl> ? curr_neighbor_lane_width <nl> : 0 . 0 ) ; <nl> double curr_right_bound_adc = <nl> - std : : fmin ( adc_l_to_lane_center_ , adc_l_to_lane_center_ + <nl> - ADC_speed_buffer ) - <nl> + std : : fmin ( adc_l_to_lane_center_ , <nl> + adc_l_to_lane_center_ + ADC_speed_buffer ) - <nl> GetBufferBetweenADCCenterAndEdge ( ) - ADC_buffer ; <nl> double curr_right_bound = <nl> std : : fmin ( curr_right_bound_lane , curr_right_bound_adc ) - offset_to_map ; <nl> mmm a / modules / planning / tasks / deciders / path_lane_borrow_decider / path_lane_borrow_decider . cc <nl> ppp b / modules / planning / tasks / deciders / path_lane_borrow_decider / path_lane_borrow_decider . cc <nl> bool PathLaneBorrowDecider : : IsWithinSidePassingSpeedADC ( const Frame & frame ) { <nl> } <nl> <nl> bool PathLaneBorrowDecider : : IsLongTermBlockingObstacle ( ) { <nl> - if ( PlanningContext : : Instance ( ) - > <nl> - front_static_obstacle_cycle_counter ( ) > = 3 ) { <nl> + if ( PlanningContext : : Instance ( ) - > front_static_obstacle_cycle_counter ( ) > = 3 ) { <nl> ADEBUG < < " The blocking obstacle is long - term existing . " ; <nl> return true ; <nl> } else { <nl> mmm a / modules / planning / tasks / deciders / speed_bounds_decider / speed_bounds_decider . cc <nl> ppp b / modules / planning / tasks / deciders / speed_bounds_decider / speed_bounds_decider . cc <nl> void SpeedBoundsDecider : : CheckLaneChangeUrgency ( Frame * const frame ) { <nl> } <nl> <nl> void SpeedBoundsDecider : : AddPathEndStop ( <nl> - Frame * const frame , ReferenceLineInfo * const reference_line_info ) { <nl> + Frame * const frame , ReferenceLineInfo * const reference_line_info ) { <nl> const std : : string stop_wall_id = " path_end_stop " ; <nl> std : : vector < std : : string > wait_for_obstacles ; <nl> if ( ! reference_line_info - > path_data ( ) . path_label ( ) . empty ( ) & & <nl> reference_line_info - > path_data ( ) . frenet_frame_path ( ) . back ( ) . s ( ) - <nl> - reference_line_info - > path_data ( ) . frenet_frame_path ( ) . front ( ) . s ( ) < <nl> - FLAGS_short_path_length_threshold ) { <nl> - DeciderRuleBasedStop : : BuildStopDecision ( stop_wall_id , <nl> + reference_line_info - > path_data ( ) . frenet_frame_path ( ) . front ( ) . s ( ) < <nl> + FLAGS_short_path_length_threshold ) { <nl> + DeciderRuleBasedStop : : BuildStopDecision ( <nl> + stop_wall_id , <nl> reference_line_info - > path_data ( ) . frenet_frame_path ( ) . back ( ) . s ( ) - 5 . 0 , <nl> 0 . 0 , StopReasonCode : : STOP_REASON_LANE_CHANGE_URGENCY , <nl> wait_for_obstacles , frame , reference_line_info ) ; <nl> mmm a / modules / planning / tasks / deciders / speed_bounds_decider / speed_bounds_decider . h <nl> ppp b / modules / planning / tasks / deciders / speed_bounds_decider / speed_bounds_decider . h <nl> class SpeedBoundsDecider : public Decider { <nl> Frame * const frame , <nl> ReferenceLineInfo * const reference_line_info ) override ; <nl> <nl> - void AddPathEndStop ( <nl> - Frame * const frame , ReferenceLineInfo * const reference_line_info ) ; <nl> + void AddPathEndStop ( Frame * const frame , <nl> + ReferenceLineInfo * const reference_line_info ) ; <nl> <nl> void CheckLaneChangeUrgency ( Frame * const frame ) ; <nl> <nl> mmm a / modules / planning / tasks / optimizers / piecewise_jerk_path / piecewise_jerk_path_optimizer . cc <nl> ppp b / modules / planning / tasks / optimizers / piecewise_jerk_path / piecewise_jerk_path_optimizer . cc <nl> common : : Status PiecewiseJerkPathOptimizer : : Process ( <nl> const auto init_frenet_state = reference_line . ToFrenetFrame ( init_point ) ; <nl> <nl> const auto & piecewise_jerk_path_config = config_ . piecewise_jerk_path_config ( ) ; <nl> - std : : array < double , 5 > w = { piecewise_jerk_path_config . l_weight ( ) , <nl> - piecewise_jerk_path_config . dl_weight ( ) * <nl> - std : : fmax ( init_frenet_state . first [ 1 ] * <nl> - init_frenet_state . first [ 1 ] , 1 . 0 ) , <nl> - piecewise_jerk_path_config . ddl_weight ( ) , <nl> - piecewise_jerk_path_config . dddl_weight ( ) , 0 . 0 } ; <nl> + std : : array < double , 5 > w = { <nl> + piecewise_jerk_path_config . l_weight ( ) , <nl> + piecewise_jerk_path_config . dl_weight ( ) * <nl> + std : : fmax ( init_frenet_state . first [ 1 ] * init_frenet_state . first [ 1 ] , <nl> + 1 . 0 ) , <nl> + piecewise_jerk_path_config . ddl_weight ( ) , <nl> + piecewise_jerk_path_config . dddl_weight ( ) , 0 . 0 } ; <nl> <nl> const auto & path_boundaries = <nl> reference_line_info_ - > GetCandidatePathBoundaries ( ) ; <nl> mmm a / modules / prediction / predictor / empty / empty_predictor . cc <nl> ppp b / modules / prediction / predictor / empty / empty_predictor . cc <nl> <nl> namespace apollo { <nl> namespace prediction { <nl> <nl> - void EmptyPredictor : : Predict ( Obstacle * obstacle ) { <nl> - } <nl> + void EmptyPredictor : : Predict ( Obstacle * obstacle ) { } <nl> <nl> } / / namespace prediction <nl> } / / namespace apollo <nl> mmm a / modules / prediction / predictor / predictor . cc <nl> ppp b / modules / prediction / predictor / predictor . cc <nl> void Predictor : : SetEqualProbability ( const double total_probability , <nl> const auto prob = total_probability / static_cast < double > ( num - start_index ) ; <nl> for ( int i = start_index ; i < num ; + + i ) { <nl> obstacle_ptr - > mutable_latest_feature ( ) <nl> - - > mutable_predicted_trajectory ( i ) <nl> - - > set_probability ( prob ) ; <nl> + - > mutable_predicted_trajectory ( i ) <nl> + - > set_probability ( prob ) ; <nl> } <nl> } <nl> <nl> void Predictor : : TrimTrajectories ( <nl> } <nl> <nl> bool Predictor : : TrimTrajectory ( <nl> - const ADCTrajectoryContainer & adc_trajectory_container , <nl> - Obstacle * obstacle , Trajectory * trajectory ) { <nl> + const ADCTrajectoryContainer & adc_trajectory_container , Obstacle * obstacle , <nl> + Trajectory * trajectory ) { <nl> if ( ! adc_trajectory_container . IsProtected ( ) ) { <nl> ADEBUG < < " Not in protection mode . " ; <nl> return false ; <nl> mmm a / modules / prediction / predictor / predictor . h <nl> ppp b / modules / prediction / predictor / predictor . h <nl> class Predictor { <nl> * @ param ADC trajectory container <nl> * @ param obstacle , <nl> * / <nl> - void TrimTrajectories ( <nl> - const ADCTrajectoryContainer & adc_trajectory_container , <nl> - Obstacle * obstacle ) ; <nl> + void TrimTrajectories ( const ADCTrajectoryContainer & adc_trajectory_container , <nl> + Obstacle * obstacle ) ; <nl> <nl> protected : <nl> / * * <nl> class Predictor { <nl> * @ param obstacle <nl> * / <nl> void SetEqualProbability ( const double probability , const int start_index , <nl> - Obstacle * obstacle_ptr ) ; <nl> + Obstacle * obstacle_ptr ) ; <nl> <nl> / * * <nl> * @ brief Trim a single prediction trajectory , <nl> class Predictor { <nl> * @ param trajectory The trimed prediction trajectory <nl> * @ return If the prediction trajectory is trimed <nl> * / <nl> - bool TrimTrajectory ( <nl> - const ADCTrajectoryContainer & adc_trajectory_container , <nl> - Obstacle * obstacle , Trajectory * trajectory ) ; <nl> + bool TrimTrajectory ( const ADCTrajectoryContainer & adc_trajectory_container , <nl> + Obstacle * obstacle , Trajectory * trajectory ) ; <nl> <nl> / * * <nl> * @ brief Determine if an obstacle is supposed to stop within a distance <nl> mmm a / modules / prediction / predictor / predictor_manager . cc <nl> ppp b / modules / prediction / predictor / predictor_manager . cc <nl> void PredictorManager : : PredictObstaclesInParallel ( <nl> GroupObstaclesByObstacleId ( id , obstacles_container , & id_obstacle_map ) ; <nl> } <nl> } <nl> - PredictionThreadPool : : ForEach ( id_obstacle_map . begin ( ) , id_obstacle_map . end ( ) , <nl> + PredictionThreadPool : : ForEach ( <nl> + id_obstacle_map . begin ( ) , id_obstacle_map . end ( ) , <nl> [ & ] ( IdObstacleListMap : : iterator : : value_type & obstacles_iter ) { <nl> for ( auto obstacle_ptr : obstacles_iter . second ) { <nl> int id = obstacle_ptr - > id ( ) ; <nl> mmm a / modules / prediction / predictor / regional / regional_predictor . cc <nl> ppp b / modules / prediction / predictor / regional / regional_predictor . cc <nl> void RegionalPredictor : : Predict ( Obstacle * obstacle ) { <nl> } <nl> } <nl> <nl> - void RegionalPredictor : : GenerateStillTrajectory ( <nl> - double probability , Obstacle * obstacle ) { <nl> + void RegionalPredictor : : GenerateStillTrajectory ( double probability , <nl> + Obstacle * obstacle ) { <nl> if ( obstacle = = nullptr ) { <nl> AERROR < < " Missing obstacle . " ; <nl> return ; <nl> void RegionalPredictor : : GenerateStillTrajectory ( <nl> DrawStillTrajectory ( position , heading , 0 . 0 , total_time , & points ) ; <nl> Trajectory trajectory = GenerateTrajectory ( points ) ; <nl> obstacle - > mutable_latest_feature ( ) - > add_predicted_trajectory ( ) - > CopyFrom ( <nl> - trajectory ) ; <nl> + trajectory ) ; <nl> SetEqualProbability ( probability , start_index , obstacle ) ; <nl> } <nl> <nl> - void RegionalPredictor : : GenerateMovingTrajectory ( <nl> - double probability , Obstacle * obstacle ) { <nl> + void RegionalPredictor : : GenerateMovingTrajectory ( double probability , <nl> + Obstacle * obstacle ) { <nl> if ( obstacle = = nullptr ) { <nl> AERROR < < " Missing obstacle . " ; <nl> return ; <nl> mmm a / modules / tools / visualizer / main_window . cc <nl> ppp b / modules / tools / visualizer / main_window . cc <nl> void MainWindow : : AddNewWriter ( <nl> <nl> QTreeWidgetItem * child = new QTreeWidgetItem ( ) ; <nl> if ( child = = nullptr ) { <nl> - QMessageBox : : warning ( this , tr ( " Error " ) , <nl> - tr ( " No Enough for New Channel ! ! ! " ) , <nl> + QMessageBox : : warning ( this , tr ( " Error " ) , tr ( " No Enough for New Channel ! ! ! " ) , <nl> QMessageBox : : Ok ) ; <nl> return ; <nl> } <nl> mmm a / modules / tools / visualizer / texture . cc <nl> ppp b / modules / tools / visualizer / texture . cc <nl> bool Texture : : UpdateData ( <nl> <nl> image_height_ = imgData - > height ( ) ; <nl> image_width_ = imgData - > width ( ) ; <nl> - <nl> + <nl> return true ; <nl> } <nl>
|
Robot : Code clean .
|
ApolloAuto/apollo
|
8734f79ac1064177e00697512ed967e67e74cae1
|
2019-04-26T18:19:35Z
|
mmm a / src / compiler . cc <nl> ppp b / src / compiler . cc <nl> Handle < SharedFunctionInfo > Compiler : : GetSharedFunctionInfo ( <nl> / / unless we already have code with debut break slots . <nl> Handle < SharedFunctionInfo > existing ; <nl> if ( maybe_existing . ToHandle ( & existing ) & & existing - > is_compiled ( ) ) { <nl> + DCHECK ( ! existing - > is_toplevel ( ) ) ; <nl> if ( ! outer_info - > is_debug ( ) | | existing - > HasDebugCode ( ) ) { <nl> return existing ; <nl> } <nl> mmm a / src / objects . cc <nl> ppp b / src / objects . cc <nl> MaybeHandle < SharedFunctionInfo > Script : : FindSharedFunctionInfo ( <nl> if ( fun - > function_token_position ( ) = = shared - > function_token_position ( ) & & <nl> fun - > start_position ( ) = = shared - > start_position ( ) & & <nl> fun - > end_position ( ) = = shared - > end_position ( ) ) { <nl> - / / This method is not used to find top - level SharedFunctionInfo objects , <nl> - / / verify that above checks are sufficient to distinguish top - level code . <nl> - DCHECK ( ! shared - > is_toplevel ( ) ) ; <nl> return Handle < SharedFunctionInfo > ( shared ) ; <nl> } <nl> } <nl>
|
Allow Script : : FindSharedFunctionInfo to return toplevel functions
|
v8/v8
|
b87bdd17456f14ccb8d25c2d5e4989e1c31a4916
|
2016-05-12T11:24:34Z
|
new file mode 100644 <nl> index 000000000 . . dfbea9e08 <nl> mmm / dev / null <nl> ppp b / . github / workflows / tests . yml <nl> <nl> + name : Tests <nl> + <nl> + on : <nl> + push : <nl> + branches : [ master ] <nl> + pull_request : <nl> + branches : [ master ] <nl> + <nl> + jobs : <nl> + <nl> + codestyle : <nl> + runs - on : macos - latest <nl> + steps : <nl> + - uses : actions / checkout @ v2 <nl> + - run : brew install clang - format <nl> + name : Install clang - format <nl> + - run : clang - format - - version <nl> + - run : bash . / tools / format - code . sh <nl> + name : Run code formatter <nl> + - run : git diff - - quiet HEAD <nl> + name : Check if the styling guide is followed <nl> + <nl> + amd64_linux_clang : <nl> + runs - on : ubuntu - 18 . 04 <nl> + steps : <nl> + - uses : actions / checkout @ v2 <nl> + - run : sudo apt - y - qq update <nl> + - run : sudo apt install - y clang cmake qt5 - default libqt5webkit5 - dev python <nl> + name : Install requirements <nl> + - run : clang + + - - version & & cmake - - version & & qmake - - version & & python - - version <nl> + name : Display tools version <nl> + - run : CC = clang CXX = clang + + . / configure <nl> + - run : make <nl> + - run : file . / bin / phantomjs <nl> + - run : . / bin / phantomjs - - version <nl> + - run : make check <nl> + <nl> + amd64_linux_gcc : <nl> + runs - on : ubuntu - 18 . 04 <nl> + steps : <nl> + - uses : actions / checkout @ v2 <nl> + - run : sudo apt - y - qq update <nl> + - run : sudo apt install - y g + + cmake qt5 - default libqt5webkit5 - dev python <nl> + name : Install requirements <nl> + - run : g + + - - version & & cmake - - version & & qmake - - version & & python - - version <nl> + name : Display tools version <nl> + - run : . / configure <nl> + - run : make <nl> + - run : file . / bin / phantomjs <nl> + - run : . / bin / phantomjs - - version <nl> + - run : make check <nl> + <nl> deleted file mode 100644 <nl> index e5196045a . . 000000000 <nl> mmm a / azure - pipelines . yml <nl> ppp / dev / null <nl> <nl> - jobs : <nl> - <nl> - - job : ' CodeQuality ' <nl> - pool : <nl> - vmImage : ' macOS 10 . 13 ' <nl> - steps : <nl> - - script : brew install clang - format & & clang - format - - version <nl> - displayName : ' Install clang - format ' <nl> - - script : bash . / tools / format - code . sh <nl> - displayName : ' Run code formatter ' <nl> - - script : git diff - - quiet HEAD <nl> - displayName : ' Check if the styling guide is followed ' <nl> - <nl> - - job : ' amd64_linux_gcc ' <nl> - pool : <nl> - vmImage : ' ubuntu - 18 . 04 ' <nl> - steps : <nl> - - script : sudo apt - get - y - qq update <nl> - displayName : ' apt - get update ' <nl> - - script : sudo apt install - y g + + cmake qt5 - default libqt5webkit5 - dev python <nl> - displayName : ' Install requirements ' <nl> - - script : g + + - - version & & cmake - - version & & qmake - - version & & python - - version <nl> - displayName : ' Display tools version ' <nl> - - script : . / configure <nl> - displayName : ' Run configure script ' <nl> - - script : make <nl> - displayName : ' make ' <nl> - - script : file . / bin / phantomjs & & . / bin / phantomjs - - version <nl> - displayName : ' Verify executable ' <nl> - - script : make check <nl> - displayName : ' Run the tests ' <nl> - <nl> - - job : ' amd64_linux_clang ' <nl> - pool : <nl> - vmImage : ' ubuntu - 18 . 04 ' <nl> - steps : <nl> - - script : sudo apt - get - y - qq update <nl> - displayName : ' apt - get update ' <nl> - - script : sudo apt install - y clang cmake qt5 - default libqt5webkit5 - dev python <nl> - displayName : ' Install requirements ' <nl> - - script : clang + + - - version & & cmake - - version & & qmake - - version & & python - - version <nl> - displayName : ' Display tools version ' <nl> - - script : CC = clang CXX = clang + + . / configure <nl> - displayName : ' Run configure script ' <nl> - - script : make <nl> - displayName : ' make ' <nl> - - script : file . / bin / phantomjs & & . / bin / phantomjs - - version <nl> - displayName : ' Verify executable ' <nl> - - script : make check <nl> - displayName : ' Run the tests ' <nl> - <nl> - - job : ' amd64_windows_mingw ' <nl> - condition : eq ( 1 , 2 ) <nl> - pool : <nl> - vmImage : ' vs2017 - win2016 ' <nl> - variables : <nl> - PACMAN_PACKAGES : ' C : \ tools \ msys64 \ var \ cache \ pacman \ pkg ' <nl> - QT5_DIR : C : \ tools \ msys64 \ mingw64 \ lib \ cmake <nl> - steps : <nl> - - script : choco install - - no - progress msys2 <nl> - displayName : ' Install MSYS2 ' <nl> - - task : Cache @ 2 <nl> - inputs : <nl> - key : pacman <nl> - restoreKeys : pacman <nl> - path : $ ( PACMAN_PACKAGES ) <nl> - displayName : Cache pacman packages <nl> - - script : pacman - - version & & pacman - Sy & & pacman - - noconfirm - S pacman - mirrors <nl> - workingDirectory : C : \ tools \ msys64 \ usr \ bin \ <nl> - displayName : ' Check pacman ' <nl> - - script : C : \ tools \ msys64 \ usr \ bin \ pacman - Syu <nl> - displayName : ' Update MSYS2 packages ' <nl> - - script : | <nl> - set PATH = C : \ tools \ msys64 \ usr \ bin ; % PATH % <nl> - pacman - - noconfirm - S mingw64 / mingw - w64 - x86_64 - toolchain <nl> - pacman - - noconfirm - S mingw64 / mingw - w64 - x86_64 - cmake <nl> - pacman - - noconfirm - S mingw64 / mingw - w64 - x86_64 - qtwebkit <nl> - pacman - - noconfirm - S mingw64 / mingw - w64 - x86_64 - python2 <nl> - displayName : ' Install requirements ' <nl> - - script : | <nl> - set PATH = C : \ tools \ msys64 \ usr \ bin ; C : \ tools \ msys64 \ mingw64 \ bin ; % PATH % <nl> - g + + - - version & & cmake - - version & & qmake - - version & & python - - version <nl> - displayName : ' Display tools version ' <nl> - - script : | <nl> - set PATH = % PATH : C : \ Program Files \ Git \ bin ; = % <nl> - set PATH = % PATH : C : \ Program Files \ Git \ usr \ bin ; = % <nl> - set PATH = C : \ tools \ msys64 \ usr \ bin ; C : \ tools \ msys64 \ mingw64 \ bin ; % PATH % <nl> - del C : \ tools \ msys64 \ usr \ bin \ sh . exe <nl> - cmake CMakeLists . txt - G " MinGW Makefiles " <nl> - displayName : ' Run CMake ' <nl>
|
Switch CI to Github Actions ( )
|
ariya/phantomjs
|
31722964623eea3122cd18906508ddb564febc8a
|
2020-05-13T09:43:22Z
|
mmm a / src / Storages / RabbitMQ / RabbitMQBlockInputStream . cpp <nl> ppp b / src / Storages / RabbitMQ / RabbitMQBlockInputStream . cpp <nl> Block RabbitMQBlockInputStream : : readImpl ( ) <nl> <nl> finished = true ; <nl> <nl> - MutableColumns result_columns = non_virtual_header . cloneEmptyColumns ( ) ; <nl> + MutableColumns result_columns = non_virtual_header . cloneEmptyColumns ( ) ; <nl> MutableColumns virtual_columns = virtual_header . cloneEmptyColumns ( ) ; <nl> <nl> auto input_format = FormatFactory : : instance ( ) . getInputFormat ( <nl> mmm a / src / Storages / RabbitMQ / RabbitMQHandler . cpp <nl> ppp b / src / Storages / RabbitMQ / RabbitMQHandler . cpp <nl> enum <nl> } ; <nl> <nl> <nl> - RabbitMQHandler : : RabbitMQHandler ( event_base * evbase_ , Poco : : Logger * log_ ) : <nl> - LibEventHandler ( evbase_ ) , <nl> - evbase ( evbase_ ) , <nl> + RabbitMQHandler : : RabbitMQHandler ( uv_loop_t * loop_ , Poco : : Logger * log_ ) : <nl> + AMQP : : LibUvHandler ( loop_ ) , <nl> + loop ( loop_ ) , <nl> log ( log_ ) <nl> { <nl> tv . tv_sec = 0 ; <nl> void RabbitMQHandler : : startConsumerLoop ( std : : atomic < bool > & loop_started ) <nl> loop_started . store ( true ) ; <nl> stop_scheduled = false ; <nl> <nl> - event_base_loop ( evbase , EVLOOP_NONBLOCK ) ; <nl> + uv_run ( loop , UV_RUN_NOWAIT ) ; <nl> mutex_before_event_loop . unlock ( ) ; <nl> } <nl> } <nl> void RabbitMQHandler : : startConsumerLoop ( std : : atomic < bool > & loop_started ) <nl> <nl> void RabbitMQHandler : : startProducerLoop ( ) <nl> { <nl> - event_base_loop ( evbase , EVLOOP_NONBLOCK ) ; <nl> + uv_run ( loop , UV_RUN_NOWAIT ) ; <nl> } <nl> <nl> <nl> void RabbitMQHandler : : stop ( ) <nl> { <nl> if ( mutex_before_loop_stop . try_lock ( ) ) <nl> { <nl> - event_base_loopbreak ( evbase ) ; <nl> + uv_stop ( loop ) ; <nl> mutex_before_loop_stop . unlock ( ) ; <nl> } <nl> } <nl> void RabbitMQHandler : : stop ( ) <nl> void RabbitMQHandler : : stopWithTimeout ( ) <nl> { <nl> stop_scheduled = true ; <nl> - event_base_loopexit ( evbase , & tv ) ; <nl> + uv_stop ( loop ) ; <nl> } <nl> <nl> } <nl> mmm a / src / Storages / RabbitMQ / RabbitMQHandler . h <nl> ppp b / src / Storages / RabbitMQ / RabbitMQHandler . h <nl> <nl> # include < amqpcpp / libevent . h > <nl> # include < amqpcpp / linux_tcp . h > <nl> # include < common / types . h > <nl> - # include < event2 / event . h > <nl> + # include < amqpcpp / libuv . h > <nl> <nl> namespace DB <nl> { <nl> <nl> - class RabbitMQHandler : public AMQP : : LibEventHandler <nl> + class RabbitMQHandler : public AMQP : : LibUvHandler <nl> { <nl> <nl> public : <nl> - RabbitMQHandler ( event_base * evbase_ , Poco : : Logger * log_ ) ; <nl> + RabbitMQHandler ( uv_loop_t * evbase_ , Poco : : Logger * log_ ) ; <nl> <nl> void onError ( AMQP : : TcpConnection * connection , const char * message ) override ; <nl> void startConsumerLoop ( std : : atomic < bool > & loop_started ) ; <nl> class RabbitMQHandler : public AMQP : : LibEventHandler <nl> std : : atomic < bool > & checkStopIsScheduled ( ) { return stop_scheduled ; } ; <nl> <nl> private : <nl> - event_base * evbase ; <nl> + uv_loop_t * loop ; <nl> Poco : : Logger * log ; <nl> <nl> timeval tv ; <nl> mmm a / src / Storages / RabbitMQ / ReadBufferFromRabbitMQConsumer . cpp <nl> ppp b / src / Storages / RabbitMQ / ReadBufferFromRabbitMQConsumer . cpp <nl> bool ReadBufferFromRabbitMQConsumer : : nextImpl ( ) <nl> } <nl> <nl> if ( received . empty ( ) ) <nl> - { <nl> - LOG_TRACE ( log , " No more messages to be fetched " ) ; <nl> return false ; <nl> - } <nl> <nl> messages . clear ( ) ; <nl> <nl> mmm a / src / Storages / RabbitMQ / StorageRabbitMQ . cpp <nl> ppp b / src / Storages / RabbitMQ / StorageRabbitMQ . cpp <nl> enum <nl> Connection_setup_retries_max = 1000 <nl> } ; <nl> <nl> + static const auto RESCHEDULE_MS = 500 ; <nl> + <nl> namespace ErrorCodes <nl> { <nl> extern const int LOGICAL_ERROR ; <nl> StorageRabbitMQ : : StorageRabbitMQ ( <nl> rabbitmq_context . getConfigRef ( ) . getString ( " rabbitmq_username " , " root " ) , <nl> rabbitmq_context . getConfigRef ( ) . getString ( " rabbitmq_password " , " clickhouse " ) ) ) <nl> , parsed_address ( parseAddress ( global_context . getMacros ( ) - > expand ( host_port_ ) , 5672 ) ) <nl> - , evbase ( event_base_new ( ) ) <nl> - , eventHandler ( evbase , log ) <nl> - , connection ( & eventHandler , AMQP : : Address ( parsed_address . first , parsed_address . second , <nl> - AMQP : : Login ( login_password . first , login_password . second ) , " / " ) ) <nl> { <nl> + loop = new uv_loop_t ; <nl> + uv_loop_init ( loop ) ; <nl> + <nl> + event_handler = std : : make_unique < RabbitMQHandler > ( loop , log ) ; <nl> + connection = std : : make_unique < AMQP : : TcpConnection > ( event_handler . get ( ) , AMQP : : Address ( parsed_address . first , parsed_address . second , AMQP : : Login ( login_password . first , login_password . second ) , " / " ) ) ; <nl> + <nl> size_t cnt_retries = 0 ; <nl> - while ( ! connection . ready ( ) & & + + cnt_retries ! = Connection_setup_retries_max ) <nl> + while ( ! connection - > ready ( ) & & + + cnt_retries ! = Connection_setup_retries_max ) <nl> { <nl> - event_base_loop ( evbase , EVLOOP_NONBLOCK | EVLOOP_ONCE ) ; <nl> + uv_run ( loop , UV_RUN_NOWAIT ) ; <nl> std : : this_thread : : sleep_for ( std : : chrono : : milliseconds ( Connection_setup_sleep ) ) ; <nl> } <nl> <nl> - if ( ! connection . ready ( ) ) <nl> + if ( ! connection - > ready ( ) ) <nl> { <nl> LOG_ERROR ( log , " Cannot set up connection for consumer " ) ; <nl> } <nl> StorageRabbitMQ : : StorageRabbitMQ ( <nl> storage_metadata . setColumns ( columns_ ) ; <nl> setInMemoryMetadata ( storage_metadata ) ; <nl> <nl> - task = global_context . getSchedulePool ( ) . createTask ( log - > name ( ) , [ this ] { threadFunc ( ) ; } ) ; <nl> - task - > deactivate ( ) ; <nl> + streaming_task = global_context . getSchedulePool ( ) . createTask ( " RabbitMQStreamingTask " , [ this ] { threadFunc ( ) ; } ) ; <nl> + streaming_task - > deactivate ( ) ; <nl> + heartbeat_task = global_context . getSchedulePool ( ) . createTask ( " RabbitMQHeartbeatTask " , [ this ] { heartbeatFunc ( ) ; } ) ; <nl> + heartbeat_task - > deactivate ( ) ; <nl> <nl> bind_by_id = num_consumers > 1 | | num_queues > 1 ; <nl> <nl> StorageRabbitMQ : : StorageRabbitMQ ( <nl> } <nl> <nl> <nl> + void StorageRabbitMQ : : heartbeatFunc ( ) <nl> + { <nl> + if ( ! stream_cancelled ) <nl> + { <nl> + LOG_DEBUG ( log , " Sending RabbitMQ heartbeat " ) ; <nl> + connection - > heartbeat ( ) ; <nl> + heartbeat_task - > scheduleAfter ( RESCHEDULE_MS * 10 ) ; <nl> + } <nl> + } <nl> + <nl> + <nl> Pipes StorageRabbitMQ : : read ( <nl> const Names & column_names , <nl> const StorageMetadataPtr & metadata_snapshot , <nl> void StorageRabbitMQ : : startup ( ) <nl> } <nl> } <nl> <nl> - task - > activateAndSchedule ( ) ; <nl> + streaming_task - > activateAndSchedule ( ) ; <nl> + heartbeat_task - > activateAndSchedule ( ) ; <nl> } <nl> <nl> <nl> void StorageRabbitMQ : : shutdown ( ) <nl> popReadBuffer ( ) ; <nl> } <nl> <nl> - connection . close ( ) ; <nl> - task - > deactivate ( ) ; <nl> + streaming_task - > deactivate ( ) ; <nl> + heartbeat_task - > deactivate ( ) ; <nl> + <nl> + connection - > close ( ) ; <nl> } <nl> <nl> <nl> ConsumerBufferPtr StorageRabbitMQ : : createReadBuffer ( ) <nl> next_channel_id + = num_queues ; <nl> update_channel_id = true ; <nl> <nl> - ChannelPtr consumer_channel = std : : make_shared < AMQP : : TcpChannel > ( & connection ) ; <nl> + ChannelPtr consumer_channel = std : : make_shared < AMQP : : TcpChannel > ( connection . get ( ) ) ; <nl> <nl> - return std : : make_shared < ReadBufferFromRabbitMQConsumer > ( consumer_channel , eventHandler , exchange_name , routing_keys , <nl> - next_channel_id , log , row_delimiter , bind_by_id , num_queues , exchange_type , local_exchange_name , stream_cancelled ) ; <nl> + return std : : make_shared < ReadBufferFromRabbitMQConsumer > ( <nl> + consumer_channel , * event_handler , exchange_name , routing_keys , <nl> + next_channel_id , log , row_delimiter , bind_by_id , num_queues , <nl> + exchange_type , local_exchange_name , stream_cancelled ) ; <nl> } <nl> <nl> <nl> ProducerBufferPtr StorageRabbitMQ : : createWriteBuffer ( ) <nl> { <nl> - return std : : make_shared < WriteBufferToRabbitMQProducer > ( parsed_address , login_password , routing_keys [ 0 ] , local_exchange_name , <nl> - log , num_consumers * num_queues , bind_by_id , use_transactional_channel , <nl> - row_delimiter ? std : : optional < char > { row_delimiter } : std : : nullopt , 1 , 1024 ) ; <nl> + return std : : make_shared < WriteBufferToRabbitMQProducer > ( <nl> + parsed_address , login_password , routing_keys [ 0 ] , local_exchange_name , <nl> + log , num_consumers * num_queues , bind_by_id , use_transactional_channel , <nl> + row_delimiter ? std : : optional < char > { row_delimiter } : std : : nullopt , 1 , 1024 ) ; <nl> } <nl> <nl> <nl> void StorageRabbitMQ : : threadFunc ( ) <nl> <nl> / / / Wait for attached views <nl> if ( ! stream_cancelled ) <nl> - task - > activateAndSchedule ( ) ; <nl> + streaming_task - > schedule ( ) ; <nl> } <nl> <nl> <nl> mmm a / src / Storages / RabbitMQ / StorageRabbitMQ . h <nl> ppp b / src / Storages / RabbitMQ / StorageRabbitMQ . h <nl> <nl> # include < atomic > <nl> # include < Storages / RabbitMQ / Buffer_fwd . h > <nl> # include < Storages / RabbitMQ / RabbitMQHandler . h > <nl> - # include < event2 / event . h > <nl> + # include < amqpcpp / libuv . h > <nl> + # include < uv . h > <nl> <nl> <nl> namespace DB <nl> class StorageRabbitMQ final : public ext : : shared_ptr_helper < StorageRabbitMQ > , pub <nl> const String & getFormatName ( ) const { return format_name ; } <nl> NamesAndTypesList getVirtuals ( ) const override ; <nl> <nl> - const void pingConnection ( ) { connection . heartbeat ( ) ; } <nl> <nl> protected : <nl> StorageRabbitMQ ( <nl> class StorageRabbitMQ final : public ext : : shared_ptr_helper < StorageRabbitMQ > , pub <nl> std : : pair < String , UInt16 > parsed_address ; <nl> std : : pair < String , String > login_password ; <nl> <nl> - event_base * evbase ; <nl> - RabbitMQHandler eventHandler ; <nl> - AMQP : : TcpConnection connection ; / / / Connection for all consumers <nl> + uv_loop_t * loop ; <nl> + std : : unique_ptr < RabbitMQHandler > event_handler ; <nl> + std : : unique_ptr < AMQP : : TcpConnection > connection ; / / / Connection for all consumers <nl> <nl> Poco : : Semaphore semaphore ; <nl> std : : mutex mutex ; <nl> class StorageRabbitMQ final : public ext : : shared_ptr_helper < StorageRabbitMQ > , pub <nl> size_t next_channel_id = 1 ; / / / Must > = 1 because it is used as a binding key , which has to be > 0 <nl> bool update_channel_id = false ; <nl> <nl> - BackgroundSchedulePool : : TaskHolder task ; <nl> + BackgroundSchedulePool : : TaskHolder streaming_task ; <nl> + BackgroundSchedulePool : : TaskHolder heartbeat_task ; <nl> std : : atomic < bool > stream_cancelled { false } ; <nl> <nl> ConsumerBufferPtr createReadBuffer ( ) ; <nl> <nl> void threadFunc ( ) ; <nl> + void heartbeatFunc ( ) ; <nl> + <nl> + void pingConnection ( ) { connection - > heartbeat ( ) ; } <nl> bool streamToViews ( ) ; <nl> bool checkDependencies ( const StorageID & table_id ) ; <nl> } ; <nl> mmm a / src / Storages / RabbitMQ / WriteBufferToRabbitMQProducer . cpp <nl> ppp b / src / Storages / RabbitMQ / WriteBufferToRabbitMQProducer . cpp <nl> <nl> # include " Columns / ColumnsNumber . h " <nl> # include < common / logger_useful . h > <nl> # include < amqpcpp . h > <nl> + # include < uv . h > <nl> # include < chrono > <nl> # include < thread > <nl> # include < atomic > <nl> WriteBufferToRabbitMQProducer : : WriteBufferToRabbitMQProducer ( <nl> , delim ( delimiter ) <nl> , max_rows ( rows_per_message ) <nl> , chunk_size ( chunk_size_ ) <nl> - , producerEvbase ( event_base_new ( ) ) <nl> - , eventHandler ( producerEvbase , log ) <nl> - , connection ( & eventHandler , AMQP : : Address ( parsed_address . first , parsed_address . second , <nl> - AMQP : : Login ( login_password . first , login_password . second ) , " / " ) ) <nl> { <nl> + <nl> + loop = new uv_loop_t ; <nl> + uv_loop_init ( loop ) ; <nl> + <nl> + event_handler = std : : make_unique < RabbitMQHandler > ( loop , log ) ; <nl> + connection = std : : make_unique < AMQP : : TcpConnection > ( event_handler . get ( ) , AMQP : : Address ( parsed_address . first , parsed_address . second , AMQP : : Login ( login_password . first , login_password . second ) , " / " ) ) ; <nl> + <nl> / * The reason behind making a separate connection for each concurrent producer is explained here : <nl> * https : / / github . com / CopernicaMarketingSoftware / AMQP - CPP / issues / 128 # issuecomment - 300780086 - publishing from <nl> * different threads ( as outputStreams are asynchronous ) with the same connection leads to internal library errors . <nl> * / <nl> size_t cnt_retries = 0 ; <nl> - while ( ! connection . ready ( ) & & + + cnt_retries ! = Loop_retries_max ) <nl> + while ( ! connection - > ready ( ) & & + + cnt_retries ! = Loop_retries_max ) <nl> { <nl> - event_base_loop ( producerEvbase , EVLOOP_NONBLOCK | EVLOOP_ONCE ) ; <nl> + uv_run ( loop , UV_RUN_NOWAIT ) ; <nl> std : : this_thread : : sleep_for ( std : : chrono : : milliseconds ( Connection_setup_sleep ) ) ; <nl> } <nl> <nl> - if ( ! connection . ready ( ) ) <nl> + if ( ! connection - > ready ( ) ) <nl> { <nl> LOG_ERROR ( log , " Cannot set up connection for producer ! " ) ; <nl> } <nl> <nl> - producer_channel = std : : make_shared < AMQP : : TcpChannel > ( & connection ) ; <nl> + producer_channel = std : : make_shared < AMQP : : TcpChannel > ( connection . get ( ) ) ; <nl> checkExchange ( ) ; <nl> <nl> / / / If publishing should be wrapped in transactions <nl> WriteBufferToRabbitMQProducer : : WriteBufferToRabbitMQProducer ( <nl> WriteBufferToRabbitMQProducer : : ~ WriteBufferToRabbitMQProducer ( ) <nl> { <nl> finilizeProducer ( ) ; <nl> - connection . close ( ) ; <nl> + connection - > close ( ) ; <nl> + event_handler - > stop ( ) ; <nl> + <nl> assert ( rows = = 0 & & chunks . empty ( ) ) ; <nl> } <nl> <nl> void WriteBufferToRabbitMQProducer : : nextImpl ( ) <nl> <nl> void WriteBufferToRabbitMQProducer : : startEventLoop ( ) <nl> { <nl> - eventHandler . startProducerLoop ( ) ; <nl> + event_handler - > startProducerLoop ( ) ; <nl> } <nl> <nl> } <nl> mmm a / src / Storages / RabbitMQ / WriteBufferToRabbitMQProducer . h <nl> ppp b / src / Storages / RabbitMQ / WriteBufferToRabbitMQProducer . h <nl> class WriteBufferToRabbitMQProducer : public WriteBuffer <nl> const size_t num_queues ; <nl> const bool use_transactional_channel ; <nl> <nl> - event_base * producerEvbase ; <nl> - RabbitMQHandler eventHandler ; <nl> - AMQP : : TcpConnection connection ; <nl> + uv_loop_t * loop ; <nl> + std : : unique_ptr < RabbitMQHandler > event_handler ; <nl> + std : : unique_ptr < AMQP : : TcpConnection > connection ; <nl> ProducerPtr producer_channel ; <nl> <nl> size_t next_queue = 0 ; <nl> mmm a / tests / integration / test_storage_rabbitmq / test . py <nl> ppp b / tests / integration / test_storage_rabbitmq / test . py <nl> def produce ( ) : <nl> while True : <nl> result = instance . query ( ' SELECT count ( ) FROM test . view ' ) <nl> time . sleep ( 1 ) <nl> + print ( " Result " , result , " Expected " , messages_num * threads_num ) <nl> if int ( result ) = = messages_num * threads_num : <nl> break <nl> <nl> def test_rabbitmq_sharding_between_channels_and_queues_publish ( rabbitmq_cluster ) <nl> DROP TABLE IF EXISTS test . consumer ; <nl> CREATE TABLE test . view ( key UInt64 , value UInt64 ) <nl> ENGINE = MergeTree <nl> - ORDER BY key ; <nl> + ORDER BY key <nl> + SETTINGS old_parts_lifetime = 5 , cleanup_delay_period = 2 , cleanup_delay_period_random_add = 3 ; <nl> CREATE MATERIALIZED VIEW test . consumer TO test . view AS <nl> SELECT * FROM test . rabbitmq ; <nl> ' ' ' ) <nl> def test_rabbitmq_headers_exchange ( rabbitmq_cluster ) : <nl> cluster . start ( ) <nl> raw_input ( " Cluster created , press any key to destroy . . . " ) <nl> cluster . shutdown ( ) <nl> - <nl>
|
Trying to do everything on top of libuv , add heartbeats
|
ClickHouse/ClickHouse
|
addee61bcb6179bf5807f3437980589b604d298a
|
2020-06-24T21:14:49Z
|
mmm a / src / ui / graphics . cpp <nl> ppp b / src / ui / graphics . cpp <nl> void Graphics : : fillRect ( ui : : Color color , const gfx : : Rect & rc ) <nl> m_dy + rc . y + rc . h - 1 , to_system ( color ) ) ; <nl> } <nl> <nl> + void Graphics : : fillRegion ( ui : : Color color , const gfx : : Region & rgn ) <nl> + { <nl> + for ( gfx : : Region : : iterator it = rgn . begin ( ) , end = rgn . end ( ) ; it ! = end ; + + it ) <nl> + fillRect ( color , * it ) ; <nl> + } <nl> + <nl> void Graphics : : drawBitmap ( BITMAP * sprite , int x , int y ) <nl> { <nl> draw_sprite ( m_bmp , sprite , m_dx + x , m_dy + y ) ; <nl> mmm a / src / ui / graphics . h <nl> ppp b / src / ui / graphics . h <nl> <nl> struct BITMAP ; <nl> struct FONT ; <nl> <nl> + namespace gfx { <nl> + class Region ; <nl> + } <nl> + <nl> namespace ui { <nl> <nl> / / Class to render a widget in the screen . <nl> namespace ui { <nl> <nl> void drawRect ( ui : : Color color , const gfx : : Rect & rc ) ; <nl> void fillRect ( ui : : Color color , const gfx : : Rect & rc ) ; <nl> + void fillRegion ( ui : : Color color , const gfx : : Region & rgn ) ; <nl> <nl> void drawBitmap ( BITMAP * sprite , int x , int y ) ; <nl> void drawAlphaBitmap ( BITMAP * sprite , int x , int y ) ; <nl>
|
Add ui : : Graphics : : fillRegion ( )
|
aseprite/aseprite
|
9b2f5399e9f23d8d6c0dfb7d6ef2f17e473817ab
|
2014-02-06T23:01:32Z
|
mmm a / src / core / lib / surface / completion_queue . c <nl> ppp b / src / core / lib / surface / completion_queue . c <nl> int grpc_cq_event_timeout_trace ; <nl> gpr_free ( _ev ) ; \ <nl> } <nl> <nl> - <nl> static void on_pollset_shutdown_done ( grpc_exec_ctx * exec_ctx , void * cc , <nl> bool success ) ; <nl> <nl>
|
More formatting fixes
|
grpc/grpc
|
05998dc6939bb7ad4230775bb5ac87696ae9e29b
|
2016-06-16T17:16:44Z
|
mmm a / src / chainparams . cpp <nl> ppp b / src / chainparams . cpp <nl> static const Checkpoints : : CCheckpointData dataRegtest = { <nl> class CMainParams : public CChainParams { <nl> public : <nl> CMainParams ( ) { <nl> - networkID = CBaseChainParams : : MAIN ; <nl> strNetworkID = " main " ; <nl> / * * <nl> * The message start string is designed to be unlikely to occur in normal data . <nl> static CMainParams mainParams ; <nl> class CTestNetParams : public CMainParams { <nl> public : <nl> CTestNetParams ( ) { <nl> - networkID = CBaseChainParams : : TESTNET ; <nl> strNetworkID = " test " ; <nl> pchMessageStart [ 0 ] = 0x0b ; <nl> pchMessageStart [ 1 ] = 0x11 ; <nl> static CTestNetParams testNetParams ; <nl> class CRegTestParams : public CTestNetParams { <nl> public : <nl> CRegTestParams ( ) { <nl> - networkID = CBaseChainParams : : REGTEST ; <nl> strNetworkID = " regtest " ; <nl> pchMessageStart [ 0 ] = 0xfa ; <nl> pchMessageStart [ 1 ] = 0xbf ; <nl> static CRegTestParams regTestParams ; <nl> class CUnitTestParams : public CMainParams , public CModifiableParams { <nl> public : <nl> CUnitTestParams ( ) { <nl> - networkID = CBaseChainParams : : UNITTEST ; <nl> strNetworkID = " unittest " ; <nl> nDefaultPort = 18445 ; <nl> vFixedSeeds . clear ( ) ; / / ! Unit test mode doesn ' t have any fixed seeds . <nl> mmm a / src / chainparams . h <nl> ppp b / src / chainparams . h <nl> class CChainParams <nl> int nMinerThreads ; <nl> std : : vector < CDNSSeedData > vSeeds ; <nl> std : : vector < unsigned char > base58Prefixes [ MAX_BASE58_TYPES ] ; <nl> - CBaseChainParams : : Network networkID ; <nl> std : : string strNetworkID ; <nl> CBlock genesis ; <nl> std : : vector < CAddress > vFixedSeeds ; <nl> mmm a / src / chainparamsbase . cpp <nl> ppp b / src / chainparamsbase . cpp <nl> class CBaseMainParams : public CBaseChainParams <nl> public : <nl> CBaseMainParams ( ) <nl> { <nl> - networkID = CBaseChainParams : : MAIN ; <nl> nRPCPort = 8332 ; <nl> } <nl> } ; <nl> class CBaseTestNetParams : public CBaseMainParams <nl> public : <nl> CBaseTestNetParams ( ) <nl> { <nl> - networkID = CBaseChainParams : : TESTNET ; <nl> nRPCPort = 18332 ; <nl> strDataDir = " testnet3 " ; <nl> } <nl> class CBaseRegTestParams : public CBaseTestNetParams <nl> public : <nl> CBaseRegTestParams ( ) <nl> { <nl> - networkID = CBaseChainParams : : REGTEST ; <nl> strDataDir = " regtest " ; <nl> } <nl> } ; <nl> class CBaseUnitTestParams : public CBaseMainParams <nl> public : <nl> CBaseUnitTestParams ( ) <nl> { <nl> - networkID = CBaseChainParams : : UNITTEST ; <nl> strDataDir = " unittest " ; <nl> } <nl> } ; <nl> mmm a / src / chainparamsbase . h <nl> ppp b / src / chainparamsbase . h <nl> class CBaseChainParams <nl> <nl> int nRPCPort ; <nl> std : : string strDataDir ; <nl> - Network networkID ; <nl> } ; <nl> <nl> / * * <nl>
|
Remove unused chainparam networkID
|
bitcoin/bitcoin
|
eb0d34b494e36af01d4636c69e6570943fb30f1c
|
2014-12-11T22:32:30Z
|
mmm a / dok / random . dok <nl> ppp b / dok / random . dok <nl> the given ' ' mean ' ' and standard deviation ' ' stdv ' ' . <nl> Returns a random integer number according to a geometric distribution <nl> ' ' p ( i ) = ( 1 - p ) * p ^ ( i - 1 ) ' ' . ' ' p ' ' must satisfy ' ' 0 < p < 1 ' ' . <nl> <nl> - = = = = [ number ] bernouilli ( [ p ] ) = = = = <nl> + = = = = [ number ] bernoulli ( [ p ] ) = = = = <nl> { { anchor : torch . bernoulli } } <nl> <nl> Returns ' ' 1 ' ' with probability ' ' p ' ' and ' ' 0 ' ' with probability ' ' 1 - p ' ' . ' ' p ' ' must satisfy ' ' 0 < p < 1 ' ' . <nl>
|
Fixed doc typo .
|
pytorch/pytorch
|
7bd8b981246a2e2fba10a315da12d07746c98a22
|
2012-11-19T19:03:15Z
|
mmm a / lib / renderer / init . js <nl> ppp b / lib / renderer / init . js <nl> if ( location . protocol = = = ' chrome - devtools : ' ) { <nl> } <nl> } <nl> <nl> - if ( nodeIntegration = = = ' true ' | | nodeIntegration = = = ' all ' | | nodeIntegration = = = ' except - iframe ' | | nodeIntegration = = = ' manual - enable - iframe ' ) { <nl> + if ( nodeIntegration = = = ' true ' ) { <nl> / / Export node bindings to global . <nl> global . require = require ; <nl> global . module = module ; <nl>
|
Only check for nodeIntegration being true
|
electron/electron
|
f033f259b4dda91679be0221933a49c011db1f50
|
2016-03-31T15:33:38Z
|
mmm a / xbmc / GUIInfoManager . cpp <nl> ppp b / xbmc / GUIInfoManager . cpp <nl> CStdString CGUIInfoManager : : GetVideoLabel ( int item ) <nl> StringUtils : : EmptyString : <nl> g_localizeStrings . Get ( 19055 ) ; / / no information available <nl> } <nl> + if ( m_currentFile - > HasPVRRecordingInfoTag ( ) & & ! m_currentFile - > GetPVRRecordingInfoTag ( ) - > m_strTitle . IsEmpty ( ) ) <nl> + return m_currentFile - > GetPVRRecordingInfoTag ( ) - > m_strTitle ; <nl> if ( m_currentFile - > HasVideoInfoTag ( ) & & ! m_currentFile - > GetVideoInfoTag ( ) - > m_strTitle . IsEmpty ( ) ) <nl> return m_currentFile - > GetVideoInfoTag ( ) - > m_strTitle ; <nl> / / don ' t have the title , so use dvdplayer , label , or drop down to title from path <nl>
|
Merge pull request from fetzerch / bugfix - pvr - recordingtitle
|
xbmc/xbmc
|
714e94a6adcf1546730517600ec3bfe7e20a8f60
|
2012-09-27T22:45:02Z
|
mmm a / 3rdParty / fuerte / src / H1Connection . cpp <nl> ppp b / 3rdParty / fuerte / src / H1Connection . cpp <nl> template < SocketType ST > <nl> void H1Connection < ST > : : asyncReadCallback ( asio_ns : : error_code const & ec ) { <nl> this - > _reading = false ; <nl> / / Do not cancel timeout now , because we might be going on to read ! <nl> - if ( ec ) { <nl> + if ( ec | | _item = = nullptr ) { <nl> this - > _proto . timer . cancel ( ) ; <nl> <nl> FUERTE_LOG_DEBUG < < " asyncReadCallback : Error while reading from socket : ' " <nl>
|
fix for BTS - 67 ( )
|
arangodb/arangodb
|
1a0b5d920c7fb086563fc9b0f6b93feaf6d1a6a5
|
2020-05-25T08:40:18Z
|
mmm a / Telegram / SourceFiles / storage / storage_media_prepare . cpp <nl> ppp b / Telegram / SourceFiles / storage / storage_media_prepare . cpp <nl> bool PrepareAlbumMediaIsWaiting ( <nl> if ( const auto image = base : : get_if < Image > ( <nl> & file . information - > media ) ) { <nl> if ( ValidPhotoForAlbum ( * image ) ) { <nl> - file . preview = image - > data . scaledToWidth ( <nl> + file . preview = Images : : prepareOpaque ( image - > data . scaledToWidth ( <nl> std : : min ( previewWidth , convertScale ( image - > data . width ( ) ) ) <nl> * cIntRetinaFactor ( ) , <nl> - Qt : : SmoothTransformation ) ; <nl> + Qt : : SmoothTransformation ) ) ; <nl> file . preview . setDevicePixelRatio ( cRetinaFactor ( ) ) ; <nl> file . type = PreparedFile : : AlbumType : : Photo ; <nl> } <nl> } else if ( const auto video = base : : get_if < Video > ( <nl> & file . information - > media ) ) { <nl> if ( ValidVideoForAlbum ( * video ) ) { <nl> - auto blurred = Images : : prepareBlur ( video - > thumbnail ) ; <nl> + auto blurred = Images : : prepareBlur ( Images : : prepareOpaque ( video - > thumbnail ) ) ; <nl> file . preview = std : : move ( blurred ) . scaledToWidth ( <nl> previewWidth * cIntRetinaFactor ( ) , <nl> Qt : : SmoothTransformation ) ; <nl>
|
Fix glitches for transparent album preview parts .
|
telegramdesktop/tdesktop
|
8ef9ec05678cc5564ca91ff934edde01d9bd90a3
|
2017-12-30T22:28:21Z
|
mmm a / hphp / test / config . hdf <nl> ppp b / hphp / test / config . hdf <nl> Eval { <nl> AllowHhas = true <nl> EnableHipHopSyntax = true <nl> EnableObjDestructCall = true <nl> + JitASize = 10485760 # 10 MB <nl> + JitAStubsSize = 10485760 # 10 MB <nl> + JitGlobalDataSize = 2097152 # 2 MB <nl> } <nl> <nl> MySQL { <nl>
|
change amount of memory tests can use
|
facebook/hhvm
|
bcefd15d4e96c357187b0bd81d80f7a59dbf5319
|
2013-06-07T21:24:34Z
|
mmm a / torch / csrc / jit / ir . h <nl> ppp b / torch / csrc / jit / ir . h <nl> friend struct Node ; <nl> / / having corner cases where the list is empty . <nl> Node * const output_ ; <nl> <nl> - / / Indicate whether the results of nodes ( ) are in topological order . <nl> - bool topological_ ; <nl> - <nl> public : <nl> Graph ( ) <nl> : next_unique_ ( 0 ) <nl> , new_node_stage_ ( 0 ) <nl> - , output_ ( initOutput ( create ( kReturn ) ) ) <nl> - , topological_ ( true ) { } <nl> + , output_ ( initOutput ( create ( kReturn ) ) ) { } <nl> <nl> const param_list & inputs ( ) { <nl> return inputs_ ; <nl> friend struct Node ; <nl> size_t stage ( ) const { <nl> return new_node_stage_ ; <nl> } <nl> - void setTopological ( bool topological ) { <nl> - topological_ = topological ; <nl> - } <nl> - bool topological ( ) const { <nl> - return topological_ ; <nl> - } <nl> ResourceGuard setStageTemporary ( size_t s ) { <nl> auto prev_stage = new_node_stage_ ; <nl> new_node_stage_ = s ; <nl> mmm a / torch / csrc / jit / passes / common_subexpression_elimination . cpp <nl> ppp b / torch / csrc / jit / passes / common_subexpression_elimination . cpp <nl> namespace torch { namespace jit { <nl> bool attributesEqualCSE ( const Node * lhs , const Node * rhs ) { <nl> JIT_ASSERT ( lhs ! = nullptr ) ; <nl> JIT_ASSERT ( rhs ! = nullptr ) ; <nl> - if ( lhs - > hasAttributes ( ) & & rhs - > hasAttributes ( ) ) return true ; <nl> - if ( lhs - > hasAttributes ( ) | | rhs - > hasAttributes ( ) ) return false ; <nl> + / / One has attributes , the other does not . <nl> + if ( lhs - > hasAttributes ( ) ! = rhs - > hasAttributes ( ) ) return false ; <nl> + / / Neither has attributes . <nl> + if ( ! lhs - > hasAttributes ( ) & & ! rhs - > hasAttributes ( ) ) return true ; <nl> <nl> auto lnames = lhs - > attributeNames ( ) ; <nl> auto rnames = rhs - > attributeNames ( ) ; <nl> bool attributesEqualCSE ( const Node * lhs , const Node * rhs ) { <nl> Node * l = const_cast < Node * > ( lhs ) ; <nl> Node * r = const_cast < Node * > ( rhs ) ; <nl> for ( auto name : lnames ) { <nl> + if ( l - > kindOf ( name ) ! = r - > kindOf ( name ) ) return false ; <nl> switch ( l - > kindOf ( name ) ) { <nl> case AttributeKind : : f : <nl> { <nl> struct EqualNodeCSE { <nl> } <nl> } ; <nl> <nl> - / / If the nodes are visited in topological order , one pass is enough . <nl> + / / The function implements common subexpression elimination . <nl> + / / Since the nodes are visited in topological order , one pass is enough . <nl> void EliminateCommonSubexpression ( std : : shared_ptr < Graph > & graph ) { <nl> - / / Keep iterating until reach the fixed point . <nl> - bool topological = graph - > topological ( ) ; <nl> - bool reach_fixed = false ; <nl> - while ( ! reach_fixed ) { <nl> - reach_fixed = true ; <nl> - auto nodes = graph - > nodes ( ) ; <nl> - std : : unordered_set < Node * , HashNodeCSE , EqualNodeCSE > subexprs ; <nl> - for ( auto it = nodes . begin ( ) ; it ! = nodes . end ( ) ; + + it ) { <nl> - auto node = * it ; <nl> - if ( node - > kind ( ) ! = kAdd <nl> - & & node - > kind ( ) ! = kMul <nl> - & & node - > kind ( ) ! = kNeg <nl> - & & node - > kind ( ) ! = kSigmoid <nl> - & & node - > kind ( ) ! = kTanh <nl> - & & node - > kind ( ) ! = kSplit <nl> - & & node - > kind ( ) ! = kAddConstant <nl> - ) { <nl> - / / TODO support more kinds of nodes . <nl> - / / Only support CSE on these nodes . <nl> - continue ; <nl> - } <nl> + auto nodes = graph - > nodes ( ) ; <nl> + std : : unordered_set < Node * , HashNodeCSE , EqualNodeCSE > subexprs ; <nl> + for ( auto it = nodes . begin ( ) ; it ! = nodes . end ( ) ; + + it ) { <nl> + auto node = * it ; <nl> + if ( node - > kind ( ) ! = kAdd <nl> + & & node - > kind ( ) ! = kMul <nl> + & & node - > kind ( ) ! = kNeg <nl> + & & node - > kind ( ) ! = kSigmoid <nl> + & & node - > kind ( ) ! = kTanh <nl> + & & node - > kind ( ) ! = kSplit <nl> + & & node - > kind ( ) ! = kAddConstant <nl> + ) { <nl> + / / TODO support more kinds of nodes . <nl> + / / Only support CSE on these nodes . <nl> + continue ; <nl> + } <nl> <nl> - / / Check whether the same subexpression already exists . <nl> - auto subit = subexprs . find ( node ) ; <nl> - if ( subit = = subexprs . end ( ) ) { <nl> - / / If not put current node into the map <nl> - subexprs . insert ( node ) ; <nl> - } else { <nl> - / / Subexpression exists , replace the uses of node , and destroy it . <nl> - auto existing = * subit ; <nl> - JIT_ASSERT ( existing ! = node ) ; <nl> - const use_list & uses = node - > uses ( ) ; <nl> - const use_list & reuses = existing - > uses ( ) ; <nl> - if ( node - > hasMultipleOutputs ( ) ) { <nl> - / / For Multi - Output nodes , all its uses should be Select nodes . <nl> - JIT_ASSERT ( uses . size ( ) = = reuses . size ( ) ) ; <nl> - / / Replace the uses of Select nodes . <nl> - for ( size_t i = 0 ; i < uses . size ( ) ; + + i ) { <nl> - JIT_ASSERT ( uses [ i ] . user - > kind ( ) = = kSelect ) ; <nl> - JIT_ASSERT ( reuses [ i ] . user - > kind ( ) = = kSelect ) ; <nl> - uses [ i ] . user - > replaceAllUsesWith ( reuses [ i ] . user ) ; <nl> - } <nl> - / / Destroy Select nodes . <nl> - while ( uses . size ( ) > 0 ) { <nl> - uses [ 0 ] . user - > destroy ( ) ; <nl> - } <nl> - } else { <nl> - node - > replaceAllUsesWith ( existing ) ; <nl> + / / Check whether the same subexpression already exists . <nl> + auto subit = subexprs . find ( node ) ; <nl> + if ( subit = = subexprs . end ( ) ) { <nl> + / / If not put current node into the map <nl> + subexprs . insert ( node ) ; <nl> + } else { <nl> + / / Subexpression exists , replace the uses of node , and destroy it . <nl> + auto existing = * subit ; <nl> + JIT_ASSERT ( existing ! = node ) ; <nl> + const use_list & uses = node - > uses ( ) ; <nl> + const use_list & reuses = existing - > uses ( ) ; <nl> + if ( node - > hasMultipleOutputs ( ) ) { <nl> + / / For Multi - Output nodes , all its uses should be Select nodes . <nl> + JIT_ASSERT ( uses . size ( ) = = reuses . size ( ) ) ; <nl> + / / Replace the uses of Select nodes . <nl> + for ( size_t i = 0 ; i < uses . size ( ) ; + + i ) { <nl> + JIT_ASSERT ( uses [ i ] . user - > kind ( ) = = kSelect ) ; <nl> + JIT_ASSERT ( reuses [ i ] . user - > kind ( ) = = kSelect ) ; <nl> + uses [ i ] . user - > replaceAllUsesWith ( reuses [ i ] . user ) ; <nl> } <nl> - / / Destroy the node . <nl> - it . destroyCurrent ( ) ; <nl> - reach_fixed = false ; <nl> + / / Destroy Select nodes . <nl> + while ( uses . size ( ) > 0 ) { <nl> + uses [ 0 ] . user - > destroy ( ) ; <nl> + } <nl> + } else { <nl> + node - > replaceAllUsesWith ( existing ) ; <nl> } <nl> + / / Destroy the node . <nl> + it . destroyCurrent ( ) ; <nl> } <nl> - if ( topological ) break ; <nl> } <nl> } <nl> <nl>
|
Fix some bugs , and assume graph is always visited in topological order .
|
pytorch/pytorch
|
0566a4c0261f39baf2573a07ff517c28889d4fbc
|
2017-09-22T21:06:27Z
|
mmm a / modules / planning / scenarios / scenario_manager . cc <nl> ppp b / modules / planning / scenarios / scenario_manager . cc <nl> void ScenarioManager : : UpdatePlanningContext ( <nl> <nl> / / TrafficLight scenario <nl> UpdatePlanningContextTrafficLightScenario ( frame , scenario_type ) ; <nl> + <nl> + / / PullOver scenario <nl> + UpdatePlanningContextPullOverScenario ( frame , scenario_type ) ; <nl> } <nl> <nl> / / update : bare_intersection status in PlanningContext <nl> void ScenarioManager : : UpdatePlanningContextTrafficLightScenario ( <nl> } <nl> } <nl> <nl> + <nl> + / / update : pull_over status in PlanningContext <nl> + void ScenarioManager : : UpdatePlanningContextPullOverScenario ( <nl> + const Frame & frame , const ScenarioConfig : : ScenarioType & scenario_type ) { <nl> + if ( scenario_type ! = ScenarioConfig : : PULL_OVER ) { <nl> + PlanningContext : : Instance ( ) <nl> + - > mutable_planning_status ( ) <nl> + - > mutable_pull_over ( ) <nl> + - > Clear ( ) ; <nl> + return ; <nl> + } <nl> + } <nl> + <nl> } / / namespace scenario <nl> } / / namespace planning <nl> } / / namespace apollo <nl> mmm a / modules / planning / scenarios / scenario_manager . h <nl> ppp b / modules / planning / scenarios / scenario_manager . h <nl> class ScenarioManager final { <nl> void UpdatePlanningContextTrafficLightScenario ( <nl> const Frame & frame , const ScenarioConfig : : ScenarioType & scenario_type ) ; <nl> <nl> + void UpdatePlanningContextPullOverScenario ( <nl> + const Frame & frame , const ScenarioConfig : : ScenarioType & scenario_type ) ; <nl> + <nl> private : <nl> std : : unordered_map < ScenarioConfig : : ScenarioType , ScenarioConfig , <nl> std : : hash < int > > <nl>
|
Planning : cleanup pull - over status in PlanningContext as needed
|
ApolloAuto/apollo
|
c6d04f209e55c4d500937b0c07d0e72ad13bb26f
|
2019-05-24T01:43:54Z
|
mmm a / README . md <nl> ppp b / README . md <nl> <nl> <nl> | | * * Swift * * | * * Package * * | <nl> | mmm | : mmm : | : mmm : | <nl> - | * * macOS * * | [ ! [ Build Status ] ( https : / / ci . swift . org / job / oss - swift - incremental - RA - osx / badge / icon ) ] ( https : / / ci . swift . org / job / oss - swift - incremental - RA - osx ) | [ ! [ Build Status ] ( https : / / ci . swift . org / job / oss - swift - package - osx / badge / icon ) ] ( https : / / ci . swift . org / job / oss - swift - package - osx ) | <nl> - | * * Ubuntu 14 . 04 * * | [ ! [ Build Status ] ( https : / / ci . swift . org / job / oss - swift - incremental - RA - linux - ubuntu - 14_04 / badge / icon ) ] ( https : / / ci . swift . org / job / oss - swift - incremental - RA - linux - ubuntu - 14_04 ) | [ ! [ Build Status ] ( https : / / ci . swift . org / job / oss - swift - package - linux - ubuntu - 14_04 / badge / icon ) ] ( https : / / ci . swift . org / job / oss - swift - package - linux - ubuntu - 14_04 ) | <nl> - | * * Ubuntu 16 . 04 * * | [ ! [ Build Status ] ( https : / / ci . swift . org / job / oss - swift - incremental - RA - linux - ubuntu - 16_04 / badge / icon ) ] ( https : / / ci . swift . org / job / oss - swift - incremental - RA - linux - ubuntu - 16_04 ) | [ ! [ Build Status ] ( https : / / ci . swift . org / job / oss - swift - package - linux - ubuntu - 16_04 / badge / icon ) ] ( https : / / ci . swift . org / job / oss - swift - package - linux - ubuntu - 16_04 ) | <nl> - | * * Ubuntu 16 . 10 * * | [ ! [ Build Status ] ( https : / / ci . swift . org / job / oss - swift - incremental - RA - linux - ubuntu - 16_10 / badge / icon ) ] ( https : / / ci . swift . org / job / oss - swift - incremental - RA - linux - ubuntu - 16_10 ) | [ ! [ Build Status ] ( https : / / ci . swift . org / job / oss - swift - package - linux - ubuntu - 16_10 / badge / icon ) ] ( https : / / ci . swift . org / job / oss - swift - package - linux - ubuntu - 16_10 ) | <nl> + | * * macOS * * | [ ! [ Build Status ] ( https : / / ci . swift . org / job / oss - swift - incremental - RA - osx / lastCompletedBuild / badge / icon ) ] ( https : / / ci . swift . org / job / oss - swift - incremental - RA - osx ) | [ ! [ Build Status ] ( https : / / ci . swift . org / job / oss - swift - package - osx / lastCompletedBuild / badge / icon ) ] ( https : / / ci . swift . org / job / oss - swift - package - osx ) | <nl> + | * * Ubuntu 14 . 04 * * | [ ! [ Build Status ] ( https : / / ci . swift . org / job / oss - swift - incremental - RA - linux - ubuntu - 14_04 / lastCompletedBuild / badge / icon ) ] ( https : / / ci . swift . org / job / oss - swift - incremental - RA - linux - ubuntu - 14_04 ) | [ ! [ Build Status ] ( https : / / ci . swift . org / job / oss - swift - package - linux - ubuntu - 14_04 / lastCompletedBuild / badge / icon ) ] ( https : / / ci . swift . org / job / oss - swift - package - linux - ubuntu - 14_04 ) | <nl> + | * * Ubuntu 16 . 04 * * | [ ! [ Build Status ] ( https : / / ci . swift . org / job / oss - swift - incremental - RA - linux - ubuntu - 16_04 / lastCompletedBuild / badge / icon ) ] ( https : / / ci . swift . org / job / oss - swift - incremental - RA - linux - ubuntu - 16_04 ) | [ ! [ Build Status ] ( https : / / ci . swift . org / job / oss - swift - package - linux - ubuntu - 16_04 / lastCompletedBuild / badge / icon ) ] ( https : / / ci . swift . org / job / oss - swift - package - linux - ubuntu - 16_04 ) | <nl> + | * * Ubuntu 16 . 10 * * | [ ! [ Build Status ] ( https : / / ci . swift . org / job / oss - swift - incremental - RA - linux - ubuntu - 16_10 / lastCompletedBuild / badge / icon ) ] ( https : / / ci . swift . org / job / oss - swift - incremental - RA - linux - ubuntu - 16_10 ) | [ ! [ Build Status ] ( https : / / ci . swift . org / job / oss - swift - package - linux - ubuntu - 16_10 / lastCompletedBuild / badge / icon ) ] ( https : / / ci . swift . org / job / oss - swift - package - linux - ubuntu - 16_10 ) | <nl> <nl> * * Welcome to Swift ! * * <nl> <nl>
|
[ README ] Update the CI badge to use last completed build
|
apple/swift
|
264b4babd4b3b4495cd8348d56ba6c30b8b8ad52
|
2018-05-02T22:47:02Z
|
mmm a / hphp / hack / src / decl / shallow_decl . ml <nl> ppp b / hphp / hack / src / decl / shallow_decl . ml <nl> let make_xhp_attr cv = Option . map cv . cv_xhp_attr ( fun xai - > { <nl> <nl> let prop env cv = <nl> let cv_pos = fst cv . cv_id in <nl> - let ty = Option . map cv . cv_type ~ f : begin fun ty ' - > <nl> - if Option . is_some cv . cv_xhp_attr <nl> - then <nl> - ( * If this is an XHP attribute and we ' re in strict mode , <nl> - relax to partial mode to allow the use of the " array " <nl> - annotation without specifying type parameters . Until <nl> - recently HHVM did not allow " array " with type parameters <nl> - in XHP attribute declarations , so this is a temporary <nl> - hack to support existing code for now . * ) <nl> - ( * Task # 5815945 : Get rid of this Hack * ) <nl> - let env = <nl> - if FileInfo . is_strict ( Decl_env . mode env ) <nl> - then { env with Decl_env . mode = FileInfo . Mpartial } <nl> - else env <nl> - in <nl> - Decl_hint . hint env ty ' <nl> - else Decl_hint . hint env ty ' <nl> - end in <nl> + let ty = Option . map cv . cv_type ~ f : ( Decl_hint . hint env ) in <nl> let const = Attrs . mem SN . UserAttributes . uaConst cv . cv_user_attributes in <nl> let lateinit = Attrs . mem2 <nl> SN . UserAttributes . uaLateInit SN . UserAttributes . uaSoftLateInit <nl> mmm a / hphp / hack / src / typing / nastCheck . ml <nl> ppp b / hphp / hack / src / typing / nastCheck . ml <nl> and typeconst ( env , _ ) tconst = <nl> maybe hint env tconst . c_tconst_type ; <nl> maybe hint env tconst . c_tconst_constraint ; <nl> and class_var env cv = <nl> - let hint_env = <nl> - ( * If this is an XHP attribute and we ' re in strict mode , <nl> - relax to partial mode to allow the use of generic <nl> - classes without specifying type parameters . This is <nl> - a temporary hack to support existing code for now . * ) <nl> - ( * Task # 5815945 : Get rid of this Hack * ) <nl> - if Option . is_some cv . cv_xhp_attr & & ( Typing_env . is_strict env . tenv ) <nl> - then { env with tenv = Typing_env . set_mode env . tenv FileInfo . Mpartial } <nl> - else env in <nl> - maybe hint hint_env cv . cv_type ; <nl> + maybe hint env cv . cv_type ; <nl> maybe expr env cv . cv_expr ; <nl> ( ) <nl> <nl> mmm a / hphp / hack / src / typing / typing . ml <nl> ppp b / hphp / hack / src / typing / typing . ml <nl> and class_var_def ~ is_static env cv = <nl> | None - > <nl> env , None <nl> | Some ( p , _ as cty ) - > <nl> - let orig_mode = Env . get_mode env in <nl> - let env = <nl> - ( * If this is an XHP attribute and we ' re in strict mode , <nl> - relax to partial mode to allow the use of the " array " <nl> - annotation without specifying type parameters . Until <nl> - recently HHVM did not allow " array " with type parameters <nl> - in XHP attribute declarations , so this is a temporary <nl> - hack to support existing code for now . * ) <nl> - ( * Task # 5815945 : Get rid of this Hack * ) <nl> - if Option . is_some cv . cv_xhp_attr & & ( Env . is_strict env ) <nl> - then Env . set_mode env FileInfo . Mpartial <nl> - else env in <nl> let decl_cty = Decl_hint . hint env . Env . decl_env cty in <nl> - let env = Env . set_mode env orig_mode in <nl> let env , cty = Phase . localize_with_self env decl_cty in <nl> env , Some ( ExpectedTy . make_and_allow_coercion p Reason . URhint cty ( Some decl_cty ) ) in <nl> ( * Next check the expression , passing in expected type if present * ) <nl> mmm a / hphp / hack / test / typecheck / xhp_attr_1 . php <nl> ppp b / hphp / hack / test / typecheck / xhp_attr_1 . php <nl> class : foo { <nl> attribute <nl> / / Using array without type parameters is okay for now <nl> array bar - baz = array ( ) , <nl> - / / Using GenericClass without type parameters is okay for now <nl> + / / Using GenericClass without type parameters is disallowed in strict mode <nl> / * HH_FIXME [ 4101 ] * / <nl> GenericClass yo @ required , <nl> / / Check to make sure that " - > : " parses correctly when chained <nl> mmm a / hphp / hack / test / typecheck / xhp_attr_1 . php . exp <nl> ppp b / hphp / hack / test / typecheck / xhp_attr_1 . php . exp <nl> @ @ - 1 + 1 , 2 @ @ <nl> - No errors <nl> + File " xhp_attr_1 . php " , line 12 , characters 5 - 9 : <nl> + You cannot have an array without generics in strict mode ( Typing [ 4045 ] ) <nl>
|
Remove horrible XHP attribute file mode hack
|
facebook/hhvm
|
894889c6108fbccb146234d56731e9ac913adc60
|
2019-07-24T07:33:43Z
|
mmm a / third_party / mlir / include / mlir / Parser . h <nl> ppp b / third_party / mlir / include / mlir / Parser . h <nl> class StringRef ; <nl> <nl> namespace mlir { <nl> class Location ; <nl> - class ModuleOp ; <nl> class MLIRContext ; <nl> + class OwningModuleRef ; <nl> class Type ; <nl> <nl> / / / This parses the file specified by the indicated SourceMgr and returns an <nl> / / / MLIR module if it was valid . If not , the error message is emitted through <nl> / / / the error handler registered in the context , and a null pointer is returned . <nl> - ModuleOp parseSourceFile ( const llvm : : SourceMgr & sourceMgr , <nl> - MLIRContext * context ) ; <nl> + OwningModuleRef parseSourceFile ( const llvm : : SourceMgr & sourceMgr , <nl> + MLIRContext * context ) ; <nl> <nl> / / / This parses the file specified by the indicated filename and returns an <nl> / / / MLIR module if it was valid . If not , the error message is emitted through <nl> / / / the error handler registered in the context , and a null pointer is returned . <nl> - ModuleOp parseSourceFile ( llvm : : StringRef filename , MLIRContext * context ) ; <nl> + OwningModuleRef parseSourceFile ( llvm : : StringRef filename , MLIRContext * context ) ; <nl> <nl> / / / This parses the file specified by the indicated filename using the provided <nl> / / / SourceMgr and returns an MLIR module if it was valid . If not , the error <nl> / / / message is emitted through the error handler registered in the context , and <nl> / / / a null pointer is returned . <nl> - ModuleOp parseSourceFile ( llvm : : StringRef filename , llvm : : SourceMgr & sourceMgr , <nl> - MLIRContext * context ) ; <nl> + OwningModuleRef parseSourceFile ( llvm : : StringRef filename , <nl> + llvm : : SourceMgr & sourceMgr , <nl> + MLIRContext * context ) ; <nl> <nl> / / / This parses the module string to a MLIR module if it was valid . If not , the <nl> / / / error message is emitted through the error handler registered in the <nl> / / / context , and a null pointer is returned . <nl> - ModuleOp parseSourceString ( llvm : : StringRef moduleStr , MLIRContext * context ) ; <nl> + OwningModuleRef parseSourceString ( llvm : : StringRef moduleStr , <nl> + MLIRContext * context ) ; <nl> <nl> / / / This parses a single MLIR type to an MLIR context if it was valid . If not , <nl> / / / an error message is emitted through a new SourceMgrDiagnosticHandler <nl> mmm a / third_party / mlir / lib / Parser / Parser . cpp <nl> ppp b / third_party / mlir / lib / Parser / Parser . cpp <nl> ParseResult ModuleParser : : parseModule ( ModuleOp module ) { <nl> / / / This parses the file specified by the indicated SourceMgr and returns an <nl> / / / MLIR module if it was valid . If not , it emits diagnostics and returns <nl> / / / null . <nl> - ModuleOp mlir : : parseSourceFile ( const llvm : : SourceMgr & sourceMgr , <nl> - MLIRContext * context ) { <nl> + OwningModuleRef mlir : : parseSourceFile ( const llvm : : SourceMgr & sourceMgr , <nl> + MLIRContext * context ) { <nl> auto sourceBuf = sourceMgr . getMemoryBuffer ( sourceMgr . getMainFileID ( ) ) ; <nl> <nl> / / This is the result module we are parsing into . <nl> ModuleOp mlir : : parseSourceFile ( const llvm : : SourceMgr & sourceMgr , <nl> if ( failed ( verify ( * module ) ) ) <nl> return nullptr ; <nl> <nl> - return module . release ( ) ; <nl> + return module ; <nl> } <nl> <nl> / / / This parses the file specified by the indicated filename and returns an <nl> / / / MLIR module if it was valid . If not , the error message is emitted through <nl> / / / the error handler registered in the context , and a null pointer is returned . <nl> - ModuleOp mlir : : parseSourceFile ( StringRef filename , MLIRContext * context ) { <nl> + OwningModuleRef mlir : : parseSourceFile ( StringRef filename , <nl> + MLIRContext * context ) { <nl> llvm : : SourceMgr sourceMgr ; <nl> return parseSourceFile ( filename , sourceMgr , context ) ; <nl> } <nl> ModuleOp mlir : : parseSourceFile ( StringRef filename , MLIRContext * context ) { <nl> / / / SourceMgr and returns an MLIR module if it was valid . If not , the error <nl> / / / message is emitted through the error handler registered in the context , and <nl> / / / a null pointer is returned . <nl> - ModuleOp mlir : : parseSourceFile ( StringRef filename , llvm : : SourceMgr & sourceMgr , <nl> - MLIRContext * context ) { <nl> + OwningModuleRef mlir : : parseSourceFile ( StringRef filename , <nl> + llvm : : SourceMgr & sourceMgr , <nl> + MLIRContext * context ) { <nl> if ( sourceMgr . getNumBuffers ( ) ! = 0 ) { <nl> / / TODO ( b / 136086478 ) : Extend to support multiple buffers . <nl> emitError ( mlir : : UnknownLoc : : get ( context ) , <nl> ModuleOp mlir : : parseSourceFile ( StringRef filename , llvm : : SourceMgr & sourceMgr , <nl> <nl> / / / This parses the program string to a MLIR module if it was valid . If not , <nl> / / / it emits diagnostics and returns null . <nl> - ModuleOp mlir : : parseSourceString ( StringRef moduleStr , MLIRContext * context ) { <nl> + OwningModuleRef mlir : : parseSourceString ( StringRef moduleStr , <nl> + MLIRContext * context ) { <nl> auto memBuffer = MemoryBuffer : : getMemBuffer ( moduleStr ) ; <nl> if ( ! memBuffer ) <nl> return nullptr ; <nl>
|
Change the parseSource * methods to return OwningModuleRef instead of ModuleOp .
|
tensorflow/tensorflow
|
78f69d1059ced7f16341bc13da54159a89955859
|
2019-08-30T05:41:24Z
|
mmm a / docs / ABI / Mangling . rst <nl> ppp b / docs / ABI / Mangling . rst <nl> Globals <nl> global : : = type ' We ' / / Outlined Consume Function Type <nl> global : : = type ' Wr ' / / Outlined Retain Function Type <nl> global : : = type ' Ws ' / / Outlined Release Function Type <nl> + global : : = type ' Wb ' / / Outlined InitializeWithTake Function Type <nl> + global : : = type ' Wc ' / / Outlined InitializeWithCopy Function Type <nl> + global : : = type ' Wd ' / / Outlined AssignWithTake Function Type <nl> + global : : = type ' Wf ' / / Outlined AssignWithCopy Function Type <nl> <nl> assoc_type_path : : = identifier ' _ ' identifier * <nl> <nl> mmm a / include / swift / Demangling / DemangleNodes . def <nl> ppp b / include / swift / Demangling / DemangleNodes . def <nl> NODE ( OutlinedCopy ) <nl> NODE ( OutlinedConsume ) <nl> NODE ( OutlinedRetain ) <nl> NODE ( OutlinedRelease ) <nl> + NODE ( OutlinedInitializeWithTake ) <nl> + NODE ( OutlinedInitializeWithCopy ) <nl> + NODE ( OutlinedAssignWithTake ) <nl> + NODE ( OutlinedAssignWithCopy ) <nl> NODE ( OutlinedVariable ) <nl> NODE ( AssocTypePath ) <nl> # undef CONTEXT_NODE <nl> mmm a / include / swift / Serialization / ModuleFormat . h <nl> ppp b / include / swift / Serialization / ModuleFormat . h <nl> const uint16_t VERSION_MAJOR = 0 ; <nl> / / / in source control , you should also update the comment to briefly <nl> / / / describe what change you made . The content of this comment isn ' t important ; <nl> / / / it just ensures a conflict if two people change the module format . <nl> - const uint16_t VERSION_MINOR = 375 ; / / Last change : added enum witness <nl> + const uint16_t VERSION_MINOR = 376 ; / / Last change : Outlined CopyAddr <nl> <nl> using DeclID = PointerEmbeddedInt < unsigned , 31 > ; <nl> using DeclIDField = BCFixed < 31 > ; <nl> mmm a / lib / Demangling / Demangler . cpp <nl> ppp b / lib / Demangling / Demangler . cpp <nl> NodePointer Demangler : : demangleWitness ( ) { <nl> return createWithChild ( Node : : Kind : : OutlinedRelease , <nl> popNode ( Node : : Kind : : Type ) ) ; <nl> } <nl> + case ' b ' : { <nl> + return createWithChild ( Node : : Kind : : OutlinedInitializeWithTake , <nl> + popNode ( Node : : Kind : : Type ) ) ; <nl> + } <nl> + case ' c ' : { <nl> + return createWithChild ( Node : : Kind : : OutlinedInitializeWithCopy , <nl> + popNode ( Node : : Kind : : Type ) ) ; <nl> + } <nl> + case ' d ' : { <nl> + return createWithChild ( Node : : Kind : : OutlinedAssignWithTake , <nl> + popNode ( Node : : Kind : : Type ) ) ; <nl> + } <nl> + case ' f ' : { <nl> + return createWithChild ( Node : : Kind : : OutlinedAssignWithCopy , <nl> + popNode ( Node : : Kind : : Type ) ) ; <nl> + } <nl> + <nl> default : <nl> return nullptr ; <nl> } <nl> mmm a / lib / Demangling / NodePrinter . cpp <nl> ppp b / lib / Demangling / NodePrinter . cpp <nl> class NodePrinter { <nl> case Node : : Kind : : OutlinedConsume : <nl> case Node : : Kind : : OutlinedRetain : <nl> case Node : : Kind : : OutlinedRelease : <nl> + case Node : : Kind : : OutlinedInitializeWithTake : <nl> + case Node : : Kind : : OutlinedInitializeWithCopy : <nl> + case Node : : Kind : : OutlinedAssignWithTake : <nl> + case Node : : Kind : : OutlinedAssignWithCopy : <nl> case Node : : Kind : : OutlinedVariable : <nl> case Node : : Kind : : AssocTypePath : <nl> return false ; <nl> NodePointer NodePrinter : : print ( NodePointer Node , bool asPrefixContext ) { <nl> Printer < < " outlined release of " ; <nl> print ( Node - > getChild ( 0 ) ) ; <nl> return nullptr ; <nl> + case Node : : Kind : : OutlinedInitializeWithTake : <nl> + Printer < < " outlined init with take of " ; <nl> + print ( Node - > getChild ( 0 ) ) ; <nl> + return nullptr ; <nl> + case Node : : Kind : : OutlinedInitializeWithCopy : <nl> + Printer < < " outlined init with copy of " ; <nl> + print ( Node - > getChild ( 0 ) ) ; <nl> + return nullptr ; <nl> + case Node : : Kind : : OutlinedAssignWithTake : <nl> + Printer < < " outlined assign with take of " ; <nl> + print ( Node - > getChild ( 0 ) ) ; <nl> + return nullptr ; <nl> + case Node : : Kind : : OutlinedAssignWithCopy : <nl> + Printer < < " outlined assign with copy of " ; <nl> + print ( Node - > getChild ( 0 ) ) ; <nl> + return nullptr ; <nl> case Node : : Kind : : OutlinedVariable : <nl> Printer < < " outlined variable # " < < Node - > getIndex ( ) < < " of " ; <nl> return nullptr ; <nl> mmm a / lib / Demangling / OldRemangler . cpp <nl> ppp b / lib / Demangling / OldRemangler . cpp <nl> void Remangler : : mangleOutlinedRelease ( Node * node ) { <nl> mangleSingleChildNode ( node ) ; <nl> } <nl> <nl> + void Remangler : : mangleOutlinedInitializeWithTake ( Node * node ) { <nl> + Out < < " Wb " ; <nl> + mangleSingleChildNode ( node ) ; <nl> + } <nl> + <nl> + void Remangler : : mangleOutlinedInitializeWithCopy ( Node * node ) { <nl> + Out < < " Wc " ; <nl> + mangleSingleChildNode ( node ) ; <nl> + } <nl> + <nl> + void Remangler : : mangleOutlinedAssignWithTake ( Node * node ) { <nl> + Out < < " Wd " ; <nl> + mangleSingleChildNode ( node ) ; <nl> + } <nl> + <nl> + void Remangler : : mangleOutlinedAssignWithCopy ( Node * node ) { <nl> + Out < < " Wf " ; <nl> + mangleSingleChildNode ( node ) ; <nl> + } <nl> + <nl> void Remangler : : mangleOutlinedVariable ( Node * node ) { <nl> Out < < " Tv " < < node - > getIndex ( ) ; <nl> mangleSingleChildNode ( node ) ; <nl> mmm a / lib / Demangling / Remangler . cpp <nl> ppp b / lib / Demangling / Remangler . cpp <nl> void Remangler : : mangleOutlinedRelease ( Node * node ) { <nl> Buffer < < " Ws " ; <nl> } <nl> <nl> + void Remangler : : mangleOutlinedInitializeWithTake ( Node * node ) { <nl> + mangleSingleChildNode ( node ) ; <nl> + Buffer < < " Wb " ; <nl> + } <nl> + <nl> + void Remangler : : mangleOutlinedInitializeWithCopy ( Node * node ) { <nl> + mangleSingleChildNode ( node ) ; <nl> + Buffer < < " Wc " ; <nl> + } <nl> + <nl> + void Remangler : : mangleOutlinedAssignWithTake ( Node * node ) { <nl> + mangleSingleChildNode ( node ) ; <nl> + Buffer < < " Wd " ; <nl> + } <nl> + <nl> + void Remangler : : mangleOutlinedAssignWithCopy ( Node * node ) { <nl> + mangleSingleChildNode ( node ) ; <nl> + Buffer < < " Wf " ; <nl> + } <nl> + <nl> void Remangler : : mangleOutlinedVariable ( Node * node ) { <nl> Buffer < < " Tv " ; <nl> mangleIndex ( node - > getIndex ( ) ) ; <nl> mmm a / lib / IRGen / GenDecl . cpp <nl> ppp b / lib / IRGen / GenDecl . cpp <nl> <nl> # include " swift / AST / Decl . h " <nl> # include " swift / AST / DiagnosticEngine . h " <nl> # include " swift / AST / DiagnosticsIRGen . h " <nl> + # include " swift / AST / GenericEnvironment . h " <nl> # include " swift / AST / GenericSignature . h " <nl> # include " swift / AST / IRGenOptions . h " <nl> # include " swift / AST / Module . h " <nl> <nl> # include " clang / AST / GlobalDecl . h " <nl> # include " llvm / ADT / SmallString . h " <nl> # include " llvm / IR / GlobalAlias . h " <nl> + # include " llvm / IR / InlineAsm . h " <nl> # include " llvm / IR / Module . h " <nl> # include " llvm / IR / TypeBuilder . h " <nl> # include " llvm / IR / Value . h " <nl> - # include " llvm / IR / InlineAsm . h " <nl> # include " llvm / Support / Compiler . h " <nl> # include " llvm / Support / ConvertUTF . h " <nl> # include " llvm / Support / Path . h " <nl> llvm : : Constant * IRGenModule : : getOrCreateRetainFunction ( const TypeInfo & objectTI , <nl> return getOrCreateHelperFunction ( <nl> funcName , llvmType , argTys , <nl> [ & ] ( IRGenFunction & IGF ) { <nl> + IGF . setInOutlinedFunction ( ) ; <nl> auto it = IGF . CurFn - > arg_begin ( ) ; <nl> Address addr ( & * it + + , loadableTI - > getFixedAlignment ( ) ) ; <nl> Explosion loaded ; <nl> IRGenModule : : getOrCreateReleaseFunction ( const TypeInfo & objectTI , Type t , <nl> return getOrCreateHelperFunction ( <nl> funcName , llvmType , argTys , <nl> [ & ] ( IRGenFunction & IGF ) { <nl> + IGF . setInOutlinedFunction ( ) ; <nl> auto it = IGF . CurFn - > arg_begin ( ) ; <nl> Address addr ( & * it + + , loadableTI - > getFixedAlignment ( ) ) ; <nl> Explosion loaded ; <nl> IRGenModule : : getOrCreateReleaseFunction ( const TypeInfo & objectTI , Type t , <nl> } , <nl> true / * setIsNoInline * / ) ; <nl> } <nl> + <nl> + void IRGenModule : : generateCallToOutlinedCopyAddr ( <nl> + IRGenFunction & IGF , const TypeInfo & objectTI , Address dest , Address src , <nl> + SILType T , const OutlinedCopyAddrFunction MethodToCall ) { <nl> + llvm : : Type * llvmType = dest - > getType ( ) ; <nl> + auto * outlinedF = ( this - > * MethodToCall ) ( objectTI , llvmType , T ) ; <nl> + llvm : : Value * args [ ] = { src . getAddress ( ) , dest . getAddress ( ) } ; <nl> + llvm : : CallInst * call = IGF . Builder . CreateCall ( outlinedF , args ) ; <nl> + call - > setCallingConv ( DefaultCC ) ; <nl> + } <nl> + <nl> + llvm : : Constant * IRGenModule : : getOrCreateOutlinedCopyAddrHelperFunction ( <nl> + const TypeInfo & objectTI , llvm : : Type * llvmType , SILType addrTy , <nl> + std : : string funcName , <nl> + llvm : : function_ref < void ( const TypeInfo & objectTI , IRGenFunction & IGF , <nl> + Address dest , Address src , SILType T ) > <nl> + Generate ) { <nl> + llvm : : Type * argTys [ ] = { llvmType , llvmType } ; <nl> + return getOrCreateHelperFunction ( <nl> + funcName , llvmType , argTys , <nl> + [ & ] ( IRGenFunction & IGF ) { <nl> + IGF . setInOutlinedFunction ( ) ; <nl> + auto it = IGF . CurFn - > arg_begin ( ) ; <nl> + Address src ( & * it + + , objectTI . getBestKnownAlignment ( ) ) ; <nl> + Address dest ( & * it + + , objectTI . getBestKnownAlignment ( ) ) ; <nl> + Generate ( objectTI , IGF , dest , src , addrTy ) ; <nl> + IGF . Builder . CreateRet ( dest . getAddress ( ) ) ; <nl> + } , <nl> + true / * setIsNoInline * / ) ; <nl> + } <nl> + <nl> + llvm : : Constant * IRGenModule : : getOrCreateOutlinedInitializeWithTakeFunction ( <nl> + const TypeInfo & objectTI , llvm : : Type * llvmType , SILType addrTy ) { <nl> + IRGenMangler mangler ; <nl> + CanType canType = addrTy . getObjectType ( ) . getSwiftRValueType ( ) ; <nl> + std : : string funcName = <nl> + mangler . mangleOutlinedInitializeWithTakeFunction ( canType ) ; <nl> + auto GenFunc = [ this ] ( const TypeInfo & objectTI , IRGenFunction & IGF , <nl> + Address dest , Address src , SILType T ) { <nl> + objectTI . initializeWithTake ( IGF , dest , src , T ) ; <nl> + } ; <nl> + return getOrCreateOutlinedCopyAddrHelperFunction ( objectTI , llvmType , addrTy , <nl> + funcName , GenFunc ) ; <nl> + } <nl> + <nl> + llvm : : Constant * IRGenModule : : getOrCreateOutlinedInitializeWithCopyFunction ( <nl> + const TypeInfo & objectTI , llvm : : Type * llvmType , SILType addrTy ) { <nl> + IRGenMangler mangler ; <nl> + CanType canType = addrTy . getObjectType ( ) . getSwiftRValueType ( ) ; <nl> + std : : string funcName = <nl> + mangler . mangleOutlinedInitializeWithCopyFunction ( canType ) ; <nl> + auto GenFunc = [ this ] ( const TypeInfo & objectTI , IRGenFunction & IGF , <nl> + Address dest , Address src , SILType T ) { <nl> + objectTI . initializeWithCopy ( IGF , dest , src , T ) ; <nl> + } ; <nl> + return getOrCreateOutlinedCopyAddrHelperFunction ( objectTI , llvmType , addrTy , <nl> + funcName , GenFunc ) ; <nl> + } <nl> + <nl> + llvm : : Constant * IRGenModule : : getOrCreateOutlinedAssignWithTakeFunction ( <nl> + const TypeInfo & objectTI , llvm : : Type * llvmType , SILType addrTy ) { <nl> + IRGenMangler mangler ; <nl> + CanType canType = addrTy . getObjectType ( ) . getSwiftRValueType ( ) ; <nl> + std : : string funcName = mangler . mangleOutlinedAssignWithTakeFunction ( canType ) ; <nl> + auto GenFunc = [ this ] ( const TypeInfo & objectTI , IRGenFunction & IGF , <nl> + Address dest , Address src , SILType T ) { <nl> + objectTI . assignWithTake ( IGF , dest , src , T ) ; <nl> + } ; <nl> + return getOrCreateOutlinedCopyAddrHelperFunction ( objectTI , llvmType , addrTy , <nl> + funcName , GenFunc ) ; <nl> + } <nl> + <nl> + llvm : : Constant * IRGenModule : : getOrCreateOutlinedAssignWithCopyFunction ( <nl> + const TypeInfo & objectTI , llvm : : Type * llvmType , SILType addrTy ) { <nl> + IRGenMangler mangler ; <nl> + CanType canType = addrTy . getObjectType ( ) . getSwiftRValueType ( ) ; <nl> + std : : string funcName = mangler . mangleOutlinedAssignWithCopyFunction ( canType ) ; <nl> + auto GenFunc = [ this ] ( const TypeInfo & objectTI , IRGenFunction & IGF , <nl> + Address dest , Address src , SILType T ) { <nl> + objectTI . assignWithCopy ( IGF , dest , src , T ) ; <nl> + } ; <nl> + return getOrCreateOutlinedCopyAddrHelperFunction ( objectTI , llvmType , addrTy , <nl> + funcName , GenFunc ) ; <nl> + } <nl> mmm a / lib / IRGen / GenEnum . cpp <nl> ppp b / lib / IRGen / GenEnum . cpp <nl> namespace { <nl> void assignWithCopy ( IRGenFunction & IGF , Address dest , Address src , <nl> SILType T ) <nl> const override { <nl> - emitIndirectAssign ( IGF , dest , src , T , IsNotTake ) ; <nl> + if ( IGF . isInOutlinedFunction ( ) | | ( TIK < Loadable ) | | <nl> + ( T . hasArchetype ( ) ) ) { <nl> + emitIndirectAssign ( IGF , dest , src , T , IsNotTake ) ; <nl> + } else { <nl> + / / Create an outlined function to avoid explosion <nl> + IGF . IGM . generateCallToOutlinedCopyAddr ( <nl> + IGF , * TI , dest , src , T , <nl> + & IRGenModule : : getOrCreateOutlinedAssignWithCopyFunction ) ; <nl> + } <nl> } <nl> <nl> void assignWithTake ( IRGenFunction & IGF , Address dest , Address src , <nl> SILType T ) <nl> const override { <nl> - emitIndirectAssign ( IGF , dest , src , T , IsTake ) ; <nl> + if ( IGF . isInOutlinedFunction ( ) | | ( TIK < Loadable ) | | <nl> + ( T . hasArchetype ( ) ) ) { <nl> + emitIndirectAssign ( IGF , dest , src , T , IsTake ) ; <nl> + } else { <nl> + / / Create an outlined function to avoid explosion <nl> + IGF . IGM . generateCallToOutlinedCopyAddr ( <nl> + IGF , * TI , dest , src , T , <nl> + & IRGenModule : : getOrCreateOutlinedAssignWithTakeFunction ) ; <nl> + } <nl> } <nl> <nl> void initializeWithCopy ( IRGenFunction & IGF , Address dest , Address src , <nl> SILType T ) <nl> const override { <nl> - emitIndirectInitialize ( IGF , dest , src , T , IsNotTake ) ; <nl> + if ( IGF . isInOutlinedFunction ( ) | | ( TIK < Loadable ) | | <nl> + ( T . hasArchetype ( ) ) ) { <nl> + emitIndirectInitialize ( IGF , dest , src , T , IsNotTake ) ; <nl> + } else { <nl> + / / Create an outlined function to avoid explosion <nl> + IGF . IGM . generateCallToOutlinedCopyAddr ( <nl> + IGF , * TI , dest , src , T , <nl> + & IRGenModule : : getOrCreateOutlinedInitializeWithCopyFunction ) ; <nl> + } <nl> } <nl> <nl> void initializeWithTake ( IRGenFunction & IGF , Address dest , Address src , <nl> SILType T ) <nl> const override { <nl> - emitIndirectInitialize ( IGF , dest , src , T , IsTake ) ; <nl> + if ( IGF . isInOutlinedFunction ( ) | | ( TIK < Loadable ) | | <nl> + ( T . hasArchetype ( ) ) ) { <nl> + emitIndirectInitialize ( IGF , dest , src , T , IsTake ) ; <nl> + } else { <nl> + / / Create an outlined function to avoid explosion <nl> + IGF . IGM . generateCallToOutlinedCopyAddr ( <nl> + IGF , * TI , dest , src , T , <nl> + & IRGenModule : : getOrCreateOutlinedInitializeWithTakeFunction ) ; <nl> + } <nl> } <nl> <nl> void storeTag ( IRGenFunction & IGF , <nl> namespace { <nl> void assignWithCopy ( IRGenFunction & IGF , Address dest , Address src , <nl> SILType T ) <nl> const override { <nl> - emitIndirectAssign ( IGF , dest , src , T , IsNotTake ) ; <nl> + if ( IGF . isInOutlinedFunction ( ) | | ( TIK < Loadable ) | | <nl> + ( T . hasArchetype ( ) ) ) { <nl> + emitIndirectAssign ( IGF , dest , src , T , IsNotTake ) ; <nl> + } else { <nl> + / / Create an outlined function to avoid explosion <nl> + IGF . IGM . generateCallToOutlinedCopyAddr ( <nl> + IGF , * TI , dest , src , T , <nl> + & IRGenModule : : getOrCreateOutlinedAssignWithCopyFunction ) ; <nl> + } <nl> } <nl> <nl> void assignWithTake ( IRGenFunction & IGF , Address dest , Address src , <nl> SILType T ) <nl> const override { <nl> - emitIndirectAssign ( IGF , dest , src , T , IsTake ) ; <nl> + if ( IGF . isInOutlinedFunction ( ) | | ( TIK < Loadable ) | | <nl> + ( T . hasArchetype ( ) ) ) { <nl> + emitIndirectAssign ( IGF , dest , src , T , IsTake ) ; <nl> + } else { <nl> + / / Create an outlined function to avoid explosion <nl> + IGF . IGM . generateCallToOutlinedCopyAddr ( <nl> + IGF , * TI , dest , src , T , <nl> + & IRGenModule : : getOrCreateOutlinedAssignWithTakeFunction ) ; <nl> + } <nl> } <nl> <nl> void initializeWithCopy ( IRGenFunction & IGF , Address dest , Address src , <nl> SILType T ) <nl> const override { <nl> - emitIndirectInitialize ( IGF , dest , src , T , IsNotTake ) ; <nl> + if ( IGF . isInOutlinedFunction ( ) | | ( TIK < Loadable ) | | <nl> + ( T . hasArchetype ( ) ) ) { <nl> + emitIndirectInitialize ( IGF , dest , src , T , IsNotTake ) ; <nl> + } else { <nl> + / / Create an outlined function to avoid explosion <nl> + IGF . IGM . generateCallToOutlinedCopyAddr ( <nl> + IGF , * TI , dest , src , T , <nl> + & IRGenModule : : getOrCreateOutlinedInitializeWithCopyFunction ) ; <nl> + } <nl> } <nl> <nl> void initializeWithTake ( IRGenFunction & IGF , Address dest , Address src , <nl> SILType T ) <nl> const override { <nl> - emitIndirectInitialize ( IGF , dest , src , T , IsTake ) ; <nl> + if ( IGF . isInOutlinedFunction ( ) | | ( TIK < Loadable ) | | <nl> + ( T . hasArchetype ( ) ) ) { <nl> + emitIndirectInitialize ( IGF , dest , src , T , IsTake ) ; <nl> + } else { <nl> + / / Create an outlined function to avoid explosion <nl> + IGF . IGM . generateCallToOutlinedCopyAddr ( <nl> + IGF , * TI , dest , src , T , <nl> + & IRGenModule : : getOrCreateOutlinedInitializeWithTakeFunction ) ; <nl> + } <nl> } <nl> <nl> void destroy ( IRGenFunction & IGF , Address addr , SILType T ) const override { <nl> mmm a / lib / IRGen / GenExistential . cpp <nl> ppp b / lib / IRGen / GenExistential . cpp <nl> class OpaqueExistentialTypeInfo final : <nl> void initializeWithCopy ( IRGenFunction & IGF , <nl> Address dest , Address src , <nl> SILType T ) const override { <nl> - llvm : : Value * metadata = copyType ( IGF , dest , src ) ; <nl> + if ( IGF . isInOutlinedFunction ( ) ) { <nl> + llvm : : Value * metadata = copyType ( IGF , dest , src ) ; <nl> <nl> - auto layout = getLayout ( ) ; <nl> + auto layout = getLayout ( ) ; <nl> <nl> - / / Project down to the buffers and ask the witnesses to do a <nl> - / / copy - initialize . <nl> - Address srcBuffer = layout . projectExistentialBuffer ( IGF , src ) ; <nl> - Address destBuffer = layout . projectExistentialBuffer ( IGF , dest ) ; <nl> - emitInitializeBufferWithCopyOfBufferCall ( IGF , metadata , <nl> - destBuffer , <nl> - srcBuffer ) ; <nl> + / / Project down to the buffers and ask the witnesses to do a <nl> + / / copy - initialize . <nl> + Address srcBuffer = layout . projectExistentialBuffer ( IGF , src ) ; <nl> + Address destBuffer = layout . projectExistentialBuffer ( IGF , dest ) ; <nl> + emitInitializeBufferWithCopyOfBufferCall ( IGF , metadata , destBuffer , <nl> + srcBuffer ) ; <nl> + } else { <nl> + / / Create an outlined function to avoid explosion <nl> + IGF . IGM . generateCallToOutlinedCopyAddr ( <nl> + IGF , * this , dest , src , T , <nl> + & IRGenModule : : getOrCreateOutlinedInitializeWithCopyFunction ) ; <nl> + } <nl> } <nl> <nl> void initializeWithTake ( IRGenFunction & IGF , <nl> Address dest , Address src , <nl> SILType T ) const override { <nl> - llvm : : Value * metadata = copyType ( IGF , dest , src ) ; <nl> + if ( IGF . isInOutlinedFunction ( ) ) { <nl> + llvm : : Value * metadata = copyType ( IGF , dest , src ) ; <nl> <nl> - auto layout = getLayout ( ) ; <nl> + auto layout = getLayout ( ) ; <nl> <nl> - / / Project down to the buffers and ask the witnesses to do a <nl> - / / take - initialize . <nl> - Address srcBuffer = layout . projectExistentialBuffer ( IGF , src ) ; <nl> - Address destBuffer = layout . projectExistentialBuffer ( IGF , dest ) ; <nl> - emitInitializeBufferWithTakeOfBufferCall ( IGF , metadata , <nl> - destBuffer , <nl> - srcBuffer ) ; <nl> + / / Project down to the buffers and ask the witnesses to do a <nl> + / / take - initialize . <nl> + Address srcBuffer = layout . projectExistentialBuffer ( IGF , src ) ; <nl> + Address destBuffer = layout . projectExistentialBuffer ( IGF , dest ) ; <nl> + emitInitializeBufferWithTakeOfBufferCall ( IGF , metadata , destBuffer , <nl> + srcBuffer ) ; <nl> + } else { <nl> + / / Create an outlined function to avoid explosion <nl> + IGF . IGM . generateCallToOutlinedCopyAddr ( <nl> + IGF , * this , dest , src , T , <nl> + & IRGenModule : : getOrCreateOutlinedInitializeWithTakeFunction ) ; <nl> + } <nl> } <nl> <nl> void destroy ( IRGenFunction & IGF , Address addr , SILType T ) const override { <nl> class AddressOnlyClassExistentialTypeInfoBase : <nl> <nl> void assignWithCopy ( IRGenFunction & IGF , Address dest , Address src , <nl> SILType T ) const override { <nl> - Address destValue = projectValue ( IGF , dest ) ; <nl> - Address srcValue = projectValue ( IGF , src ) ; <nl> - asDerived ( ) . emitValueAssignWithCopy ( IGF , destValue , srcValue ) ; <nl> - emitCopyOfTables ( IGF , dest , src ) ; <nl> + if ( IGF . isInOutlinedFunction ( ) ) { <nl> + Address destValue = projectValue ( IGF , dest ) ; <nl> + Address srcValue = projectValue ( IGF , src ) ; <nl> + asDerived ( ) . emitValueAssignWithCopy ( IGF , destValue , srcValue ) ; <nl> + emitCopyOfTables ( IGF , dest , src ) ; <nl> + } else { <nl> + IGF . IGM . generateCallToOutlinedCopyAddr ( <nl> + IGF , * this , dest , src , T , <nl> + & IRGenModule : : getOrCreateOutlinedAssignWithCopyFunction ) ; <nl> + } <nl> } <nl> <nl> void initializeWithCopy ( IRGenFunction & IGF , <nl> Address dest , Address src , <nl> SILType T ) const override { <nl> - Address destValue = projectValue ( IGF , dest ) ; <nl> - Address srcValue = projectValue ( IGF , src ) ; <nl> - asDerived ( ) . emitValueInitializeWithCopy ( IGF , destValue , srcValue ) ; <nl> - emitCopyOfTables ( IGF , dest , src ) ; <nl> + if ( IGF . isInOutlinedFunction ( ) ) { <nl> + Address destValue = projectValue ( IGF , dest ) ; <nl> + Address srcValue = projectValue ( IGF , src ) ; <nl> + asDerived ( ) . emitValueInitializeWithCopy ( IGF , destValue , srcValue ) ; <nl> + emitCopyOfTables ( IGF , dest , src ) ; <nl> + } else { <nl> + IGF . IGM . generateCallToOutlinedCopyAddr ( <nl> + IGF , * this , dest , src , T , <nl> + & IRGenModule : : getOrCreateOutlinedInitializeWithCopyFunction ) ; <nl> + } <nl> } <nl> <nl> void assignWithTake ( IRGenFunction & IGF , <nl> Address dest , Address src , <nl> SILType T ) const override { <nl> - Address destValue = projectValue ( IGF , dest ) ; <nl> - Address srcValue = projectValue ( IGF , src ) ; <nl> - asDerived ( ) . emitValueAssignWithTake ( IGF , destValue , srcValue ) ; <nl> - emitCopyOfTables ( IGF , dest , src ) ; <nl> + if ( IGF . isInOutlinedFunction ( ) ) { <nl> + Address destValue = projectValue ( IGF , dest ) ; <nl> + Address srcValue = projectValue ( IGF , src ) ; <nl> + asDerived ( ) . emitValueAssignWithTake ( IGF , destValue , srcValue ) ; <nl> + emitCopyOfTables ( IGF , dest , src ) ; <nl> + } else { <nl> + IGF . IGM . generateCallToOutlinedCopyAddr ( <nl> + IGF , * this , dest , src , T , <nl> + & IRGenModule : : getOrCreateOutlinedAssignWithTakeFunction ) ; <nl> + } <nl> } <nl> <nl> void initializeWithTake ( IRGenFunction & IGF , <nl> Address dest , Address src , <nl> SILType T ) const override { <nl> - Address destValue = projectValue ( IGF , dest ) ; <nl> - Address srcValue = projectValue ( IGF , src ) ; <nl> - asDerived ( ) . emitValueInitializeWithTake ( IGF , destValue , srcValue ) ; <nl> - emitCopyOfTables ( IGF , dest , src ) ; <nl> + if ( IGF . isInOutlinedFunction ( ) ) { <nl> + Address destValue = projectValue ( IGF , dest ) ; <nl> + Address srcValue = projectValue ( IGF , src ) ; <nl> + asDerived ( ) . emitValueInitializeWithTake ( IGF , destValue , srcValue ) ; <nl> + emitCopyOfTables ( IGF , dest , src ) ; <nl> + } else { <nl> + IGF . IGM . generateCallToOutlinedCopyAddr ( <nl> + IGF , * this , dest , src , T , <nl> + & IRGenModule : : getOrCreateOutlinedInitializeWithTakeFunction ) ; <nl> + } <nl> } <nl> <nl> void destroy ( IRGenFunction & IGF , Address existential , <nl> mmm a / lib / IRGen / GenRecord . h <nl> ppp b / lib / IRGen / GenRecord . h <nl> class RecordTypeInfoImpl : public Base , <nl> <nl> auto offsets = asImpl ( ) . getNonFixedOffsets ( IGF , T ) ; <nl> for ( auto & field : getFields ( ) ) { <nl> - if ( field . isEmpty ( ) ) continue ; <nl> + if ( field . isEmpty ( ) ) <nl> + continue ; <nl> <nl> Address destField = field . projectAddress ( IGF , dest , offsets ) ; <nl> Address srcField = field . projectAddress ( IGF , src , offsets ) ; <nl> mmm a / lib / IRGen / GenType . cpp <nl> ppp b / lib / IRGen / GenType . cpp <nl> void LoadableTypeInfo : : initializeWithCopy ( IRGenFunction & IGF , <nl> } <nl> <nl> / / Otherwise explode and re - implode . <nl> - Explosion copy ; <nl> - loadAsCopy ( IGF , srcAddr , copy ) ; <nl> - initialize ( IGF , copy , destAddr ) ; <nl> + if ( IGF . isInOutlinedFunction ( ) ) { <nl> + Explosion copy ; <nl> + loadAsCopy ( IGF , srcAddr , copy ) ; <nl> + initialize ( IGF , copy , destAddr ) ; <nl> + } else { <nl> + IGF . IGM . generateCallToOutlinedCopyAddr ( <nl> + IGF , * this , destAddr , srcAddr , T , <nl> + & IRGenModule : : getOrCreateOutlinedInitializeWithCopyFunction ) ; <nl> + } <nl> } <nl> <nl> LoadedRef LoadableTypeInfo : : loadRefcountedPtr ( IRGenFunction & IGF , <nl> mmm a / lib / IRGen / IRGenFunction . cpp <nl> ppp b / lib / IRGen / IRGenFunction . cpp <nl> IRGenFunction : : IRGenFunction ( IRGenModule & IGM , llvm : : Function * Fn , <nl> Optional < SILLocation > DbgLoc ) <nl> : IGM ( IGM ) , Builder ( IGM . getLLVMContext ( ) , <nl> IGM . DebugInfo & & ! IGM . Context . LangOpts . DebuggerSupport ) , <nl> - CurFn ( Fn ) , DbgScope ( DbgScope ) { <nl> + CurFn ( Fn ) , DbgScope ( DbgScope ) , inOutlinedFunction ( false ) { <nl> <nl> / / Make sure the instructions in this function are attached its debug scope . <nl> if ( IGM . DebugInfo ) { <nl> Address IRGenFunction : : emitAddressAtOffset ( llvm : : Value * base , Offset offset , <nl> auto slotPtr = emitByteOffsetGEP ( base , offsetValue , objectTy ) ; <nl> return Address ( slotPtr , objectAlignment ) ; <nl> } <nl> + <nl> + bool IRGenFunction : : isInOutlinedFunction ( ) { return inOutlinedFunction ; } <nl> + <nl> + void IRGenFunction : : setInOutlinedFunction ( ) { <nl> + assert ( ! isInOutlinedFunction ( ) & & " Expected inOutlinedFunction to be false " ) ; <nl> + inOutlinedFunction = true ; <nl> + } <nl> mmm a / lib / IRGen / IRGenFunction . h <nl> ppp b / lib / IRGen / IRGenFunction . h <nl> class IRGenFunction { <nl> <nl> llvm : : Value * getLocalSelfMetadata ( ) ; <nl> void setLocalSelfMetadata ( llvm : : Value * value , LocalSelfKind kind ) ; <nl> - <nl> + <nl> + public : <nl> + / / mmm Outlined Function Support mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + public : <nl> + bool isInOutlinedFunction ( ) ; <nl> + void setInOutlinedFunction ( ) ; <nl> + <nl> private : <nl> LocalTypeDataCache & getOrCreateLocalTypeData ( ) ; <nl> void destroyLocalTypeData ( ) ; <nl> class IRGenFunction { <nl> llvm : : Value * LocalSelf = nullptr ; <nl> <nl> LocalSelfKind SelfKind ; <nl> + <nl> + / / / Flag indiacting wherever we are in the middle of creating <nl> + / / / an outlined address type function <nl> + bool inOutlinedFunction ; <nl> } ; <nl> <nl> using ConditionalDominanceScope = IRGenFunction : : ConditionalDominanceScope ; <nl> mmm a / lib / IRGen / IRGenMangler . h <nl> ppp b / lib / IRGen / IRGenMangler . h <nl> class IRGenMangler : public Mangle : : ASTMangler { <nl> return finalize ( ) ; <nl> } <nl> <nl> + std : : string mangleOutlinedInitializeWithTakeFunction ( const Type t ) { <nl> + beginMangling ( ) ; <nl> + appendType ( t ) ; <nl> + appendOperator ( " Wb " ) ; <nl> + return finalize ( ) ; <nl> + } <nl> + std : : string mangleOutlinedInitializeWithCopyFunction ( const Type t ) { <nl> + beginMangling ( ) ; <nl> + appendType ( t ) ; <nl> + appendOperator ( " Wc " ) ; <nl> + return finalize ( ) ; <nl> + } <nl> + std : : string mangleOutlinedAssignWithTakeFunction ( const Type t ) { <nl> + beginMangling ( ) ; <nl> + appendType ( t ) ; <nl> + appendOperator ( " Wd " ) ; <nl> + return finalize ( ) ; <nl> + } <nl> + std : : string mangleOutlinedAssignWithCopyFunction ( const Type t ) { <nl> + beginMangling ( ) ; <nl> + appendType ( t ) ; <nl> + appendOperator ( " Wf " ) ; <nl> + return finalize ( ) ; <nl> + } <nl> + <nl> std : : string manglePartialApplyForwarder ( StringRef FuncName ) ; <nl> <nl> std : : string mangleTypeForMetadata ( Type type ) { <nl> mmm a / lib / IRGen / IRGenModule . h <nl> ppp b / lib / IRGen / IRGenModule . h <nl> class IRGenModule { <nl> llvm : : Constant * getOrCreateReleaseFunction ( const TypeInfo & objectTI , Type t , <nl> llvm : : Type * llvmType ) ; <nl> <nl> + typedef llvm : : Constant * ( IRGenModule : : * OutlinedCopyAddrFunction ) ( <nl> + const TypeInfo & objectTI , llvm : : Type * llvmType , SILType addrTy ) ; <nl> + <nl> + void <nl> + generateCallToOutlinedCopyAddr ( IRGenFunction & IGF , const TypeInfo & objectTI , <nl> + Address dest , Address src , SILType T , <nl> + const OutlinedCopyAddrFunction MethodToCall ) ; <nl> + <nl> + llvm : : Constant * getOrCreateOutlinedInitializeWithTakeFunction ( <nl> + const TypeInfo & objectTI , llvm : : Type * llvmType , SILType addrTy ) ; <nl> + <nl> + llvm : : Constant * getOrCreateOutlinedInitializeWithCopyFunction ( <nl> + const TypeInfo & objectTI , llvm : : Type * llvmType , SILType addrTy ) ; <nl> + <nl> + llvm : : Constant * getOrCreateOutlinedAssignWithTakeFunction ( <nl> + const TypeInfo & objectTI , llvm : : Type * llvmType , SILType addrTy ) ; <nl> + <nl> + llvm : : Constant * getOrCreateOutlinedAssignWithCopyFunction ( <nl> + const TypeInfo & objectTI , llvm : : Type * llvmType , SILType addrTy ) ; <nl> + <nl> private : <nl> llvm : : Constant * getAddrOfClangGlobalDecl ( clang : : GlobalDecl global , <nl> ForDefinition_t forDefinition ) ; <nl> + llvm : : Constant * getOrCreateOutlinedCopyAddrHelperFunction ( <nl> + const TypeInfo & objectTI , llvm : : Type * llvmType , SILType addrTy , <nl> + std : : string funcName , <nl> + llvm : : function_ref < void ( const TypeInfo & objectTI , IRGenFunction & IGF , <nl> + Address dest , Address src , SILType T ) > <nl> + Generate ) ; <nl> <nl> llvm : : DenseMap < LinkEntity , llvm : : Constant * > GlobalVars ; <nl> llvm : : DenseMap < LinkEntity , llvm : : Constant * > GlobalGOTEquivalents ; <nl> mmm a / lib / IRGen / IRGenSIL . cpp <nl> ppp b / lib / IRGen / IRGenSIL . cpp <nl> void IRGenSILFunction : : visitCopyAddrInst ( swift : : CopyAddrInst * i ) { <nl> auto & loweredDest = getLoweredValue ( i - > getDest ( ) ) ; <nl> assert ( ! loweredDest . isUnallocatedAddressInBuffer ( ) ) ; <nl> Address dest = loweredDest . getAnyAddress ( ) ; <nl> - <nl> if ( i - > isInitializationOfDest ( ) ) { <nl> if ( i - > isTakeOfSrc ( ) ) { <nl> addrTI . initializeWithTake ( * this , dest , src , addrTy ) ; <nl> mmm a / test / IRGen / enum_value_semantics_special_cases . sil <nl> ppp b / test / IRGen / enum_value_semantics_special_cases . sil <nl> enum NullableRefcounted { <nl> / / CHECK : entry : <nl> / / CHECK : % 0 = bitcast % swift . opaque * % dest to % T34enum_value_semantics_special_cases18NullableRefcountedO * <nl> / / CHECK : % 1 = bitcast % swift . opaque * % src to % T34enum_value_semantics_special_cases18NullableRefcountedO * <nl> - / / CHECK : % 2 = bitcast % T34enum_value_semantics_special_cases18NullableRefcountedO * % 0 to % swift . refcounted * * <nl> - / / CHECK : % 3 = bitcast % T34enum_value_semantics_special_cases18NullableRefcountedO * % 1 to % swift . refcounted * * <nl> - / / CHECK : % 4 = load % swift . refcounted * , % swift . refcounted * * % 3 , align 8 <nl> - / / CHECK : call % swift . refcounted * @ swift_rt_swift_retain ( % swift . refcounted * returned % 4 ) { { # [ 0 - 9 ] + } } <nl> - / / CHECK : store % swift . refcounted * % 4 , % swift . refcounted * * % 2 , align 8 <nl> - / / CHECK : % 6 = bitcast % T34enum_value_semantics_special_cases18NullableRefcountedO * % 0 to % swift . opaque * <nl> - / / CHECK : ret % swift . opaque * % 6 <nl> + / / CHECK : % 2 = call % T34enum_value_semantics_special_cases18NullableRefcountedO * @ _T034enum_value_semantics_special_cases18NullableRefcountedOWc ( % T34enum_value_semantics_special_cases18NullableRefcountedO * % 1 , % T34enum_value_semantics_special_cases18NullableRefcountedO * % 0 ) <nl> + / / CHECK : % 3 = bitcast % T34enum_value_semantics_special_cases18NullableRefcountedO * % 0 to % swift . opaque * <nl> + / / CHECK : ret % swift . opaque * % 3 <nl> / / CHECK : } <nl> <nl> / / CHECK - LABEL : define linkonce_odr hidden % swift . opaque * @ _T034enum_value_semantics_special_cases18NullableRefcountedOwca ( % swift . opaque * % dest , % swift . opaque * % src , % swift . type * % NullableRefcounted ) { { . * } } { <nl> / / CHECK : entry : <nl> / / CHECK : % 0 = bitcast % swift . opaque * % dest to % T34enum_value_semantics_special_cases18NullableRefcountedO * <nl> / / CHECK : % 1 = bitcast % swift . opaque * % src to % T34enum_value_semantics_special_cases18NullableRefcountedO * <nl> - / / CHECK : % 2 = bitcast % T34enum_value_semantics_special_cases18NullableRefcountedO * % 0 to % swift . refcounted * * <nl> - / / CHECK : % 3 = bitcast % T34enum_value_semantics_special_cases18NullableRefcountedO * % 1 to % swift . refcounted * * <nl> - / / CHECK : % 4 = load % swift . refcounted * , % swift . refcounted * * % 2 , align 8 <nl> - / / CHECK : % 5 = load % swift . refcounted * , % swift . refcounted * * % 3 , align 8 <nl> - / / CHECK : call % swift . refcounted * @ swift_rt_swift_retain ( % swift . refcounted * returned % 5 ) { { # [ 0 - 9 ] + } } <nl> - / / CHECK : store % swift . refcounted * % 5 , % swift . refcounted * * % 2 , align 8 <nl> - / / CHECK : call void @ swift_rt_swift_release ( % swift . refcounted * % 4 ) { { # [ 0 - 9 ] + } } <nl> - / / CHECK : % 7 = bitcast % T34enum_value_semantics_special_cases18NullableRefcountedO * % 0 to % swift . opaque * <nl> - / / CHECK : ret % swift . opaque * % 7 <nl> + / / CHECK : % 2 = call % T34enum_value_semantics_special_cases18NullableRefcountedO * @ _T034enum_value_semantics_special_cases18NullableRefcountedOWf ( % T34enum_value_semantics_special_cases18NullableRefcountedO * % 1 , % T34enum_value_semantics_special_cases18NullableRefcountedO * % 0 ) <nl> + / / CHECK : % 3 = bitcast % T34enum_value_semantics_special_cases18NullableRefcountedO * % 0 to % swift . opaque * <nl> + / / CHECK : ret % swift . opaque * % 3 <nl> / / CHECK : } <nl> <nl> / / CHECK - LABEL : define linkonce_odr hidden % swift . opaque * @ _T034enum_value_semantics_special_cases18NullableRefcountedOwta ( % swift . opaque * noalias % dest , % swift . opaque * noalias % src , % swift . type * % NullableRefcounted ) { { . * } } { <nl> / / CHECK : entry : <nl> / / CHECK : % 0 = bitcast % swift . opaque * % dest to % T34enum_value_semantics_special_cases18NullableRefcountedO * <nl> / / CHECK : % 1 = bitcast % swift . opaque * % src to % T34enum_value_semantics_special_cases18NullableRefcountedO * <nl> - / / CHECK : % 2 = bitcast % T34enum_value_semantics_special_cases18NullableRefcountedO * % 0 to % swift . refcounted * * <nl> - / / CHECK : % 3 = bitcast % T34enum_value_semantics_special_cases18NullableRefcountedO * % 1 to % swift . refcounted * * <nl> - / / CHECK : % 4 = load % swift . refcounted * , % swift . refcounted * * % 2 , align 8 <nl> - / / CHECK : % 5 = load % swift . refcounted * , % swift . refcounted * * % 3 , align 8 <nl> - / / CHECK : store % swift . refcounted * % 5 , % swift . refcounted * * % 2 , align 8 <nl> - / / CHECK : call void @ swift_rt_swift_release ( % swift . refcounted * % 4 ) { { # [ 0 - 9 ] + } } <nl> - / / CHECK : % 6 = bitcast % T34enum_value_semantics_special_cases18NullableRefcountedO * % 0 to % swift . opaque * <nl> - / / CHECK : ret % swift . opaque * % 6 <nl> + / / CHECK : % 2 = call % T34enum_value_semantics_special_cases18NullableRefcountedO * @ _T034enum_value_semantics_special_cases18NullableRefcountedOWd ( % T34enum_value_semantics_special_cases18NullableRefcountedO * % 1 , % T34enum_value_semantics_special_cases18NullableRefcountedO * % 0 ) <nl> + / / CHECK : % 3 = bitcast % T34enum_value_semantics_special_cases18NullableRefcountedO * % 0 to % swift . opaque * <nl> + / / CHECK : ret % swift . opaque * % 3 <nl> / / CHECK : } <nl> <nl> / / Enums consisting of a retainable block pointer and a single empty case use <nl> enum NullableBlockRefcounted { <nl> / / CHECK : entry : <nl> / / CHECK : % 0 = bitcast % swift . opaque * % dest to % T34enum_value_semantics_special_cases23NullableBlockRefcountedO * <nl> / / CHECK : % 1 = bitcast % swift . opaque * % src to % T34enum_value_semantics_special_cases23NullableBlockRefcountedO * <nl> - / / CHECK : % 2 = bitcast % T34enum_value_semantics_special_cases23NullableBlockRefcountedO * % 0 to % objc_block * * <nl> - / / CHECK : % 3 = bitcast % T34enum_value_semantics_special_cases23NullableBlockRefcountedO * % 1 to % objc_block * * <nl> - / / CHECK : % 4 = load % objc_block * , % objc_block * * % 3 , align 8 <nl> - / / CHECK : % 5 = call % objc_block * @ _Block_copy ( % objc_block * % 4 ) <nl> - / / CHECK : store % objc_block * % 4 , % objc_block * * % 2 , align 8 <nl> - / / CHECK : % 6 = bitcast % T34enum_value_semantics_special_cases23NullableBlockRefcountedO * % 0 to % swift . opaque * <nl> - / / CHECK : ret % swift . opaque * % 6 <nl> + / / CHECK : % 2 = call % T34enum_value_semantics_special_cases23NullableBlockRefcountedO * @ _T034enum_value_semantics_special_cases23NullableBlockRefcountedOWc ( % T34enum_value_semantics_special_cases23NullableBlockRefcountedO * % 1 , % T34enum_value_semantics_special_cases23NullableBlockRefcountedO * % 0 ) <nl> + / / CHECK : % 3 = bitcast % T34enum_value_semantics_special_cases23NullableBlockRefcountedO * % 0 to % swift . opaque * <nl> + / / CHECK : ret % swift . opaque * % 3 <nl> / / CHECK : } <nl> <nl> / / CHECK - LABEL : define linkonce_odr hidden % swift . opaque * @ _T034enum_value_semantics_special_cases23NullableBlockRefcountedOwca ( % swift . opaque * % dest , % swift . opaque * % src , % swift . type * % NullableBlockRefcounted ) { { . * } } { <nl> / / CHECK : entry : <nl> / / CHECK : % 0 = bitcast % swift . opaque * % dest to % T34enum_value_semantics_special_cases23NullableBlockRefcountedO * <nl> / / CHECK : % 1 = bitcast % swift . opaque * % src to % T34enum_value_semantics_special_cases23NullableBlockRefcountedO * <nl> - / / CHECK : % 2 = bitcast % T34enum_value_semantics_special_cases23NullableBlockRefcountedO * % 0 to % objc_block * * <nl> - / / CHECK : % 3 = bitcast % T34enum_value_semantics_special_cases23NullableBlockRefcountedO * % 1 to % objc_block * * <nl> - / / CHECK : % 4 = load % objc_block * , % objc_block * * % 2 , align 8 <nl> - / / CHECK : % 5 = load % objc_block * , % objc_block * * % 3 , align 8 <nl> - / / CHECK : % 6 = call % objc_block * @ _Block_copy ( % objc_block * % 5 ) <nl> - / / CHECK : store % objc_block * % 5 , % objc_block * * % 2 , align 8 <nl> - / / CHECK : call void @ _Block_release ( % objc_block * % 4 ) { { # [ 0 - 9 ] + } } <nl> - / / CHECK : % 7 = bitcast % T34enum_value_semantics_special_cases23NullableBlockRefcountedO * % 0 to % swift . opaque * <nl> - / / CHECK : ret % swift . opaque * % 7 <nl> + / / CHECK : % 2 = call % T34enum_value_semantics_special_cases23NullableBlockRefcountedO * @ _T034enum_value_semantics_special_cases23NullableBlockRefcountedOWf ( % T34enum_value_semantics_special_cases23NullableBlockRefcountedO * % 1 , % T34enum_value_semantics_special_cases23NullableBlockRefcountedO * % 0 ) <nl> + / / CHECK : % 3 = bitcast % T34enum_value_semantics_special_cases23NullableBlockRefcountedO * % 0 to % swift . opaque * <nl> + / / CHECK : ret % swift . opaque * % 3 <nl> / / CHECK : } <nl> <nl> / / CHECK - LABEL : define linkonce_odr hidden % swift . opaque * @ _T034enum_value_semantics_special_cases23NullableBlockRefcountedOwta ( % swift . opaque * noalias % dest , % swift . opaque * noalias % src , % swift . type * % NullableBlockRefcounted ) { { . * } } { <nl> / / CHECK : entry : <nl> / / CHECK : % 0 = bitcast % swift . opaque * % dest to % T34enum_value_semantics_special_cases23NullableBlockRefcountedO * <nl> / / CHECK : % 1 = bitcast % swift . opaque * % src to % T34enum_value_semantics_special_cases23NullableBlockRefcountedO * <nl> - / / CHECK : % 2 = bitcast % T34enum_value_semantics_special_cases23NullableBlockRefcountedO * % 0 to % objc_block * * <nl> - / / CHECK : % 3 = bitcast % T34enum_value_semantics_special_cases23NullableBlockRefcountedO * % 1 to % objc_block * * <nl> - / / CHECK : % 4 = load % objc_block * , % objc_block * * % 2 , align 8 <nl> - / / CHECK : % 5 = load % objc_block * , % objc_block * * % 3 , align 8 <nl> - / / CHECK : store % objc_block * % 5 , % objc_block * * % 2 , align 8 <nl> - / / CHECK : call void @ _Block_release ( % objc_block * % 4 ) { { # [ 0 - 9 ] + } } <nl> - / / CHECK : % 6 = bitcast % T34enum_value_semantics_special_cases23NullableBlockRefcountedO * % 0 to % swift . opaque * <nl> - / / CHECK : ret % swift . opaque * % 6 <nl> + / / CHECK : % 2 = call % T34enum_value_semantics_special_cases23NullableBlockRefcountedO * @ _T034enum_value_semantics_special_cases23NullableBlockRefcountedOWd ( % T34enum_value_semantics_special_cases23NullableBlockRefcountedO * % 1 , % T34enum_value_semantics_special_cases23NullableBlockRefcountedO * % 0 ) <nl> + / / CHECK : % 3 = bitcast % T34enum_value_semantics_special_cases23NullableBlockRefcountedO * % 0 to % swift . opaque * <nl> + / / CHECK : ret % swift . opaque * % 3 <nl> / / CHECK : } <nl> <nl> / / With multiple empty cases , the nullable pointer semantics aren ' t used . <nl> enum AllRefcounted { <nl> case None <nl> } <nl> <nl> + / / CHECK - LABEL : define linkonce_odr hidden % T34enum_value_semantics_special_cases13AllRefcountedO * @ _T034enum_value_semantics_special_cases13AllRefcountedOWc ( % T34enum_value_semantics_special_cases13AllRefcountedO * , % T34enum_value_semantics_special_cases13AllRefcountedO * ) <nl> + / / - - 0x3fffffffffffffff <nl> + / / CHECK : % 4 = and i64 % 3 , 4611686018427387903 <nl> + / / CHECK : % 5 = inttoptr i64 % 4 to % swift . refcounted * <nl> + / / CHECK : call % swift . refcounted * @ swift_rt_swift_retain ( % swift . refcounted * returned % 5 ) <nl> + / / CHECK : % 7 = bitcast % T34enum_value_semantics_special_cases13AllRefcountedO * % 1 to i64 * <nl> + / / - - NB : The original loaded value is stored , not the masked one . <nl> + / / CHECK : store i64 % 3 , i64 * % 7 , align 8 <nl> + / / CHECK : } <nl> + <nl> / / CHECK - LABEL : define linkonce_odr hidden void @ _T034enum_value_semantics_special_cases13AllRefcountedOwxx ( % swift . opaque * noalias % object , % swift . type * % AllRefcounted ) { { . * } } { <nl> / / CHECK : entry : <nl> / / CHECK : % 0 = bitcast % swift . opaque * % object to % T34enum_value_semantics_special_cases13AllRefcountedO * <nl> enum AllRefcounted { <nl> / / CHECK : ret void <nl> / / CHECK : } <nl> <nl> - / / CHECK - LABEL : define linkonce_odr hidden % swift . opaque * @ _T034enum_value_semantics_special_cases13AllRefcountedOwcp ( % swift . opaque * noalias % dest , % swift . opaque * noalias % src , % swift . type * % AllRefcounted ) { { . * } } { <nl> - / / CHECK : % 3 = load i64 , i64 * % 2 , align 8 <nl> - / / - - 0x3fffffffffffffff <nl> - / / CHECK : % 4 = and i64 % 3 , 4611686018427387903 <nl> - / / CHECK : % 5 = inttoptr i64 % 4 to % swift . refcounted * <nl> - / / CHECK : call % swift . refcounted * @ swift_rt_swift_retain ( % swift . refcounted * returned % 5 ) <nl> - / / CHECK : % 6 = bitcast % T34enum_value_semantics_special_cases13AllRefcountedO * % 0 to i64 * <nl> - / / - - NB : The original loaded value is stored , not the masked one . <nl> - / / CHECK : store i64 % 3 , i64 * % 6 , align 8 <nl> - / / CHECK : } <nl> - <nl> enum AllRefcountedTwoSimple { <nl> case Ref ( Builtin . NativeObject ) <nl> case CRef ( C ) <nl> mmm a / test / IRGen / existentials . sil <nl> ppp b / test / IRGen / existentials . sil <nl> entry ( % w : $ * @ sil_weak CP ? , % a : $ CP ? ) : <nl> / / CHECK : [ [ DEST_WITNESS : % . * ] ] = load i8 * * , i8 * * * [ [ SRC_WITNESS_ADDR ] ] <nl> % c = load_weak % w : $ * @ sil_weak CP ? <nl> <nl> - / / CHECK : [ [ DEST_REF_ADDR : % . * ] ] = getelementptr inbounds { % swift . weak , i8 * * } , { % swift . weak , i8 * * } * [ [ V ] ] , i32 0 , i32 0 <nl> - / / CHECK : [ [ SRC_REF_ADDR : % . * ] ] = getelementptr inbounds { % swift . weak , i8 * * } , { % swift . weak , i8 * * } * % 0 , i32 0 , i32 0 <nl> - / / CHECK : call % swift . weak * @ swift_weakTakeInit ( % swift . weak * returned [ [ DEST_REF_ADDR ] ] , % swift . weak * [ [ SRC_REF_ADDR ] ] ) <nl> - / / CHECK : [ [ SRC_WITNESS_ADDR : % . * ] ] = getelementptr inbounds { % swift . weak , i8 * * } , { % swift . weak , i8 * * } * % 0 , i32 0 , i32 1 <nl> - / / CHECK : [ [ WITNESS : % . * ] ] = load i8 * * , i8 * * * [ [ SRC_WITNESS_ADDR ] ] , align 8 <nl> - / / CHECK : [ [ DEST_WITNESS_ADDR : % . * ] ] = getelementptr inbounds { % swift . weak , i8 * * } , { % swift . weak , i8 * * } * [ [ V ] ] , i32 0 , i32 1 <nl> - / / CHECK : store i8 * * [ [ WITNESS ] ] , i8 * * * [ [ DEST_WITNESS_ADDR ] ] , align 8 <nl> + / / CHECK : call { % swift . weak , i8 * * } * @ _T012existentials2CP_pSgXwWb ( { % swift . weak , i8 * * } * % 0 , { % swift . weak , i8 * * } * [ [ V ] ] ) <nl> copy_addr [ take ] % w to [ initialization ] % v : $ * @ sil_weak CP ? <nl> <nl> - / / CHECK : [ [ DEST_REF_ADDR : % . * ] ] = getelementptr inbounds { % swift . weak , i8 * * } , { % swift . weak , i8 * * } * [ [ V ] ] , i32 0 , i32 0 <nl> - / / CHECK : [ [ SRC_REF_ADDR : % . * ] ] = getelementptr inbounds { % swift . weak , i8 * * } , { % swift . weak , i8 * * } * % 0 , i32 0 , i32 0 <nl> - / / CHECK : call % swift . weak * @ swift_weakTakeAssign ( % swift . weak * returned [ [ DEST_REF_ADDR ] ] , % swift . weak * [ [ SRC_REF_ADDR ] ] ) <nl> - / / CHECK : [ [ SRC_WITNESS_ADDR : % . * ] ] = getelementptr inbounds { % swift . weak , i8 * * } , { % swift . weak , i8 * * } * % 0 , i32 0 , i32 1 <nl> - / / CHECK : [ [ WITNESS : % . * ] ] = load i8 * * , i8 * * * [ [ SRC_WITNESS_ADDR ] ] , align 8 <nl> - / / CHECK : [ [ DEST_WITNESS_ADDR : % . * ] ] = getelementptr inbounds { % swift . weak , i8 * * } , { % swift . weak , i8 * * } * [ [ V ] ] , i32 0 , i32 1 <nl> - / / CHECK : store i8 * * [ [ WITNESS ] ] , i8 * * * [ [ DEST_WITNESS_ADDR ] ] , align 8 <nl> + / / CHECK : call { % swift . weak , i8 * * } * @ _T012existentials2CP_pSgXwWd ( { % swift . weak , i8 * * } * % 0 , { % swift . weak , i8 * * } * [ [ V ] ] ) <nl> copy_addr [ take ] % w to % v : $ * @ sil_weak CP ? <nl> <nl> - / / CHECK : [ [ DEST_REF_ADDR : % . * ] ] = getelementptr inbounds { % swift . weak , i8 * * } , { % swift . weak , i8 * * } * [ [ V ] ] , i32 0 , i32 0 <nl> - / / CHECK : [ [ SRC_REF_ADDR : % . * ] ] = getelementptr inbounds { % swift . weak , i8 * * } , { % swift . weak , i8 * * } * % 0 , i32 0 , i32 0 <nl> - / / CHECK : call % swift . weak * @ swift_weakCopyInit ( % swift . weak * returned [ [ DEST_REF_ADDR ] ] , % swift . weak * [ [ SRC_REF_ADDR ] ] ) <nl> - / / CHECK : [ [ SRC_WITNESS_ADDR : % . * ] ] = getelementptr inbounds { % swift . weak , i8 * * } , { % swift . weak , i8 * * } * % 0 , i32 0 , i32 1 <nl> - / / CHECK : [ [ WITNESS : % . * ] ] = load i8 * * , i8 * * * [ [ SRC_WITNESS_ADDR ] ] , align 8 <nl> - / / CHECK : [ [ DEST_WITNESS_ADDR : % . * ] ] = getelementptr inbounds { % swift . weak , i8 * * } , { % swift . weak , i8 * * } * [ [ V ] ] , i32 0 , i32 1 <nl> - / / CHECK : store i8 * * [ [ WITNESS ] ] , i8 * * * [ [ DEST_WITNESS_ADDR ] ] , align 8 <nl> + / / CHECK : call { % swift . weak , i8 * * } * @ _T012existentials2CP_pSgXwWc ( { % swift . weak , i8 * * } * % 0 , { % swift . weak , i8 * * } * [ [ V ] ] ) <nl> copy_addr % w to [ initialization ] % v : $ * @ sil_weak CP ? <nl> <nl> - / / CHECK : [ [ DEST_REF_ADDR : % . * ] ] = getelementptr inbounds { % swift . weak , i8 * * } , { % swift . weak , i8 * * } * [ [ V ] ] , i32 0 , i32 0 <nl> - / / CHECK : [ [ SRC_REF_ADDR : % . * ] ] = getelementptr inbounds { % swift . weak , i8 * * } , { % swift . weak , i8 * * } * % 0 , i32 0 , i32 0 <nl> - / / CHECK : call % swift . weak * @ swift_weakCopyAssign ( % swift . weak * returned [ [ DEST_REF_ADDR ] ] , % swift . weak * [ [ SRC_REF_ADDR ] ] ) <nl> - / / CHECK : [ [ SRC_WITNESS_ADDR : % . * ] ] = getelementptr inbounds { % swift . weak , i8 * * } , { % swift . weak , i8 * * } * % 0 , i32 0 , i32 1 <nl> - / / CHECK : [ [ WITNESS : % . * ] ] = load i8 * * , i8 * * * [ [ SRC_WITNESS_ADDR ] ] , align 8 <nl> - / / CHECK : [ [ DEST_WITNESS_ADDR : % . * ] ] = getelementptr inbounds { % swift . weak , i8 * * } , { % swift . weak , i8 * * } * [ [ V ] ] , i32 0 , i32 1 <nl> - / / CHECK : store i8 * * [ [ WITNESS ] ] , i8 * * * [ [ DEST_WITNESS_ADDR ] ] , align 8 <nl> + / / CHECK : call { % swift . weak , i8 * * } * @ _T012existentials2CP_pSgXwWf ( { % swift . weak , i8 * * } * % 0 , { % swift . weak , i8 * * } * [ [ V ] ] ) <nl> copy_addr % w to % v : $ * @ sil_weak CP ? <nl> <nl> / / CHECK : [ [ REF_ADDR : % . * ] ] = getelementptr inbounds { % swift . weak , i8 * * } , { % swift . weak , i8 * * } * [ [ V ] ] , i32 0 , i32 0 <nl> mmm a / test / IRGen / existentials_objc . sil <nl> ppp b / test / IRGen / existentials_objc . sil <nl> bb0 ( % 0 : $ * Any , % 1 : $ * Any ) : <nl> } <nl> <nl> / / CHECK - DAG : define { { ( protected ) ? } } swiftcc void @ take_opaque_existential ( [ [ ANY : % Any ] ] * noalias nocapture sret , % Any * noalias nocapture dereferenceable ( { { . * } } ) ) { { . * } } { <nl> - / / CHECK : [ [ T0 : % . * ] ] = getelementptr inbounds [ [ ANY ] ] , [ [ ANY ] ] * [ [ SRC : % 1 ] ] , i32 0 , i32 1 <nl> + / / CHECK : call % Any * @ _T0ypWb ( % Any * % 1 , % Any * % 0 ) <nl> + / / CHECK - NEXT : ret void <nl> + <nl> + / / CHECK - DAG : define { { ( protected ) ? } } linkonce_odr hidden % Any * @ _T0ypWb ( [ [ ANY : % Any ] ] * , % Any * ) <nl> + / / CHECK : [ [ T0 : % . * ] ] = getelementptr inbounds [ [ ANY ] ] , [ [ ANY ] ] * [ [ SRC : % 0 ] ] , i32 0 , i32 1 <nl> / / CHECK - NEXT : [ [ TYPE : % . * ] ] = load % swift . type * , % swift . type * * [ [ T0 ] ] , align 8 <nl> - / / CHECK - NEXT : [ [ T0 : % . * ] ] = getelementptr inbounds [ [ ANY ] ] , [ [ ANY ] ] * [ [ DEST : % 0 ] ] , i32 0 , i32 1 <nl> + / / CHECK - NEXT : [ [ T0 : % . * ] ] = getelementptr inbounds [ [ ANY ] ] , [ [ ANY ] ] * [ [ DEST : % 1 ] ] , i32 0 , i32 1 <nl> / / CHECK - NEXT : store % swift . type * [ [ TYPE ] ] , % swift . type * * [ [ T0 ] ] , align 8 <nl> - / / CHECK - NEXT : [ [ FROM_BUFFER_ADDR : % . * ] ] = getelementptr inbounds % Any , % Any * % 1 , i32 0 , i32 0 <nl> - / / CHECK - NEXT : [ [ TO_BUFFER_ADDR : % . * ] ] = getelementptr inbounds % Any , % Any * % 0 , i32 0 , i32 0 <nl> + / / CHECK - NEXT : [ [ FROM_BUFFER_ADDR : % . * ] ] = getelementptr inbounds % Any , % Any * % 0 , i32 0 , i32 0 <nl> + / / CHECK - NEXT : [ [ TO_BUFFER_ADDR : % . * ] ] = getelementptr inbounds % Any , % Any * % 1 , i32 0 , i32 0 <nl> / / CHECK - NEXT : [ [ CAST : % . * ] ] = bitcast % swift . type * [ [ TYPE ] ] to i8 * * * <nl> / / CHECK - NEXT : [ [ VWT_ADDR : % . * ] ] = getelementptr inbounds i8 * * , i8 * * * [ [ CAST ] ] , i64 - 1 <nl> / / CHECK - NEXT : [ [ VWT : % . * ] ] = load i8 * * , i8 * * * [ [ VWT_ADDR ] ] <nl> bb0 ( % 0 : $ * Any , % 1 : $ * Any ) : <nl> / / CHECK - NEXT : [ [ VW : % . * ] ] = load i8 * , i8 * * [ [ VW_ADDR ] ] <nl> / / CHECK - NEXT : [ [ INITWITHTAKEBUFFER : % . * ] ] = bitcast i8 * [ [ VW ] ] <nl> / / CHECK - NEXT : call % swift . opaque * [ [ INITWITHTAKEBUFFER ] ] ( { { . * } } [ [ TO_BUFFER_ADDR ] ] , { { . * } } [ [ FROM_BUFFER_ADDR ] ] , % swift . type * [ [ TYPE ] ] ) <nl> - / / CHECK - NEXT : ret void <nl> <nl> / / rdar : / / problem / 19035529 <nl> @ objc protocol OP { } <nl> entry ( % w : $ * @ sil_weak CP ? , % a : $ CP ? ) : <nl> / / CHECK : [ [ DEST_WITNESS : % . * ] ] = load i8 * * , i8 * * * [ [ SRC_WITNESS_ADDR ] ] <nl> % c = load_weak % w : $ * @ sil_weak CP ? <nl> <nl> - / / CHECK : [ [ DEST_REF_ADDR : % . * ] ] = getelementptr inbounds { % swift . weak , i8 * * } , { % swift . weak , i8 * * } * [ [ V ] ] , i32 0 , i32 0 <nl> - / / CHECK : [ [ SRC_REF_ADDR : % . * ] ] = getelementptr inbounds { % swift . weak , i8 * * } , { % swift . weak , i8 * * } * % 0 , i32 0 , i32 0 <nl> - / / CHECK : call % swift . weak * @ swift_unknownWeakTakeInit ( % swift . weak * returned [ [ DEST_REF_ADDR ] ] , % swift . weak * [ [ SRC_REF_ADDR ] ] ) <nl> - / / CHECK : [ [ SRC_WITNESS_ADDR : % . * ] ] = getelementptr inbounds { % swift . weak , i8 * * } , { % swift . weak , i8 * * } * % 0 , i32 0 , i32 1 <nl> - / / CHECK : [ [ WITNESS : % . * ] ] = load i8 * * , i8 * * * [ [ SRC_WITNESS_ADDR ] ] , align 8 <nl> - / / CHECK : [ [ DEST_WITNESS_ADDR : % . * ] ] = getelementptr inbounds { % swift . weak , i8 * * } , { % swift . weak , i8 * * } * [ [ V ] ] , i32 0 , i32 1 <nl> - / / CHECK : store i8 * * [ [ WITNESS ] ] , i8 * * * [ [ DEST_WITNESS_ADDR ] ] , align 8 <nl> + / / CHECK : call { % swift . weak , i8 * * } * @ _T017existentials_objc2CP_pSgXwWb ( { % swift . weak , i8 * * } * % 0 , { % swift . weak , i8 * * } * [ [ V ] ] ) <nl> copy_addr [ take ] % w to [ initialization ] % v : $ * @ sil_weak CP ? <nl> <nl> - / / CHECK : [ [ DEST_REF_ADDR : % . * ] ] = getelementptr inbounds { % swift . weak , i8 * * } , { % swift . weak , i8 * * } * [ [ V ] ] , i32 0 , i32 0 <nl> - / / CHECK : [ [ SRC_REF_ADDR : % . * ] ] = getelementptr inbounds { % swift . weak , i8 * * } , { % swift . weak , i8 * * } * % 0 , i32 0 , i32 0 <nl> - / / CHECK : call % swift . weak * @ swift_unknownWeakTakeAssign ( % swift . weak * returned [ [ DEST_REF_ADDR ] ] , % swift . weak * [ [ SRC_REF_ADDR ] ] ) <nl> - / / CHECK : [ [ SRC_WITNESS_ADDR : % . * ] ] = getelementptr inbounds { % swift . weak , i8 * * } , { % swift . weak , i8 * * } * % 0 , i32 0 , i32 1 <nl> - / / CHECK : [ [ WITNESS : % . * ] ] = load i8 * * , i8 * * * [ [ SRC_WITNESS_ADDR ] ] , align 8 <nl> - / / CHECK : [ [ DEST_WITNESS_ADDR : % . * ] ] = getelementptr inbounds { % swift . weak , i8 * * } , { % swift . weak , i8 * * } * [ [ V ] ] , i32 0 , i32 1 <nl> - / / CHECK : store i8 * * [ [ WITNESS ] ] , i8 * * * [ [ DEST_WITNESS_ADDR ] ] , align 8 <nl> + / / CHECK : call { % swift . weak , i8 * * } * @ _T017existentials_objc2CP_pSgXwWd ( { % swift . weak , i8 * * } * % 0 , { % swift . weak , i8 * * } * [ [ V ] ] ) <nl> copy_addr [ take ] % w to % v : $ * @ sil_weak CP ? <nl> <nl> - / / CHECK : [ [ DEST_REF_ADDR : % . * ] ] = getelementptr inbounds { % swift . weak , i8 * * } , { % swift . weak , i8 * * } * [ [ V ] ] , i32 0 , i32 0 <nl> - / / CHECK : [ [ SRC_REF_ADDR : % . * ] ] = getelementptr inbounds { % swift . weak , i8 * * } , { % swift . weak , i8 * * } * % 0 , i32 0 , i32 0 <nl> - / / CHECK : call % swift . weak * @ swift_unknownWeakCopyInit ( % swift . weak * returned [ [ DEST_REF_ADDR ] ] , % swift . weak * [ [ SRC_REF_ADDR ] ] ) <nl> - / / CHECK : [ [ SRC_WITNESS_ADDR : % . * ] ] = getelementptr inbounds { % swift . weak , i8 * * } , { % swift . weak , i8 * * } * % 0 , i32 0 , i32 1 <nl> - / / CHECK : [ [ WITNESS : % . * ] ] = load i8 * * , i8 * * * [ [ SRC_WITNESS_ADDR ] ] , align 8 <nl> - / / CHECK : [ [ DEST_WITNESS_ADDR : % . * ] ] = getelementptr inbounds { % swift . weak , i8 * * } , { % swift . weak , i8 * * } * [ [ V ] ] , i32 0 , i32 1 <nl> - / / CHECK : store i8 * * [ [ WITNESS ] ] , i8 * * * [ [ DEST_WITNESS_ADDR ] ] , align 8 <nl> + / / CHECK : call { % swift . weak , i8 * * } * @ _T017existentials_objc2CP_pSgXwWc ( { % swift . weak , i8 * * } * % 0 , { % swift . weak , i8 * * } * [ [ V ] ] ) <nl> copy_addr % w to [ initialization ] % v : $ * @ sil_weak CP ? <nl> <nl> - / / CHECK : [ [ DEST_REF_ADDR : % . * ] ] = getelementptr inbounds { % swift . weak , i8 * * } , { % swift . weak , i8 * * } * [ [ V ] ] , i32 0 , i32 0 <nl> - / / CHECK : [ [ SRC_REF_ADDR : % . * ] ] = getelementptr inbounds { % swift . weak , i8 * * } , { % swift . weak , i8 * * } * % 0 , i32 0 , i32 0 <nl> - / / CHECK : call % swift . weak * @ swift_unknownWeakCopyAssign ( % swift . weak * returned [ [ DEST_REF_ADDR ] ] , % swift . weak * [ [ SRC_REF_ADDR ] ] ) <nl> - / / CHECK : [ [ SRC_WITNESS_ADDR : % . * ] ] = getelementptr inbounds { % swift . weak , i8 * * } , { % swift . weak , i8 * * } * % 0 , i32 0 , i32 1 <nl> - / / CHECK : [ [ WITNESS : % . * ] ] = load i8 * * , i8 * * * [ [ SRC_WITNESS_ADDR ] ] , align 8 <nl> - / / CHECK : [ [ DEST_WITNESS_ADDR : % . * ] ] = getelementptr inbounds { % swift . weak , i8 * * } , { % swift . weak , i8 * * } * [ [ V ] ] , i32 0 , i32 1 <nl> - / / CHECK : store i8 * * [ [ WITNESS ] ] , i8 * * * [ [ DEST_WITNESS_ADDR ] ] , align 8 <nl> + / / CHECK : call { % swift . weak , i8 * * } * @ _T017existentials_objc2CP_pSgXwWf ( { % swift . weak , i8 * * } * % 0 , { % swift . weak , i8 * * } * [ [ V ] ] ) <nl> copy_addr % w to % v : $ * @ sil_weak CP ? <nl> <nl> / / CHECK : [ [ REF_ADDR : % . * ] ] = getelementptr inbounds { % swift . weak , i8 * * } , { % swift . weak , i8 * * } * [ [ V ] ] , i32 0 , i32 0 <nl> mmm a / test / IRGen / existentials_opaque_boxed . sil <nl> ppp b / test / IRGen / existentials_opaque_boxed . sil <nl> bb0 ( % 0 : $ * Existential ) : <nl> / / CHECK : define { { ( protected ) ? } } swiftcc void @ test_assignWithTake_existential_addr ( % T25existentials_opaque_boxed11ExistentialP * <nl> / / CHECK : [ [ ALLOCA : % . * ] ] = alloca % T25existentials_opaque_boxed11ExistentialP <nl> / / CHECK : call void @ __swift_destroy_boxed_opaque_existential_1 ( % T25existentials_opaque_boxed11ExistentialP * [ [ ALLOCA ] ] ) <nl> - / / CHECK : [ [ ARG_TYPE_ADDR : % . * ] ] = getelementptr inbounds % T25existentials_opaque_boxed11ExistentialP , % T25existentials_opaque_boxed11ExistentialP * % 0 , i32 0 , i32 1 <nl> - / / CHECK : [ [ ARG_TYPE : % . * ] ] = load % swift . type * , % swift . type * * [ [ ARG_TYPE_ADDR ] ] <nl> - / / CHECK : [ [ LOCAL_TYPE_ADDR : % . * ] ] = getelementptr inbounds % T25existentials_opaque_boxed11ExistentialP , % T25existentials_opaque_boxed11ExistentialP * [ [ ALLOCA ] ] , i32 0 , i32 1 <nl> - / / CHECK : store % swift . type * [ [ ARG_TYPE ] ] , % swift . type * * [ [ LOCAL_TYPE_ADDR ] ] <nl> - / / CHECK : [ [ ARG_PWT_ADDR : % . * ] ] = getelementptr inbounds % T25existentials_opaque_boxed11ExistentialP , % T25existentials_opaque_boxed11ExistentialP * % 0 , i32 0 , i32 2 <nl> - / / CHECK : [ [ ARG_PWT : % . * ] ] = load i8 * * , i8 * * * [ [ ARG_PWT_ADDR ] ] <nl> - / / CHECK : [ [ LOCAL_PWT_ADDR : % . * ] ] = getelementptr inbounds % T25existentials_opaque_boxed11ExistentialP , % T25existentials_opaque_boxed11ExistentialP * [ [ ALLOCA ] ] , i32 0 , i32 2 <nl> - / / CHECK : store i8 * * [ [ ARG_PWT ] ] , i8 * * * [ [ LOCAL_PWT_ADDR ] ] <nl> - / / CHECK : [ [ BUFFER_ARG_ADDR : % . * ] ] = getelementptr inbounds % T25existentials_opaque_boxed11ExistentialP , % T25existentials_opaque_boxed11ExistentialP * % 0 , i32 0 , i32 0 <nl> - / / CHECK : [ [ BUFFER_LOCAL_ADDR : % . * ] ] = getelementptr inbounds % T25existentials_opaque_boxed11ExistentialP , % T25existentials_opaque_boxed11ExistentialP * [ [ ALLOCA ] ] , i32 0 , i32 0 <nl> - / / CHECK : [ [ CAST_ADDR : % . * ] ] = bitcast % swift . type * [ [ ARG_TYPE ] ] to i8 * * * <nl> - / / CHECK : [ [ VWT_ADDR : % . * ] ] = getelementptr inbounds i8 * * , i8 * * * [ [ CAST_ADDR ] ] , { { ( i64 | i32 ) } } - 1 <nl> - / / CHECK : [ [ VWT : % . * ] ] = load i8 * * , i8 * * * [ [ VWT_ADDR ] ] <nl> - / / CHECK : [ [ VW_ADDR : % . * ] ] = getelementptr inbounds i8 * , i8 * * [ [ VWT ] ] , i32 6 <nl> - / / CHECK : [ [ VW : % . * ] ] = load i8 * , i8 * * [ [ VW_ADDR ] ] <nl> - / / CHECK : [ [ INITWITHTAKEBUFFER : % . * ] ] = bitcast i8 * [ [ VW ] ] <nl> - / / CHECK : call % swift . opaque * [ [ INITWITHTAKEBUFFER ] ] ( { { . * } } [ [ BUFFER_LOCAL_ADDR ] ] , { { . * } } [ [ BUFFER_ARG_ADDR ] ] , % swift . type * [ [ ARG_TYPE ] ] ) <nl> + / / CHECK : call % T25existentials_opaque_boxed11ExistentialP * @ _T025existentials_opaque_boxed11Existential_pWb ( % T25existentials_opaque_boxed11ExistentialP * % 0 , % T25existentials_opaque_boxed11ExistentialP * [ [ ALLOCA ] ] ) <nl> / / CHECK : ret void <nl> sil @ test_assignWithTake_existential_addr : $ @ convention ( thin ) ( @ in Existential ) - > ( ) { <nl> bb0 ( % 0 : $ * Existential ) : <nl> bb0 ( % 0 : $ * Existential ) : <nl> return % t : $ ( ) <nl> } <nl> <nl> - / / CHECK : define { { ( protected ) ? } } swiftcc void @ test_initWithTake_existential_addr ( % T25existentials_opaque_boxed11ExistentialP * <nl> - / / CHECK : [ [ LOCAL : % . * ] ] = alloca % T25existentials_opaque_boxed11ExistentialP <nl> + / / CHECK : define { { ( protected ) ? } } linkonce_odr hidden % T25existentials_opaque_boxed11ExistentialP * @ _T025existentials_opaque_boxed11Existential_pWb ( % T25existentials_opaque_boxed11ExistentialP * , % T25existentials_opaque_boxed11ExistentialP * ) <nl> / / CHECK : [ [ METADATA_ADDR : % . * ] ] = getelementptr inbounds % T25existentials_opaque_boxed11ExistentialP , % T25existentials_opaque_boxed11ExistentialP * % 0 , i32 0 , i32 1 <nl> / / CHECK : [ [ METADATA : % . * ] ] = load % swift . type * , % swift . type * * [ [ METADATA_ADDR ] ] <nl> - / / CHECK : [ [ LOCAL_METADATA_ADDR : % . * ] ] = getelementptr inbounds % T25existentials_opaque_boxed11ExistentialP , % T25existentials_opaque_boxed11ExistentialP * [ [ LOCAL ] ] , i32 0 , i32 1 <nl> + / / CHECK : [ [ LOCAL_METADATA_ADDR : % . * ] ] = getelementptr inbounds % T25existentials_opaque_boxed11ExistentialP , % T25existentials_opaque_boxed11ExistentialP * % 1 , i32 0 , i32 1 <nl> / / CHECK : store % swift . type * [ [ METADATA ] ] , % swift . type * * [ [ LOCAL_METADATA_ADDR ] ] <nl> / / CHECK : [ [ PWT_ADDR : % . * ] ] = getelementptr inbounds % T25existentials_opaque_boxed11ExistentialP , % T25existentials_opaque_boxed11ExistentialP * % 0 , i32 0 , i32 2 <nl> / / CHECK : [ [ PWT : % . * ] ] = load i8 * * , i8 * * * [ [ PWT_ADDR ] ] <nl> - / / CHECK : [ [ LOCAL_PWT_ADDR : % . * ] ] = getelementptr inbounds % T25existentials_opaque_boxed11ExistentialP , % T25existentials_opaque_boxed11ExistentialP * [ [ LOCAL ] ] , i32 0 , i32 2 <nl> + / / CHECK : [ [ LOCAL_PWT_ADDR : % . * ] ] = getelementptr inbounds % T25existentials_opaque_boxed11ExistentialP , % T25existentials_opaque_boxed11ExistentialP * % 1 , i32 0 , i32 2 <nl> / / CHECK : store i8 * * [ [ PWT ] ] , i8 * * * [ [ LOCAL_PWT_ADDR ] ] <nl> / / CHECK : [ [ BUFFER_ARG_ADDR : % . * ] ] = getelementptr inbounds % T25existentials_opaque_boxed11ExistentialP , % T25existentials_opaque_boxed11ExistentialP * % 0 , i32 0 , i32 0 <nl> - / / CHECK : [ [ BUFFER_LOCAL_ADDR : % . * ] ] = getelementptr inbounds % T25existentials_opaque_boxed11ExistentialP , % T25existentials_opaque_boxed11ExistentialP * [ [ ALLOCA ] ] , i32 0 , i32 0 <nl> - / / CHECK : [ [ CAST_ADDR : % . * ] ] = bitcast % swift . type * [ [ ARG_TYPE ] ] to i8 * * * <nl> + / / CHECK : [ [ BUFFER_LOCAL_ADDR : % . * ] ] = getelementptr inbounds % T25existentials_opaque_boxed11ExistentialP , % T25existentials_opaque_boxed11ExistentialP * % 1 , i32 0 , i32 0 <nl> + / / CHECK : [ [ CAST_ADDR : % . * ] ] = bitcast % swift . type * [ [ METADATA ] ] to i8 * * * <nl> / / CHECK : [ [ VWT_ADDR : % . * ] ] = getelementptr inbounds i8 * * , i8 * * * [ [ CAST_ADDR ] ] , { { ( i64 | i32 ) } } - 1 <nl> / / CHECK : [ [ VWT : % . * ] ] = load i8 * * , i8 * * * [ [ VWT_ADDR ] ] <nl> / / CHECK : [ [ VW_ADDR : % . * ] ] = getelementptr inbounds i8 * , i8 * * [ [ VWT ] ] , i32 6 <nl> / / CHECK : [ [ VW : % . * ] ] = load i8 * , i8 * * [ [ VW_ADDR ] ] <nl> / / CHECK : [ [ INITWITHTAKEBUFFER : % . * ] ] = bitcast i8 * [ [ VW ] ] <nl> - / / CHECK : call % swift . opaque * [ [ INITWITHTAKEBUFFER ] ] ( { { . * } } [ [ BUFFER_LOCAL_ADDR ] ] , { { . * } } [ [ BUFFER_ARG_ADDR ] ] , % swift . type * [ [ ARG_TYPE ] ] ) <nl> + / / CHECK : call % swift . opaque * [ [ INITWITHTAKEBUFFER ] ] ( { { . * } } [ [ BUFFER_LOCAL_ADDR ] ] , { { . * } } [ [ BUFFER_ARG_ADDR ] ] , % swift . type * [ [ METADATA ] ] ) <nl> + / / CHECK : ret % T25existentials_opaque_boxed11ExistentialP * % 1 <nl> + <nl> + / / CHECK : define { { ( protected ) ? } } swiftcc void @ test_initWithTake_existential_addr ( % T25existentials_opaque_boxed11ExistentialP * <nl> + / / CHECK : [ [ LOCAL : % . * ] ] = alloca % T25existentials_opaque_boxed11ExistentialP <nl> + / / CHECK : call % T25existentials_opaque_boxed11ExistentialP * @ _T025existentials_opaque_boxed11Existential_pWb ( % T25existentials_opaque_boxed11ExistentialP * % 0 , % T25existentials_opaque_boxed11ExistentialP * [ [ LOCAL ] ] ) <nl> / / CHECK : ret void <nl> sil @ test_initWithTake_existential_addr : $ @ convention ( thin ) ( @ in Existential ) - > ( ) { <nl> bb0 ( % 0 : $ * Existential ) : <nl> bb0 ( % 0 : $ * Existential ) : <nl> <nl> / / CHECK - LABEL : define { { ( protected ) ? } } swiftcc void @ test_initWithCopy_existential_addr ( % T25existentials_opaque_boxed11ExistentialP * <nl> / / CHECK : [ [ LOCAL : % . * ] ] = alloca % T25existentials_opaque_boxed11ExistentialP <nl> + / / CHECK : call % T25existentials_opaque_boxed11ExistentialP * @ _T025existentials_opaque_boxed11Existential_pWc ( % T25existentials_opaque_boxed11ExistentialP * % 0 , % T25existentials_opaque_boxed11ExistentialP * [ [ LOCAL ] ] ) <nl> + / / CHECK : ret void <nl> + / / CHECK - LABEL : define { { ( protected ) ? } } linkonce_odr hidden % T25existentials_opaque_boxed11ExistentialP * @ _T025existentials_opaque_boxed11Existential_pWc ( % T25existentials_opaque_boxed11ExistentialP * , % T25existentials_opaque_boxed11ExistentialP * ) <nl> / / CHECK : [ [ TYPE_ADDR : % . * ] ] = getelementptr inbounds % T25existentials_opaque_boxed11ExistentialP , % T25existentials_opaque_boxed11ExistentialP * % 0 , i32 0 , i32 1 <nl> - / / CHECK : [ [ TYPE : % . * ] ] = load % swift . type * , % swift . type * * [ [ TYPE_ADDR ] ] <nl> - / / CHECK : [ [ LOCAL_TYPE_ADDR : % . * ] ] = getelementptr inbounds % T25existentials_opaque_boxed11ExistentialP , % T25existentials_opaque_boxed11ExistentialP * [ [ LOCAL ] ] , i32 0 , i32 1 <nl> - / / CHECK : store % swift . type * [ [ TYPE ] ] , % swift . type * * [ [ LOCAL_TYPE_ADDR ] ] <nl> + / / CHECK : [ [ ARG_TYPE : % . * ] ] = load % swift . type * , % swift . type * * [ [ TYPE_ADDR ] ] <nl> + / / CHECK : [ [ LOCAL_TYPE_ADDR : % . * ] ] = getelementptr inbounds % T25existentials_opaque_boxed11ExistentialP , % T25existentials_opaque_boxed11ExistentialP * % 1 , i32 0 , i32 1 <nl> + / / CHECK : store % swift . type * [ [ ARG_TYPE ] ] , % swift . type * * [ [ LOCAL_TYPE_ADDR ] ] <nl> / / CHECK : [ [ PWT_ADDR : % . * ] ] = getelementptr inbounds % T25existentials_opaque_boxed11ExistentialP , % T25existentials_opaque_boxed11ExistentialP * % 0 , i32 0 , i32 2 <nl> / / CHECK : [ [ PWT : % . * ] ] = load i8 * * , i8 * * * [ [ PWT_ADDR ] ] <nl> - / / CHECK : [ [ LOCAL_PWT_ADDR : % . * ] ] = getelementptr inbounds % T25existentials_opaque_boxed11ExistentialP , % T25existentials_opaque_boxed11ExistentialP * [ [ LOCAL ] ] , i32 0 , i32 2 <nl> + / / CHECK : [ [ LOCAL_PWT_ADDR : % . * ] ] = getelementptr inbounds % T25existentials_opaque_boxed11ExistentialP , % T25existentials_opaque_boxed11ExistentialP * % 1 , i32 0 , i32 2 <nl> / / CHECK : store i8 * * [ [ PWT ] ] , i8 * * * [ [ LOCAL_PWT_ADDR ] ] <nl> / / CHECK : [ [ BUFFER_ARG_ADDR : % . * ] ] = getelementptr inbounds % T25existentials_opaque_boxed11ExistentialP , % T25existentials_opaque_boxed11ExistentialP * % 0 , i32 0 , i32 0 <nl> - / / CHECK : [ [ BUFFER_LOCAL_ADDR : % . * ] ] = getelementptr inbounds % T25existentials_opaque_boxed11ExistentialP , % T25existentials_opaque_boxed11ExistentialP * [ [ ALLOCA ] ] , i32 0 , i32 0 <nl> + / / CHECK : [ [ BUFFER_LOCAL_ADDR : % . * ] ] = getelementptr inbounds % T25existentials_opaque_boxed11ExistentialP , % T25existentials_opaque_boxed11ExistentialP * % 1 , i32 0 , i32 0 <nl> / / CHECK : [ [ CAST_ADDR : % . * ] ] = bitcast % swift . type * [ [ ARG_TYPE ] ] to i8 * * * <nl> / / CHECK : [ [ VWT_ADDR : % . * ] ] = getelementptr inbounds i8 * * , i8 * * * [ [ CAST_ADDR ] ] , { { ( i64 | i32 ) } } - 1 <nl> / / CHECK : [ [ VWT : % . * ] ] = load i8 * * , i8 * * * [ [ VWT_ADDR ] ] <nl> / / CHECK : [ [ VW : % . * ] ] = load i8 * , i8 * * [ [ VWT ] ] <nl> / / CHECK : [ [ INITWITHCOPYBUFFER : % . * ] ] = bitcast i8 * [ [ VW ] ] <nl> / / CHECK : call % swift . opaque * [ [ INITWITHCOPYBUFFER ] ] ( { { . * } } noalias [ [ BUFFER_LOCAL_ADDR ] ] , { { . * } } noalias [ [ BUFFER_ARG_ADDR ] ] , % swift . type * [ [ ARG_TYPE ] ] ) <nl> - / / CHECK : ret void <nl> + / / CHECK : ret % T25existentials_opaque_boxed11ExistentialP * % 1 <nl> sil @ test_initWithCopy_existential_addr : $ @ convention ( thin ) ( @ in Existential ) - > ( ) { <nl> bb0 ( % 0 : $ * Existential ) : <nl> % s = alloc_stack $ Existential <nl> mmm a / test / IRGen / unowned_objc . sil <nl> ppp b / test / IRGen / unowned_objc . sil <nl> bb0 ( % p : $ P , % q : $ P ) : <nl> / / CHECK - NEXT : call % swift . unowned * @ swift_unknownUnownedInit ( % swift . unowned * returned [ [ T0 ] ] , [ [ UNKNOWN ] ] * [ [ PV : % 0 ] ] ) <nl> store_unowned % p to [ initialization ] % x : $ * @ sil_unowned P <nl> <nl> - / / CHECK - NEXT : [ [ T0 : % . * ] ] = getelementptr inbounds [ [ UREF ] ] , [ [ UREF ] ] * [ [ Y ] ] , i32 0 , i32 0 <nl> - / / CHECK - NEXT : [ [ T1 : % . * ] ] = getelementptr inbounds [ [ UREF ] ] , [ [ UREF ] ] * [ [ X ] ] , i32 0 , i32 0 <nl> - / / CHECK - NEXT : call % swift . unowned * @ swift_unknownUnownedCopyInit ( % swift . unowned * returned [ [ T0 ] ] , % swift . unowned * [ [ T1 ] ] ) <nl> - / / CHECK - NEXT : [ [ T0 : % . * ] ] = getelementptr inbounds [ [ UREF ] ] , [ [ UREF ] ] * [ [ X ] ] , i32 0 , i32 1 <nl> - / / CHECK - NEXT : [ [ WT : % . * ] ] = load i8 * * , i8 * * * [ [ T0 ] ] , align 8 <nl> - / / CHECK - NEXT : [ [ T0 : % . * ] ] = getelementptr inbounds [ [ UREF ] ] , [ [ UREF ] ] * [ [ Y ] ] , i32 0 , i32 1 <nl> - / / CHECK - NEXT : store i8 * * [ [ WT ] ] , i8 * * * [ [ T0 ] ] , align 8 <nl> + / / CHECK - NEXT : call { % swift . unowned , i8 * * } * @ _T012unowned_objc1P_pXoWc ( { % swift . unowned , i8 * * } * [ [ X ] ] , { % swift . unowned , i8 * * } * [ [ Y ] ] ) <nl> copy_addr % x to [ initialization ] % y : $ * @ sil_unowned P <nl> <nl> / / CHECK - NEXT : [ [ T0 : % . * ] ] = getelementptr inbounds [ [ UREF ] ] , [ [ UREF ] ] * [ [ X ] ] , i32 0 , i32 0 <nl> bb0 ( % p : $ P , % q : $ P ) : <nl> / / CHECK - NEXT : call void @ swift_unknownRelease ( [ [ UNKNOWN ] ] * [ [ TV ] ] ) <nl> strong_release % t0 : $ P <nl> <nl> - / / CHECK - NEXT : [ [ T0 : % . * ] ] = getelementptr inbounds [ [ UREF ] ] , [ [ UREF ] ] * [ [ Y ] ] , i32 0 , i32 0 <nl> - / / CHECK - NEXT : [ [ T1 : % . * ] ] = getelementptr inbounds [ [ UREF ] ] , [ [ UREF ] ] * [ [ X ] ] , i32 0 , i32 0 <nl> - / / CHECK - NEXT : call % swift . unowned * @ swift_unknownUnownedCopyAssign ( % swift . unowned * returned [ [ T0 ] ] , % swift . unowned * [ [ T1 ] ] ) <nl> - / / CHECK - NEXT : [ [ T0 : % . * ] ] = getelementptr inbounds [ [ UREF ] ] , [ [ UREF ] ] * [ [ X ] ] , i32 0 , i32 1 <nl> - / / CHECK - NEXT : [ [ WT : % . * ] ] = load i8 * * , i8 * * * [ [ T0 ] ] , align 8 <nl> - / / CHECK - NEXT : [ [ T0 : % . * ] ] = getelementptr inbounds [ [ UREF ] ] , [ [ UREF ] ] * [ [ Y ] ] , i32 0 , i32 1 <nl> - / / CHECK - NEXT : store i8 * * [ [ WT ] ] , i8 * * * [ [ T0 ] ] , align 8 <nl> + / / CHECK - NEXT : call { % swift . unowned , i8 * * } * @ _T012unowned_objc1P_pXoWf ( { % swift . unowned , i8 * * } * [ [ X ] ] , { % swift . unowned , i8 * * } * [ [ Y ] ] ) <nl> copy_addr % x to % y : $ * @ sil_unowned P <nl> <nl> / / CHECK - NEXT : [ [ T0 : % . * ] ] = getelementptr inbounds [ [ UREF ] ] , [ [ UREF ] ] * [ [ Y ] ] , i32 0 , i32 1 <nl> bb0 ( % p : $ P , % q : $ P ) : <nl> / / CHECK - NEXT : call % swift . unowned * @ swift_unknownUnownedAssign ( % swift . unowned * returned [ [ T0 ] ] , [ [ UNKNOWN ] ] * [ [ QV : % 2 ] ] ) <nl> store_unowned % q to % y : $ * @ sil_unowned P <nl> <nl> - / / CHECK - NEXT : [ [ T0 : % . * ] ] = getelementptr inbounds [ [ UREF ] ] , [ [ UREF ] ] * [ [ Y ] ] , i32 0 , i32 0 <nl> - / / CHECK - NEXT : [ [ T1 : % . * ] ] = getelementptr inbounds [ [ UREF ] ] , [ [ UREF ] ] * [ [ X ] ] , i32 0 , i32 0 <nl> - / / CHECK - NEXT : call % swift . unowned * @ swift_unknownUnownedTakeAssign ( % swift . unowned * returned [ [ T0 ] ] , % swift . unowned * [ [ T1 ] ] ) <nl> - / / CHECK - NEXT : [ [ T0 : % . * ] ] = getelementptr inbounds [ [ UREF ] ] , [ [ UREF ] ] * [ [ X ] ] , i32 0 , i32 1 <nl> - / / CHECK - NEXT : [ [ WT : % . * ] ] = load i8 * * , i8 * * * [ [ T0 ] ] , align 8 <nl> - / / CHECK - NEXT : [ [ T0 : % . * ] ] = getelementptr inbounds [ [ UREF ] ] , [ [ UREF ] ] * [ [ Y ] ] , i32 0 , i32 1 <nl> - / / CHECK - NEXT : store i8 * * [ [ WT ] ] , i8 * * * [ [ T0 ] ] , align 8 <nl> + / / CHECK - NEXT : call { % swift . unowned , i8 * * } * @ _T012unowned_objc1P_pXoWd ( { % swift . unowned , i8 * * } * [ [ X ] ] , { % swift . unowned , i8 * * } * [ [ Y ] ] ) <nl> copy_addr [ take ] % x to % y : $ * @ sil_unowned P <nl> <nl> - / / CHECK - NEXT : [ [ T0 : % . * ] ] = getelementptr inbounds [ [ UREF ] ] , [ [ UREF ] ] * [ [ X ] ] , i32 0 , i32 0 <nl> - / / CHECK - NEXT : [ [ T1 : % . * ] ] = getelementptr inbounds [ [ UREF ] ] , [ [ UREF ] ] * [ [ Y ] ] , i32 0 , i32 0 <nl> - / / CHECK - NEXT : call % swift . unowned * @ swift_unknownUnownedTakeInit ( % swift . unowned * returned [ [ T0 ] ] , % swift . unowned * [ [ T1 ] ] ) <nl> - / / CHECK - NEXT : [ [ T0 : % . * ] ] = getelementptr inbounds [ [ UREF ] ] , [ [ UREF ] ] * [ [ Y ] ] , i32 0 , i32 1 <nl> - / / CHECK - NEXT : [ [ WT : % . * ] ] = load i8 * * , i8 * * * [ [ T0 ] ] , align 8 <nl> - / / CHECK - NEXT : [ [ T0 : % . * ] ] = getelementptr inbounds [ [ UREF ] ] , [ [ UREF ] ] * [ [ X ] ] , i32 0 , i32 1 <nl> - / / CHECK - NEXT : store i8 * * [ [ WT ] ] , i8 * * * [ [ T0 ] ] , align 8 <nl> + / / CHECK - NEXT : call { % swift . unowned , i8 * * } * @ _T012unowned_objc1P_pXoWb ( { % swift . unowned , i8 * * } * [ [ Y ] ] , { % swift . unowned , i8 * * } * [ [ X ] ] ) <nl> copy_addr [ take ] % y to [ initialization ] % x : $ * @ sil_unowned P <nl> <nl> / / CHECK - NEXT : [ [ T0 : % . * ] ] = getelementptr inbounds [ [ UREF ] ] , [ [ UREF ] ] * [ [ Y ] ] , i32 0 , i32 0 <nl>
|
Merge remote - tracking branch ' origin / master ' into master - next
|
apple/swift
|
03155cf2185bfe6ca791d51583cdc384ac3fac47
|
2017-11-01T17:48:57Z
|
mmm a / xbmc / interfaces / Builtins . cpp <nl> ppp b / xbmc / interfaces / Builtins . cpp <nl> int CBuiltins : : Execute ( const CStdString & execString ) <nl> <nl> if ( g_alarmClock . IsRunning ( ) ) <nl> g_alarmClock . Stop ( params [ 0 ] , silent ) ; <nl> - <nl> + / / no negative times not allowed , loop must have a positive time <nl> + if ( seconds < 0 | | ( seconds = = 0 & & loop ) ) <nl> + return false ; <nl> g_alarmClock . Start ( params [ 0 ] , seconds , params [ 1 ] , silent , loop ) ; <nl> } <nl> else if ( execute . Equals ( " notification " ) ) <nl>
|
Merge pull request from phil65 / alarmclock - fix
|
xbmc/xbmc
|
8604fde73e563f023decfdf517d7e6bf8d1b9711
|
2013-02-17T06:24:55Z
|
mmm a / docs - translations / pt - BR / README . md <nl> ppp b / docs - translations / pt - BR / README . md <nl> Existem muitas perguntas comuns que são feitas , verifique antes de criar uma is <nl> <nl> # # # Módulos para o Processo Renderizador : <nl> <nl> - * [ DesktopCapturer ] ( . . / . . / docs / api / desktop - capturer ) <nl> + * [ DesktopCapturer ] ( . . / . . / docs / api / desktop - capturer . md ) <nl> * [ ipcRenderer ] ( . . / . . / docs / api / ipc - renderer . md ) <nl> * [ remote ] ( . . / . . / docs / api / remote . md ) <nl> * [ webFrame ] ( . . / . . / docs / api / web - frame . md ) <nl>
|
broken link ( 404 )
|
electron/electron
|
3da41e03aadc26b519fc31b9f5a3ab9cb0063f82
|
2016-06-27T23:27:09Z
|
mmm a / tools / oom_dump / oom_dump . cc <nl> ppp b / tools / oom_dump / oom_dump . cc <nl> void DumpHeapStats ( const char * minidump_file ) { <nl> ReadPointedValue ( memory_region , heap_stats_addr , offset ) <nl> <nl> CHECK ( READ_FIELD ( 0 ) = = v8 : : internal : : HeapStats : : kStartMarker ) ; <nl> - CHECK ( READ_FIELD ( 23 ) = = v8 : : internal : : HeapStats : : kEndMarker ) ; <nl> + CHECK ( READ_FIELD ( 24 ) = = v8 : : internal : : HeapStats : : kEndMarker ) ; <nl> <nl> const int new_space_size = READ_FIELD ( 1 ) ; <nl> const int new_space_capacity = READ_FIELD ( 2 ) ; <nl> void DumpHeapStats ( const char * minidump_file ) { <nl> const int destroyed_global_handle_count = READ_FIELD ( 18 ) ; <nl> const int memory_allocator_size = READ_FIELD ( 19 ) ; <nl> const int memory_allocator_capacity = READ_FIELD ( 20 ) ; <nl> + const int os_error = READ_FIELD ( 23 ) ; <nl> # undef READ_FIELD <nl> <nl> int objects_per_type [ v8 : : internal : : LAST_TYPE + 1 ] = { 0 } ; <nl> void DumpHeapStats ( const char * minidump_file ) { <nl> PRINT_INT_STAT ( destroyed_global_handle_count ) ; <nl> PRINT_MB_STAT ( memory_allocator_size ) ; <nl> PRINT_MB_STAT ( memory_allocator_capacity ) ; <nl> + PRINT_INT_STAT ( os_error ) ; <nl> # undef PRINT_STAT <nl> <nl> printf ( " \ n " ) ; <nl>
|
Add os_error stat to oom_dump utility .
|
v8/v8
|
79a219cf3105e2655be9da5b7342465e8b5d4b11
|
2010-08-30T12:26:58Z
|
mmm a / lib / liba52 / vc + + / liba52 . vcxproj <nl> ppp b / lib / liba52 / vc + + / liba52 . vcxproj <nl> <nl> < DataExecutionPrevention > <nl> < / DataExecutionPrevention > <nl> < ImportLibrary > $ ( Configuration ) \ vs2010 \ $ ( TargetName ) . lib < / ImportLibrary > <nl> + < AdditionalDependencies > % ( AdditionalDependencies ) < / AdditionalDependencies > <nl> < / Link > <nl> < PostBuildEvent > <nl> < Command > <nl> <nl> < DataExecutionPrevention > <nl> < / DataExecutionPrevention > <nl> < ImportLibrary > $ ( Configuration ) \ vs2010 \ $ ( TargetName ) . lib < / ImportLibrary > <nl> + < AdditionalDependencies > % ( AdditionalDependencies ) < / AdditionalDependencies > <nl> < / Link > <nl> < PostBuildEvent > <nl> < Command > <nl> mmm a / lib / xbadpcm / adpcm . vcxproj <nl> ppp b / lib / xbadpcm / adpcm . vcxproj <nl> <nl> < / DataExecutionPrevention > <nl> < ImportLibrary > $ ( TargetName ) . lib < / ImportLibrary > <nl> < TargetMachine > MachineX86 < / TargetMachine > <nl> + < AdditionalDependencies > % ( AdditionalDependencies ) < / AdditionalDependencies > <nl> < / Link > <nl> < PostBuildEvent > <nl> < Command > <nl> <nl> < / DataExecutionPrevention > <nl> < ImportLibrary > $ ( TargetName ) . lib < / ImportLibrary > <nl> < TargetMachine > MachineX86 < / TargetMachine > <nl> + < AdditionalDependencies > % ( AdditionalDependencies ) < / AdditionalDependencies > <nl> < / Link > <nl> < PostBuildEvent > <nl> < Command > <nl>
|
[ WIN32 ] removed unneeded linker libs ( is liba52 . dll in use at all ? )
|
xbmc/xbmc
|
b40940c25e92230d020e9e88b589bb5ea6ef38bc
|
2011-02-05T23:33:50Z
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.