Changeset 213 in flair-src for trunk/lib/FlairCore/src/Widget_impl.cpp
- Timestamp:
- Jan 30, 2018, 5:47:12 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairCore/src/Widget_impl.cpp
r133 r213 33 33 namespace { 34 34 #ifdef __XENO__ 35 RT_HEAP xml_heap;36 37 void xml2_free(void *mem) {35 RT_HEAP rt_xml_heap; 36 37 void rt_xml2_free(void *mem) { 38 38 // Printf("free %x\n",mem); 39 39 if (mem == NULL) 40 40 return; 41 int status = rt_heap_free(& xml_heap, mem);41 int status = rt_heap_free(&rt_xml_heap, mem); 42 42 43 43 if (status != 0) { … … 47 47 } 48 48 49 void * xml2_alloc(size_t sz) {49 void *rt_xml2_alloc(size_t sz) { 50 50 void *ptr; 51 51 // printf("alloc %i\n",sz); 52 int status = rt_heap_alloc(& xml_heap, sz, TM_NONBLOCK, &ptr);52 int status = rt_heap_alloc(&rt_xml_heap, sz, TM_NONBLOCK, &ptr); 53 53 if (status != 0) { 54 54 char errorMsg[256]; … … 60 60 } 61 61 62 void * xml2_realloc(void *emem, size_t sz) {62 void *rt_xml2_realloc(void *emem, size_t sz) { 63 63 // Printf("realloc %x %i -> %i\n",emem,sz,sz); 64 64 void *mem_re; 65 65 66 66 if (emem == NULL) { 67 return xml2_alloc(sz);67 return rt_xml2_alloc(sz); 68 68 } else if (sz == 0) { 69 xml2_free(emem);70 } 71 72 mem_re = xml2_alloc(sz);69 rt_xml2_free(emem); 70 } 71 72 mem_re = rt_xml2_alloc(sz); 73 73 74 74 memcpy(mem_re, emem, sz); 75 75 76 xml2_free(emem);76 rt_xml2_free(emem); 77 77 78 78 return mem_re; 79 79 } 80 80 81 char * xml2_strdup(const char *str) {81 char *rt_xml2_strdup(const char *str) { 82 82 // printf("strdup %s\n",str); 83 char *s = (char *) xml2_alloc(strlen(str) + 1);83 char *s = (char *)rt_xml2_alloc(strlen(str) + 1); 84 84 if (s == NULL) 85 85 return NULL; … … 103 103 string tmp_name; 104 104 tmp_name = name + "-xml"; 105 int status = rt_heap_create(& xml_heap, tmp_name.c_str(),XML_HEAP, H_FIFO);105 int status = rt_heap_create(&rt_xml_heap, tmp_name.c_str(), RT_XML_HEAP, H_FIFO); 106 106 if (status != 0) { 107 107 char errorMsg[256]; … … 109 109 } 110 110 111 xmlMemSetup( xml2_free, xml2_alloc, xml2_realloc,xml2_strdup);111 xmlMemSetup(rt_xml2_free, rt_xml2_alloc, rt_xml2_realloc, rt_xml2_strdup); 112 112 #endif //__XENO__ 113 113 } … … 188 188 #ifdef __XENO__ 189 189 int status; 190 char errorMsg[256];191 190 RT_HEAP_INFO info; 192 status = rt_heap_inquire(& xml_heap, &info);191 status = rt_heap_inquire(&rt_xml_heap, &info); 193 192 if (status != 0) { 193 char errorMsg[256]; 194 194 self->Err("rt_heap_inquire error (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg))); 195 195 } … … 197 197 self->Err("fuite memoire xml heap (%ld)\n", info.usedmem); 198 198 // Printf("fin heap xml\n"); 199 status = rt_heap_delete(& xml_heap);199 status = rt_heap_delete(&rt_xml_heap); 200 200 if (status != 0) { 201 char errorMsg[256]; 201 202 self->Err("rt_heap_delete error (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg))); 202 203 }
Note:
See TracChangeset
for help on using the changeset viewer.