Comments (4)
@jori-nordic thanks for creating this issue. Just a few quick thoughts:
- I don't think we want to constrain this API to
ref == 1
. Moving a reference doesn't need to imply that this is the only reference there is - that's a separate use-case specific constraint IMO. - Since we have
atomic_ptr_clear()
I'd just use it. Most places may not need it right now, but as we move towards supporting preemptible threads then being able to use this API without locking will be nice.
from zephyr.
To me this new function gives impression of moving the data from/to the net_buf, like what memmove()
does. Not sure what it could be called, but some examples could be net_buf_replace()
, net_buf_swap()
or similar.
from zephyr.
To me this new function gives impression of moving the data from/to the net_buf, like what
memmove()
does. Not sure what it could be called, but some examples could benet_buf_replace()
,net_buf_swap()
or similar.
@jukkar point taken. That said, we do tend to use net_buf_*_mem()
in the net_buf API for memory operations. Also, "move" is verb that's used for analogous things in other languages, like Rust. Would it help to append _ref() to the API, i.e. net_buf_move_ref()
? (not sure I prefer that more, but that could just be due to my dislike for unnecessarily long symbol names :)
from zephyr.
Yes, net_buf_move_ref()
would indeed be better here.
from zephyr.
Related Issues (20)
- RTC RV3028 clock output disabled by enabling alarm/update callback
- NXP's IMX RT1010 triggers assert on SPI Loopback test when EDMA enabled HOT 3
- bluetooth: audio: race hazard in bt_bap_unicast_client_discover() HOT 5
- spi: stm32 spi slave spi_read should return immediately after a spi transaction. HOT 1
- Reinit Systick when using S2RAM
- Automatically include references to a sample's relevant APIs
- intel_adsp: test_colors fails on tests/subsys/logging/log_output/logging.output.*
- Bluetooth: Controller: ISO: Providing incorrect broadcast code asserts instead of returning MIC failure
- [Backport v3.7-branch] Failed to backport #77008
- ESP32C3: Inconsistent flash erase times in ESP32-C3-MINI-1 (ESP32-C3FN4) modules [zephyr-v3.6.99] HOT 4
- [Backport v3.7-branch] Failed to backport #77054
- multi_heap: support for realloc HOT 1
- SCSI Read Capacity reports wrong capacity when used with USB Mass storage device HOT 1
- Devices using USB Mass storage function sometimes crash upon USB insertion, or during files manipulation from a host computer HOT 1
- RTC RV3028 driver does not disable minutes alarm correctly
- TFM: Nordic pinctrl consumers broken
- Sample USB-C Sink Not Working in Zephyr v3.7.0 on weact_stm32g431_core HOT 6
- Unaligned 32-bit reads following casts on dns_socket_dispatcher::local_addr (Cortex-M0) HOT 4
- off-by-one error on month counting in rtc rv8263 driver HOT 2
- drivers: spi: stm32: Broken device power management on SPI bus HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zephyr.