473,578 Members | 3,150 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Buffer objects

Greetings,

I need a little help with buffer objects. Many Python objects export
the buffer interface, or can be persuaded to create a buffer object
with a buffer() call.

First question, the buffer() function appears very quick. Does it just
wrap the internal pointer and then exit?

Second question, the buffer interface does include support for
multiple segments of memory. All the buffers I have examined are only
a single segment, is this a rarely used functionality?

Third question, having got my buffer interface I want to get the
actual pointer out so that I can call foreign functions with ctypes
with the pointer as a function argument and add offsets to it, so I
would like it as a plain int. What is the recommended method of
accessing the raw pointer from the buffer object?

It must be me but I have found the whole buffer thing difficult to
understand from the docs, it appears only useful to C coders, but I
use the buffer interface (GetData()) of wx.Image objects a lot in my
work.

TomH celephicus(AT)g mail(DOT)com
Sep 1 '08 #1
0 906

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1922
by: Thomas Lotze | last post by:
Hi, I want to implement a tokenizer for some syntax. So I thought I'd subclass StringIO and make my new class return tokens on next(). However, if I want to read tokens from two places in the string in turns, I'd either need to do some housekeeping of file pointers outside the tokenizer class (which is ugly) or use two tokenizers on the...
8
6842
by: Tron Thomas | last post by:
As part of applying for a programming position at a company, I recently I had submitted some code samples to one of the developers for review. This is the feedback I received: One of his concerns was frequent calls to new and delete, which can cause memory fragmentation over time. An example is the allocation and destruction
4
2807
by: Tomasz Grobelny | last post by:
Is it possible to create for example stl queue in previously allocated memory buffer (memory shared between two processes)? I thought of sth like that: queue<int>* q=new(buffer) queue<int>; but won't integer variables (and possible others needed by queue object) be allocated using default allocator outside the buffer? How to force allocation...
6
2360
by: Mark | last post by:
If you have STL containers (like list, vector,...) in functions as automatic variables, do the nodes that are put on the containers get buffered so they can be reused by later container operations? For example, if I have 10 member methods, and lots of them have a list <Foo*> when that list is cleared or goes out of scope, the nodes are...
5
17547
by: Sandy | last post by:
Hi, In one of my interview i was asked the difference between Stream and Buffer. can anybody explain the difference. Thanks
0
329
by: Ken Allen | last post by:
I am relatively new to C# and .Net in general, but have been programming in many other languages for more years than I want to recall. I have a problem where an existing set of code (actually a Windows kernel component developed by a company I do some work for) is returning information to user space in the buffer from an IOCTL call in a...
12
7883
by: Jim Rodgers | last post by:
I have a big asp file that has an error under certain conditions -- totally repeatable. However, it only fails when I set response.buffer = True at the top. WHen I set it False in order to debug it, it works every time! I even set it to True, but did a .Flush just before the error, and the error won't happen. It only happens when...
0
739
by: Terry Reedy | last post by:
Tom Harris wrote: .... The 1.x/2.x buffer interface was not considered terribly successful. Buffer() is gone in 3.0. I believe class memoryview() (which supports viewing the 'buffer' as an n-dimensional array) is considered to be its replacement. You might find the latter in 2.6 also. Images, in particular, will be viewed as row x...
8
3363
by: rmurgia | last post by:
Has anyone noticed that scrolling through objects i.e. forms, reports, tables, etc with Access 2007 is not as easy as Access 2003? I have a database with a large number of objects. When scrolling through with the down arrow or page down, it seems that items get caught in the buffer making scrolling through large amounts of objects cumbersome. ...
0
7778
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8290
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8148
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6522
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5664
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3781
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3798
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2292
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1389
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.