8000 CVD_IMAGE_DEBUG and bounds checking with img[y][x] syntax · Issue #30 · edrosten/libcvd · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content 8000
CVD_IMAGE_DEBUG and bounds checking with img[y][x] syntax #30
Open
@deads

Description

@deads

The CVD_IMAGE_DEBUG macro is very useful for checking out-of-bounds memory violations, but it does not work in many cases throughout the CVD library where the img[y][x] syntax is used.

One idea is when CVD_IMAGE_DEBUG is defined img[y] returns a BoundsCheckedBuffer<T> instead of a T*. BoundsCheckedBuffer<T> is a type that behaves like a T* but returns an error when an attempt is made to access outside the horizontal scan-line. The only situation where this would not work is when a type is specialized on a T* but I imagine this case is rare.

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

      0