# US 2014/0195741 A1 · Type casting in a managed code system

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2014/0195741 A1
- Document ID: US20140195741A1
- Status: Published application
- Kind: A1
- Application number: 13/734,793
- Filed: 2013-01-04
- Published: 2014-07-10
- Earliest claimed: 2013-01-04
- Assignees: Microsoft Corporation
- Applicants: Microsoft Corporation
- Inventors: Martin Taillefer
- Web page: https://patentgrep.com/patent/US20140195741A1

## CPC

- G06F 12/0813: with a network or matrix configuration
- G06F 8/437: {Type checking}
- G06F 9/30192: {according to data descriptor, e.g. dynamic data typing}
- G06F 12/145: {the protection being virtual, e.g. for virtual blocks or segments before a translation mechanism}
- G06F 8/315: {Object-oriented languages}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Type casting in a managed code system is described. The managed code system includes managed memory as well as shared memory located outside of the managed memory. The managed memory has multiple managed memory portions, each corresponding to a computing entity, such as a processes. The type system permits obtaining of data from shared memory using type casting to thereby assign the data a type that supports type casting. The type is a valid type casting type that satisfies certain requirements that allow the type to be assigned while maintaining type safety.

## Claims

### Claim 1

A managed code system comprising:
a managed memory have a plurality of managed memory portions, each corresponding to a managed computing entity;
shared memory located outside of the managed memory;
a type system that permits obtaining a data from shared memory using type casting to thereby assign the data a type that supports type casting.

### Claim 2 (depends on 1)

The system in accordance with claim 1, wherein the type is a value type.

### Claim 3 (depends on 1)

The system in accordance with claim 1, wherein the type is composed only of other types which support type casting.

### Claim 4 (depends on 1)

The system in accordance with claim 1, wherein the type is not composed of references.

### Claim 5 (depends on 1)

The system in accordance with claim 1, wherein the type is defined using a specific memory layout.

### Claim 6 (depends on 1)

The system in accordance with claim 1, wherein the type tolerates any bit pattern in any of its type fields.

### Claim 7 (depends on 1)

The system in accordance with claim 1, wherein the type is a value type, is composed only of other types which support type casting, is not composed of references, is defined using a specific memory layout, and tolerates any bit pattern in any of its type fields.

### Claim 8 (depends on 1)

The system in accordance with claim 1, wherein a first span is used to reference the data as a first type.

### Claim 9 (depends on 8)

The system in accordance with claim 8, wherein a second span is used to reference the data as a second type.

### Claim 10 (depends on 1)

The system in accordance with claim 1, wherein the type is a TCP header.

### Claim 11

A method for type casting in a managed code environment, the method comprising:
an act of determining that data from the shared memory may be subject to type casting for a plurality of types that support type casting; and
an act of a type system obtaining data from shared memory using type casting to thereby assign the data a type of the plurality of types that supports type casting.

### Claim 12 (depends on 11)

The method in accordance with claim 11, wherein the shared memory is outside of entity-specific managed memory that includes a plurality of portions, each corresponding to a particular computing entity.

### Claim 13 (depends on 11)

The method in accordance with claim 11, wherein the particular computing entities include processes.

### Claim 14 (depends on 11)

The method in accordance with claim 11, wherein the particular computing entities include threads.

### Claim 15 (depends on 11)

The system in accordance with claim 11, wherein each of the plurality of types is a value type.

### Claim 16 (depends on 11)

The method in accordance with claim 11, wherein each of the plurality of type is composed only of other types which support type casting.

### Claim 17 (depends on 11)

The method in accordance with claim 11, wherein the type is not composed of references.

### Claim 18 (depends on 11)

The method in accordance with claim 11, wherein the type is defined using a specific memory layout.

### Claim 19 (depends on 11)

The method in accordance with claim 11, wherein the type tolerates any bit pattern in any of its type fields.

### Claim 20

A computer program product comprising one or more computer-readable media having thereon computer-executable instructions that, when executed by one or more processors of a computing system, cause the computing system to operate a type system in a managed code environment, the type system configure to perform type casting by performing the following:
an act of determining that data from the shared memory may be subject to type casting for a plurality of types that support type casting; and
an act of a type system obtaining data from shared memory using type casting to thereby assign the data a type of the plurality of types that supports type casting.
