8000 Tracking: Generic over static lifetimes in HIL interfaces · Issue #1074 · tock/tock · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Tracking: Generic over static lifetimes in HIL interfaces #1074
Closed
@ppannuto

Description

@ppannuto

HILs with 'static not in the context of buffers:

Early in Tock we used 'static lifetimes fairly liberally. As interfaces matured, we shifted towards generic lifetimes ('a) for the flexibility it (could eventually) affords components. Unfortunately, many of the HILs currently specific static rather than generic lifetimes.

As noted in (2) of #1069, one example of a negative consequence is an artificial restriction of where and how clients can be set.

I believe that the use of static lifetimes is largely a historical artifact, however I wanted to open this as an RFC in case this is something folks feel we need to discuss further before adapting.

Current Status

From a highly scientific and imprecise study, we have more HILs with static lifetimes than generic, but I think that can be attributed to history. Loosely, the newer HILs seem to prefer generic lifetimes:

# Static
$ git grep static | grep -v '//!' | cut -d':' -f1 | sort | uniq -c
   9 adc.rs
   5 ble_advertising.rs
   4 flash.rs
  11 i2c.rs
   4 led.rs
   1 ninedof.rs
   5 nonvolatile_storage.rs
  12 radio.rs
   4 sensors.rs
  14 spi.rs
   3 symmetric_encryption.rs
   6 uart.rs
# Generic
$ git grep "'a" | grep -v '//!' | cut -d':' -f1 | sort | uniq -c
   2 flash.rs
  10 symmetric_encryption.rs

Metadata

Metadata

Assignees

No one assigned

    Labels

    HILThis affects a Tock HIL interface.tracking

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0