From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 43D8F138335 for ; Sun, 5 May 2019 18:13:33 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id ED19CE087B; Sun, 5 May 2019 18:13:31 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D4272E087B for ; Sun, 5 May 2019 18:13:31 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id CCF0F3436CE for ; Sun, 5 May 2019 18:13:29 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id AB4AD566 for ; Sun, 5 May 2019 18:13:27 +0000 (UTC) From: "Fabian Groffen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" Message-ID: <1557075960.caa404364ae6e08ea2af6bbee7a6b0432162edef.grobian@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: libq/ X-VCS-Repository: proj/portage-utils X-VCS-Files: libq/atom.c X-VCS-Directories: libq/ X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: caa404364ae6e08ea2af6bbee7a6b0432162edef X-VCS-Branch: master Date: Sun, 5 May 2019 18:13:27 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: c6ccec09-45e4-4646-80ff-ddd99a9329df X-Archives-Hash: 068b8cd6e8baaafeec9dc95affd88261 commit: caa404364ae6e08ea2af6bbee7a6b0432162edef Author: Fabian Groffen gentoo org> AuthorDate: Sun May 5 17:06:00 2019 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Sun May 5 17:06:00 2019 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=caa40436 libq/atom: drop non-functional USE_CACHE bits Signed-off-by: Fabian Groffen gentoo.org> libq/atom.c | 37 +++---------------------------------- 1 file changed, 3 insertions(+), 34 deletions(-) diff --git a/libq/atom.c b/libq/atom.c index 75a621f..5f4b137 100644 --- a/libq/atom.c +++ b/libq/atom.c @@ -38,27 +38,6 @@ const char * const atom_op_str[] = { const char * const booga[] = {"!!!", "!=", "==", ">", "<"}; -#ifdef EBUG -void -atom_print(const depend_atom *atom) -{ - if (atom->CATEGORY) - printf("%s/", atom->CATEGORY); - printf("%s", atom->P); - if (atom->PR_int) - printf("-r%i", atom->PR_int); - if (atom->SLOT) - printf(":%s", atom->SLOT); - if (atom->REPO) - printf("::%s", atom->REPO); -} -#endif - -#ifdef _USE_CACHE -static depend_atom *_atom_cache = NULL; -static size_t _atom_cache_len = 0; -#endif - depend_atom * atom_explode(const char *atom) { @@ -74,18 +53,7 @@ atom_explode(const char *atom) * PVR needs 3 extra bytes for possible implicit '-r0'. */ slen = strlen(atom); len = sizeof(*ret) + (slen + 1) * sizeof(*atom) * 3 + 3; -#ifdef _USE_CACHE - if (len <= _atom_cache_len) { - ret = _atom_cache; - memset(ret, 0x00, len); - } else { - free(_atom_cache); - _atom_cache = ret = xzalloc(len); - _atom_cache_len = len; - } -#else ret = xzalloc(len); -#endif ptr = (char*)ret; ret->P = ptr + sizeof(*ret); ret->PVR = ret->P + slen + 1; @@ -356,9 +324,7 @@ atom_implode(depend_atom *atom) if (!atom) errf("Atom is empty !"); free(atom->suffixes); -#ifndef _USE_CACHE free(atom); -#endif } static int @@ -600,6 +566,9 @@ implode_a1_ret: return ret; } +/** + * Reconstructs an atom exactly like it was originally given (exploded). + */ static char _atom_buf[BUFSIZ]; char * atom_to_string(depend_atom *a)