1
0
mirror of https://github.com/lxc/go-lxc.git synced 2026-02-05 06:46:38 +01:00

container: Fix 32bit build

Reduce memory allocation for snapshots to allow building on 32bit.
This will limit the total number of snapshots that this can handle but
it's still such a ludicrous number that it shouldn't be an issue until
we can fully ignore 32bit.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
This commit is contained in:
Stéphane Graber
2021-03-24 15:50:45 -04:00
parent 3eb27f7385
commit 5f45fb54e6

View File

@@ -295,7 +295,7 @@ func (c *Container) Snapshots() ([]Snapshot, error) {
return nil, ErrNoSnapshot
}
gosnapshots := (*[(1 << 30) - 1]C.struct_lxc_snapshot)(unsafe.Pointer(csnapshots))[:size:size]
gosnapshots := (*[(1 << 26) - 1]C.struct_lxc_snapshot)(unsafe.Pointer(csnapshots))[:size:size]
snapshots := make([]Snapshot, size, size)
for i := 0; i < size; i++ {
snapshots[i] = Snapshot{