• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

TokTok / toxcore / 232 / 2
74%
master: 74%

Build:
DEFAULT BRANCH: master
Ran 17 Aug 2016 04:18PM UTC
Files 85
Run time 6s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

17 Aug 2016 04:18PM UTC coverage: 65.745% (+0.4%) from 65.297%
BUILD=toxcore ENV=linux

push

travis-ci

iphydf
Make self_connection_status callback stateless.

**What are we doing?**

We are moving towards stateless callbacks. This means that when registering a
callback, you no longer pass a user data pointer. Instead, you pass a user data
pointer to tox_iterate. This pointer is threaded through the code, passed to
each callback. The callback can modify the data pointed at. An extra indirection
will be needed if the pointer itself can change.

**Why?**

Currently, callbacks are registered with a user data pointer. This means the
library has N pointers for N different callbacks. These pointers need to be
managed by the client code. Managing the lifetime of the pointee can be
difficult. In C++, it takes special effort to ensure that the lifetime of user
data extends at least beyond the lifetime of the Tox instance. For other
languages, the situation is much worse. Java and other garbage collected
languages may move objects in memory, so the pointers are not stable. Tox4j goes
through a lot of effort to make the Java/Scala user experience a pleasant one by
keeping a global array of Tox+userdata on the C++ side, and communicating via
protobufs. A Haskell FFI would have to do similarly complex tricks.

Stateless callbacks ensure that a user data pointer only needs to live during a
single function call. This means that the user code (or language runtime) can
move the data around at will, as long as it sets the new location in the
callback.

**How?**

We are doing this change one callback at a time. After each callback, we ensure
that everything still works as expected. This means the toxcore change will
require 15 Pull Requests.

8230 of 12518 relevant lines covered (65.75%)

513579.74 hits per line

Source Files on job 232.2 (BUILD=toxcore ENV=linux)
  • Tree
  • List 0
  • Changed 30
  • Source Changed 4
  • Coverage Changed 30
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 232
  • Travis Job 232.2
  • dd8a5681 on github
  • Prev Job for BUILD=toxcore ENV=linux on master (#218.2)
  • Next Job for BUILD=toxcore ENV=linux on master (#248.2)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc