|
by: serikas |
last post by:
Is there a way to get aligned dynamically allocated memory?
(provided that the requested memory size is a power of 2.)
For example, if I request 128 bytes of memory, can I implement
an allocator that allocates 128 bytes with 128-byte alignment?
Of course I know that it is possible by allocating twice the requested
size or more, but I would like to know if it is possible without excessive
memory allocation.
|
by: Andrew |
last post by:
Is there anyway to test if a pointer points to allocated memory or
not?
For example if I have a pointer such as char *p is there a standard
way to test whether an assignment such as the following has been
applied?
p = (char *) malloc(sizeof(char) * n);
|
by: menkaur |
last post by:
Is there eny way to get the memory size allocated with new (like GlobalSize for GlobalAlloc) ?
|
by: pinkfloydhomer |
last post by:
Please read the example below. I'm sorry I couldn't make it smaller,
but it is pretty simple.
When client code is calling newThingy(), it is similar to malloc: the
client gets a pointer to a chunk of memory that it can use for it's own
purposes.
But on the "library" side, I want to be able to do some book-keeping
for each memory block that I hand out. I want some "hidden" meta-data
(that I keep in struct Container) to be associated...
|
by: ballpointpenthief |
last post by:
If I have malloc()'ed a pointer and want to read from it as if it were
an array, I need to know that I won't be reading past the last index.
If this is a pointer to a pointer, a common technique seems to be
setting a NULL pointer to the end of the list, and here we know that
the allocated memory has been exhausted. All good.
When this is a pointer to another type, say int, I could have a
variable that records how much memory is being...
|
|
by: Bill Reid |
last post by:
Bear with me, as I am not a "professional" programmer, but I was
working on part of program that reads parts of four text files into
a buffer which I re-allocate the size as I read each file. I read some
of the items from the bottom up of the buffer, and some from the
top down, moving the bottom items back to the new re-allocated
bottom on every file read.
Then when I've read all four files, I sort the top and bottom items
separately...
|
by: Jinkuzo |
last post by:
Have been working on this project for a week, unfortunately missed the lesson on it and have been struggling to figure it out.
These are the instructions and the point at which I'm up to.
So essentially we don't know the size of the array and the user doesn't specify size, it's all done on the fly.
Point I'm up to:
|
by: Hackles |
last post by:
Hello,
Is it possible to retrieve the size of allocated memory from a pointer (more specifically, a pointer returned my malloc/realloc). This question may have already been asked countless times. However, please consider the following:
The program's heap stores the size of an element
When you use realloc to allocate more memory, a new address may sometimes be issued in order to accommodate the space demand. In these cases, the existing data...
|
by: Paul |
last post by:
hi, there,
I was asked such a question: how to determine the size of memory of
the int
pointer pointed? for example
int GetTheSizeofMemory(int *buffer)
{
int size;
//enter your code here, to calculate the memory size of buffer
|
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 captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
|
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 launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
|