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)
- sample: drivers: spi_flash: sample.drivers.spi.flash - spi_nor - undefined reference to `__device_dts_ord_161'
- drivers: video: software driver to turn a display into a video sink
- stm32H7 cannot XiP from dual quad nor in Memorymapped mode HOT 1
- RFC: sensor authors should take maintainership/ownership
- RFC: sensor decoder associated data HOT 5
- How to find out ((no paths)) and (hidden) section information using rom_report
- IOT Devices disconnects if the Gateway is replaced with new gateway HOT 10
- Unaligned access fault in net_if.c for pi_pico_w. HOT 3
- Governing Board 2024 Dependability Goals
- ci: samples: frdm_k64f build failure HOT 1
- APPLICATION_CONFIG_DIR should follow principle of ROOT settings
- Sysbuild treats relative ROOT settings differently in sysbuild vs. image build
- LLEXT EDK sample generates an EDK that's missing header files on Windows
- samples: subsys: usb: hid-keyboard: Assertion failure on USB cable attach when CONFIG_ASSERT=y HOT 3
- Lack of overlay for adc tests for steval_stwinbx1
- DOC: Generation: Win10: Could not import extension zephyr.kconfig (exception: No module named 'sphinx.util.display') HOT 3
- LE Audio: CAP Initiator cannot handle any unexpected state changes HOT 1
- Zephyr MQTT library -128 error when trying to use unencrypted broker with authentication. HOT 6
- DACx3608 Driver Feature Support HOT 1
- drivers: sensors: nxp: kinetis: temp: wrong length provided to memset()
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.