Changeset 213 in flair-src for trunk/lib/FlairCore/src/Widget_impl.cpp


Ignore:
Timestamp:
01/30/18 17:47:12 (6 years ago)
Author:
Sanahuja Guillaume
Message:

thread stack size rework
add Matrix class

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairCore/src/Widget_impl.cpp

    r133 r213  
    3333namespace {
    3434#ifdef __XENO__
    35 RT_HEAP xml_heap;
    36 
    37 void xml2_free(void *mem) {
     35RT_HEAP rt_xml_heap;
     36
     37void rt_xml2_free(void *mem) {
    3838  // Printf("free %x\n",mem);
    3939  if (mem == NULL)
    4040    return;
    41   int status = rt_heap_free(&xml_heap, mem);
     41  int status = rt_heap_free(&rt_xml_heap, mem);
    4242
    4343  if (status != 0) {
     
    4747}
    4848
    49 void *xml2_alloc(size_t sz) {
     49void *rt_xml2_alloc(size_t sz) {
    5050  void *ptr;
    5151  // 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);
    5353  if (status != 0) {
    5454                char errorMsg[256];
     
    6060}
    6161
    62 void *xml2_realloc(void *emem, size_t sz) {
     62void *rt_xml2_realloc(void *emem, size_t sz) {
    6363  // Printf("realloc %x %i -> %i\n",emem,sz,sz);
    6464  void *mem_re;
    6565
    6666  if (emem == NULL) {
    67     return xml2_alloc(sz);
     67    return rt_xml2_alloc(sz);
    6868  } 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);
    7373
    7474  memcpy(mem_re, emem, sz);
    7575
    76   xml2_free(emem);
     76  rt_xml2_free(emem);
    7777
    7878  return mem_re;
    7979}
    8080
    81 char *xml2_strdup(const char *str) {
     81char *rt_xml2_strdup(const char *str) {
    8282  // printf("strdup %s\n",str);
    83   char *s = (char *)xml2_alloc(strlen(str) + 1);
     83  char *s = (char *)rt_xml2_alloc(strlen(str) + 1);
    8484  if (s == NULL)
    8585    return NULL;
     
    103103    string tmp_name;
    104104    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);
    106106    if (status != 0) {
    107107                        char errorMsg[256];
     
    109109    }
    110110
    111     xmlMemSetup(xml2_free, xml2_alloc, xml2_realloc, xml2_strdup);
     111    xmlMemSetup(rt_xml2_free, rt_xml2_alloc, rt_xml2_realloc, rt_xml2_strdup);
    112112#endif //__XENO__
    113113  }
     
    188188#ifdef __XENO__
    189189    int status;
    190                 char errorMsg[256];
    191190    RT_HEAP_INFO info;
    192     status = rt_heap_inquire(&xml_heap, &info);
     191    status = rt_heap_inquire(&rt_xml_heap, &info);
    193192    if (status != 0) {
     193      char errorMsg[256];
    194194      self->Err("rt_heap_inquire error (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
    195195    }
     
    197197      self->Err("fuite memoire xml heap (%ld)\n", info.usedmem);
    198198    // Printf("fin heap xml\n");
    199     status = rt_heap_delete(&xml_heap);
     199    status = rt_heap_delete(&rt_xml_heap);
    200200    if (status != 0) {
     201      char errorMsg[256];
    201202      self->Err("rt_heap_delete error (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
    202203    }
Note: See TracChangeset for help on using the changeset viewer.