~ubuntu-branches/ubuntu/wily/trafficserver/wily

« back to all changes in this revision

Viewing changes to lib/records/P_RecCore.i

  • Committer: Package Import Robot
  • Author(s): Adam Conrad
  • Date: 2012-12-17 22:28:16 UTC
  • mfrom: (5.1.8 raring-proposed)
  • Revision ID: package-import@ubuntu.com-20121217222816-7xwjsx5k76zkb63d
Tags: 3.2.0-1ubuntu1
* Revert FreeBSD strerror_r() fixes that give errors with glibc 2.16.
* Apply patch from Konstantinos Margaritis to define barriers on ARM.

Show diffs side-by-side

added added

removed removed

Lines of Context:
461
461
      }
462
462
      rec_mutex_release(&(r1->lock));
463
463
    } else {
464
 
      // We don't need to xstrdup() here as we will make copies of any
 
464
      // We don't need to ats_strdup() here as we will make copies of any
465
465
      // strings when we marshal them into our RecMessage buffer.
466
466
      RecRecord r2;
467
467
      memset(&r2, 0, sizeof(RecRecord));
571
571
  }
572
572
 
573
573
  ink_rwlock_unlock(&g_records_rwlock);
574
 
 
575
 
  if (m)
576
 
    xfree(m);
 
574
  ats_free(m);
577
575
 
578
576
  return REC_ERR_OKAY;
579
577
}
653
651
  // clear our g_rec_config_contents_xxx structures
654
652
  while (!queue_is_empty(g_rec_config_contents_llq)) {
655
653
    cfe = (RecConfigFileEntry *) dequeue(g_rec_config_contents_llq);
656
 
    if (cfe->entry) {
657
 
      xfree(cfe->entry);
658
 
    }
659
 
    xfree(cfe);
 
654
    ats_free(cfe->entry);
 
655
    ats_free(cfe);
660
656
  }
661
657
  ink_hash_table_destroy(g_rec_config_contents_ht);
662
658
  g_rec_config_contents_ht = ink_hash_table_create(InkHashTableKeyType_String);
669
665
  line = line_tok.iterFirst(&line_tok_state);
670
666
  line_num = 1;
671
667
  while (line) {
672
 
    char *lc = xstrdup(line);
 
668
    char *lc = ats_strdup(line);
673
669
    char *lt = lc;
674
670
    char *ln;
675
671
 
754
750
    RecDataClear(data_type, &data);
755
751
 
756
752
    // update our g_rec_config_contents_xxx
757
 
    cfe = (RecConfigFileEntry *) xmalloc(sizeof(RecConfigFileEntry));
 
753
    cfe = (RecConfigFileEntry *)ats_malloc(sizeof(RecConfigFileEntry));
758
754
    cfe->entry_type = RECE_RECORD;
759
 
    cfe->entry = xstrdup(name_str);
 
755
    cfe->entry = ats_strdup(name_str);
760
756
    enqueue(g_rec_config_contents_llq, (void *) cfe);
761
757
    ink_hash_table_insert(g_rec_config_contents_ht, name_str, NULL);
762
758
    goto L_done;
764
760
  L_next_line:
765
761
    // store this line into g_rec_config_contents_llq so that we can
766
762
    // write it out later
767
 
    cfe = (RecConfigFileEntry *) xmalloc(sizeof(RecConfigFileEntry));
 
763
    cfe = (RecConfigFileEntry *)ats_malloc(sizeof(RecConfigFileEntry));
768
764
    cfe->entry_type = RECE_COMMENT;
769
 
    cfe->entry = xstrdup(line);
 
765
    cfe->entry = ats_strdup(line);
770
766
    enqueue(g_rec_config_contents_llq, (void *) cfe);
771
767
 
772
768
  L_done:
773
769
    line = line_tok.iterNext(&line_tok_state);
774
770
    line_num++;
775
 
    xfree(lc);
 
771
    ats_free(lc);
776
772
  }
777
773
 
778
774
  // release our hash table
779
775
  ink_rwlock_unlock(&g_records_rwlock);
780
776
  ink_mutex_release(&g_rec_config_lock);
781
 
  xfree(fbuf);
 
777
  ats_free(fbuf);
782
778
 
783
779
  return REC_ERR_OKAY;
784
780
}
810
806
      if (REC_TYPE_IS_CONFIG(r->rec_type)) {
811
807
        if (r->sync_required & REC_DISK_SYNC_REQUIRED) {
812
808
          if (!ink_hash_table_isbound(g_rec_config_contents_ht, r->name)) {
813
 
            cfe = (RecConfigFileEntry *) xmalloc(sizeof(RecConfigFileEntry));
 
809
            cfe = (RecConfigFileEntry *)ats_malloc(sizeof(RecConfigFileEntry));
814
810
            cfe->entry_type = RECE_RECORD;
815
 
            cfe->entry = xstrdup(r->name);
 
811
            cfe->entry = ats_strdup(r->name);
816
812
            enqueue(g_rec_config_contents_llq, (void *) cfe);
817
813
            ink_hash_table_insert(g_rec_config_contents_ht, r->name, NULL);
818
814
          }