Why does the stack address grow towards decreasing memory addresses?

First, it’s platform dependent. In some architectures, stack is allocated from the bottom of the address space and grows upwards. Assuming an architecture like x86 that stack grown downwards from the top of address space, the idea is pretty simple: =============== Highest Address (e.g. 0xFFFF) | | | STACK | | | |————-| <- Stack … Read more

What does ‘corrupted double-linked list’ mean

I have found the answer to my question myself:) So what I didn’t understand was how the glibc could differentiate between a Segfault and a corrupted double-linked list, because according to my understanding, from perspective of glibc they should look like the same thing. Because if I implement a double-linked list inside my program, how … Read more

Difference between sequential write and random write

When people talk about sequential vs random writes to a file, they’re generally drawing a distinction between writing without intermediate seeks (“sequential”), vs. a pattern of seek-write-seek-write-seek-write, etc. (“random”). The distinction is very important in traditional disk-based systems, where each disk seek will take around 10ms. Sequentially writing data to that same disk takes about … Read more

iPhone OS Memory Warnings. What Do The Different Levels Mean?

Memory level warnings are logged by SpringBoard. As an app developer you don’t need to care about it. Just responding to -{application}didReceiveMemoryWarning is enough. There are 4 levels of warnings (0 to 3). These are set from the kernel memory watcher, and can be obtained by the not-so-public function OSMemoryNotificationCurrentLevel(). typedef enum { OSMemoryNotificationLevelAny = … Read more

Is it necessary to use autoreleasepool in a Swift program?

The autoreleasepool pattern is used in Swift when returning autorelease objects (created by either your Objective-C code or using Cocoa classes). The autorelease pattern in Swift functions much like it does in Objective-C. For example, consider this Swift rendition of your method (instantiating NSImage/UIImage objects): func useManyImages() { let filename = pathForResourceInBundle for _ in … Read more

What are the differences between virtual memory and physical memory?

Softwares run on the OS on a very simple premise – they require memory. The device OS provides it in the form of RAM. The amount of memory required may vary – some softwares need huge memory, some require paltry memory. Most (if not all) users run multiple applications on the OS simultaneously, and given … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)