Ignore:
Timestamp:
Dec 29, 2008, 6:10:07 PM (12 years ago)
Author:
charles
Message:

(trunk libT) avoid some unnecessary memory fragmentation... for composited objects that have a tr_publisher, contain the it directly rather than a pointer to one allocated elsewhere on the heap.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/publish.h

    r7404 r7528  
    1818#define _TR_PUBLISHER_H_
    1919
     20struct tr_list;
     21
    2022/**
    2123***  A lightweight implementation of the 'Observable' design pattern.
    2224**/
    2325
    24 typedef struct tr_publisher_s tr_publisher_t;
     26typedef struct tr_publisher
     27{
     28    struct tr_list * list;
     29}
     30tr_publisher;
    2531
    2632typedef void * tr_publisher_tag;
     
    3440**/
    3541
    36 tr_publisher_tag tr_publisherSubscribe( tr_publisher_t * publisher,
     42tr_publisher_tag tr_publisherSubscribe( tr_publisher  * publisher,
    3743                                        tr_delivery_func delivery_func,
    3844                                        void *           user_data );
    3945
    40 void             tr_publisherUnsubscribe( tr_publisher_t * publisher,
     46void             tr_publisherUnsubscribe( tr_publisher  * publisher,
    4147                                          tr_publisher_tag tag );
    4248
     
    4551**/
    4652
    47 tr_publisher_t * tr_publisherNew( void );
     53extern const tr_publisher TR_PUBLISHER_INIT;
    4854
    49 void             tr_publisherFree( tr_publisher_t ** publisher );
     55void             tr_publisherDestruct( tr_publisher * );
    5056
    51 void             tr_publisherPublish( tr_publisher_t * publisher,
     57void             tr_publisherPublish( tr_publisher * publisher,
    5258                                      void *           source,
    5359                                      void *           event );
Note: See TracChangeset for help on using the changeset viewer.