Skip to content

v4.0.0

Compare
Choose a tag to compare
@FedeDP FedeDP released this 26 Jan 09:57
· 432 commits to master since this release

Here is a new libmodule release.
This release breaks API thus the version bump.

Highlights:

New APIs

  • module_get_ref should now be used to take another module reference. All Actor-like API has been changed to make use of module references. A module reference is a self_t object that is marked as reference, and thus it cannot be used to pretend being another module.
  • stack_clear to completely reset a stack_t object.
  • stack_set_dtor to set a dtor function to be called on each element marked with autofree upon deletion.
  • map_clear to completely reset a map_t object.
  • map_set_dtor to set a dtor function to be called on each element marked with autofree upon deletion.

API breaks

  • module_tell now takes a self_t as second parameter; this leads to better performance too as no more hasmap lookups must be done for each module_tell.
  • map_put now takes an additional "autofree" parameter, to mark data to be autofreed by map API (upon map_clear or map_free.

Fixes

  • You cannot use another module "self_t" as obtained by pubsub msg sender to impersonate it.
  • module_register now avoids memleaks when it fails with NOMEM.
  • Fixed an issue in map_new if m->data calloc fails: map object was not memsetted to 0 thus leading to a crash when map_free was called.
  • Actually honor current module's callback when flushing pubsub messages.

Generic

  • More tests have been added, making libmodule more robust.
  • Code has been refactored and it is now more easy to read.
  • Doc has been obviously updated.