Skip to content

HeapImp.h: static_assert may fail with regard to BlkPrefix and DLink sizes #278

@barracuda156

Description

@barracuda156

Could someone say if exact sizes of these structs are critical or not?

In file included from ./uppsrc/Core/heaputil.cpp:11:
./uppsrc/Core/HeapImp.h:350:41: error: static assertion failed: Wrong sizeof(BlkPrefix)
  350 |         static_assert(sizeof(BlkPrefix) == 16, "Wrong sizeof(BlkPrefix)");
      |                       ~~~~~~~~~~~~~~~~~~^~~~~
./uppsrc/Core/HeapImp.h:350:41: note: the comparison reduces to '(20 == 16)'
./uppsrc/Core/HeapImp.h:351:37: error: static assertion failed: Wrong sizeof(DLink)
  351 |         static_assert(sizeof(DLink) == 64, "Wrong sizeof(DLink)");
      |                       ~~~~~~~~~~~~~~^~~~~
./uppsrc/Core/HeapImp.h:351:37: note: the comparison reduces to '(68 == 64)'
make: *** [.cache/upp.out/Core/GCC-Gcc-Gui-Linux-Posix-Shared/heaputil.o] Error 1
In file included from ./uppsrc/Core/hheap.cpp:10:
./uppsrc/Core/HeapImp.h:350:41: error: static assertion failed: Wrong sizeof(BlkPrefix)
  350 |         static_assert(sizeof(BlkPrefix) == 16, "Wrong sizeof(BlkPrefix)");
      |                       ~~~~~~~~~~~~~~~~~~^~~~~
./uppsrc/Core/HeapImp.h:350:41: note: the comparison reduces to '(20 == 16)'
./uppsrc/Core/HeapImp.h:351:37: error: static assertion failed: Wrong sizeof(DLink)
  351 |         static_assert(sizeof(DLink) == 64, "Wrong sizeof(DLink)");
      |                       ~~~~~~~~~~~~~~^~~~~
./uppsrc/Core/HeapImp.h:351:37: note: the comparison reduces to '(68 == 64)'
In file included from ./uppsrc/Core/sheap.cpp:9:
./uppsrc/Core/HeapImp.h:350:41: error: static assertion failed: Wrong sizeof(BlkPrefix)
  350 |         static_assert(sizeof(BlkPrefix) == 16, "Wrong sizeof(BlkPrefix)");
      |                       ~~~~~~~~~~~~~~~~~~^~~~~
./uppsrc/Core/HeapImp.h:350:41: note: the comparison reduces to '(20 == 16)'
./uppsrc/Core/HeapImp.h:351:37: error: static assertion failed: Wrong sizeof(DLink)
  351 |         static_assert(sizeof(DLink) == 64, "Wrong sizeof(DLink)");
      |                       ~~~~~~~~~~~~~~^~~~~
./uppsrc/Core/HeapImp.h:351:37: note: the comparison reduces to '(68 == 64)'
make: *** [.cache/upp.out/Core/GCC-Gcc-Gui-Linux-Posix-Shared/hheap.o] Error 1
make: *** [.cache/upp.out/Core/GCC-Gcc-Gui-Linux-Posix-Shared/sheap.o] Error 1
In file included from ./uppsrc/Core/lheap.cpp:11:
./uppsrc/Core/HeapImp.h:350:41: error: static assertion failed: Wrong sizeof(BlkPrefix)
  350 |         static_assert(sizeof(BlkPrefix) == 16, "Wrong sizeof(BlkPrefix)");
      |                       ~~~~~~~~~~~~~~~~~~^~~~~
./uppsrc/Core/HeapImp.h:350:41: note: the comparison reduces to '(20 == 16)'
./uppsrc/Core/HeapImp.h:351:37: error: static assertion failed: Wrong sizeof(DLink)
  351 |         static_assert(sizeof(DLink) == 64, "Wrong sizeof(DLink)");
      |                       ~~~~~~~~~~~~~~^~~~~
./uppsrc/Core/HeapImp.h:351:37: note: the comparison reduces to '(68 == 64)'
make: *** [.cache/upp.out/Core/GCC-Gcc-Gui-Linux-Posix-Shared/lheap.o] Error 1

For the first look it does not seem that anything actually requires them to be exactly 64 and 16. But if it is important, I will try to find a way to fit sizes to what is expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions