Skip to content

Commit e0a514d

Browse files
Silverandrewrk
Silver
authored andcommitted
std: make IntegerBitSet and ArrayBitSet have defined memory layout
This is useful for wrapping C libraries and native interfaces that make use of bit sets
1 parent 67c4b16 commit e0a514d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/std/bit_set.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ pub fn StaticBitSet(comptime size: usize) type {
5050
/// This set is good for sets with a small size, but may generate
5151
/// inefficient code for larger sets, especially in debug mode.
5252
pub fn IntegerBitSet(comptime size: u16) type {
53-
return struct {
53+
return packed struct {
5454
const Self = @This();
5555

5656
// TODO: Make this a comptime field once those are fixed
@@ -287,7 +287,7 @@ pub fn ArrayBitSet(comptime MaskIntType: type, comptime size: usize) type {
287287
", which contains padding bits. Please round this up to an unpadded integer size (i.e. " ++ @typeName(FixedMaskType) ++ ").");
288288
}
289289

290-
return struct {
290+
return extern struct {
291291
const Self = @This();
292292

293293
// TODO: Make this a comptime field once those are fixed

0 commit comments

Comments
 (0)