MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rt_custom_object_create

Function rt_custom_object_create

src/object.c:775–787  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

773 */
774
775rt_object_t rt_custom_object_create(const char *name, void *data, rt_err_t (*data_destroy)(void *))
776{
777 struct rt_custom_object *cobj = RT_NULL;
778
779 cobj = (struct rt_custom_object *)rt_object_allocate(RT_Object_Class_Custom, name);
780 if (!cobj)
781 {
782 return RT_NULL;
783 }
784 cobj->destroy = data_destroy;
785 cobj->data = data;
786 return (struct rt_object *)cobj;
787}
788
789/**
790 * This function will destroy a custom object

Callers 2

_pftx_create_lockedFunction · 0.85
_sftx_createFunction · 0.85

Calls 1

rt_object_allocateFunction · 0.85

Tested by

no test coverage detected