Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f614dd95 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "liblog: remove android_lookupEventTag" am: d81e1d34

Original change: https://android-review.googlesource.com/c/platform/system/core/+/1396175

Change-Id: I3f2e7cf013201a8a9cfc13a3b5bc2c4c0790162f
parents e92882a8 d81e1d34
Loading
Loading
Loading
Loading
+0 −15
Original line number Diff line number Diff line
@@ -559,21 +559,6 @@ const char* android_lookupEventFormat_len(const EventTagMap* map, size_t* len, u
  return str->second.data();
}

// This function is deprecated and replaced with android_lookupEventTag_len
// since it will cause the map to change from Shared and backed by a file,
// to Private Dirty and backed up by swap, albeit highly compressible. By
// deprecating this function everywhere, we save 100s of MB of memory space.
const char* android_lookupEventTag(const EventTagMap* map, unsigned int tag) {
  size_t len;
  const char* tagStr = android_lookupEventTag_len(map, &len, tag);

  if (!tagStr) return tagStr;
  char* cp = const_cast<char*>(tagStr);
  cp += len;
  if (*cp) *cp = '\0';  // Trigger copy on write :-( and why deprecated.
  return tagStr;
}

// Look up tagname, generate one if necessary, and return a tag
int android_lookupEventTagNum(EventTagMap* map, const char* tagname, const char* format, int prio) {
  const char* ep = endOfTag(tagname);
+0 −8
Original line number Diff line number Diff line
@@ -39,14 +39,6 @@ EventTagMap* android_openEventTagMap(const char* fileName);
 */
void android_closeEventTagMap(EventTagMap* map);

/*
 * Look up a tag by index.  Returns the tag string, or NULL if not found.
 */
const char* android_lookupEventTag(const EventTagMap* map, unsigned int tag)
    __attribute__((
        deprecated("use android_lookupEventTag_len() instead to minimize "
                   "MAP_PRIVATE copy-on-write memory impact")));

/*
 * Look up a tag by index.  Returns the tag string & string length, or NULL if
 * not found.  Returned string is not guaranteed to be nul terminated.