Skip to content

uctypes reports wrong sizeof() #15

@jepler

Description

@jepler

Hardware

umac

m86k MicroPython version

>>> descr = { 's': uctypes.INT32, 'c': uctypes.INT8 | 4 }
>>> uctypes.sizeof(descr)
8

However, the correct size is 6 bytes, because the alignment of INT32 is 2 bytes, not 4 bytes.

I think the uctypes assumption is that any object is aligned to its size. But this is not true in the m68k mac ABI.

Reproduction

use the above code

Expected behaviour

should print 6

Observed behaviour

prints 8

Additional Information

No, I've provided everything above.

Code of Conduct

Yes, I agree

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy