Skip to content

Bool type maybe wrong calculated #22

Description

@Alisis33

I used a code for number theory returning results on a bool array. The code crashed in unpredictable way.

Now I found that SizeOf returns a 4 byte for bool. Should it be 1 byte? I am not sure.
I changed the type on c# to byte[] and in kernel to uchar[], and the code works now.

Could there by a bug? I am not sure, so sorry if it is a false alarm.

internal static int SizeOf<T>() { return typeof (T).IsGenericType ? Marshal.SizeOf(default(T)) : Marshal.SizeOf(typeof(T)); }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions