~ubuntu-branches/ubuntu/trusty/fcitx/trusty-proposed

« back to all changes in this revision

Viewing changes to src/lib/fcitx-utils/memory.h

  • Committer: Package Import Robot
  • Author(s): Aron Xu
  • Date: 2013-02-10 17:03:56 UTC
  • mfrom: (1.3.18) (33.1.3 experimental)
  • Revision ID: package-import@ubuntu.com-20130210170356-2yuv6xy3ed378kn0
Tags: 1:4.2.7-1
* New upstream release.
* New binary packages:
  - fcitx-libs-gclient: D-Bus client library for Glib
  - fcitx-libs-qt: D-Bus client library for Qt
  - fcitx-module-quickphrase-editor: Quick Phrase editor module

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
 
48
48
#include <stdlib.h>
49
49
 
 
50
#ifdef __cplusplus
 
51
extern "C" {
 
52
#endif
 
53
 
50
54
/** memory pool private struct */
51
55
typedef struct _FcitxMemoryPool FcitxMemoryPool;
52
56
 
65
69
 * @return void*
66
70
 **/
67
71
void* fcitx_memory_pool_alloc(FcitxMemoryPool* pool, size_t size);
 
72
#define fcitx_memory_pool_alloc(pool, size)             \
 
73
    fcitx_memory_pool_alloc_align(pool, size, 0)
 
74
 
 
75
void *fcitx_memory_pool_alloc_align(FcitxMemoryPool* pool,
 
76
                                    size_t size, int align);
 
77
#define fcitx_memory_pool_alloc_align(pool, size, args...)      \
 
78
    _fcitx_memory_pool_alloc_align(pool, size, ##args, 1)
 
79
#define _fcitx_memory_pool_alloc_align(pool, size, align, ...)  \
 
80
    (fcitx_memory_pool_alloc_align)(pool, size, align)
68
81
 
69
82
/**
70
83
 * free memory pool and free all the memory inside the pool
74
87
 **/
75
88
void fcitx_memory_pool_destroy(FcitxMemoryPool* pool);
76
89
 
 
90
/**
 
91
 * free all the memory inside the pool but keep the pool itself
 
92
 *
 
93
 * @param pool memory ppol
 
94
 * @return void
 
95
 * @since 4.2.6
 
96
 **/
 
97
void fcitx_memory_pool_clear(FcitxMemoryPool* pool);
 
98
 
 
99
#ifdef __cplusplus
 
100
}
 
101
#endif
 
102
 
77
103
#endif
78
104
 
79
105
/**