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
- debian bookworm: publib-dev 0.40-3+b1 Β· BSD-2-Clause
- debian trixie: publib-dev 0.40-4 Β· BSD-2-Clause
- ubuntu jammy: publib-dev 0.40-3build1 Β· BSD-2-Clause
- ubuntu noble: publib-dev 0.40-3build1 Β· BSD-2-Clause
- ubuntu questing: publib-dev 0.40-4
- ubuntu resolute: publib-dev 0.40-4build1 Β· BSD-2-Clause
- ubuntu stonking: publib-dev 0.40-4build1 Β· BSD-2-Clause
- Copyright (c) 1994-2006 Lars Wirzenius. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms