File tree 15 files changed +133
-16
lines changed
15 files changed +133
-16
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ let clean_bs_garbage bsc_dir proj_dir =
47
47
try
48
48
Bsb_parse_sources. clean_re_js proj_dir; (* clean re.js files*)
49
49
ninja_clean bsc_dir proj_dir ;
50
- List . iter try_remove Bsb_config. all_lib_artifacts;
50
+ Ext_list . iter Bsb_config. all_lib_artifacts try_remove ;
51
51
with
52
52
e ->
53
53
Bsb_log. warn " @{<warning>Failed@} to clean due to %s" (Printexc. to_string e)
Original file line number Diff line number Diff line change @@ -276,7 +276,7 @@ let extract_ignored_dirs (map : json_map) =
276
276
let interpret_json
277
277
~override_package_specs
278
278
~bsc_dir
279
- ~generate_watch_metadata
279
+ ~( generate_watch_metadata : bool )
280
280
~not_dev
281
281
cwd
282
282
Original file line number Diff line number Diff line change @@ -75,11 +75,9 @@ and decode_modules (x : string) (offset : cursor) module_number : string array =
75
75
if String. unsafe_get x ! cur = '\n' then
76
76
begin
77
77
let offs = ! last in
78
- let len = (! cur - ! last) in
79
- let b = Bytes. create len in
80
- Ext_bytes. unsafe_blit_string x offs b 0 len;
78
+ let len = (! cur - ! last) in
81
79
Array. unsafe_set result ! tasks
82
- (Bytes. unsafe_to_string b );
80
+ (Ext_string. unsafe_sub x offs len );
83
81
incr tasks;
84
82
last := ! cur + 1 ;
85
83
end ;
Original file line number Diff line number Diff line change @@ -567,4 +567,9 @@ let get_1_2_3_4 (x : string) ~off len : int =
567
567
else if len = 2 then get_int_2 x off
568
568
else if len = 3 then get_int_3 x off
569
569
else if len = 4 then get_int_4 x off
570
- else assert false
570
+ else assert false
571
+
572
+ let unsafe_sub x offs len =
573
+ let b = Bytes. create len in
574
+ Ext_bytes. unsafe_blit_string x offs b 0 len;
575
+ (Bytes. unsafe_to_string b);
Original file line number Diff line number Diff line change @@ -216,4 +216,10 @@ val get_1_2_3_4 :
216
216
string ->
217
217
off :int ->
218
218
int ->
219
- int
219
+ int
220
+
221
+ val unsafe_sub :
222
+ string ->
223
+ int ->
224
+ int ->
225
+ string
Original file line number Diff line number Diff line change @@ -810,6 +810,12 @@ val get_1_2_3_4 :
810
810
off:int ->
811
811
int ->
812
812
int
813
+
814
+ val unsafe_sub :
815
+ string ->
816
+ int ->
817
+ int ->
818
+ string
813
819
end = struct
814
820
#1 "ext_string.ml"
815
821
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
@@ -1374,6 +1380,11 @@ let get_1_2_3_4 (x : string) ~off len : int =
1374
1380
else if len = 3 then get_int_3 x off
1375
1381
else if len = 4 then get_int_4 x off
1376
1382
else assert false
1383
+
1384
+ let unsafe_sub x offs len =
1385
+ let b = Bytes.create len in
1386
+ Ext_bytes.unsafe_blit_string x offs b 0 len;
1387
+ (Bytes.unsafe_to_string b);
1377
1388
end
1378
1389
module Bsb_pkg_types : sig
1379
1390
#1 "bsb_pkg_types.mli"
@@ -9461,7 +9472,7 @@ let clean_bs_garbage bsc_dir proj_dir =
9461
9472
try
9462
9473
Bsb_parse_sources.clean_re_js proj_dir; (* clean re.js files*)
9463
9474
ninja_clean bsc_dir proj_dir ;
9464
- List .iter try_remove Bsb_config.all_lib_artifacts;
9475
+ Ext_list .iter Bsb_config.all_lib_artifacts try_remove ;
9465
9476
with
9466
9477
e ->
9467
9478
Bsb_log.warn "@{<warning>Failed@} to clean due to %s" (Printexc.to_string e)
@@ -11118,7 +11129,7 @@ let extract_ignored_dirs (map : json_map) =
11118
11129
let interpret_json
11119
11130
~override_package_specs
11120
11131
~bsc_dir
11121
- ~generate_watch_metadata
11132
+ ~( generate_watch_metadata : bool)
11122
11133
~not_dev
11123
11134
cwd
11124
11135
Original file line number Diff line number Diff line change @@ -1149,6 +1149,12 @@ val get_1_2_3_4 :
1149
1149
off :int ->
1150
1150
int ->
1151
1151
int
1152
+
1153
+ val unsafe_sub :
1154
+ string ->
1155
+ int ->
1156
+ int ->
1157
+ string
1152
1158
end = struct
1153
1159
#1 " ext_string.ml"
1154
1160
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
@@ -1713,6 +1719,11 @@ let get_1_2_3_4 (x : string) ~off len : int =
1713
1719
else if len = 3 then get_int_3 x off
1714
1720
else if len = 4 then get_int_4 x off
1715
1721
else assert false
1722
+
1723
+ let unsafe_sub x offs len =
1724
+ let b = Bytes. create len in
1725
+ Ext_bytes. unsafe_blit_string x offs b 0 len;
1726
+ (Bytes. unsafe_to_string b);
1716
1727
end
1717
1728
module Ext_list : sig
1718
1729
#1 " ext_list.mli"
@@ -4020,11 +4031,9 @@ and decode_modules (x : string) (offset : cursor) module_number : string array =
4020
4031
if String. unsafe_get x ! cur = '\n' then
4021
4032
begin
4022
4033
let offs = ! last in
4023
- let len = (! cur - ! last) in
4024
- let b = Bytes. create len in
4025
- Ext_bytes. unsafe_blit_string x offs b 0 len;
4034
+ let len = (! cur - ! last) in
4026
4035
Array. unsafe_set result ! tasks
4027
- (Bytes. unsafe_to_string b );
4036
+ (Ext_string. unsafe_sub x offs len );
4028
4037
incr tasks;
4029
4038
last := ! cur + 1 ;
4030
4039
end ;
Original file line number Diff line number Diff line change @@ -23599,6 +23599,12 @@ val get_1_2_3_4 :
23599
23599
off:int ->
23600
23600
int ->
23601
23601
int
23602
+
23603
+ val unsafe_sub :
23604
+ string ->
23605
+ int ->
23606
+ int ->
23607
+ string
23602
23608
end = struct
23603
23609
#1 "ext_string.ml"
23604
23610
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
@@ -24163,6 +24169,11 @@ let get_1_2_3_4 (x : string) ~off len : int =
24163
24169
else if len = 3 then get_int_3 x off
24164
24170
else if len = 4 then get_int_4 x off
24165
24171
else assert false
24172
+
24173
+ let unsafe_sub x offs len =
24174
+ let b = Bytes.create len in
24175
+ Ext_bytes.unsafe_blit_string x offs b 0 len;
24176
+ (Bytes.unsafe_to_string b);
24166
24177
end
24167
24178
module Ext_list : sig
24168
24179
#1 "ext_list.mli"
Original file line number Diff line number Diff line change @@ -5872,6 +5872,12 @@ val get_1_2_3_4 :
5872
5872
off:int ->
5873
5873
int ->
5874
5874
int
5875
+
5876
+ val unsafe_sub :
5877
+ string ->
5878
+ int ->
5879
+ int ->
5880
+ string
5875
5881
end = struct
5876
5882
#1 "ext_string.ml"
5877
5883
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
@@ -6436,6 +6442,11 @@ let get_1_2_3_4 (x : string) ~off len : int =
6436
6442
else if len = 3 then get_int_3 x off
6437
6443
else if len = 4 then get_int_4 x off
6438
6444
else assert false
6445
+
6446
+ let unsafe_sub x offs len =
6447
+ let b = Bytes.create len in
6448
+ Ext_bytes.unsafe_blit_string x offs b 0 len;
6449
+ (Bytes.unsafe_to_string b);
6439
6450
end
6440
6451
module Ext_list : sig
6441
6452
#1 "ext_list.mli"
Original file line number Diff line number Diff line change @@ -2276,6 +2276,12 @@ val get_1_2_3_4 :
2276
2276
off:int ->
2277
2277
int ->
2278
2278
int
2279
+
2280
+ val unsafe_sub :
2281
+ string ->
2282
+ int ->
2283
+ int ->
2284
+ string
2279
2285
end = struct
2280
2286
#1 "ext_string.ml"
2281
2287
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
@@ -2840,6 +2846,11 @@ let get_1_2_3_4 (x : string) ~off len : int =
2840
2846
else if len = 3 then get_int_3 x off
2841
2847
else if len = 4 then get_int_4 x off
2842
2848
else assert false
2849
+
2850
+ let unsafe_sub x offs len =
2851
+ let b = Bytes.create len in
2852
+ Ext_bytes.unsafe_blit_string x offs b 0 len;
2853
+ (Bytes.unsafe_to_string b);
2843
2854
end
2844
2855
module Ounit_array_tests
2845
2856
= struct
Original file line number Diff line number Diff line change @@ -810,6 +810,12 @@ val get_1_2_3_4 :
810
810
off:int ->
811
811
int ->
812
812
int
813
+
814
+ val unsafe_sub :
815
+ string ->
816
+ int ->
817
+ int ->
818
+ string
813
819
end = struct
814
820
#1 "ext_string.ml"
815
821
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
@@ -1374,6 +1380,11 @@ let get_1_2_3_4 (x : string) ~off len : int =
1374
1380
else if len = 3 then get_int_3 x off
1375
1381
else if len = 4 then get_int_4 x off
1376
1382
else assert false
1383
+
1384
+ let unsafe_sub x offs len =
1385
+ let b = Bytes.create len in
1386
+ Ext_bytes.unsafe_blit_string x offs b 0 len;
1387
+ (Bytes.unsafe_to_string b);
1377
1388
end
1378
1389
module Bsb_pkg_types : sig
1379
1390
#1 "bsb_pkg_types.mli"
@@ -9461,7 +9472,7 @@ let clean_bs_garbage bsc_dir proj_dir =
9461
9472
try
9462
9473
Bsb_parse_sources.clean_re_js proj_dir; (* clean re.js files*)
9463
9474
ninja_clean bsc_dir proj_dir ;
9464
- List .iter try_remove Bsb_config.all_lib_artifacts;
9475
+ Ext_list .iter Bsb_config.all_lib_artifacts try_remove ;
9465
9476
with
9466
9477
e ->
9467
9478
Bsb_log.warn "@{<warning>Failed@} to clean due to %s" (Printexc.to_string e)
@@ -11150,7 +11161,7 @@ let extract_ignored_dirs (map : json_map) =
11150
11161
let interpret_json
11151
11162
~override_package_specs
11152
11163
~bsc_dir
11153
- ~generate_watch_metadata
11164
+ ~( generate_watch_metadata : bool)
11154
11165
~not_dev
11155
11166
cwd
11156
11167
Original file line number Diff line number Diff line change @@ -5069,6 +5069,12 @@ val get_1_2_3_4 :
5069
5069
off:int ->
5070
5070
int ->
5071
5071
int
5072
+
5073
+ val unsafe_sub :
5074
+ string ->
5075
+ int ->
5076
+ int ->
5077
+ string
5072
5078
end = struct
5073
5079
#1 "ext_string.ml"
5074
5080
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
@@ -5633,6 +5639,11 @@ let get_1_2_3_4 (x : string) ~off len : int =
5633
5639
else if len = 3 then get_int_3 x off
5634
5640
else if len = 4 then get_int_4 x off
5635
5641
else assert false
5642
+
5643
+ let unsafe_sub x offs len =
5644
+ let b = Bytes.create len in
5645
+ Ext_bytes.unsafe_blit_string x offs b 0 len;
5646
+ (Bytes.unsafe_to_string b);
5636
5647
end
5637
5648
module Ext_filename : sig
5638
5649
#1 "ext_filename.mli"
Original file line number Diff line number Diff line change @@ -5559,6 +5559,12 @@ val get_1_2_3_4 :
5559
5559
off:int ->
5560
5560
int ->
5561
5561
int
5562
+
5563
+ val unsafe_sub :
5564
+ string ->
5565
+ int ->
5566
+ int ->
5567
+ string
5562
5568
end = struct
5563
5569
#1 "ext_string.ml"
5564
5570
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
@@ -6123,6 +6129,11 @@ let get_1_2_3_4 (x : string) ~off len : int =
6123
6129
else if len = 3 then get_int_3 x off
6124
6130
else if len = 4 then get_int_4 x off
6125
6131
else assert false
6132
+
6133
+ let unsafe_sub x offs len =
6134
+ let b = Bytes.create len in
6135
+ Ext_bytes.unsafe_blit_string x offs b 0 len;
6136
+ (Bytes.unsafe_to_string b);
6126
6137
end
6127
6138
module Ext_list : sig
6128
6139
#1 "ext_list.mli"
Original file line number Diff line number Diff line change @@ -5537,6 +5537,12 @@ val get_1_2_3_4 :
5537
5537
off:int ->
5538
5538
int ->
5539
5539
int
5540
+
5541
+ val unsafe_sub :
5542
+ string ->
5543
+ int ->
5544
+ int ->
5545
+ string
5540
5546
end = struct
5541
5547
#1 "ext_string.ml"
5542
5548
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
@@ -6101,6 +6107,11 @@ let get_1_2_3_4 (x : string) ~off len : int =
6101
6107
else if len = 3 then get_int_3 x off
6102
6108
else if len = 4 then get_int_4 x off
6103
6109
else assert false
6110
+
6111
+ let unsafe_sub x offs len =
6112
+ let b = Bytes.create len in
6113
+ Ext_bytes.unsafe_blit_string x offs b 0 len;
6114
+ (Bytes.unsafe_to_string b);
6104
6115
end
6105
6116
module Ext_list : sig
6106
6117
#1 "ext_list.mli"
Original file line number Diff line number Diff line change @@ -22863,6 +22863,12 @@ val get_1_2_3_4 :
22863
22863
off:int ->
22864
22864
int ->
22865
22865
int
22866
+
22867
+ val unsafe_sub :
22868
+ string ->
22869
+ int ->
22870
+ int ->
22871
+ string
22866
22872
end = struct
22867
22873
#1 "ext_string.ml"
22868
22874
(* Copyright (C) 2015-2016 Bloomberg Finance L.P.
@@ -23427,6 +23433,11 @@ let get_1_2_3_4 (x : string) ~off len : int =
23427
23433
else if len = 3 then get_int_3 x off
23428
23434
else if len = 4 then get_int_4 x off
23429
23435
else assert false
23436
+
23437
+ let unsafe_sub x offs len =
23438
+ let b = Bytes.create len in
23439
+ Ext_bytes.unsafe_blit_string x offs b 0 len;
23440
+ (Bytes.unsafe_to_string b);
23430
23441
end
23431
23442
module Js_config : sig
23432
23443
#1 "js_config.mli"
You can’t perform that action at this time.
0 commit comments