本文整理汇总了C++中pd_free函数的典型用法代码示例。如果您正苦于以下问题:C++ pd_free函数的具体用法?C++ pd_free怎么用?C++ pd_free使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pd_free函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: hammerfile_free
void hammerfile_free(t_hammerfile *f)
{
t_hammerfile *prev, *next;
hammereditor_close(f, 0);
if (f->f_embedfn)
/* just in case of missing 'restore' */
hammerembed_gc(f->f_master, ps__C, 0);
if (f->f_savepanel)
{
pd_unbind((t_pd *)f->f_savepanel, f->f_savepanel->f_bindname);
pd_free((t_pd *)f->f_savepanel);
}
if (f->f_bindname) pd_unbind((t_pd *)f, f->f_bindname);
if (f->f_panelclock) clock_free(f->f_panelclock);
if (f->f_editorclock) clock_free(f->f_editorclock);
for (prev = 0, next = hammerfile_proxies;
next; prev = next, next = next->f_next)
if (next == f)
break;
if (prev)
prev->f_next = f->f_next;
else if (f == hammerfile_proxies)
hammerfile_proxies = f->f_next;
pd_free((t_pd *)f);
}
开发者ID:dropship,项目名称:special-delivery,代码行数:25,代码来源:file.c
示例2: pd_string_free
void pd_string_free(t_pdstring *str)
{
if (!str) return;
if (str->strData)
{
pd_free(str->strData);
}
pd_free(str);
}
开发者ID:spike0xff,项目名称:pdfraster,代码行数:9,代码来源:PdfString.c
示例3: pando_buffer_delete
void FUNCTION_ATTRIBUTE pando_buffer_delete(struct pando_buffer *pdbuf)
{
if (pdbuf == NULL)
{
return;
}
if (pdbuf->buffer != NULL)
{
pd_free(pdbuf->buffer);
}
pd_free(pdbuf);
}
开发者ID:DenisZheng,项目名称:pando-ios-sdk,代码行数:12,代码来源:pando_protocol_tool.c
示例4: delete_device_package
void FUNCTION_ATTRIBUTE delete_device_package(struct sub_device_buffer *device_buffer)
{
if (device_buffer != NULL)
{
if (device_buffer->buffer != NULL)
{
pd_free(device_buffer->buffer);
device_buffer->buffer = NULL;
}
}
pd_free(device_buffer);
device_buffer = NULL;
}
开发者ID:DenisZheng,项目名称:pando-protocol,代码行数:14,代码来源:sub_device_protocol.c
示例5: sic_makecostable
static void *cycle_new(t_symbol *s, int ac, t_atom *av)
{
t_cycle *x = (t_cycle *)pd_new(cycle_class);
int i = (ac && av->a_type == A_FLOAT ? 1 : 0);
int tabsize = CYCLE_TABSIZE;
x->x_costable = sic_makecostable(&tabsize);
if (tabsize != CYCLE_TABSIZE)
{
loudbug_bug("cycle_new");
pd_free((t_pd *)x);
return (0);
}
if (ac && av->a_type == A_FLOAT)
{
sic_inlet((t_sic *)x, 0, 0, 0, ac, av);
ac--, av++;
}
sic_newinlet((t_sic *)x, 0);
outlet_new((t_object *)x, &s_signal);
x->x_offset = 0;
if (ac && av->a_type == A_SYMBOL)
{
x->x_name = av->a_w.w_symbol;
ac--, av++;
if (ac && av->a_type == A_FLOAT)
if ((x->x_offset = (int)av->a_w.w_float) < 0)
x->x_offset = 0;
}
else x->x_name = 0;
x->x_table = 0;
x->x_phase = 0.;
x->x_conv = 0.;
return (x);
}
开发者ID:EQ4,项目名称:Pd-for-LibPd,代码行数:34,代码来源:cycle.c
示例6: multireceive_free
static void multireceive_free(t_multireceive *x)
{
multireceive_clear(x);
pd_free((t_pd *)x->x_proxy);
outlet_free(x->x_out);
x->x_out=NULL;
}
开发者ID:Angeldude,项目名称:pd,代码行数:7,代码来源:multireceive.c
示例7: dict_unbind
/* adapted pd_unbind() from m_pd.c */
void dict_unbind(t_dict *x, t_pd *obj, t_symbol *s)
{
#ifdef DICT_DEBUG
post("unbind %x from \"%s\" at %x", (int)obj, s->s_name, (int)s);
#endif
if (s->s_thing == obj) s->s_thing = 0;
else if (s->s_thing && *s->s_thing == x->d_bindlist_class)
{
/* bindlists always have at least two elements... if the number
goes down to one, get rid of the bindlist and bind the symbol
straight to the remaining element. */
t_dict_bindlist *b = (t_dict_bindlist *)s->s_thing;
t_dict_bindelem *e, *e2;
if ((e = b->b_list)->e_who == obj)
{
b->b_list = e->e_next;
freebytes(e, sizeof(t_dict_bindelem));
}
else for (e = b->b_list; e2 = e->e_next; e = e2)
if (e2->e_who == obj)
{
e->e_next = e2->e_next;
freebytes(e2, sizeof(t_dict_bindelem));
break;
}
if (!b->b_list->e_next)
{
s->s_thing = b->b_list->e_who;
freebytes(b->b_list, sizeof(t_dict_bindelem));
pd_free(&b->b_pd);
}
}
else pd_error(obj, "%s: couldn't unbind", s->s_name);
}
开发者ID:pure-data,项目名称:xeq,代码行数:36,代码来源:dict.c
示例8: pd_alloc
packet_data* pd_alloc(uint16_t size, uint16_t block_size)
{
packet_data* pd = NULL;
packet_data* next = NULL;
while(size)
{
uint16_t alloc_size = size > block_size ? block_size : size;
if (next == NULL)
{
pd = bget(align_size(sizeof(packet_data) + alloc_size));
next = pd;
} else
{
next->next = bget(align_size(sizeof(packet_data) + alloc_size));
next = next->next;
}
if (next == NULL)
{
pd_free(pd);
return NULL;
}
pd->data = (uint8_t*)pd + sizeof(packet_data);
pd->next = NULL;
pd->size = alloc_size;
pd->total_size = size;
pd->refs_count = 1;
size -= alloc_size;
}
return pd;
}
开发者ID:oter,项目名称:dtolc,代码行数:32,代码来源:laser_packet.c
示例9: bindlist_cleanup
static void bindlist_cleanup(t_bindlist *x)
{
//fprintf(stderr,"bindlist_cleanup\n");
t_bindelem *e, *e2;
if (x->b_list->e_who == NULL)
{
e = x->b_list;
x->b_list = e->e_next;
freebytes(e, sizeof(t_bindelem));
//fprintf(stderr,"success B1a\n");
}
for (e = x->b_list; e2 = e->e_next; e = e2)
if (e2->e_who == NULL)
{
e->e_next = e2->e_next;
freebytes(e2, sizeof(t_bindelem));
//fprintf(stderr,"success B1b\n");
break;
}
if (!x->b_list->e_next)
{
freebytes(x->b_list, sizeof(t_bindelem));
pd_free(&x->b_pd);
//fprintf(stderr,"success B2\n");
}
}
开发者ID:Tzero2,项目名称:pd,代码行数:26,代码来源:m_pd.c
示例10: calloc
struct pt_directive *pd_alloc(size_t n)
{
struct pt_directive *pd;
pd = calloc(1, sizeof(*pd));
if (!pd)
return NULL;
pd->name = malloc(n);
if (!pd->name)
goto error;
pd->payload = malloc(n);
if (!pd->payload)
goto error;
pd->nlen = n;
pd->plen = n;
return pd;
error:
pd_free(pd);
return NULL;
}
开发者ID:kasikci,项目名称:processor-trace,代码行数:25,代码来源:yasm.c
示例11: add_next_property
/* malloc a new block to save old buffer and new property, and update the package length */
int FUNCTION_ATTRIBUTE add_next_property(struct sub_device_buffer *data_package, uint16_t property_num, struct TLVs *next_data_params)
{
uint8_t *old_buffer = NULL;
uint8_t *position = NULL;
uint16_t old_len = 0;
uint16_t subdevice_id;
if (data_package == NULL)
{
return -1;
}
old_buffer = data_package->buffer;
old_len = data_package->buffer_length;
/* append payload length */
data_package->buffer_length += (sizeof(struct pando_property)
+ current_tlv_block_size - sizeof(struct TLVs));
data_package->buffer = (uint8_t *)pd_malloc(data_package->buffer_length);
pd_memset(data_package->buffer, 0, data_package->buffer_length);
/* copy old content and new property */
position = copy_return_next(data_package->buffer, old_buffer, old_len);
subdevice_id = 0;
position = copy_return_next(position, &subdevice_id, sizeof(subdevice_id));
property_num = host16_to_net(property_num);
position = copy_return_next(position, &property_num, sizeof(property_num));
pd_memcpy(position, next_data_params, current_tlv_block_size);
pd_free(old_buffer);
return 0;
}
开发者ID:DenisZheng,项目名称:pando-protocol,代码行数:36,代码来源:sub_device_protocol.c
示例12: pd_unbind
void pd_unbind(t_pd *x, t_symbol *s)
{
if (s->s_thing == x) s->s_thing = 0;
else if (s->s_thing && *s->s_thing == bindlist_class)
{
/* bindlists always have at least two elements... if the number
goes down to one, get rid of the bindlist and bind the symbol
straight to the remaining element. */
t_bindlist *b = (t_bindlist *)s->s_thing;
t_bindelem *e, *e2;
if ((e = b->b_list)->e_who == x)
{
b->b_list = e->e_next;
freebytes(e, sizeof(t_bindelem));
}
else for (e = b->b_list; e2 = e->e_next; e = e2)
if (e2->e_who == x)
{
e->e_next = e2->e_next;
freebytes(e2, sizeof(t_bindelem));
break;
}
if (!b->b_list->e_next)
{
s->s_thing = b->b_list->e_who;
freebytes(b->b_list, sizeof(t_bindelem));
pd_free(&b->b_pd);
}
}
else pd_error(x, "%s: couldn't unbind", s->s_name);
}
开发者ID:amurtet,项目名称:pure-data,代码行数:32,代码来源:m_pd.c
示例13: delete_pando_objects_iterator
void FUNCTION_ATTRIBUTE
delete_pando_objects_iterator(pando_objects_iterator* it)
{
if(it)
{
pd_free(it);
}
}
开发者ID:wwlong,项目名称:pando-embedded-framework,代码行数:8,代码来源:pando_object.c
示例14: delete_params_block
void delete_params_block(struct TLVs *params_block)
{
if (params_block != NULL)
{
pd_free(params_block);
params_block = NULL;
}
}
开发者ID:DenisZheng,项目名称:pando-ios-sdk,代码行数:9,代码来源:sub_device_protocol_tool.c
示例15: delete_params_block
void FUNCTION_ATTRIBUTE delete_params_block(struct TLVs *params_block)
{
if (params_block != NULL)
{
pd_free(params_block);
params_block = NULL;
}
}
开发者ID:DenisZheng,项目名称:pando-protocol,代码行数:9,代码来源:sub_device_protocol.c
示例16: gfxstub_deleteforkey
/*! This virtual function is called before the destructor.
We do this because here we can still call virtual methods.
*/
void flext_base::Exit()
{
#if FLEXT_SYS == FLEXT_SYS_MAX
// according to David Z. one should do that first...
if(NeedDSP()) dsp_free(thisHdr());
#endif
#if FLEXT_SYS == FLEXT_SYS_PD && !defined(FLEXT_NOATTREDIT)
// attribute editor window may still be open -> close it
gfxstub_deleteforkey(thisHdr());
#endif
#ifdef FLEXT_THREADS
StopThreads();
#endif
// send remaining pending messages for this object
QFlush(this);
// delete message lists
if(bindhead) delete bindhead; // ATTENTION: the object must free all memory associated to bindings itself
if(methhead) delete methhead;
if(attrhead) delete attrhead;
if(attrdata) delete attrdata;
#if FLEXT_SYS == FLEXT_SYS_PD || FLEXT_SYS == FLEXT_SYS_MAX
if(outlets) delete[] outlets;
if(inlets) {
FLEXT_ASSERT(incnt > 1);
for(int ix = 1; ix < incnt; ++ix)
if(inlets[ix-1]) {
// release proxy object
#if FLEXT_SYS == FLEXT_SYS_PD
pd_free(&inlets[ix-1]->obj.ob_pd);
#elif FLEXT_SYS == FLEXT_SYS_MAX
freeobject((object *)inlets[ix-1]);
#endif
}
delete[] inlets;
}
#endif
#if FLEXT_SYS == FLEXT_SYS_MAX
if(indesc) {
for(int i = 0; i < incnt; ++i) if(indesc[i]) delete[] indesc[i];
delete[] indesc;
}
if(outdesc) {
for(int i = 0; i < outcnt; ++i) if(outdesc[i]) delete[] outdesc[i];
delete[] outdesc;
}
#endif
flext_obj::Exit();
}
开发者ID:IcaroL2ORK,项目名称:pd,代码行数:59,代码来源:flext.cpp
示例17: lp_free
void lp_free(laser_packet* lp)
{
if (lp == NULL)
{
return;
}
pd_free(lp->data);
brel(lp);
}
开发者ID:oter,项目名称:dtolc,代码行数:10,代码来源:laser_packet.c
示例18: guiconnect_signoff
/* the GUI calls this when it disappears. (If there's any chance the
GUI will fail to do this, the "target", when it signs off, should specify
a timeout after which the guiconnect will disappear.) */
static void guiconnect_signoff(t_guiconnect *x)
{
if (!x->x_who)
pd_free(&x->x_obj.ob_pd);
else
{
pd_unbind(&x->x_obj.ob_pd, x->x_sym);
x->x_sym = 0;
}
}
开发者ID:jyg,项目名称:pure-data,代码行数:13,代码来源:g_guiconnect.c
示例19: number_release
void number_release(t_symbol *s)
{ t_number *num = (t_number *)pd_findbyclass(s,number_class);
if (num) {
if (!--num->o_refcount) {
pd_unbind(&num->o_pd, s);
pd_free(&num->o_pd);
}
}
else bug("value_release");
}
开发者ID:Angeldude,项目名称:pd,代码行数:10,代码来源:number.c
示例20: zero_device_data_process
/******************************************************************************
* FunctionName : zero_device_data_process.
* Description : process the received data of zero device(zero device is the gateway itself).
* Parameters : uint.
* Returns : none.
*******************************************************************************/
static void FUNCTION_ATTRIBUTE
zero_device_data_process(uint8_t * buffer, uint16_t length)
{
struct pando_command cmd_body;
uint16_t type = 0;
uint16_t len = 0;
struct sub_device_buffer * device_buffer = (struct sub_device_buffer *)pd_malloc(sizeof(struct sub_device_buffer));
if(device_buffer == NULL)
{
pd_printf("%s:malloc error!\n", __func__);
return;
}
device_buffer->buffer = (uint8_t*)pd_malloc(length);
if(device_buffer->buffer == NULL)
{
pd_printf("%s:malloc error!\n", __func__);
pd_free(device_buffer);
return;
}
pd_memcpy(device_buffer->buffer, buffer, length);
device_buffer->buffer_length = length;
struct TLVs *cmd_param = get_sub_device_command(device_buffer, &cmd_body);
if(COMMON_COMMAND_SYN_TIME == cmd_body.command_num )
{
pd_printf("PANDO: synchronize time\n");
uint64_t time = get_next_uint64(cmd_param);
show_package((uint8_t*)(&time), sizeof(time));
// pando_set_system_time(time);
}
if( device_buffer->buffer != NULL)
{
pd_free( device_buffer->buffer);
device_buffer->buffer = NULL;
}
if(device_buffer != NULL)
{
pd_free(device_buffer);
device_buffer = NULL;
}
}
开发者ID:Koenma413,项目名称:pando-embedded-framework,代码行数:48,代码来源:pando_zero_device.c
注:本文中的pd_free函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论