Patch Detail
Show a patch.
GET /api/1.1/patches/20751/?format=api
{ "id": 20751, "url": "https://patchwork.libcamera.org/api/1.1/patches/20751/?format=api", "web_url": "https://patchwork.libcamera.org/patch/20751/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20240803211007.18330-1-laurent.pinchart@ideasonboard.com>", "date": "2024-08-03T21:10:07", "name": "libcamera: software_isp: Replace malloc() with new[]()", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "8c14a8984fd9ba3853a3e243baeab43f88297cd6", "submitter": { "id": 2, "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api", "name": "Laurent Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/20751/mbox/", "series": [ { "id": 4476, "url": "https://patchwork.libcamera.org/api/1.1/series/4476/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4476", "date": "2024-08-03T21:10:07", "name": "libcamera: software_isp: Replace malloc() with new[]()", "version": 1, "mbox": "https://patchwork.libcamera.org/series/4476/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/20751/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/20751/checks/", "tags": {}, "headers": { "Return-Path": "<libcamera-devel-bounces@lists.libcamera.org>", "X-Original-To": "parsemail@patchwork.libcamera.org", "Delivered-To": "parsemail@patchwork.libcamera.org", "Received": [ "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 0329EC323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat, 3 Aug 2024 21:10:29 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9FB6B63381;\n\tSat, 3 Aug 2024 23:10:29 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A8F156336E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 3 Aug 2024 23:10:28 +0200 (CEST)", "from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 588F6512\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 3 Aug 2024 23:09:38 +0200 (CEST)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"Nqb8Bu/0\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1722719378;\n\tbh=qXAaJCNUcB/oP9r356tFFVg5MbO+Q7/O5WQR8aLmYiU=;\n\th=From:To:Subject:Date:From;\n\tb=Nqb8Bu/0saTb8WRBM1q36llXnFG5xj9vi/RHMv7fLmubOTicWqVIJbt9vRR7Romh+\n\tpoQlnjubBtIkfnIUN8oilxCGCmmcu4oOg18GSA6EwZCjc2DOmN7HaqtSEOpaYjEt8E\n\tn9+lMD9AIbF1j7lxYckn43EGcwTgVh8DMqDOPBY8=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Subject": "[PATCH] libcamera: software_isp: Replace malloc() with new[]()", "Date": "Sun, 4 Aug 2024 00:10:07 +0300", "Message-ID": "<20240803211007.18330-1-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.44.2", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-BeenThere": "libcamera-devel@lists.libcamera.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "<libcamera-devel.lists.libcamera.org>", "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>", "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>", "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>", "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>", "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "libcamera is implemented in C++, use new[]() instead of malloc() (and\ndelete[]() instead of free()).\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/software_isp/debayer_cpu.cpp | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\n\nbase-commit: 19bbca3c0b376ba0183f5db53472c8c46cd402b5", "diff": "diff --git a/src/libcamera/software_isp/debayer_cpu.cpp b/src/libcamera/software_isp/debayer_cpu.cpp\nindex f8d2677d657a..249294efca01 100644\n--- a/src/libcamera/software_isp/debayer_cpu.cpp\n+++ b/src/libcamera/software_isp/debayer_cpu.cpp\n@@ -57,7 +57,7 @@ DebayerCpu::DebayerCpu(std::unique_ptr<SwStatsCpu> stats)\n DebayerCpu::~DebayerCpu()\n {\n \tfor (unsigned int i = 0; i < kMaxLineBuffers; i++)\n-\t\tfree(lineBuffers_[i]);\n+\t\tdelete[] lineBuffers_[i];\n }\n \n #define DECLARE_SRC_POINTERS(pixel_t) \\\n@@ -529,8 +529,8 @@ int DebayerCpu::configure(const StreamConfiguration &inputCfg,\n \tfor (unsigned int i = 0;\n \t i < (inputConfig_.patternSize.height + 1) && enableInputMemcpy_;\n \t i++) {\n-\t\tfree(lineBuffers_[i]);\n-\t\tlineBuffers_[i] = (uint8_t *)malloc(lineBufferLength_);\n+\t\tdelete[] lineBuffers_[i];\n+\t\tlineBuffers_[i] = new uint8_t[lineBufferLength_];\n \t\tif (!lineBuffers_[i])\n \t\t\treturn -ENOMEM;\n \t}\n", "prefixes": [] }