From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Elias_M=C3=A5rtenson?= Newsgroups: gmane.emacs.devel Subject: Re: creating unibyte strings Date: Sun, 24 Mar 2019 22:51:16 +0800 Message-ID: References: <83y3b4wdw9.fsf@gnu.org> <83tvhal45r.fsf@gnu.org> <83h8bwt1on.fsf@gnu.org> <83bm24t0hv.fsf@gnu.org> <83wokrs6en.fsf@gnu.org> <837ecrrqdm.fsf@gnu.org> <83sgvfq6yv.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000000a20ef0584d83910" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="94230"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Stefan Monnier , emacs-devel To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 24 15:57:02 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h84YX-000OOn-VL for ged-emacs-devel@m.gmane.org; Sun, 24 Mar 2019 15:57:02 +0100 Original-Received: from localhost ([127.0.0.1]:57193 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h84YW-0006DQ-UV for ged-emacs-devel@m.gmane.org; Sun, 24 Mar 2019 10:57:01 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:52991) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h84Xs-0005pM-OT for emacs-devel@gnu.org; Sun, 24 Mar 2019 10:56:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h84TO-00077A-45 for emacs-devel@gnu.org; Sun, 24 Mar 2019 10:51:44 -0400 Original-Received: from mail-it1-x12f.google.com ([2607:f8b0:4864:20::12f]:39406) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h84TD-00071a-GU; Sun, 24 Mar 2019 10:51:33 -0400 Original-Received: by mail-it1-x12f.google.com with SMTP id 139so10307684ita.4; Sun, 24 Mar 2019 07:51:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NVuaRAd1nIgT8JtskxvHVaC8Z1y4sG30YA6PXsp+swE=; b=TK2UlJ7lztkWJlDSAbHLBP00/Aut0jR4t8c/6a706/GS744jtwHBz8Zpk4MPe+X+Um NhDsjWdY0rzgT4N1hW5GMJ6pN4ft2NSD2oRN1KJtWPiEWGDxMHVcksKM4+y9aJdpG7xu DkWX1opXvoS1880uyOSNMqKHTsBJY7g7LXkFy55y5qsEX60brR7LX3HbYu8jrhLLBDIW vlzxmqWAH+EgmpnZF2ssDmVPtdQhy6JiTROwEqCFFva0/zZBGoiXy4g+0zyFO5Wj2cnd lGvXzcBZ6WchjObNMYR5diB0QtNXulF/Ek+tqtnu1CLOe8mvG/AjFrnph2L7kMlRjLYE X7vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NVuaRAd1nIgT8JtskxvHVaC8Z1y4sG30YA6PXsp+swE=; b=JAYaO1BiaVrZ/4DQWO2VuO9qspagVIBcpdEdJNU2BBbFSvTplb6FAEBbseHsJYWZIe /im86iJ1OZPvYQrzZsWp6nzAzAIGR06J24M+teircq/qIwl1MvzkEFSossavUyCYjin0 XrtrL257DVEMAPeeQ33gCsj9fdxV6ZRPEqF7AlktIGEejsNBBXpqlcPKs83jl0jxXQ32 X1rh3/NoiFX17bjxvQ8Ux1e3XDjdjtjVKiUDqnZyMct9xSdGslPwlaLV1t9v9XJxu9K1 D1ub/PCVbNDPFgpQEHm5IZ0H2cfMagiCmNnWxeWtHTCoYTjHZ8f2DYOVxrWHuL43pbf1 qCww== X-Gm-Message-State: APjAAAUTPl7NcPxFxaB7txBRfv/NFdiFQD3QZQLOR4Q3ha+6f1TylW0z 4bJggcolsPmFQ+sYlJElObRQgveyyUqFQinyNYQvBYYj X-Google-Smtp-Source: APXvYqzRctBjpXbXE+CmeLenIoixc2uTW2jpLn+yAvOIetMslx8sBOAphnJmOH5f4VjaVHqTWZIk19DnVs91fV5yaeQ= X-Received: by 2002:a24:2b94:: with SMTP id h142mr5453058ita.13.1553439088319; Sun, 24 Mar 2019 07:51:28 -0700 (PDT) In-Reply-To: <83sgvfq6yv.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::12f X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:234680 Archived-At: --0000000000000a20ef0584d83910 Content-Type: text/plain; charset="UTF-8" On Fri, 22 Mar 2019 at 23:14, Eli Zaretskii wrote: > Because the number of Emacs features that require you to submit a > unibyte string is very small. In the one native module that I have written, integration of GSSAPI, I end up passing large byte buffers back and forth between Elisp and C. There really is no efficient way to do this, so I ended up having to use vectors and use extract_integer in a loop. Am I misunderstanding this discussion, and there is a better way to pass binary buffers to modules that I don't know about? This is what the current code looks like, and it's not really pretty: https://github.com/lokedhs/emacs-gssapi/blob/master/gssapi.c#L382 Regards, Elias --0000000000000a20ef0584d83910 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Fri, 22 Mar 2019 at 2= 3:14, Eli Zaretskii <eliz@gnu.org>= ; wrote:
=C2=A0
Because the number of Emacs features t= hat require you to submit a
unibyte string is very small.

In the one na= tive module that I have written, integration of GSSAPI, I end up passing la= rge byte buffers back and forth between Elisp and C. There really is no eff= icient way to do this, so I ended up having to use vectors and use extract_= integer in a loop.

Am I misunderstanding this disc= ussion, and there is a better way to pass binary buffers to modules that I = don't know about?

This is what the current cod= e looks like, and it's not really pretty:=C2=A0https://github.com/lo= kedhs/emacs-gssapi/blob/master/gssapi.c#L382

R= egards,
Elias
--0000000000000a20ef0584d83910--