@@ -41,12 +41,12 @@ pub const GameProfile = struct {
4141 id : []const u8 ,
4242 name : []const u8 ,
4343 engine : []const u8 ,
44- ports : std .ArrayList (Port ),
44+ ports : std .array_list . AlignedManaged (Port , null ),
4545 protocol : []const u8 ,
4646 fingerprint_pattern : []const u8 ,
4747 config_format : []const u8 ,
4848 config_path : []const u8 ,
49- field_defs : std .ArrayList (FieldDef ),
49+ field_defs : std .array_list . AlignedManaged (FieldDef , null ),
5050 actions : std .StringHashMap ([]const u8 ),
5151 allocator : Allocator ,
5252
@@ -56,12 +56,12 @@ pub const GameProfile = struct {
5656 .id = "" ,
5757 .name = "" ,
5858 .engine = "" ,
59- .ports = std .ArrayList (Port ).init (std .heap .c_allocator ),
59+ .ports = std .array_list . AlignedManaged (Port , null ).init (std .heap .c_allocator ),
6060 .protocol = "" ,
6161 .fingerprint_pattern = "" ,
6262 .config_format = "" ,
6363 .config_path = "" ,
64- .field_defs = std .ArrayList (FieldDef ).init (std .heap .c_allocator ),
64+ .field_defs = std .array_list . AlignedManaged (FieldDef , null ).init (std .heap .c_allocator ),
6565 .actions = std .StringHashMap ([]const u8 ).init (std .heap .c_allocator ),
6666 .allocator = std .heap .c_allocator ,
6767 };
@@ -213,7 +213,7 @@ pub const ProfileRegistry = struct {
213213
214214 /// Return a JSON array summarising all loaded profiles.
215215 pub fn listProfiles (self : * ProfileRegistry , allocator : Allocator ) ! []const u8 {
216- var buf = std .ArrayList (u8 ).init (allocator );
216+ var buf = std .array_list . AlignedManaged (u8 , null ).init (allocator );
217217 errdefer buf .deinit ();
218218 const writer = buf .writer ();
219219
@@ -252,12 +252,12 @@ pub fn parseA2MLProfile(data: []const u8, allocator: Allocator) !GameProfile {
252252 .id = try allocator .dupe (u8 , "" ),
253253 .name = try allocator .dupe (u8 , "" ),
254254 .engine = try allocator .dupe (u8 , "" ),
255- .ports = std .ArrayList (Port ).init (allocator ),
255+ .ports = std .array_list . AlignedManaged (Port , null ).init (allocator ),
256256 .protocol = try allocator .dupe (u8 , "" ),
257257 .fingerprint_pattern = try allocator .dupe (u8 , "" ),
258258 .config_format = try allocator .dupe (u8 , "" ),
259259 .config_path = try allocator .dupe (u8 , "" ),
260- .field_defs = std .ArrayList (FieldDef ).init (allocator ),
260+ .field_defs = std .array_list . AlignedManaged (FieldDef , null ).init (allocator ),
261261 .actions = std .StringHashMap ([]const u8 ).init (allocator ),
262262 .allocator = allocator ,
263263 };
@@ -367,7 +367,7 @@ pub fn parseA2MLProfile(data: []const u8, allocator: Allocator) !GameProfile {
367367 if (std .mem .indexOfPos (u8 , field_body , opt_start , ")" )) | opt_end | {
368368 const opt_content = field_body [opt_start + 9 .. opt_end ];
369369 // Count quoted strings
370- var enum_list = std .ArrayList ([]const u8 ).init (allocator );
370+ var enum_list = std .array_list . AlignedManaged ([]const u8 , null ).init (allocator );
371371 var opt_pos : usize = 0 ;
372372 while (opt_pos < opt_content .len ) {
373373 if (opt_content [opt_pos ] == '"' ) {
@@ -459,7 +459,7 @@ fn extractAttrFrom(attrs: []const u8, name: []const u8) ?[]const u8 {
459459/// Returns the number of profiles loaded, or a negative error code.
460460export fn gossamer_gsa_load_profiles (
461461 dir : [* :0 ]const u8 ,
462- ) callconv (.C ) c_int {
462+ ) callconv (.c ) c_int {
463463 const gsa = main .getGlobalHandle () orelse {
464464 main .setErrorStr ("not initialized" );
465465 return @intFromEnum (main .GsaResult .not_initialized );
@@ -480,7 +480,7 @@ export fn gossamer_gsa_load_profiles(
480480/// Returns a NUL-terminated JSON string.
481481threadlocal var list_profiles_buf : [16384 ]u8 = undefined ;
482482
483- export fn gossamer_gsa_list_profiles () callconv (.C ) [* :0 ]const u8 {
483+ export fn gossamer_gsa_list_profiles () callconv (.c ) [* :0 ]const u8 {
484484 const gsa = main .getGlobalHandle () orelse {
485485 main .setErrorStr ("not initialized" );
486486 return @as ([* :0 ]const u8 , @ptrCast (&[_ :0 ]u8 { '[' , ']' }));
@@ -504,7 +504,7 @@ export fn gossamer_gsa_list_profiles() callconv(.C) [*:0]const u8 {
504504/// Returns 0 on success, negative error code on failure.
505505export fn gossamer_gsa_add_profile (
506506 a2ml : [* :0 ]const u8 ,
507- ) callconv (.C ) c_int {
507+ ) callconv (.c ) c_int {
508508 const gsa = main .getGlobalHandle () orelse {
509509 main .setErrorStr ("not initialized" );
510510 return @intFromEnum (main .GsaResult .not_initialized );
@@ -557,7 +557,7 @@ test "parse minimal A2ML profile" {
557557 \\ @end
558558 \\ @end
559559 \\ @ports:
560- \\ @port(name="game", number=27015, protocol="UDP"):@end
560+ \\ @port(name="game", number=" 27015" , protocol="UDP"):@end
561561 \\ @end
562562 \\@end
563563 ;
@@ -589,11 +589,9 @@ test "ProfileRegistry init and deinit" {
589589}
590590
591591test "GameProfile.empty" {
592- var p = GameProfile .empty ();
592+ const p = GameProfile .empty ();
593593 try std .testing .expectEqualStrings ("" , p .id );
594594 try std .testing .expectEqual (@as (usize , 0 ), p .ports .items .len );
595- // empty() uses c_allocator so no deinit needed for test
596- _ = p ;
597595}
598596
599597test "extractAttrFrom" {
0 commit comments