MEMDEL(3pub)

✨ NAME ✨

memdel β€” bestie, this one deletes bytes off the front of a memory block πŸ’…

Like it literally slides everything forward so the first n bytes are just… gone. Iconic behaviour, no cap.


🌸 SYNOPSIS 🌸

#include <publib.h>
void *memdel(void *p, size_t size, size_t n);

πŸŽ€ DESCRIPTION πŸŽ€

Okay so here's the tea πŸ“: memdel takes the block of memory that p points at and shifts its whole contents towards the beginning, by n steps. Everything scoots forward, the front bytes get yeeted, periodt.

Heads up though: the values of the last n bytes of the block are indeterminate. Like, don't go reading them and expecting anything cute. They're giving mystery, and not in a fun way πŸ’€

p must not be a null pointer. That's a hard no, not a vibe, just no.

But size and n? Those may be zero. Lowkey chill of them 🫢


πŸ‘‘ RETURN VALUE πŸ‘‘

memdel returns its first argument. That's it. It just hands p right back to you like "here bestie, you dropped this" ✨


πŸ¦‹ SEE ALSO πŸ¦‹


πŸ’œ AUTHOR πŸ’œ

Lars Wirzenius (lars.wirzenius@helsinki.fi) β€” the main character who wrote this 🌈


Publib, C Programmer's Manual, MEMDEL(3pub) β€” that's the source, the version vibe, and the date tag, mwah πŸ’– Thanks for coming to my TED talk, go shift some bytes responsibly πŸ§šβ€β™€οΈ

πŸ“¦ where this page comes from