Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
23 views

I am reading about blocking memory allocation idea in book Real time concepts in embedded systems by QingLi. A blocking memory allocation function can be implemented using both a counting semaphore ...
venkysmarty's user avatar
  • 11.5k
1 vote
1 answer
153 views

I'm working on a Compose Multiplatform project (CMP) with multiple feature modules. Each feature module contains a composeResources folder with drawable and values (strings,...) inside. The issue is ...
melikaafrakhteh's user avatar
0 votes
0 answers
57 views

I realized that Kotlin is missing a built-in event mechanism similar to what we have in C#. So I tried to implement my own and ran into a problem that can easily lead to memory leaks. My original idea ...
Yan's user avatar
  • 1,746
1 vote
1 answer
38 views

I have severe UI hang issues whenever my sync worker is running. The app experiences: Screen navigation freezes Scroll lag and stuttering Unresponsive UI during data synchronization The root cause is ...
Hassan Riaz's user avatar
0 votes
1 answer
61 views

In a high-performance Node.js service, I noticed that structuredClone() introduces unexpected latency spikes when cloning large nested objects (30–50 KB each). Even switching to manual cloning ...
Chand jr's user avatar
2 votes
2 answers
99 views

I'm writing some C code where I want to have a NULL-terminated GPtrArray containing static strings. Typically, I would use g_ptr_array_new_null_terminated () to construct a NULL-terminated GPtrArray, ...
Newbyte's user avatar
  • 3,955
Advice
0 votes
2 replies
76 views

I was thinking back to WinJS or WinUI with Windows Universal Applications (WUA) from about 10 years ago. I am wondering how it compiled and avoided typical architecture errors. If there is no memory ...
LJones's user avatar
  • 35
0 votes
1 answer
186 views

I am working on a function that must read one line at a time from a file, give the file descriptor of said file as input. Here is my get_next_line function, and helper functions on top of it # include ...
Simeon Sutarmin's user avatar
1 vote
0 answers
59 views

We are using Matlab to communicate with a C++ library, and are struggling with memory management. We create a libpointer pointing to an array, and then try to update its value in a loop. I don't think ...
RPM's user avatar
  • 1,809
2 votes
2 answers
88 views

I am trying to catch memory-related bugs such as use-after-free by mallopt(M_PERTURB, <value>). According to the doc, the memory will be initialized to value when it has been released by free. ...
davidhcefx's user avatar
Advice
3 votes
4 replies
179 views

public class Test{ static int add (int m, int n){ return m+n; } public static void main (String[] args){ int a=1; int b=2; int c= add(a,b); } } ...
Sebastian Mueller's user avatar
0 votes
1 answer
60 views

I'm trying to fully understand how paging works in the x86 architecture when segmentation is also enabled. I have a couple of questions: Does paging divide the logical memory (the selector + offset ...
GZanotto's user avatar
8 votes
0 answers
182 views

I'm working in an ESPHome / embedded C++ environment, where exceptions are disabled, so std::vector::resize() won't throw std::bad_alloc on allocation failure. I need to resize a std::vector to match ...
Luigi's user avatar
  • 411
-1 votes
1 answer
64 views

What is the dictionary memory and where does it stores, is it uses the memory of buffer pool or a seperate memory, does buffer pool stores metadata pages also or only user table and indexes, in both ...
Shiivesh's user avatar
24 votes
2 answers
2k views

In JavaScript, when you do something like this, function connect() { var ws = new WebSocket(url); ws.onmessage = function(e) { window.alert(e.data); }; } it will work. But why ...
Maestro's user avatar
  • 9,876
0 votes
0 answers
87 views

I have a kernel mode driver that calls ZwAllocateVirtualMemory following a call to KeStackAttachProcess all from within a PsRemoveLoadImageNotifyRoutine callback routine. My question is the memory ...
blogger13's user avatar
  • 305
2 votes
1 answer
127 views

We have something that looks like this: abstract class TreeNode { internal abstract Branches GetChildren(); } class Leaf : TreeNode { internal override Branches GetChildren() => ...
Joshua's user avatar
  • 43.6k
0 votes
0 answers
25 views

I'm learning odin, and I'm writing a program where the map allocating memory, growing and doing its checks is a considerable part of my program running time, is there a way to have a map where I can ...
jhonny's user avatar
  • 858
1 vote
2 answers
198 views

I am using an Ubuntu 16.04 a 32-bit Virtual Machine OS. I executed sysctl -w kernel.randomize_va_space=0 to disable ASLR in root prior to gcc. I have also compiled this using the command: gcc -g -fno-...
Wabba Fett's user avatar
1 vote
1 answer
100 views

I’m trying to measure the RAM usage of a specific application using C# (.NET Framework 4.6.2). I’ve already done some research and managed to get a result using Process.WorkingSet64, but the value ...
Sardor's user avatar
  • 27
4 votes
2 answers
190 views

I have a web app written in Delphi 12 using TMS Webcore components. At logout (which happens by user action, or after idle timeout), I want to clear the memory for security reasons, in case there are ...
Rohit Gupta's user avatar
  • 4,277
0 votes
1 answer
50 views

I have a fairly complex JuMP (HiGHS) model that I have developed for running over "batches" of input data. It runs fine on a single batch, but once I start looping over several instances, ...
Telemakos_1987BC's user avatar
0 votes
0 answers
164 views

I am aware that calling delete this in a member function is not UB in itself. In fact, compiler is doing the very same thing when one calls delete ptr, ptr being a pointer to a polymorphic object (...
lobelk's user avatar
  • 531
3 votes
2 answers
135 views

I’m trying to design a generic linked list in C where each node can store arbitrary data. Right now I have the following definitions: typedef struct { int clientID; char name[256]; } Client; ...
F. Zer's user avatar
  • 1,311
3 votes
0 answers
155 views

I try to understand how ::operator delete sync with other atomic operation. Is any atomic::write --SC-order--> ::operator delete in the same thread? atomic<void*> A; T1: old = A.read(relaxed);...
Alex's user avatar
  • 31
1 vote
1 answer
148 views

Consider these two functions: int foo(std::array<int, 10> const& v) { auto const w = v; int s{}; for (int i = 0; i < v.size(); ++i) { s += (i % 2 == 0 ? v : w)[i]; ...
Enlico's user avatar
  • 30.3k
-3 votes
2 answers
183 views

I have std::map of std::vector of raw pointers. According to Google AI, in order to clean it I should do: int main() { std::map<int, std::vector<MyObject*>> myMap; // Populate the ...
Igor's user avatar
  • 6,473
2 votes
3 answers
267 views

I’m working on a C project where I need to know if a pointer refers to memory allocated on the stack or the heap. For example: int x = 42; // stack variable int *y = malloc(sizeof(...
Pawan Bhatta's user avatar
-5 votes
2 answers
176 views

I'm writing a program that is very sensitive to garbage collection so I'm trying to avoid allocating to the heap after initialization. In the example below, calling Run() will allocate to the heap ...
ATD's user avatar
  • 892
2 votes
0 answers
87 views

I am trying to write data starting at a specific address (0x88000000) of the memory (simulated DRAM size is 256 MiB), once all data is written, the DMA unit is programmed using the MMIO registers. The ...
student_11's user avatar
0 votes
0 answers
60 views

Apologies if I didn't perform any checks or standards for my query. In my app with packages:- react-native 0.79.5 Expo 53 expo-file-system 18.1.11 and react-native-blob-util 0.22.2. I am trying to ...
Raeygzz's user avatar
  • 61
3 votes
2 answers
180 views

I need to allocate memory (in C code on a Linux system) in the amount of a multiple of page size, and later increase the allocation (multiple times when necessary) by multiples of page size. As I ...
user2052436's user avatar
  • 5,087
2 votes
1 answer
112 views

I am trying to implement a custom global allocator for use in my Rust application. The goal is to track memory usage and align to 64 bytes. My allocator uses libc::malloc and libc::free for allocation ...
Ronika Kashyap's user avatar
-6 votes
1 answer
170 views

I'm using a networking library with an interface like: read(void *buf, size_t nbytes); write(void *buf, size_t nbytes); It enables communication between processes on different machines using these ...
lluttrell's user avatar
2 votes
1 answer
102 views

I am using WebAssembly to implement a sandboxed plugin system in a C application. Users can write plugins in any language that will compile to WASM, and we just say "you can import a, b, c ...
Logan R. Kearsley's user avatar
1 vote
0 answers
67 views

I'm trying to implement a high-performance fan-out (broadcast) service in Netty where I need to write the same, immutable ByteBuf to multiple channels. To avoid memory copies, I'm using ...
user3888453's user avatar
1 vote
1 answer
202 views

TLDR: I have a huge array (around 70% of available memory) and I don't want it to be swapped to disk. What's the best way on modern linux to pin a vector in memory so that it doesn't get swapped by ...
Mascarpone's user avatar
  • 2,578
0 votes
0 answers
75 views

I'd like to preface this with the understanding that I'm not the most knowledgeable on scatter files, but I've been learning a lot in the ARM forums about them. I'm working with the STM32F429 ...
slicknick's user avatar
0 votes
3 answers
219 views

I often see both terms — JMM (Java Memory Model) and JVM (Java Virtual Machine) — when learning about multithreading and memory management in Java. However, I'm confused about how they relate to each ...
Nurlis Kimbiletov's user avatar
2 votes
1 answer
73 views

I'm using FlatBuffers in Swift (version 25.2.10) to serialize a large array of objects (1,000,000 items). After serialization, the app's memory usage jumps to about 387 MB and never goes down, even ...
Steve Ham's user avatar
  • 3,202
2 votes
2 answers
195 views

I have this class: class Socket { [...] pollfd* fdPtr; }; And I have a Manager class that creates the actual pollfd objects and adds them to a std::vector named pollFdsVec, to then poll on ...
desynchedneo's user avatar
0 votes
0 answers
206 views

I have been having issues allocating memory on the GPU with jax. I am running on a cluster that gives me access to a RTX6000 (24GiB vram) which jax is attempting to allocate to. Output of jax....
Kepler7894i's user avatar
2 votes
2 answers
166 views

I am designing a memory allocator that is able to move objects during their lifetime. To support this it requires use of IndirectPointer that points to a control block. This control block points to ...
Aedoro's user avatar
  • 940
0 votes
0 answers
17 views

Suppose I've allocated a region of memory with clSVMAlloc(). Looking at the clEnqueueSVMMap() function, we are told that it will "allow the host to update a region of a SVM buffer". Does ...
einpoklum's user avatar
  • 137k
2 votes
1 answer
144 views

I'm studying std::move semantics and I would like this to be clarified to me: Say I have: // Message.h class Message { private: std::array<uint8_t, BUFFER_SIZE> buffer; std::queue<...
desynchedneo's user avatar
0 votes
1 answer
108 views

can someone please help in explaining why virt_to_phys cant be used in case of SMMU to get the IOVA address, as in SMMU enabled system physical address are not exposed , so can we use virt_to_phys in ...
devender's user avatar
-1 votes
1 answer
103 views

I implemented a function to return the Pascal Tree of numRows rows in 2 ways: // Making a copy of the last element class Solution { public: vector<vector<int>> generate(int numRows) { ...
Harshit Tomar's user avatar
1 vote
2 answers
76 views

According this awesome article there is an interesting case with two given examples: A: B: And there is an explanation for A: Unfortunately you have not taken into account that such Strings will ...
Bartłomiej Semańczyk's user avatar
0 votes
1 answer
46 views

In a microcontroller without any OS, how does the microcontroller keep track of where a malloc will point to in the heap? char *x; char *y; char *z; x=(char*)malloc(10); y=(char*)malloc(10); free(x); ...
hal's user avatar
  • 1
0 votes
1 answer
138 views

Is it possible to change malloc or new behavior for a somewhat limited scope to actually allocate out of a given buffer that is already allocated? Eg. something like: char buffer[1024]; void main(...
dronus's user avatar
  • 11.4k

1
2 3 4 5
555