Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Compile-time bounds checking for user-defined types

A technique of boundary checking and definition, applied in the direction of using stored programs for program control, program code conversion, instrumentation, etc.

Active Publication Date: 2012-04-04
MICROSOFT TECH LICENSING LLC
View PDF5 Cites 3 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

But the compiler or other optimization tools may automatically eliminate the second bounds check after determining that the array size has not been changed and that the same location in the array is being read and then written to

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Compile-time bounds checking for user-defined types
  • Compile-time bounds checking for user-defined types
  • Compile-time bounds checking for user-defined types

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0013] overview

[0014] Today's managed code systems, like Microsoft .NET and environments (marks of Microsoft Corporation and Oracle America Corporation, respectively), it is often assumed that all memory used by managed code programs is allocated and managed automatically. However, in system programming, especially device driver programming, this assumption may fail. In some cases, the memory used by a device driver is fixed in location by the physical device, such as when buffers on the device are memory mapped into a specific set of addresses. In other cases, memory is managed explicitly to avoid unnecessary copying of data or to reuse buffers within certain time limits.

[0015] In some languages ​​(such as C#), programmers will frequently use unsafe pointers to unmanaged data structures when the program uses explicitly allocated memory. Care must be taken to avoid errors when accessing this pointer or doing pointer arithmetic. Unsafe pointers can negate the corre...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The present invention relates to a compile-time bounds checking for user-defined types. Compile-time optimized bounds checking of user-defined types is provided. A user-defined class has an annotated memory-accessing method, and an annotated bound-providing member such as an integer field containing a bound or a method that returns a bound when called. The user-defined-bounds check may supply bounds checking where the programming language has none, or it may supplement existing bounds checks, e.g., by wrapping a built-in array type or a garbage-collector-managed type. Bounds checking can be extended beyond arrays and other types whose layout is controlled by a compiler, allowing efficient systems programming in a managed code environment. A bounds-check representation is inserted by the compiler in intermediate language code. Optimization then reduces duplicative bounds checking.

Description

technical field [0001] The present invention relates to computer-readable media, processes, and computer systems, and more particularly, to compile-time bounds checking for user-defined types. Background technique [0002] Bounds checking can be done in a computer program to detect whether a variable is within some specified bounds. For example, before using a value as an index into an array, the value can be checked to determine whether the value is within the bounds of the array, this bounds check is sometimes called an index check or a range check. A failed bounds check can generate runtime errors, such as exception signals. Attempting to access an array or other variable outside its bounds often indicates a programming error. However, bounds checking is not always performed before each use of bounded variables because bounds checking increases program execution time. [0003] Compilers sometimes automatically eliminate bounds checks that are deemed unnecessary. As an...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F9/45
CPCG06F9/00G06F8/423G06F8/437G06F8/443G06F8/40G06F9/06G06F9/30
Inventor D·S·哈维
Owner MICROSOFT TECH LICENSING LLC
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products